X Tutup
%% Generated by Sphinx. \def\sphinxdocclass{report} \documentclass[letterpaper,11pt,english]{sphinxmanual} \ifdefined\pdfpxdimen \let\sphinxpxdimen\pdfpxdimen\else\newdimen\sphinxpxdimen \fi \sphinxpxdimen=.75bp\relax \PassOptionsToPackage{warn}{textcomp} \usepackage[utf8]{inputenc} \ifdefined\DeclareUnicodeCharacter \ifdefined\DeclareUnicodeCharacterAsOptional \DeclareUnicodeCharacter{"00A0}{\nobreakspace} \DeclareUnicodeCharacter{"2500}{\sphinxunichar{2500}} \DeclareUnicodeCharacter{"2502}{\sphinxunichar{2502}} \DeclareUnicodeCharacter{"2514}{\sphinxunichar{2514}} \DeclareUnicodeCharacter{"251C}{\sphinxunichar{251C}} \DeclareUnicodeCharacter{"2572}{\textbackslash} \else \DeclareUnicodeCharacter{00A0}{\nobreakspace} \DeclareUnicodeCharacter{2500}{\sphinxunichar{2500}} \DeclareUnicodeCharacter{2502}{\sphinxunichar{2502}} \DeclareUnicodeCharacter{2514}{\sphinxunichar{2514}} \DeclareUnicodeCharacter{251C}{\sphinxunichar{251C}} \DeclareUnicodeCharacter{2572}{\textbackslash} \fi \fi \usepackage{cmap} \usepackage[T1]{fontenc} \usepackage{amsmath,amssymb,amstext} \usepackage{babel} \usepackage{times} \usepackage[Bjarne]{fncychap} \usepackage{sphinx} \usepackage{geometry} % Include hyperref last. \usepackage{hyperref} % Fix anchor placement for figures with captions. \usepackage{hypcap}% it must be loaded after hyperref. % Set up styles of URL: it should be placed after hyperref. \urlstyle{same} \addto\captionsenglish{\renewcommand{\figurename}{Fig.}} \addto\captionsenglish{\renewcommand{\tablename}{Table}} \addto\captionsenglish{\renewcommand{\literalblockname}{Listing}} \addto\captionsenglish{\renewcommand{\literalblockcontinuedname}{continued from previous page}} \addto\captionsenglish{\renewcommand{\literalblockcontinuesname}{continues on next page}} \addto\extrasenglish{\def\pageautorefname{page}} \setcounter{tocdepth}{0} % In the parameters section, place a newline after the Parameters % header. (This is stolen directly from Numpy's conf.py, since it % affects Numpy-style docstrings). \usepackage{expdlist} \let\latexdescription=\description \def\description{\latexdescription{}{} \breaklabel} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{txfonts} % The enumitem package provides unlimited nesting of lists and % enums. Sphinx may use this in the future, in which case this can % be removed. See % https://bitbucket.org/birkenfeld/sphinx/issue/777/latex-output-too-deeply-nested \usepackage{enumitem} \setlistdepth{2048} \title{Matplotlib} \date{June 28, 2018} \release{2.2.2} \author{John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the matplotlib development team} \newcommand{\sphinxlogo}{\vbox{}} \renewcommand{\releasename}{Release} \makeindex \begin{document} \maketitle \sphinxtableofcontents \phantomsection\label{\detokenize{contents::doc}} \part{User’s Guide} \label{\detokenize{users/index:user-s-guide}}\label{\detokenize{users/index:users-guide-index}}\label{\detokenize{users/index::doc}} \chapter{History} \label{\detokenize{users/history:history}}\label{\detokenize{users/history::doc}} \begin{sphinxadmonition}{note}{Note:} The following introductory text was written in 2008 by John D. Hunter (1968-2012), the original author of Matplotlib. \end{sphinxadmonition} Matplotlib is a library for making 2D plots of arrays in \sphinxhref{https://www.python.org}{Python}. Although it has its origins in emulating the MATLAB graphics commands, it is independent of MATLAB, and can be used in a Pythonic, object oriented way. Although Matplotlib is written primarily in pure Python, it makes heavy use of \sphinxhref{http://www.numpy.org}{NumPy} and other extension code to provide good performance even for large arrays. Matplotlib is designed with the philosophy that you should be able to create simple plots with just a few commands, or just one! If you want to see a histogram of your data, you shouldn’t need to instantiate objects, call methods, set properties, and so on; it should just work. For years, I used to use MATLAB exclusively for data analysis and visualization. MATLAB excels at making nice looking plots easy. When I began working with EEG data, I found that I needed to write applications to interact with my data, and developed an EEG analysis application in MATLAB. As the application grew in complexity, interacting with databases, http servers, manipulating complex data structures, I began to strain against the limitations of MATLAB as a programming language, and decided to start over in Python. Python more than makes up for all of MATLAB’s deficiencies as a programming language, but I was having difficulty finding a 2D plotting package (for 3D \sphinxhref{http://www.vtk.org/}{VTK} more than exceeds all of my needs). When I went searching for a Python plotting package, I had several requirements: \begin{itemize} \item {} Plots should look great - publication quality. One important requirement for me is that the text looks good (antialiased, etc.) \item {} Postscript output for inclusion with TeX documents \item {} Embeddable in a graphical user interface for application development \item {} Code should be easy enough that I can understand it and extend it \item {} Making plots should be easy \end{itemize} Finding no package that suited me just right, I did what any self-respecting Python programmer would do: rolled up my sleeves and dived in. Not having any real experience with computer graphics, I decided to emulate MATLAB’s plotting capabilities because that is something MATLAB does very well. This had the added advantage that many people have a lot of MATLAB experience, and thus they can quickly get up to steam plotting in python. From a developer’s perspective, having a fixed user interface (the pylab interface) has been very useful, because the guts of the code base can be redesigned without affecting user code. The Matplotlib code is conceptually divided into three parts: the \sphinxstyleemphasis{pylab interface} is the set of functions provided by \sphinxcode{\sphinxupquote{matplotlib.pylab}} which allow the user to create plots with code quite similar to MATLAB figure generating code ({\hyperref[\detokenize{tutorials/introductory/pyplot::doc}]{\sphinxcrossref{\DUrole{doc}{Pyplot tutorial}}}}). The \sphinxstyleemphasis{Matplotlib frontend} or \sphinxstyleemphasis{Matplotlib API} is the set of classes that do the heavy lifting, creating and managing figures, text, lines, plots and so on ({\hyperref[\detokenize{tutorials/intermediate/artists::doc}]{\sphinxcrossref{\DUrole{doc}{Artist tutorial}}}}). This is an abstract interface that knows nothing about output. The \sphinxstyleemphasis{backends} are device-dependent drawing devices, aka renderers, that transform the frontend representation to hardcopy or a display device ({\hyperref[\detokenize{tutorials/introductory/usage:what-is-a-backend}]{\sphinxcrossref{\DUrole{std,std-ref}{What is a backend?}}}}). Example backends: PS creates \sphinxhref{http://www.adobe.com/products/postscript/}{PostScript®} hardcopy, SVG creates \sphinxhref{https://www.w3.org/Graphics/SVG/}{Scalable Vector Graphics} hardcopy, Agg creates PNG output using the high quality \sphinxhref{http://antigrain.com/}{Anti-Grain Geometry} library that ships with Matplotlib, GTK embeds Matplotlib in a \sphinxhref{https://www.gtk.org/}{Gtk+} application, GTKAgg uses the Anti-Grain renderer to create a figure and embed it in a Gtk+ application, and so on for \sphinxhref{https://acrobat.adobe.com/us/en/why-adobe/about-adobe-pdf.html}{PDF}, \sphinxhref{https://www.wxpython.org/}{WxWidgets}, \sphinxhref{https://docs.python.org/library/tkinter.html}{Tkinter}, etc. Matplotlib is used by many people in many different contexts. Some people want to automatically generate PostScript files to send to a printer or publishers. Others deploy Matplotlib on a web application server to generate PNG output for inclusion in dynamically-generated web pages. Some use Matplotlib interactively from the Python shell in Tkinter on Windows. My primary use is to embed Matplotlib in a Gtk+ EEG application that runs on Windows, Linux and Macintosh OS X. \bigskip\hrule\bigskip Matplotlib’s original logo (2003 \textendash{} 2008). \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{history-1}.pdf} \end{figure} \chapter{Installing} \label{\detokenize{users/installing:installing}}\label{\detokenize{users/installing::doc}} \begin{sphinxadmonition}{note}{Note:} If you wish to contribute to the project, it’s recommended you {\hyperref[\detokenize{users/installing:install-from-source}]{\sphinxcrossref{\DUrole{std,std-ref}{install the latest development version}}}}. \end{sphinxadmonition} \begin{sphinxShadowBox} \sphinxstyletopictitle{Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/installing:id2}}{\hyperref[\detokenize{users/installing:installing}]{\sphinxcrossref{Installing}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/installing:id3}}{\hyperref[\detokenize{users/installing:installing-an-official-release}]{\sphinxcrossref{Installing an official release}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/installing:id4}}{\hyperref[\detokenize{users/installing:windows}]{\sphinxcrossref{Windows}}} \item {} \phantomsection\label{\detokenize{users/installing:id5}}{\hyperref[\detokenize{users/installing:macos}]{\sphinxcrossref{macOS}}} \item {} \phantomsection\label{\detokenize{users/installing:id6}}{\hyperref[\detokenize{users/installing:linux}]{\sphinxcrossref{Linux}}} \item {} \phantomsection\label{\detokenize{users/installing:id7}}{\hyperref[\detokenize{users/installing:test-data}]{\sphinxcrossref{Test Data}}} \end{itemize} \item {} \phantomsection\label{\detokenize{users/installing:id8}}{\hyperref[\detokenize{users/installing:third-party-distributions-of-matplotlib}]{\sphinxcrossref{Third-party distributions of Matplotlib}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/installing:id9}}{\hyperref[\detokenize{users/installing:scientific-python-distributions}]{\sphinxcrossref{Scientific Python Distributions}}} \item {} \phantomsection\label{\detokenize{users/installing:id10}}{\hyperref[\detokenize{users/installing:linux-using-your-package-manager}]{\sphinxcrossref{Linux : using your package manager}}} \end{itemize} \item {} \phantomsection\label{\detokenize{users/installing:id11}}{\hyperref[\detokenize{users/installing:installing-from-source}]{\sphinxcrossref{Installing from source}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/installing:id12}}{\hyperref[\detokenize{users/installing:dependencies}]{\sphinxcrossref{Dependencies}}} \item {} \phantomsection\label{\detokenize{users/installing:id13}}{\hyperref[\detokenize{users/installing:building-on-linux}]{\sphinxcrossref{Building on Linux}}} \item {} \phantomsection\label{\detokenize{users/installing:id14}}{\hyperref[\detokenize{users/installing:building-on-macos}]{\sphinxcrossref{Building on macOS}}} \item {} \phantomsection\label{\detokenize{users/installing:id15}}{\hyperref[\detokenize{users/installing:building-on-windows}]{\sphinxcrossref{Building on Windows}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/installing:id16}}{\hyperref[\detokenize{users/installing:wheel-builds-using-conda-packages}]{\sphinxcrossref{Wheel builds using conda packages}}} \item {} \phantomsection\label{\detokenize{users/installing:id17}}{\hyperref[\detokenize{users/installing:conda-packages}]{\sphinxcrossref{Conda packages}}} \end{itemize} \end{itemize} \end{itemize} \end{itemize} \end{sphinxShadowBox} \section{Installing an official release} \label{\detokenize{users/installing:installing-an-official-release}} Matplotlib and most of its dependencies are all available as wheel packages for macOS, Windows and Linux distributions: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{o}{\PYGZhy{}}\PYG{n}{U} \PYG{n}{pip} \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{o}{\PYGZhy{}}\PYG{n}{U} \PYG{n}{matplotlib} \end{sphinxVerbatim} \begin{sphinxadmonition}{note}{Note:} The following backends work out of the box: Agg, ps, pdf, svg and TkAgg. For support of other GUI frameworks, LaTeX rendering, saving animations and a larger selection of file formats, you may need to install {\hyperref[\detokenize{users/installing:install-requirements}]{\sphinxcrossref{\DUrole{std,std-ref}{additional dependencies}}}}. \end{sphinxadmonition} Although not required, we suggest also installing \sphinxcode{\sphinxupquote{IPython}} for interactive use. To easily install a complete Scientific Python stack, see {\hyperref[\detokenize{users/installing:install-scipy-dists}]{\sphinxcrossref{\DUrole{std,std-ref}{Scientific Python Distributions}}}} below. \subsection{Windows} \label{\detokenize{users/installing:windows}}\label{\detokenize{users/installing:installing-windows}} In case Python 2.7 or 3.4 are not installed for all users, the Microsoft Visual C++ 2008 (\sphinxhref{https://www.microsoft.com/en-us/download/details.aspx?id=15336}{64 bit} or \sphinxhref{https://www.microsoft.com/en-us/download/details.aspx?id=29}{32 bit} for Python 2.7) or Microsoft Visual C++ 2010 (\sphinxhref{https://www.microsoft.com/en-us/download/details.aspx?id=14632}{64 bit} or \sphinxhref{https://www.microsoft.com/en-us/download/details.aspx?id=5555}{32 bit} for Python 3.4) redistributable packages need to be installed. \subsection{macOS} \label{\detokenize{users/installing:macos}} If you are using Python 2.7 on a Mac you may need to do: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{xcode}\PYG{o}{\PYGZhy{}}\PYG{n}{select} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{install} \end{sphinxVerbatim} so that \sphinxstyleemphasis{subprocess32}, a dependency, may be compiled. To use the native OSX backend you will need {\hyperref[\detokenize{faq/osx_framework:osxframework-faq}]{\sphinxcrossref{\DUrole{std,std-ref}{a framework build}}}} build of Python. \subsection{Linux} \label{\detokenize{users/installing:linux}} On extremely old versions of Linux and Python 2.7 you may need to install the master version of \sphinxstyleemphasis{subprocess32} (\sphinxhref{https://github.com/google/python-subprocess32/issues/12\#issuecomment-304724113}{see comments}). \subsection{Test Data} \label{\detokenize{users/installing:test-data}} The wheels (\sphinxcode{\sphinxupquote{*.whl}}) on the \sphinxhref{https://pypi.python.org/pypi/matplotlib/}{PyPI download page} do not contain test data or example code. If you want to try the many demos that come in the Matplotlib source distribution, download the \sphinxcode{\sphinxupquote{*.tar.gz}} file and look in the \sphinxcode{\sphinxupquote{examples}} subdirectory. To run the test suite: \begin{itemize} \item {} extract the \sphinxcode{\sphinxupquote{lib\textbackslash{}matplotlib\textbackslash{}tests}} or \sphinxcode{\sphinxupquote{lib\textbackslash{}mpl\_toolkits\textbackslash{}tests}} directories from the source distribution; \item {} install test dependencies: \sphinxhref{https://pypi.python.org/pypi/pytest}{pytest}, \sphinxhref{https://pypi.python.org/pypi/mock}{mock}, Pillow, MiKTeX, GhostScript, ffmpeg, avconv, ImageMagick, and \sphinxhref{https://inkscape.org/}{Inkscape}; \item {} run \sphinxcode{\sphinxupquote{py.test path\textbackslash{}to\textbackslash{}tests\textbackslash{}directory}}. \end{itemize} \section{Third-party distributions of Matplotlib} \label{\detokenize{users/installing:third-party-distributions-of-matplotlib}} \subsection{Scientific Python Distributions} \label{\detokenize{users/installing:scientific-python-distributions}}\label{\detokenize{users/installing:install-scipy-dists}} \sphinxhref{https://www.continuum.io/downloads/}{Anaconda} and \sphinxhref{https://www.enthought.com/products/canopy/}{Canopy} and \sphinxhref{https://www.activestate.com/activepython/downloads}{ActiveState} are excellent choices that “just work” out of the box for Windows, macOS and common Linux platforms. \sphinxhref{https://winpython.github.io/}{WinPython} is an option for windows users. All of these distributions include Matplotlib and \sphinxstyleemphasis{lots} of other useful (data) science tools. \subsection{Linux : using your package manager} \label{\detokenize{users/installing:linux-using-your-package-manager}} If you are on Linux, you might prefer to use your package manager. Matplotlib is packaged for almost every major Linux distribution. \begin{itemize} \item {} Debian / Ubuntu: \sphinxcode{\sphinxupquote{sudo apt-get install python3-matplotlib}} \item {} Fedora: \sphinxcode{\sphinxupquote{sudo dnf install python3-matplotlib}} \item {} Red Hat: \sphinxcode{\sphinxupquote{sudo yum install python3-matplotlib}} \item {} Arch: \sphinxcode{\sphinxupquote{sudo pacman -S python-matplotlib}} \end{itemize} \section{Installing from source} \label{\detokenize{users/installing:installing-from-source}}\label{\detokenize{users/installing:install-from-source}} If you are interested in contributing to Matplotlib development, running the latest source code, or just like to build everything yourself, it is not difficult to build Matplotlib from source. Grab the latest \sphinxstyleemphasis{tar.gz} release file from \sphinxhref{https://pypi.python.org/pypi/matplotlib/}{the PyPI files page}, or if you want to develop Matplotlib or just need the latest bugfixed version, grab the latest git version {\hyperref[\detokenize{faq/installing_faq:install-from-git}]{\sphinxcrossref{\DUrole{std,std-ref}{Install from source}}}}. The standard environment variables \sphinxcode{\sphinxupquote{CC}}, \sphinxcode{\sphinxupquote{CXX}}, \sphinxcode{\sphinxupquote{PKG\_CONFIG}} are respected. This means you can set them if your toolchain is prefixed. This may be used for cross compiling. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{export} \PYG{n}{CC}\PYG{o}{=}\PYG{n}{x86\PYGZus{}64}\PYG{o}{\PYGZhy{}}\PYG{n}{pc}\PYG{o}{\PYGZhy{}}\PYG{n}{linux}\PYG{o}{\PYGZhy{}}\PYG{n}{gnu}\PYG{o}{\PYGZhy{}}\PYG{n}{gcc} \PYG{n}{export} \PYG{n}{CXX}\PYG{o}{=}\PYG{n}{x86\PYGZus{}64}\PYG{o}{\PYGZhy{}}\PYG{n}{pc}\PYG{o}{\PYGZhy{}}\PYG{n}{linux}\PYG{o}{\PYGZhy{}}\PYG{n}{gnu}\PYG{o}{\PYGZhy{}}\PYG{n}{g}\PYG{o}{+}\PYG{o}{+} \PYG{n}{export} \PYG{n}{PKG\PYGZus{}CONFIG}\PYG{o}{=}\PYG{n}{x86\PYGZus{}64}\PYG{o}{\PYGZhy{}}\PYG{n}{pc}\PYG{o}{\PYGZhy{}}\PYG{n}{linux}\PYG{o}{\PYGZhy{}}\PYG{n}{gnu}\PYG{o}{\PYGZhy{}}\PYG{n}{pkg}\PYG{o}{\PYGZhy{}}\PYG{n}{config} \end{sphinxVerbatim} Once you have satisfied the requirements detailed below (mainly Python, NumPy, libpng and FreeType), you can build Matplotlib. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{cd} \PYG{n}{matplotlib} \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{o}{.} \end{sphinxVerbatim} We provide a \sphinxhref{https://raw.githubusercontent.com/matplotlib/matplotlib/master/setup.cfg.template}{setup.cfg} file which you can use to customize the build process. For example, which default backend to use, whether some of the optional libraries that Matplotlib ships with are installed, and so on. This file will be particularly useful to those packaging Matplotlib. If you have installed prerequisites to nonstandard places and need to inform Matplotlib where they are, edit \sphinxcode{\sphinxupquote{setupext.py}} and add the base dirs to the \sphinxcode{\sphinxupquote{basedir}} dictionary entry for your \sphinxcode{\sphinxupquote{sys.platform}}; e.g., if the header of some required library is in \sphinxcode{\sphinxupquote{/some/path/include/someheader.h}}, put \sphinxcode{\sphinxupquote{/some/path}} in the \sphinxcode{\sphinxupquote{basedir}} list for your platform. \subsection{Dependencies} \label{\detokenize{users/installing:dependencies}}\label{\detokenize{users/installing:install-requirements}} Matplotlib requires a large number of dependencies: \begin{itemize} \item {} \sphinxhref{https://www.python.org/downloads/}{Python} (\textgreater{}= 2.7 or \textgreater{}= 3.4) \item {} \sphinxhref{http://www.numpy.org}{NumPy} (\textgreater{}= 1.7.1) \item {} \sphinxhref{https://setuptools.readthedocs.io/en/latest/}{setuptools} \item {} \sphinxhref{https://pypi.python.org/pypi/python-dateutil}{dateutil} (\textgreater{}= 2.1) \item {} \sphinxhref{https://pyparsing.wikispaces.com/}{pyparsing} \item {} \sphinxhref{http://www.libpng.org}{libpng} (\textgreater{}= 1.2) \item {} \sphinxhref{http://pytz.sourceforge.net/}{pytz} \item {} FreeType (\textgreater{}= 2.3) \item {} \sphinxhref{http://matplotlib.org/cycler/}{cycler} (\textgreater{}= 0.10.0) \item {} \sphinxhref{https://pypi.python.org/pypi/six}{six} \item {} \sphinxhref{https://pypi.python.org/pypi/backports.functools\_lru\_cache}{backports.functools\_lru\_cache} (for Python 2.7 only) \item {} \sphinxhref{https://pypi.python.org/pypi/subprocess32/}{subprocess32} (for Python 2.7 only, on Linux and macOS only) \item {} \sphinxhref{https://github.com/nucleic/kiwi}{kiwisolver} (\textgreater{}= 1.0.0) \end{itemize} Optionally, you can also install a number of packages to enable better user interface toolkits. See {\hyperref[\detokenize{tutorials/introductory/usage:what-is-a-backend}]{\sphinxcrossref{\DUrole{std,std-ref}{What is a backend?}}}} for more details on the optional Matplotlib backends and the capabilities they provide. \begin{itemize} \item {} {\hyperref[\detokenize{glossary/index:term-tk}]{\sphinxtermref{\DUrole{xref,std,std-term}{tk}}}} (\textgreater{}= 8.3, != 8.6.0 or 8.6.1): for the TkAgg backend; \item {} \sphinxhref{https://pypi.python.org/pypi/PyQt4}{PyQt4} (\textgreater{}= 4.4) or \sphinxhref{https://pypi.python.org/pypi/PySide}{PySide}: for the Qt4Agg backend; \item {} \sphinxhref{https://pypi.python.org/pypi/PyQt5}{PyQt5}: for the Qt5Agg backend; \item {} {\hyperref[\detokenize{glossary/index:term-pygtk}]{\sphinxtermref{\DUrole{xref,std,std-term}{pygtk}}}} (\textgreater{}= 2.4): for the GTK and the GTKAgg backend; \item {} {\hyperref[\detokenize{glossary/index:term-wxpython}]{\sphinxtermref{\DUrole{xref,std,std-term}{wxpython}}}} (\textgreater{}= 2.9 or later): for the WX or WXAgg backend; \item {} \sphinxhref{https://cairocffi.readthedocs.io/en/latest/}{cairocffi} (\textgreater{}= v0.8): for cairo based backends; \item {} \sphinxhref{https://pypi.python.org/pypi/pycairo}{pycairo}: for GTK3Cairo; \item {} \sphinxhref{https://pypi.python.org/pypi/tornado}{Tornado}: for the WebAgg backend; \end{itemize} For better support of animation output format and image file formats, LaTeX, etc., you can install the following: \begin{itemize} \item {} \sphinxhref{https://www.ffmpeg.org/}{ffmpeg}/\sphinxhref{https://libav.org/avconv.html}{avconv}: for saving movies; \item {} \sphinxhref{https://www.imagemagick.org/script/index.php}{ImageMagick}: for saving animated gifs; \item {} \sphinxhref{https://pillow.readthedocs.io/en/latest/}{Pillow} (\textgreater{}=2.0): for a larger selection of image file formats: JPEG, BMP, and TIFF image files; \item {} \sphinxhref{https://miktex.org/}{LaTeX} and \sphinxhref{https://ghostscript.com/download/}{GhostScript} (for rendering text with LaTeX). \end{itemize} \begin{sphinxadmonition}{note}{Note:} Matplotlib depends on a large number of non-Python libraries. \sphinxhref{https://www.freedesktop.org/wiki/Software/pkg-config/}{pkg-config} can be used to find required non-Python libraries and thus make the install go more smoothly if the libraries and headers are not in the expected locations. \end{sphinxadmonition} \begin{sphinxadmonition}{note}{Note:} The following libraries are shipped with Matplotlib: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{Agg}}: the Anti-Grain Geometry C++ rendering engine; \item {} \sphinxcode{\sphinxupquote{qhull}}: to compute Delaunay triangulation; \item {} \sphinxcode{\sphinxupquote{ttconv}}: a true type font utility. \end{itemize} \end{sphinxadmonition} \subsection{Building on Linux} \label{\detokenize{users/installing:building-on-linux}}\label{\detokenize{users/installing:build-linux}} It is easiest to use your system package manager to install the dependencies. If you are on Debian/Ubuntu, you can get all the dependencies required to build Matplotlib with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{sudo} \PYG{n}{apt}\PYG{o}{\PYGZhy{}}\PYG{n}{get} \PYG{n}{build}\PYG{o}{\PYGZhy{}}\PYG{n}{dep} \PYG{n}{python}\PYG{o}{\PYGZhy{}}\PYG{n}{matplotlib} \end{sphinxVerbatim} If you are on Fedora, you can get all the dependencies required to build Matplotlib with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{sudo} \PYG{n}{dnf} \PYG{n}{builddep} \PYG{n}{python}\PYG{o}{\PYGZhy{}}\PYG{n}{matplotlib} \end{sphinxVerbatim} If you are on RedHat, you can get all the dependencies required to build Matplotlib by first installing \sphinxcode{\sphinxupquote{yum-builddep}} and then running: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{su} \PYG{o}{\PYGZhy{}}\PYG{n}{c} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{yum\PYGZhy{}builddep python\PYGZhy{}matplotlib}\PYG{l+s+s2}{\PYGZdq{}} \end{sphinxVerbatim} These commands do not build Matplotlib, but instead get and install the build dependencies, which will make building from source easier. \subsection{Building on macOS} \label{\detokenize{users/installing:building-on-macos}}\label{\detokenize{users/installing:build-osx}} The build situation on macOS is complicated by the various places one can get the libpng and FreeType requirements (MacPorts, Fink, /usr/X11R6), the different architectures (e.g., x86, ppc, universal), and the different macOS versions (e.g., 10.4 and 10.5). We recommend that you build the way we do for the macOS release: get the source from the tarball or the git repository and install the required dependencies through a third-party package manager. Two widely used package managers are Homebrew, and MacPorts. The following example illustrates how to install libpng and FreeType using \sphinxcode{\sphinxupquote{brew}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{brew} \PYG{n}{install} \PYG{n}{libpng} \PYG{n}{freetype} \PYG{n}{pkg}\PYG{o}{\PYGZhy{}}\PYG{n}{config} \end{sphinxVerbatim} If you are using MacPorts, execute the following instead: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{port} \PYG{n}{install} \PYG{n}{libpng} \PYG{n}{freetype} \PYG{n}{pkgconfig} \end{sphinxVerbatim} After installing the above requirements, install Matplotlib from source by executing: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{o}{.} \end{sphinxVerbatim} Note that your environment is somewhat important. Some conda users have found that, to run the tests, their PYTHONPATH must include /path/to/anaconda/…/site-packages and their DYLD\_FALLBACK\_LIBRARY\_PATH must include /path/to/anaconda/lib. \subsection{Building on Windows} \label{\detokenize{users/installing:building-on-windows}}\label{\detokenize{users/installing:build-windows}} The Python shipped from \sphinxurl{https://www.python.org} is compiled with Visual Studio 2008 for versions before 3.3, Visual Studio 2010 for 3.3 and 3.4, and Visual Studio 2015 for 3.5 and 3.6. Python extensions are recommended to be compiled with the same compiler. Since there is no canonical Windows package manager, the methods for building FreeType, zlib, and libpng from source code are documented as a build script at \sphinxhref{https://github.com/jbmohler/matplotlib-winbuild}{matplotlib-winbuild}. There are a few possibilities to build Matplotlib on Windows: \begin{itemize} \item {} Wheels via \sphinxhref{https://github.com/jbmohler/matplotlib-winbuild}{matplotlib-winbuild} \item {} Wheels by using conda packages \item {} Conda packages \end{itemize} \subsubsection{Wheel builds using conda packages} \label{\detokenize{users/installing:wheel-builds-using-conda-packages}} This is a wheel build, but we use conda packages to get all the requirements. The binary requirements (png, FreeType,…) are statically linked and therefore not needed during the wheel install. The commands below assume that you can compile a native Python lib for the Python version of your choice. See \sphinxhref{https://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/}{this howto} for how to install and setup such environments. If in doubt: use Python \textgreater{}= 3.5 as it mostly works without fiddling with environment variables: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} create a new environment with the required packages} \PYG{n}{conda} \PYG{n}{create} \PYG{o}{\PYGZhy{}}\PYG{n}{n} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{matplotlib\PYGZus{}build}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{python}\PYG{o}{=}\PYG{l+m+mf}{3.5} \PYG{n}{numpy} \PYG{n}{python}\PYG{o}{\PYGZhy{}}\PYG{n}{dateutil} \PYG{n}{pyparsing} \PYG{n}{pytz} \PYG{n}{tornado} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{cycler\PYGZgt{}=0.10}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{tk} \PYG{n}{libpng} \PYG{n}{zlib} \PYG{n}{freetype} \PYG{n}{activate} \PYG{n}{matplotlib\PYGZus{}build} \PYG{c+c1}{\PYGZsh{} if you want a qt backend, you also have to install pyqt (be aware that pyqt doesn\PYGZsq{}t mix well if} \PYG{c+c1}{\PYGZsh{} you have created the environment with conda\PYGZhy{}forge already activated...)} \PYG{n}{conda} \PYG{n}{install} \PYG{n}{pyqt} \PYG{c+c1}{\PYGZsh{} this package is only available in the conda\PYGZhy{}forge channel} \PYG{n}{conda} \PYG{n}{install} \PYG{o}{\PYGZhy{}}\PYG{n}{c} \PYG{n}{conda}\PYG{o}{\PYGZhy{}}\PYG{n}{forge} \PYG{n}{msinttypes} \PYG{c+c1}{\PYGZsh{} for Python 2.7} \PYG{n}{conda} \PYG{n}{install} \PYG{o}{\PYGZhy{}}\PYG{n}{c} \PYG{n}{conda}\PYG{o}{\PYGZhy{}}\PYG{n}{forge} \PYG{n}{backports}\PYG{o}{.}\PYG{n}{functools\PYGZus{}lru\PYGZus{}cache} \PYG{c+c1}{\PYGZsh{} copy the libs which have \PYGZdq{}wrong\PYGZdq{} names} \PYG{n+nb}{set} \PYG{n}{LIBRARY\PYGZus{}LIB}\PYG{o}{=}\PYG{o}{\PYGZpc{}}\PYG{n}{CONDA\PYGZus{}PREFIX}\PYG{o}{\PYGZpc{}}\PYGZbs{}\PYG{n}{Library}\PYGZbs{}\PYG{n}{lib} \PYG{n}{mkdir} \PYG{n}{lib} \PYG{o}{\textbar{}}\PYG{o}{\textbar{}} \PYG{n}{cmd} \PYG{o}{/}\PYG{n}{c} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{exit /b 0}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{copy} \PYG{o}{\PYGZpc{}}\PYG{n}{LIBRARY\PYGZus{}LIB}\PYG{o}{\PYGZpc{}}\PYGZbs{}\PYG{n}{zlibstatic}\PYG{o}{.}\PYG{n}{lib} \PYG{n}{lib}\PYGZbs{}\PYG{n}{z}\PYG{o}{.}\PYG{n}{lib} \PYG{n}{copy} \PYG{o}{\PYGZpc{}}\PYG{n}{LIBRARY\PYGZus{}LIB}\PYG{o}{\PYGZpc{}}\PYGZbs{}\PYG{n}{libpng\PYGZus{}static}\PYG{o}{.}\PYG{n}{lib} \PYG{n}{lib}\PYGZbs{}\PYG{n}{png}\PYG{o}{.}\PYG{n}{lib} \PYG{c+c1}{\PYGZsh{} Make the header files and the rest of the static libs available during the build} \PYG{c+c1}{\PYGZsh{} CONDA\PYGZus{}DEFAULT\PYGZus{}ENV is a env variable which is set to the currently active environment path} \PYG{n+nb}{set} \PYG{n}{MPLBASEDIRLIST}\PYG{o}{=}\PYG{o}{\PYGZpc{}}\PYG{n}{CONDA\PYGZus{}PREFIX}\PYG{o}{\PYGZpc{}}\PYGZbs{}\PYG{n}{Library}\PYGZbs{}\PYG{p}{;}\PYG{o}{.} \PYG{c+c1}{\PYGZsh{} build the wheel} \PYG{n}{python} \PYG{n}{setup}\PYG{o}{.}\PYG{n}{py} \PYG{n}{bdist\PYGZus{}wheel} \end{sphinxVerbatim} The \sphinxcode{\sphinxupquote{build\_alllocal.cmd}} script in the root folder automates these steps if you have already created and activated the conda environment. \subsubsection{Conda packages} \label{\detokenize{users/installing:conda-packages}} This needs a \sphinxhref{https://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/}{working installed C compiler} for the version of Python you are compiling the package for but you don’t need to setup the environment variables: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} only the first time...} \PYG{n}{conda} \PYG{n}{install} \PYG{n}{conda}\PYG{o}{\PYGZhy{}}\PYG{n}{build} \PYG{c+c1}{\PYGZsh{} the Python version you want a package for...} \PYG{n+nb}{set} \PYG{n}{CONDA\PYGZus{}PY}\PYG{o}{=}\PYG{l+m+mf}{3.5} \PYG{c+c1}{\PYGZsh{} builds the package, using a clean build environment} \PYG{n}{conda} \PYG{n}{build} \PYG{n}{ci}\PYGZbs{}\PYG{n}{conda\PYGZus{}recipe} \PYG{c+c1}{\PYGZsh{} install the new package} \PYG{n}{conda} \PYG{n}{install} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{use}\PYG{o}{\PYGZhy{}}\PYG{n}{local} \PYG{n}{matplotlib} \end{sphinxVerbatim} \chapter{Tutorials} \label{\detokenize{tutorials/index:tutorials}}\label{\detokenize{tutorials/index:id1}}\label{\detokenize{tutorials/index::doc}} 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. For shorter examples, see our \sphinxhref{../gallery/index.html}{examples page}. You can also find \sphinxhref{../resources/index.html}{external resources} and a \sphinxhref{../faq/index.html}{FAQ} in our \sphinxhref{../contents.html}{user guide}. \section{Introductory} \label{\detokenize{tutorials/index:introductory}}\label{\detokenize{tutorials/index:tutorials-introductory}} These tutorials cover the basics of creating visualizations with Matplotlib, as well as some best-practices in using the package effectively. \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/introductory/sample_plots:sphx-glr-download-tutorials-introductory-sample-plots-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Sample plots in Matplotlib} \label{\detokenize{tutorials/introductory/sample_plots:sample-plots-in-matplotlib}}\label{\detokenize{tutorials/introductory/sample_plots:sphx-glr-tutorials-introductory-sample-plots-py}}\label{\detokenize{tutorials/introductory/sample_plots::doc}} Here you’ll find a host of example plots with the code that generated them. \subsubsection{Line Plot} \label{\detokenize{tutorials/introductory/sample_plots:line-plot}}\label{\detokenize{tutorials/introductory/sample_plots:matplotlibscreenshots}} Here’s how to create a line plot with text labels using {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot()}}}}}. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/lines\_bars\_and\_markers/simple\_plot.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_simple_plot_0011}.png}}\caption{Simple Plot}\label{\detokenize{tutorials/introductory/sample_plots:id1}}\end{figure} \subsubsection{Multiple subplots in one figure} \label{\detokenize{tutorials/introductory/sample_plots:multiple-subplots-in-one-figure}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-subplot-demo}} Multiple axes (i.e. subplots) are created with the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot:matplotlib.pyplot.subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot()}}}}} function: \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/subplots\_axes\_and\_figures/subplot.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_subplot_0011}.png}}\caption{Subplot}\label{\detokenize{tutorials/introductory/sample_plots:id2}}\end{figure} \subsubsection{Images} \label{\detokenize{tutorials/introductory/sample_plots:images}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-images-demo}} Matplotlib can display images (assuming equally spaced horizontal dimensions) using the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow()}}}}} function. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/images\_contours\_and\_fields/image\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_image_demo_0031}.png}}\caption{Example of using {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow()}}}}} to display a CT scan}\label{\detokenize{tutorials/introductory/sample_plots:id3}}\end{figure} \subsubsection{Contouring and pseudocolor} \label{\detokenize{tutorials/introductory/sample_plots:contouring-and-pseudocolor}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-pcolormesh-demo}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolormesh:matplotlib.pyplot.pcolormesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolormesh()}}}}} function can make a colored representation of a two-dimensional array, even if the horizontal dimensions are unevenly spaced. The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}} function is another way to represent the same data: \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/images\_contours\_and\_fields/pcolormesh\_levels.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_pcolormesh_levels_0011}.png}}\caption{Example comparing {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolormesh:matplotlib.pyplot.pcolormesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolormesh()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}} for plotting two-dimensional data}\label{\detokenize{tutorials/introductory/sample_plots:id4}}\end{figure} \subsubsection{Histograms} \label{\detokenize{tutorials/introductory/sample_plots:histograms}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-histogram-demo}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hist:matplotlib.pyplot.hist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hist()}}}}} function automatically generates histograms and returns the bin counts or probabilities: \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/statistics/histogram\_features.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_histogram_features_0011}.png}}\caption{Histogram Features}\label{\detokenize{tutorials/introductory/sample_plots:id5}}\end{figure} \subsubsection{Paths} \label{\detokenize{tutorials/introductory/sample_plots:paths}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-path-demo}} You can add arbitrary paths in Matplotlib using the {\hyperref[\detokenize{api/path_api:module-matplotlib.path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.path}}}}} module: \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/shapes\_and\_collections/path\_patch.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_path_patch_0011}.png}}\caption{Path Patch}\label{\detokenize{tutorials/introductory/sample_plots:id6}}\end{figure} \subsubsection{Three-dimensional plotting} \label{\detokenize{tutorials/introductory/sample_plots:three-dimensional-plotting}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-mplot3d-surface}} The mplot3d toolkit (see {\hyperref[\detokenize{tutorials/toolkits/mplot3d:toolkit-mplot3d-tutorial}]{\sphinxcrossref{\DUrole{std,std-ref}{Getting started}}}} and \DUrole{xref,std,std-ref}{mplot3d-examples-index}) has support for simple 3d graphs including surface, wireframe, scatter, and bar charts. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/surface3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_surface3d_0011}.png}}\caption{Surface3d}\label{\detokenize{tutorials/introductory/sample_plots:id7}}\end{figure} Thanks to John Porter, Jonathon Taylor, Reinier Heeres, and Ben Root for the \sphinxcode{\sphinxupquote{mplot3d}} toolkit. This toolkit is included with all standard Matplotlib installs. \subsubsection{Streamplot} \label{\detokenize{tutorials/introductory/sample_plots:streamplot}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-ellipse-demo}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.streamplot:matplotlib.pyplot.streamplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{streamplot()}}}}} function plots the streamlines of a vector field. In addition to simply plotting the streamlines, it allows you to map the colors and/or line widths of streamlines to a separate parameter, such as the speed or local intensity of the vector field. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/images\_contours\_and\_fields/plot\_streamplot.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_plot_streamplot_0011}.png}}\caption{Streamplot with various plotting options.}\label{\detokenize{tutorials/introductory/sample_plots:id8}}\end{figure} This feature complements the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.quiver:matplotlib.pyplot.quiver}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{quiver()}}}}} function for plotting vector fields. Thanks to Tom Flannaghan and Tony Yu for adding the streamplot function. \subsubsection{Ellipses} \label{\detokenize{tutorials/introductory/sample_plots:ellipses}} In support of the \sphinxhref{http://www.jpl.nasa.gov/news/phoenix/main.php}{Phoenix} mission to Mars (which used Matplotlib to display ground tracking of spacecraft), Michael Droettboom built on work by Charlie Moad to provide an extremely accurate 8-spline approximation to elliptical arcs (see {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Arc:matplotlib.patches.Arc}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Arc}}}}}), which are insensitive to zoom level. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/shapes\_and\_collections/ellipse\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_ellipse_demo_0011}.png}}\caption{Ellipse Demo}\label{\detokenize{tutorials/introductory/sample_plots:id9}}\end{figure} \subsubsection{Bar charts} \label{\detokenize{tutorials/introductory/sample_plots:bar-charts}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-barchart-demo}} Use the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.bar:matplotlib.pyplot.bar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bar()}}}}} function to make bar charts, which includes customizations such as error bars: \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/statistics/barchart\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_barchart_demo_0011}.png}}\caption{Barchart Demo}\label{\detokenize{tutorials/introductory/sample_plots:id10}}\end{figure} You can also create stacked bars (\sphinxhref{../../gallery/lines\_bars\_and\_markers/bar\_stacked.html}{bar\_stacked.py}), or horizontal bar charts (\sphinxhref{../../gallery/lines\_bars\_and\_markers/barh.html}{barh.py}). \subsubsection{Pie charts} \label{\detokenize{tutorials/introductory/sample_plots:pie-charts}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-pie-demo}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pie:matplotlib.pyplot.pie}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pie()}}}}} function allows you to create pie charts. Optional features include auto-labeling the percentage of area, exploding one or more wedges from the center of the pie, and a shadow effect. Take a close look at the attached code, which generates this figure in just a few lines of code. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/pie\_and\_polar\_charts/pie\_features.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_pie_features_0011}.png}}\caption{Pie Features}\label{\detokenize{tutorials/introductory/sample_plots:id11}}\end{figure} \subsubsection{Tables} \label{\detokenize{tutorials/introductory/sample_plots:tables}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-table-demo}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.table:matplotlib.pyplot.table}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{table()}}}}} function adds a text table to an axes. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/misc/table\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_table_demo_0011}.png}}\caption{Table Demo}\label{\detokenize{tutorials/introductory/sample_plots:id12}}\end{figure} \subsubsection{Scatter plots} \label{\detokenize{tutorials/introductory/sample_plots:scatter-plots}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-scatter-demo}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.scatter:matplotlib.pyplot.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter()}}}}} function makes a scatter plot with (optional) size and color arguments. This example plots changes in Google’s stock price, with marker sizes reflecting the trading volume and colors varying with time. Here, the alpha attribute is used to make semitransparent circle markers. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/lines\_bars\_and\_markers/scatter\_demo2.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_scatter_demo2_0011}.png}}\caption{Scatter Demo2}\label{\detokenize{tutorials/introductory/sample_plots:id13}}\end{figure} \subsubsection{GUI widgets} \label{\detokenize{tutorials/introductory/sample_plots:gui-widgets}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-slider-demo}} Matplotlib has basic GUI widgets that are independent of the graphical user interface you are using, allowing you to write cross GUI figures and widgets. See {\hyperref[\detokenize{api/widgets_api:module-matplotlib.widgets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.widgets}}}}} and the \sphinxhref{../../gallery/index.html}{widget examples}. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/widgets/slider\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_slider_demo_0011}.png}}\caption{Slider and radio-button GUI.}\label{\detokenize{tutorials/introductory/sample_plots:id14}}\end{figure} \subsubsection{Filled curves} \label{\detokenize{tutorials/introductory/sample_plots:filled-curves}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-fill-demo}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.fill:matplotlib.pyplot.fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill()}}}}} function lets you plot filled curves and polygons: \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/lines\_bars\_and\_markers/fill.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_fill_0011}.png}}\caption{Fill}\label{\detokenize{tutorials/introductory/sample_plots:id15}}\end{figure} Thanks to Andrew Straw for adding this function. \subsubsection{Date handling} \label{\detokenize{tutorials/introductory/sample_plots:date-handling}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-date-demo}} You can plot timeseries data with major and minor ticks and custom tick formatters for both. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/text\_labels\_and\_annotations/date.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_date_0011}.png}}\caption{Date}\label{\detokenize{tutorials/introductory/sample_plots:id16}}\end{figure} See {\hyperref[\detokenize{api/ticker_api:module-matplotlib.ticker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker}}}}} and {\hyperref[\detokenize{api/dates_api:module-matplotlib.dates}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates}}}}} for details and usage. \subsubsection{Log plots} \label{\detokenize{tutorials/introductory/sample_plots:log-plots}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-log-demo}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.semilogx:matplotlib.pyplot.semilogx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{semilogx()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.semilogy:matplotlib.pyplot.semilogy}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{semilogy()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.loglog:matplotlib.pyplot.loglog}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{loglog()}}}}} functions simplify the creation of logarithmic plots. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/scales/log\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_log_demo_0011}.png}}\caption{Log Demo}\label{\detokenize{tutorials/introductory/sample_plots:id17}}\end{figure} Thanks to Andrew Straw, Darren Dale and Gregory Lielens for contributions log-scaling infrastructure. \subsubsection{Polar plots} \label{\detokenize{tutorials/introductory/sample_plots:polar-plots}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-polar-demo}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.polar:matplotlib.pyplot.polar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{polar()}}}}} function generates polar plots. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/pie\_and\_polar\_charts/polar\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_polar_demo_0011}.png}}\caption{Polar Demo}\label{\detokenize{tutorials/introductory/sample_plots:id18}}\end{figure} \subsubsection{Legends} \label{\detokenize{tutorials/introductory/sample_plots:legends}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-legend-demo}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.legend:matplotlib.pyplot.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend()}}}}} function automatically generates figure legends, with MATLAB-compatible legend-placement functions. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/api/legend.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_legend_0011}.png}}\caption{Legend}\label{\detokenize{tutorials/introductory/sample_plots:id19}}\end{figure} Thanks to Charles Twardy for input on the legend function. \subsubsection{TeX-notation for text objects} \label{\detokenize{tutorials/introductory/sample_plots:tex-notation-for-text-objects}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-mathtext-examples-demo}} Below is a sampling of the many TeX expressions now supported by Matplotlib’s internal mathtext engine. The mathtext module provides TeX style mathematical expressions using \sphinxhref{https://www.freetype.org/}{FreeType} and the DejaVu, BaKoMa computer modern, or \sphinxhref{http://www.stixfonts.org}{STIX} fonts. See the {\hyperref[\detokenize{api/mathtext_api:module-matplotlib.mathtext}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext}}}}} module for additional details. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/text\_labels\_and\_annotations/mathtext\_examples.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_mathtext_examples_0011}.png}}\caption{Mathtext Examples}\label{\detokenize{tutorials/introductory/sample_plots:id20}}\end{figure} Matplotlib’s mathtext infrastructure is an independent implementation and does not require TeX or any external packages installed on your computer. See the tutorial at {\hyperref[\detokenize{tutorials/text/mathtext:sphx-glr-tutorials-text-mathtext-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Writing mathematical expressions}}}}. \subsubsection{Native TeX rendering} \label{\detokenize{tutorials/introductory/sample_plots:native-tex-rendering}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-tex-demo}} Although Matplotlib’s internal math rendering engine is quite powerful, sometimes you need TeX. Matplotlib supports external TeX rendering of strings with the \sphinxstyleemphasis{usetex} option. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/text\_labels\_and\_annotations/tex\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_tex_demo_0011}.png}}\caption{Tex Demo}\label{\detokenize{tutorials/introductory/sample_plots:id21}}\end{figure} \subsubsection{EEG GUI} \label{\detokenize{tutorials/introductory/sample_plots:eeg-gui}}\label{\detokenize{tutorials/introductory/sample_plots:screenshots-eeg-demo}} You can embed Matplotlib into pygtk, wx, Tk, or Qt applications. Here is a screenshot of an EEG viewer called \sphinxhref{https://github.com/nipy/pbrain}{pbrain}. \noindent\sphinxincludegraphics{{eeg_small}.png} The lower axes uses {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.specgram:matplotlib.pyplot.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}} to plot the spectrogram of one of the EEG channels. For examples of how to embed Matplotlib in different toolkits, see: \begin{itemize} \item {} \DUrole{xref,std,std-doc}{/gallery/user\_interfaces/embedding\_in\_gtk2\_sgskip} \item {} \DUrole{xref,std,std-doc}{/gallery/user\_interfaces/embedding\_in\_wx2\_sgskip} \item {} \DUrole{xref,std,std-doc}{/gallery/user\_interfaces/mpl\_with\_glade\_sgskip} \item {} \DUrole{xref,std,std-doc}{/gallery/user\_interfaces/embedding\_in\_qt\_sgskip} \item {} \DUrole{xref,std,std-doc}{/gallery/user\_interfaces/embedding\_in\_tk\_sgskip} \end{itemize} \subsubsection{XKCD-style sketch plots} \label{\detokenize{tutorials/introductory/sample_plots:xkcd-style-sketch-plots}} Just for fun, Matplotlib supports plotting in the style of \sphinxcode{\sphinxupquote{xkcd}}. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/showcase/xkcd.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_xkcd_0011}.png}}\caption{Xkcd}\label{\detokenize{tutorials/introductory/sample_plots:id22}}\end{figure} \subsubsection{Subplot example} \label{\detokenize{tutorials/introductory/sample_plots:subplot-example}} Many plot types can be combined in one figure to create powerful and flexible representations of data. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{19680801}\PYG{p}{)} \PYG{n}{data} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{)}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{hist}\PYG{p}{(}\PYG{n}{data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{scatter}\PYG{p}{(}\PYG{n}{data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{data}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{data}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{hist2d}\PYG{p}{(}\PYG{n}{data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{data}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_sample_plots_001}.png} \phantomsection\label{\detokenize{tutorials/introductory/sample_plots:sphx-glr-download-tutorials-introductory-sample-plots-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/introductory/customizing:sphx-glr-download-tutorials-introductory-customizing-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Customizing Matplotlib with style sheets and rcParams} \label{\detokenize{tutorials/introductory/customizing:customizing-matplotlib-with-style-sheets-and-rcparams}}\label{\detokenize{tutorials/introductory/customizing:sphx-glr-tutorials-introductory-customizing-py}}\label{\detokenize{tutorials/introductory/customizing::doc}} Tips for customizing the properties and default styles of Matplotlib. \subsubsection{Using style sheets} \label{\detokenize{tutorials/introductory/customizing:using-style-sheets}} The \sphinxcode{\sphinxupquote{style}} package adds support for easy-to-switch plotting “styles” with the same parameters as a \sphinxhref{http://matplotlib.org/users/customizing.html}{matplotlibrc} file (which is read at startup to configure matplotlib). There are a number of pre-defined styles \sphinxhref{https://github.com/matplotlib/matplotlib/tree/master/lib/matplotlib/mpl-data/stylelib}{provided by Matplotlib}. For example, there’s a pre-defined style called “ggplot”, which emulates the aesthetics of \sphinxhref{http://ggplot2.org/}{ggplot} (a popular plotting package for \sphinxhref{https://www.r-project.org/}{R}). To use this style, just add: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{k+kn}{as} \PYG{n+nn}{mpl} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{style}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ggplot}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{data} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{50}\PYG{p}{)} \end{sphinxVerbatim} To list all available styles, use: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{print}\PYG{p}{(}\PYG{n}{plt}\PYG{o}{.}\PYG{n}{style}\PYG{o}{.}\PYG{n}{available}\PYG{p}{)} \end{sphinxVerbatim} Out: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] [\PYGZsq{}seaborn\PYGZhy{}ticks\PYGZsq{}, \PYGZsq{}ggplot\PYGZsq{}, \PYGZsq{}dark\PYGZus{}background\PYGZsq{}, \PYGZsq{}bmh\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}poster\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}notebook\PYGZsq{}, \PYGZsq{}fast\PYGZsq{}, \PYGZsq{}seaborn\PYGZsq{}, \PYGZsq{}classic\PYGZsq{}, \PYGZsq{}Solarize\PYGZus{}Light2\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}dark\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}pastel\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}muted\PYGZsq{}, \PYGZsq{}\PYGZus{}classic\PYGZus{}test\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}paper\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}colorblind\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}bright\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}talk\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}dark\PYGZhy{}palette\PYGZsq{}, \PYGZsq{}tableau\PYGZhy{}colorblind10\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}darkgrid\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}whitegrid\PYGZsq{}, \PYGZsq{}fivethirtyeight\PYGZsq{}, \PYGZsq{}grayscale\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}white\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}deep\PYGZsq{}] \end{sphinxVerbatim} \subsubsection{Defining your own style} \label{\detokenize{tutorials/introductory/customizing:defining-your-own-style}} You can create custom styles and use them by calling \sphinxcode{\sphinxupquote{style.use}} with the path or URL to the style sheet. Additionally, if you add your \sphinxcode{\sphinxupquote{\textless{}style-name\textgreater{}.mplstyle}} file to \sphinxcode{\sphinxupquote{mpl\_configdir/stylelib}}, you can reuse your custom style sheet with a call to \sphinxcode{\sphinxupquote{style.use(\textless{}style-name\textgreater{})}}. By default \sphinxcode{\sphinxupquote{mpl\_configdir}} should be \sphinxcode{\sphinxupquote{\textasciitilde{}/.config/matplotlib}}, but you can check where yours is with \sphinxcode{\sphinxupquote{matplotlib.get\_configdir()}}; you may need to create this directory. You also can change the directory where matplotlib looks for the stylelib/ folder by setting the MPLCONFIGDIR environment variable, see {\hyperref[\detokenize{faq/troubleshooting_faq:locating-matplotlib-config-dir}]{\sphinxcrossref{\DUrole{std,std-ref}{matplotlib configuration and cache directory locations}}}}. Note that a custom style sheet in \sphinxcode{\sphinxupquote{mpl\_configdir/stylelib}} will override a style sheet defined by matplotlib if the styles have the same name. For example, you might want to create \sphinxcode{\sphinxupquote{mpl\_configdir/stylelib/presentation.mplstyle}} with the following: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{axes}\PYG{o}{.}\PYG{n}{titlesize} \PYG{p}{:} \PYG{l+m+mi}{24} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{labelsize} \PYG{p}{:} \PYG{l+m+mi}{20} \PYG{n}{lines}\PYG{o}{.}\PYG{n}{linewidth} \PYG{p}{:} \PYG{l+m+mi}{3} \PYG{n}{lines}\PYG{o}{.}\PYG{n}{markersize} \PYG{p}{:} \PYG{l+m+mi}{10} \PYG{n}{xtick}\PYG{o}{.}\PYG{n}{labelsize} \PYG{p}{:} \PYG{l+m+mi}{16} \PYG{n}{ytick}\PYG{o}{.}\PYG{n}{labelsize} \PYG{p}{:} \PYG{l+m+mi}{16} \end{sphinxVerbatim} Then, when you want to adapt a plot designed for a paper to one that looks good in a presentation, you can just add: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plt}\PYG{o}{.}\PYG{n}{style}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{presentation}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \subsubsection{Composing styles} \label{\detokenize{tutorials/introductory/customizing:composing-styles}} Style sheets are designed to be composed together. So you can have a style sheet that customizes colors and a separate style sheet that alters element sizes for presentations. These styles can easily be combined by passing a list of styles: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plt}\PYG{o}{.}\PYG{n}{style}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{dark\PYGZus{}background}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{presentation}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} Note that styles further to the right will overwrite values that are already defined by styles on the left. \subsubsection{Temporary styling} \label{\detokenize{tutorials/introductory/customizing:temporary-styling}} If you only want to use a style for a specific block of code but don’t want to change the global styling, the style package provides a context manager for limiting your changes to a specific scope. To isolate your styling changes, you can write something like the following: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{with} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{style}\PYG{o}{.}\PYG{n}{context}\PYG{p}{(}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{dark\PYGZus{}background}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{)}\PYG{p}{:} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{)}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r\PYGZhy{}o}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_customizing_001}.png} \subsection{matplotlib rcParams} \label{\detokenize{tutorials/introductory/customizing:matplotlib-rcparams}} \subsubsection{Dynamic rc settings} \label{\detokenize{tutorials/introductory/customizing:dynamic-rc-settings}}\label{\detokenize{tutorials/introductory/customizing:customizing-with-dynamic-rc-settings}} You can also dynamically change the default rc settings in a python script or interactively from the python shell. All of the rc settings are stored in a dictionary-like variable called {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcParams}}}}}, which is global to the matplotlib package. rcParams can be modified directly, for example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines.linewidth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mi}{2} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines.color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{data}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_customizing_002}.png} Matplotlib also provides a couple of convenience functions for modifying rc settings. The {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rc}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rc()}}}}} command can be used to modify multiple settings in a single group at once, using keyword arguments: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rc}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{data}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_customizing_003}.png} The {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcdefaults}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcdefaults()}}}}} command will restore the standard matplotlib default settings. There is some degree of validation when setting the values of rcParams, see {\hyperref[\detokenize{api/rcsetup_api:module-matplotlib.rcsetup}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcsetup}}}}} for details. \subsubsection{The \sphinxstyleliteralintitle{\sphinxupquote{matplotlibrc}} file} \label{\detokenize{tutorials/introductory/customizing:the-matplotlibrc-file}}\label{\detokenize{tutorials/introductory/customizing:customizing-with-matplotlibrc-files}} matplotlib uses \sphinxcode{\sphinxupquote{matplotlibrc}} configuration files to customize all kinds of properties, which we call \sphinxcode{\sphinxupquote{rc settings}} or \sphinxcode{\sphinxupquote{rc parameters}}. You can control the defaults of almost every property in matplotlib: figure size and dpi, line width, color and style, axes, axis and grid properties, text and font properties and so on. matplotlib looks for \sphinxcode{\sphinxupquote{matplotlibrc}} in four locations, in the following order: \begin{enumerate} \item {} \sphinxcode{\sphinxupquote{matplotlibrc}} in the current working directory, usually used for specific customizations that you do not want to apply elsewhere. \item {} \sphinxcode{\sphinxupquote{\$MATPLOTLIBRC}} if it is a file, else \sphinxcode{\sphinxupquote{\$MATPLOTLIBRC/matplotlibrc}}. \item {} It next looks in a user-specific place, depending on your platform: \begin{itemize} \item {} On Linux and FreeBSD, it looks in \sphinxcode{\sphinxupquote{.config/matplotlib/matplotlibrc}} (or \sphinxcode{\sphinxupquote{\$XDG\_CONFIG\_HOME/matplotlib/matplotlibrc}}) if you’ve customized your environment. \item {} On other platforms, it looks in \sphinxcode{\sphinxupquote{.matplotlib/matplotlibrc}}. \end{itemize} See {\hyperref[\detokenize{faq/troubleshooting_faq:locating-matplotlib-config-dir}]{\sphinxcrossref{\DUrole{std,std-ref}{matplotlib configuration and cache directory locations}}}}. \item {} \sphinxcode{\sphinxupquote{\sphinxstyleemphasis{INSTALL}/matplotlib/mpl-data/matplotlibrc}}, where \sphinxcode{\sphinxupquote{\sphinxstyleemphasis{INSTALL}}} is something like \sphinxcode{\sphinxupquote{/usr/lib/python3.5/site-packages}} on Linux, and maybe \sphinxcode{\sphinxupquote{C:\textbackslash{}Python35\textbackslash{}Lib\textbackslash{}site-packages}} on Windows. Every time you install matplotlib, this file will be overwritten, so if you want your customizations to be saved, please move this file to your user-specific matplotlib directory. \end{enumerate} Once a \sphinxcode{\sphinxupquote{matplotlibrc}} file has been found, it will \sphinxstyleemphasis{not} search any of the other paths. To display where the currently active \sphinxcode{\sphinxupquote{matplotlibrc}} file was loaded from, one can do the following: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{matplotlib\PYGZus{}fname}\PYG{p}{(}\PYG{p}{)} \PYG{g+go}{\PYGZsq{}/home/foo/.config/matplotlib/matplotlibrc\PYGZsq{}} \end{sphinxVerbatim} See below for a sample {\hyperref[\detokenize{tutorials/introductory/customizing:matplotlibrc-sample}]{\sphinxcrossref{\DUrole{std,std-ref}{matplotlibrc file}}}}. Although all parameters are optional, you should almost always set the \sphinxcode{\sphinxupquote{backend}} or else matplotlib will choose \sphinxcode{\sphinxupquote{Agg}}, a \sphinxstyleemphasis{non-interactive} backend. This can lead to unexpected behavior, since if you do not have a \sphinxcode{\sphinxupquote{matplotlibrc}} file, it would normally fall back to \sphinxcode{\sphinxupquote{\sphinxstyleemphasis{INSTALL}/matplotlib/mpl-data/matplotlibrc}}, which is often set to an interactive backend by the package maintainer. \paragraph{A sample matplotlibrc file} \label{\detokenize{tutorials/introductory/customizing:a-sample-matplotlibrc-file}}\label{\detokenize{tutorials/introductory/customizing:matplotlibrc-sample}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} MATPLOTLIBRC FORMAT \PYGZsh{}\PYGZsh{} This is a sample matplotlib configuration file \PYGZhy{} you can find a copy \PYGZsh{}\PYGZsh{} of it on your system in \PYGZsh{}\PYGZsh{} site\PYGZhy{}packages/matplotlib/mpl\PYGZhy{}data/matplotlibrc. If you edit it \PYGZsh{}\PYGZsh{} there, please note that it will be overwritten in your next install. \PYGZsh{}\PYGZsh{} If you want to keep a permanent local copy that will not be \PYGZsh{}\PYGZsh{} overwritten, place it in the following location: \PYGZsh{}\PYGZsh{} unix/linux: \PYGZsh{}\PYGZsh{} \PYGZdl{}HOME/.config/matplotlib/matplotlibrc or \PYGZsh{}\PYGZsh{} \PYGZdl{}XDG\PYGZus{}CONFIG\PYGZus{}HOME/matplotlib/matplotlibrc (if \PYGZdl{}XDG\PYGZus{}CONFIG\PYGZus{}HOME is set) \PYGZsh{}\PYGZsh{} other platforms: \PYGZsh{}\PYGZsh{} \PYGZdl{}HOME/.matplotlib/matplotlibrc \PYGZsh{}\PYGZsh{} \PYGZsh{}\PYGZsh{} See http://matplotlib.org/users/customizing.html\PYGZsh{}the\PYGZhy{}matplotlibrc\PYGZhy{}file for \PYGZsh{}\PYGZsh{} more details on the paths which are checked for the configuration file. \PYGZsh{}\PYGZsh{} \PYGZsh{}\PYGZsh{} This file is best viewed in a editor which supports python mode \PYGZsh{}\PYGZsh{} syntax highlighting. Blank lines, or lines starting with a comment \PYGZsh{}\PYGZsh{} symbol, are ignored, as are trailing comments. Other lines must \PYGZsh{}\PYGZsh{} have the format \PYGZsh{}\PYGZsh{} key : val \PYGZsh{}\PYGZsh{} optional comment \PYGZsh{}\PYGZsh{} \PYGZsh{}\PYGZsh{} Colors: for the color values below, you can either use \PYGZhy{} a \PYGZsh{}\PYGZsh{} matplotlib color string, such as r, k, or b \PYGZhy{} an rgb tuple, such as \PYGZsh{}\PYGZsh{} (1.0, 0.5, 0.0) \PYGZhy{} a hex string, such as ff00ff \PYGZhy{} a scalar \PYGZsh{}\PYGZsh{} grayscale intensity such as 0.75 \PYGZhy{} a legal html color name, e.g., red, \PYGZsh{}\PYGZsh{} blue, darkslategray \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} CONFIGURATION BEGINS HERE \PYGZsh{}\PYGZsh{} The default backend; one of GTK GTKAgg GTKCairo GTK3Agg GTK3Cairo \PYGZsh{}\PYGZsh{} MacOSX Qt4Agg Qt5Agg TkAgg WX WXAgg Agg Cairo GDK PS PDF SVG \PYGZsh{}\PYGZsh{} Template. \PYGZsh{}\PYGZsh{} You can also deploy your own backend outside of matplotlib by \PYGZsh{}\PYGZsh{} referring to the module name (which must be in the PYTHONPATH) as \PYGZsh{}\PYGZsh{} \PYGZsq{}module://my\PYGZus{}backend\PYGZsq{}. \PYGZsh{}\PYGZsh{} \PYGZsh{}\PYGZsh{} If you omit this parameter, it will always default to \PYGZdq{}Agg\PYGZdq{}, which is a \PYGZsh{}\PYGZsh{} non\PYGZhy{}interactive backend. backend : \PYGZdl{}TEMPLATE\PYGZus{}BACKEND \PYGZsh{}\PYGZsh{} Note that this can be overridden by the environment variable \PYGZsh{}\PYGZsh{} QT\PYGZus{}API used by Enthought Tool Suite (ETS); valid values are \PYGZsh{}\PYGZsh{} \PYGZdq{}pyqt\PYGZdq{} and \PYGZdq{}pyside\PYGZdq{}. The \PYGZdq{}pyqt\PYGZdq{} setting has the side effect of \PYGZsh{}\PYGZsh{} forcing the use of Version 2 API for QString and QVariant. \PYGZsh{}\PYGZsh{} The port to use for the web server in the WebAgg backend. \PYGZsh{}webagg.port : 8988 \PYGZsh{}\PYGZsh{} The address on which the WebAgg web server should be reachable \PYGZsh{}webagg.address : 127.0.0.1 \PYGZsh{}\PYGZsh{} If webagg.port is unavailable, a number of other random ports will \PYGZsh{}\PYGZsh{} be tried until one that is available is found. \PYGZsh{}webagg.port\PYGZus{}retries : 50 \PYGZsh{}\PYGZsh{} When True, open the webbrowser to the plot that is shown \PYGZsh{}webagg.open\PYGZus{}in\PYGZus{}browser : True \PYGZsh{}\PYGZsh{} if you are running pyplot inside a GUI and your backend choice \PYGZsh{}\PYGZsh{} conflicts, we will automatically try to find a compatible one for \PYGZsh{}\PYGZsh{} you if backend\PYGZus{}fallback is True \PYGZsh{}backend\PYGZus{}fallback: True \PYGZsh{}interactive : False \PYGZsh{}toolbar : toolbar2 \PYGZsh{}\PYGZsh{} None \textbar{} toolbar2 (\PYGZdq{}classic\PYGZdq{} is deprecated) \PYGZsh{}timezone : UTC \PYGZsh{}\PYGZsh{} a pytz timezone string, e.g., US/Central or Europe/Paris \PYGZsh{}\PYGZsh{} Where your matplotlib data lives if you installed to a non\PYGZhy{}default \PYGZsh{}\PYGZsh{} location. This is where the matplotlib fonts, bitmaps, etc reside \PYGZsh{}datapath : /home/jdhunter/mpldata \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} LINES \PYGZsh{}\PYGZsh{} See http://matplotlib.org/api/artist\PYGZus{}api.html\PYGZsh{}module\PYGZhy{}matplotlib.lines for more \PYGZsh{}\PYGZsh{} information on line properties. \PYGZsh{}lines.linewidth : 1.5 \PYGZsh{}\PYGZsh{} line width in points \PYGZsh{}lines.linestyle : \PYGZhy{} \PYGZsh{}\PYGZsh{} solid line \PYGZsh{}lines.color : C0 \PYGZsh{}\PYGZsh{} has no affect on plot(); see axes.prop\PYGZus{}cycle \PYGZsh{}lines.marker : None \PYGZsh{}\PYGZsh{} the default marker \PYGZsh{}lines.markeredgewidth : 1.0 \PYGZsh{}\PYGZsh{} the line width around the marker symbol \PYGZsh{}lines.markersize : 6 \PYGZsh{}\PYGZsh{} markersize, in points \PYGZsh{}lines.dash\PYGZus{}joinstyle : round \PYGZsh{}\PYGZsh{} miter\textbar{}round\textbar{}bevel \PYGZsh{}lines.dash\PYGZus{}capstyle : butt \PYGZsh{}\PYGZsh{} butt\textbar{}round\textbar{}projecting \PYGZsh{}lines.solid\PYGZus{}joinstyle : round \PYGZsh{}\PYGZsh{} miter\textbar{}round\textbar{}bevel \PYGZsh{}lines.solid\PYGZus{}capstyle : projecting \PYGZsh{}\PYGZsh{} butt\textbar{}round\textbar{}projecting \PYGZsh{}lines.antialiased : True \PYGZsh{}\PYGZsh{} render lines in antialiased (no jaggies) \PYGZsh{}\PYGZsh{} The three standard dash patterns. These are scaled by the linewidth. \PYGZsh{}lines.dashed\PYGZus{}pattern : 3.7, 1.6 \PYGZsh{}lines.dashdot\PYGZus{}pattern : 6.4, 1.6, 1, 1.6 \PYGZsh{}lines.dotted\PYGZus{}pattern : 1, 1.65 \PYGZsh{}lines.scale\PYGZus{}dashes : True \PYGZsh{}markers.fillstyle: full \PYGZsh{}\PYGZsh{} full\textbar{}left\textbar{}right\textbar{}bottom\textbar{}top\textbar{}none \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} PATCHES \PYGZsh{}\PYGZsh{} Patches are graphical objects that fill 2D space, like polygons or \PYGZsh{}\PYGZsh{} circles. See \PYGZsh{}\PYGZsh{} http://matplotlib.org/api/artist\PYGZus{}api.html\PYGZsh{}module\PYGZhy{}matplotlib.patches \PYGZsh{}\PYGZsh{} information on patch properties \PYGZsh{}patch.linewidth : 1 \PYGZsh{}\PYGZsh{} edge width in points. \PYGZsh{}patch.facecolor : C0 \PYGZsh{}patch.edgecolor : k \PYGZsh{}\PYGZsh{} if forced, or patch is not filled \PYGZsh{}patch.force\PYGZus{}edgecolor : False \PYGZsh{}\PYGZsh{} True to always use edgecolor \PYGZsh{}patch.antialiased : True \PYGZsh{}\PYGZsh{} render patches in antialiased (no jaggies) \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} HATCHES \PYGZsh{}hatch.color : k \PYGZsh{}hatch.linewidth : 1.0 \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} Boxplot \PYGZsh{}boxplot.notch : False \PYGZsh{}boxplot.vertical : True \PYGZsh{}boxplot.whiskers : 1.5 \PYGZsh{}boxplot.bootstrap : None \PYGZsh{}boxplot.patchartist : False \PYGZsh{}boxplot.showmeans : False \PYGZsh{}boxplot.showcaps : True \PYGZsh{}boxplot.showbox : True \PYGZsh{}boxplot.showfliers : True \PYGZsh{}boxplot.meanline : False \PYGZsh{}boxplot.flierprops.color : k \PYGZsh{}boxplot.flierprops.marker : o \PYGZsh{}boxplot.flierprops.markerfacecolor : none \PYGZsh{}boxplot.flierprops.markeredgecolor : k \PYGZsh{}boxplot.flierprops.markersize : 6 \PYGZsh{}boxplot.flierprops.linestyle : none \PYGZsh{}boxplot.flierprops.linewidth : 1.0 \PYGZsh{}boxplot.boxprops.color : k \PYGZsh{}boxplot.boxprops.linewidth : 1.0 \PYGZsh{}boxplot.boxprops.linestyle : \PYGZhy{} \PYGZsh{}boxplot.whiskerprops.color : k \PYGZsh{}boxplot.whiskerprops.linewidth : 1.0 \PYGZsh{}boxplot.whiskerprops.linestyle : \PYGZhy{} \PYGZsh{}boxplot.capprops.color : k \PYGZsh{}boxplot.capprops.linewidth : 1.0 \PYGZsh{}boxplot.capprops.linestyle : \PYGZhy{} \PYGZsh{}boxplot.medianprops.color : C1 \PYGZsh{}boxplot.medianprops.linewidth : 1.0 \PYGZsh{}boxplot.medianprops.linestyle : \PYGZhy{} \PYGZsh{}boxplot.meanprops.color : C2 \PYGZsh{}boxplot.meanprops.marker : \PYGZca{} \PYGZsh{}boxplot.meanprops.markerfacecolor : C2 \PYGZsh{}boxplot.meanprops.markeredgecolor : C2 \PYGZsh{}boxplot.meanprops.markersize : 6 \PYGZsh{}boxplot.meanprops.linestyle : \PYGZhy{}\PYGZhy{} \PYGZsh{}boxplot.meanprops.linewidth : 1.0 \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} FONT \PYGZsh{}\PYGZsh{} font properties used by text.Text. See \PYGZsh{}\PYGZsh{} http://matplotlib.org/api/font\PYGZus{}manager\PYGZus{}api.html for more \PYGZsh{}\PYGZsh{} information on font properties. The 6 font properties used for font \PYGZsh{}\PYGZsh{} matching are given below with their default values. \PYGZsh{}\PYGZsh{} \PYGZsh{}\PYGZsh{} The font.family property has five values: \PYGZsq{}serif\PYGZsq{} (e.g., Times), \PYGZsh{}\PYGZsh{} \PYGZsq{}sans\PYGZhy{}serif\PYGZsq{} (e.g., Helvetica), \PYGZsq{}cursive\PYGZsq{} (e.g., Zapf\PYGZhy{}Chancery), \PYGZsh{}\PYGZsh{} \PYGZsq{}fantasy\PYGZsq{} (e.g., Western), and \PYGZsq{}monospace\PYGZsq{} (e.g., Courier). Each of \PYGZsh{}\PYGZsh{} these font families has a default list of font names in decreasing \PYGZsh{}\PYGZsh{} order of priority associated with them. When text.usetex is False, \PYGZsh{}\PYGZsh{} font.family may also be one or more concrete font names. \PYGZsh{}\PYGZsh{} \PYGZsh{}\PYGZsh{} The font.style property has three values: normal (or roman), italic \PYGZsh{}\PYGZsh{} or oblique. The oblique style will be used for italic, if it is not \PYGZsh{}\PYGZsh{} present. \PYGZsh{}\PYGZsh{} \PYGZsh{}\PYGZsh{} The font.variant property has two values: normal or small\PYGZhy{}caps. For \PYGZsh{}\PYGZsh{} TrueType fonts, which are scalable fonts, small\PYGZhy{}caps is equivalent \PYGZsh{}\PYGZsh{} to using a font size of \PYGZsq{}smaller\PYGZsq{}, or about 83\PYGZpc{}\PYGZpc{} of the current font \PYGZsh{}\PYGZsh{} size. \PYGZsh{}\PYGZsh{} \PYGZsh{}\PYGZsh{} The font.weight property has effectively 13 values: normal, bold, \PYGZsh{}\PYGZsh{} bolder, lighter, 100, 200, 300, ..., 900. Normal is the same as \PYGZsh{}\PYGZsh{} 400, and bold is 700. bolder and lighter are relative values with \PYGZsh{}\PYGZsh{} respect to the current weight. \PYGZsh{}\PYGZsh{} \PYGZsh{}\PYGZsh{} The font.stretch property has 11 values: ultra\PYGZhy{}condensed, \PYGZsh{}\PYGZsh{} extra\PYGZhy{}condensed, condensed, semi\PYGZhy{}condensed, normal, semi\PYGZhy{}expanded, \PYGZsh{}\PYGZsh{} expanded, extra\PYGZhy{}expanded, ultra\PYGZhy{}expanded, wider, and narrower. This \PYGZsh{}\PYGZsh{} property is not currently implemented. \PYGZsh{}\PYGZsh{} \PYGZsh{}\PYGZsh{} The font.size property is the default font size for text, given in pts. \PYGZsh{}\PYGZsh{} 10 pt is the standard value. \PYGZsh{}font.family : sans\PYGZhy{}serif \PYGZsh{}font.style : normal \PYGZsh{}font.variant : normal \PYGZsh{}font.weight : normal \PYGZsh{}font.stretch : normal \PYGZsh{}\PYGZsh{} note that font.size controls default text sizes. To configure \PYGZsh{}\PYGZsh{} special text sizes tick labels, axes, labels, title, etc, see the rc \PYGZsh{}\PYGZsh{} settings for axes and ticks. Special text sizes can be defined \PYGZsh{}\PYGZsh{} relative to font.size, using the following values: xx\PYGZhy{}small, x\PYGZhy{}small, \PYGZsh{}\PYGZsh{} small, medium, large, x\PYGZhy{}large, xx\PYGZhy{}large, larger, or smaller \PYGZsh{}font.size : 10.0 \PYGZsh{}font.serif : DejaVu Serif, Bitstream Vera Serif, Computer Modern Roman, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif \PYGZsh{}font.sans\PYGZhy{}serif : DejaVu Sans, Bitstream Vera Sans, Computer Modern Sans Serif, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans\PYGZhy{}serif \PYGZsh{}font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, Script MT, Felipa, cursive \PYGZsh{}font.fantasy : Comic Sans MS, Chicago, Charcoal, ImpactWestern, Humor Sans, xkcd, fantasy \PYGZsh{}font.monospace : DejaVu Sans Mono, Bitstream Vera Sans Mono, Computer Modern Typewriter, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} TEXT \PYGZsh{}\PYGZsh{} text properties used by text.Text. See \PYGZsh{}\PYGZsh{} http://matplotlib.org/api/artist\PYGZus{}api.html\PYGZsh{}module\PYGZhy{}matplotlib.text for more \PYGZsh{}\PYGZsh{} information on text properties \PYGZsh{}text.color : k \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} LaTeX customizations. See http://wiki.scipy.org/Cookbook/Matplotlib/UsingTex \PYGZsh{}text.usetex : False \PYGZsh{}\PYGZsh{} use latex for all text handling. The following fonts \PYGZsh{}\PYGZsh{} are supported through the usual rc parameter settings: \PYGZsh{}\PYGZsh{} new century schoolbook, bookman, times, palatino, \PYGZsh{}\PYGZsh{} zapf chancery, charter, serif, sans\PYGZhy{}serif, helvetica, \PYGZsh{}\PYGZsh{} avant garde, courier, monospace, computer modern roman, \PYGZsh{}\PYGZsh{} computer modern sans serif, computer modern typewriter \PYGZsh{}\PYGZsh{} If another font is desired which can loaded using the \PYGZsh{}\PYGZsh{} LaTeX \PYGZbs{}usepackage command, please inquire at the \PYGZsh{}\PYGZsh{} matplotlib mailing list \PYGZsh{}text.latex.unicode : False \PYGZsh{}\PYGZsh{} use \PYGZdq{}ucs\PYGZdq{} and \PYGZdq{}inputenc\PYGZdq{} LaTeX packages for handling \PYGZsh{}\PYGZsh{} unicode strings. \PYGZsh{}text.latex.preamble : \PYGZsh{}\PYGZsh{} IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES \PYGZsh{}\PYGZsh{} AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP \PYGZsh{}\PYGZsh{} IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO. \PYGZsh{}\PYGZsh{} preamble is a comma separated list of LaTeX statements \PYGZsh{}\PYGZsh{} that are included in the LaTeX document preamble. \PYGZsh{}\PYGZsh{} An example: \PYGZsh{}\PYGZsh{} text.latex.preamble : \PYGZbs{}usepackage\PYGZob{}bm\PYGZcb{},\PYGZbs{}usepackage\PYGZob{}euler\PYGZcb{} \PYGZsh{}\PYGZsh{} The following packages are always loaded with usetex, so \PYGZsh{}\PYGZsh{} beware of package collisions: color, geometry, graphicx, \PYGZsh{}\PYGZsh{} type1cm, textcomp. Adobe Postscript (PSSNFS) font packages \PYGZsh{}\PYGZsh{} may also be loaded, depending on your font settings \PYGZsh{}text.latex.preview : False \PYGZsh{}text.hinting : auto \PYGZsh{}\PYGZsh{} May be one of the following: \PYGZsh{}\PYGZsh{} none: Perform no hinting \PYGZsh{}\PYGZsh{} auto: Use FreeType\PYGZsq{}s autohinter \PYGZsh{}\PYGZsh{} native: Use the hinting information in the \PYGZsh{} font file, if available, and if your \PYGZsh{} FreeType library supports it \PYGZsh{}\PYGZsh{} either: Use the native hinting information, \PYGZsh{} or the autohinter if none is available. \PYGZsh{}\PYGZsh{} For backward compatibility, this value may also be \PYGZsh{}\PYGZsh{} True === \PYGZsq{}auto\PYGZsq{} or False === \PYGZsq{}none\PYGZsq{}. \PYGZsh{}text.hinting\PYGZus{}factor : 8 \PYGZsh{}\PYGZsh{} Specifies the amount of softness for hinting in the \PYGZsh{}\PYGZsh{} horizontal direction. A value of 1 will hint to full \PYGZsh{}\PYGZsh{} pixels. A value of 2 will hint to half pixels etc. \PYGZsh{}text.antialiased : True \PYGZsh{}\PYGZsh{} If True (default), the text will be antialiased. \PYGZsh{}\PYGZsh{} This only affects the Agg backend. \PYGZsh{}\PYGZsh{} The following settings allow you to select the fonts in math mode. \PYGZsh{}\PYGZsh{} They map from a TeX font name to a fontconfig font pattern. \PYGZsh{}\PYGZsh{} These settings are only used if mathtext.fontset is \PYGZsq{}custom\PYGZsq{}. \PYGZsh{}\PYGZsh{} Note that this \PYGZdq{}custom\PYGZdq{} mode is unsupported and may go away in the \PYGZsh{}\PYGZsh{} future. \PYGZsh{}mathtext.cal : cursive \PYGZsh{}mathtext.rm : sans \PYGZsh{}mathtext.tt : monospace \PYGZsh{}mathtext.it : sans:italic \PYGZsh{}mathtext.bf : sans:bold \PYGZsh{}mathtext.sf : sans \PYGZsh{}mathtext.fontset : dejavusans \PYGZsh{}\PYGZsh{} Should be \PYGZsq{}dejavusans\PYGZsq{} (default), \PYGZsh{}\PYGZsh{} \PYGZsq{}dejavuserif\PYGZsq{}, \PYGZsq{}cm\PYGZsq{} (Computer Modern), \PYGZsq{}stix\PYGZsq{}, \PYGZsh{}\PYGZsh{} \PYGZsq{}stixsans\PYGZsq{} or \PYGZsq{}custom\PYGZsq{} \PYGZsh{}mathtext.fallback\PYGZus{}to\PYGZus{}cm : True \PYGZsh{}\PYGZsh{} When True, use symbols from the Computer Modern \PYGZsh{}\PYGZsh{} fonts when a symbol can not be found in one of \PYGZsh{}\PYGZsh{} the custom math fonts. \PYGZsh{}mathtext.default : it \PYGZsh{}\PYGZsh{} The default font to use for math. \PYGZsh{}\PYGZsh{} Can be any of the LaTeX font names, including \PYGZsh{}\PYGZsh{} the special name \PYGZdq{}regular\PYGZdq{} for the same font \PYGZsh{}\PYGZsh{} used in regular text. \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} AXES \PYGZsh{}\PYGZsh{} default face and edge color, default tick sizes, \PYGZsh{}\PYGZsh{} default fontsizes for ticklabels, and so on. See \PYGZsh{}\PYGZsh{} http://matplotlib.org/api/axes\PYGZus{}api.html\PYGZsh{}module\PYGZhy{}matplotlib.axes \PYGZsh{}axes.facecolor : w \PYGZsh{}\PYGZsh{} axes background color \PYGZsh{}axes.edgecolor : k \PYGZsh{}\PYGZsh{} axes edge color \PYGZsh{}axes.linewidth : 0.8 \PYGZsh{}\PYGZsh{} edge linewidth \PYGZsh{}axes.grid : False \PYGZsh{}\PYGZsh{} display grid or not \PYGZsh{}axes.grid.axis : both \PYGZsh{}\PYGZsh{} which axis the grid should apply to \PYGZsh{}axes.grid.which : major \PYGZsh{}\PYGZsh{} gridlines at major, minor or both ticks \PYGZsh{}axes.titlesize : large \PYGZsh{}\PYGZsh{} fontsize of the axes title \PYGZsh{}axes.titleweight : normal \PYGZsh{}\PYGZsh{} font weight of title \PYGZsh{}axes.titlepad : 6.0 \PYGZsh{}\PYGZsh{} pad between axes and title in points \PYGZsh{}axes.labelsize : medium \PYGZsh{}\PYGZsh{} fontsize of the x any y labels \PYGZsh{}axes.labelpad : 4.0 \PYGZsh{}\PYGZsh{} space between label and axis \PYGZsh{}axes.labelweight : normal \PYGZsh{}\PYGZsh{} weight of the x and y labels \PYGZsh{}axes.labelcolor : k \PYGZsh{}axes.axisbelow : line \PYGZsh{}\PYGZsh{} draw axis gridlines and ticks below \PYGZsh{}\PYGZsh{} patches (True); above patches but below \PYGZsh{}\PYGZsh{} lines (\PYGZsq{}line\PYGZsq{}); or above all (False) \PYGZsh{}axes.formatter.limits : \PYGZhy{}7, 7 \PYGZsh{}\PYGZsh{} use scientific notation if log10 \PYGZsh{}\PYGZsh{} of the axis range is smaller than the \PYGZsh{}\PYGZsh{} first or larger than the second \PYGZsh{}axes.formatter.use\PYGZus{}locale : False \PYGZsh{}\PYGZsh{} When True, format tick labels \PYGZsh{}\PYGZsh{} according to the user\PYGZsq{}s locale. \PYGZsh{}\PYGZsh{} For example, use \PYGZsq{},\PYGZsq{} as a decimal \PYGZsh{}\PYGZsh{} separator in the fr\PYGZus{}FR locale. \PYGZsh{}axes.formatter.use\PYGZus{}mathtext : False \PYGZsh{}\PYGZsh{} When True, use mathtext for scientific \PYGZsh{}\PYGZsh{} notation. \PYGZsh{}axes.formatter.min\PYGZus{}exponent: 0 \PYGZsh{}\PYGZsh{} minimum exponent to format in scientific notation \PYGZsh{}axes.formatter.useoffset : True \PYGZsh{}\PYGZsh{} If True, the tick label formatter \PYGZsh{}\PYGZsh{} will default to labeling ticks relative \PYGZsh{}\PYGZsh{} to an offset when the data range is \PYGZsh{}\PYGZsh{} small compared to the minimum absolute \PYGZsh{}\PYGZsh{} value of the data. \PYGZsh{}axes.formatter.offset\PYGZus{}threshold : 4 \PYGZsh{}\PYGZsh{} When useoffset is True, the offset \PYGZsh{}\PYGZsh{} will be used when it can remove \PYGZsh{}\PYGZsh{} at least this number of significant \PYGZsh{}\PYGZsh{} digits from tick labels. \PYGZsh{}axes.spines.left : True \PYGZsh{}\PYGZsh{} display axis spines \PYGZsh{}axes.spines.bottom : True \PYGZsh{}axes.spines.top : True \PYGZsh{}axes.spines.right : True \PYGZsh{}axes.unicode\PYGZus{}minus : True \PYGZsh{}\PYGZsh{} use unicode for the minus symbol \PYGZsh{}\PYGZsh{} rather than hyphen. See \PYGZsh{}\PYGZsh{} http://en.wikipedia.org/wiki/Plus\PYGZus{}and\PYGZus{}minus\PYGZus{}signs\PYGZsh{}Character\PYGZus{}codes \PYGZsh{}axes.prop\PYGZus{}cycle : cycler(\PYGZsq{}color\PYGZsq{}, [\PYGZsq{}1f77b4\PYGZsq{}, \PYGZsq{}ff7f0e\PYGZsq{}, \PYGZsq{}2ca02c\PYGZsq{}, \PYGZsq{}d62728\PYGZsq{}, \PYGZsq{}9467bd\PYGZsq{}, \PYGZsq{}8c564b\PYGZsq{}, \PYGZsq{}e377c2\PYGZsq{}, \PYGZsq{}7f7f7f\PYGZsq{}, \PYGZsq{}bcbd22\PYGZsq{}, \PYGZsq{}17becf\PYGZsq{}]) \PYGZsh{}\PYGZsh{} color cycle for plot lines as list of string \PYGZsh{}\PYGZsh{} colorspecs: single letter, long name, or web\PYGZhy{}style hex \PYGZsh{}\PYGZsh{} Note the use of string escapes here (\PYGZsq{}1f77b4\PYGZsq{}, instead of 1f77b4) \PYGZsh{}\PYGZsh{} as opposed to the rest of this file. \PYGZsh{}axes.autolimit\PYGZus{}mode : data \PYGZsh{}\PYGZsh{} How to scale axes limits to the data. \PYGZsh{}\PYGZsh{} Use \PYGZdq{}data\PYGZdq{} to use data limits, plus some margin \PYGZsh{}\PYGZsh{} Use \PYGZdq{}round\PYGZus{}number\PYGZdq{} move to the nearest \PYGZdq{}round\PYGZdq{} number \PYGZsh{}axes.xmargin : .05 \PYGZsh{}\PYGZsh{} x margin. See {}`axes.Axes.margins{}` \PYGZsh{}axes.ymargin : .05 \PYGZsh{}\PYGZsh{} y margin See {}`axes.Axes.margins{}` \PYGZsh{}polaraxes.grid : True \PYGZsh{}\PYGZsh{} display grid on polar axes \PYGZsh{}axes3d.grid : True \PYGZsh{}\PYGZsh{} display grid on 3d axes \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} DATES \PYGZsh{}\PYGZsh{} These control the default format strings used in AutoDateFormatter. \PYGZsh{}\PYGZsh{} Any valid format datetime format string can be used (see the python \PYGZsh{}\PYGZsh{} {}`datetime{}` for details). For example using \PYGZsq{}\PYGZpc{}\PYGZpc{}x\PYGZsq{} will use the locale date representation \PYGZsh{}\PYGZsh{} \PYGZsq{}\PYGZpc{}\PYGZpc{}X\PYGZsq{} will use the locale time representation and \PYGZsq{}\PYGZpc{}\PYGZpc{}c\PYGZsq{} will use the full locale datetime \PYGZsh{}\PYGZsh{} representation. \PYGZsh{}\PYGZsh{} These values map to the scales: \PYGZsh{}\PYGZsh{} \PYGZob{}\PYGZsq{}year\PYGZsq{}: 365, \PYGZsq{}month\PYGZsq{}: 30, \PYGZsq{}day\PYGZsq{}: 1, \PYGZsq{}hour\PYGZsq{}: 1/24, \PYGZsq{}minute\PYGZsq{}: 1 / (24 * 60)\PYGZcb{} \PYGZsh{}date.autoformatter.year : \PYGZpc{}Y \PYGZsh{}date.autoformatter.month : \PYGZpc{}Y\PYGZhy{}\PYGZpc{}m \PYGZsh{}date.autoformatter.day : \PYGZpc{}Y\PYGZhy{}\PYGZpc{}m\PYGZhy{}\PYGZpc{}d \PYGZsh{}date.autoformatter.hour : \PYGZpc{}m\PYGZhy{}\PYGZpc{}d \PYGZpc{}H \PYGZsh{}date.autoformatter.minute : \PYGZpc{}d \PYGZpc{}H:\PYGZpc{}M \PYGZsh{}date.autoformatter.second : \PYGZpc{}H:\PYGZpc{}M:\PYGZpc{}S \PYGZsh{}date.autoformatter.microsecond : \PYGZpc{}M:\PYGZpc{}S.\PYGZpc{}f \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} TICKS \PYGZsh{}\PYGZsh{} see http://matplotlib.org/api/axis\PYGZus{}api.html\PYGZsh{}matplotlib.axis.Tick \PYGZsh{}xtick.top : False \PYGZsh{}\PYGZsh{} draw ticks on the top side \PYGZsh{}xtick.bottom : True \PYGZsh{}\PYGZsh{} draw ticks on the bottom side \PYGZsh{}xtick.labeltop : False \PYGZsh{}\PYGZsh{} draw label on the top \PYGZsh{}xtick.labelbottom : True \PYGZsh{}\PYGZsh{} draw label on the bottom \PYGZsh{}xtick.major.size : 3.5 \PYGZsh{}\PYGZsh{} major tick size in points \PYGZsh{}xtick.minor.size : 2 \PYGZsh{}\PYGZsh{} minor tick size in points \PYGZsh{}xtick.major.width : 0.8 \PYGZsh{}\PYGZsh{} major tick width in points \PYGZsh{}xtick.minor.width : 0.6 \PYGZsh{}\PYGZsh{} minor tick width in points \PYGZsh{}xtick.major.pad : 3.5 \PYGZsh{}\PYGZsh{} distance to major tick label in points \PYGZsh{}xtick.minor.pad : 3.4 \PYGZsh{}\PYGZsh{} distance to the minor tick label in points \PYGZsh{}xtick.color : k \PYGZsh{}\PYGZsh{} color of the tick labels \PYGZsh{}xtick.labelsize : medium \PYGZsh{}\PYGZsh{} fontsize of the tick labels \PYGZsh{}xtick.direction : out \PYGZsh{}\PYGZsh{} direction: in, out, or inout \PYGZsh{}xtick.minor.visible : False \PYGZsh{}\PYGZsh{} visibility of minor ticks on x\PYGZhy{}axis \PYGZsh{}xtick.major.top : True \PYGZsh{}\PYGZsh{} draw x axis top major ticks \PYGZsh{}xtick.major.bottom : True \PYGZsh{}\PYGZsh{} draw x axis bottom major ticks \PYGZsh{}xtick.minor.top : True \PYGZsh{}\PYGZsh{} draw x axis top minor ticks \PYGZsh{}xtick.minor.bottom : True \PYGZsh{}\PYGZsh{} draw x axis bottom minor ticks \PYGZsh{}xtick.alignment : center \PYGZsh{}\PYGZsh{} alignment of xticks \PYGZsh{}ytick.left : True \PYGZsh{}\PYGZsh{} draw ticks on the left side \PYGZsh{}ytick.right : False \PYGZsh{}\PYGZsh{} draw ticks on the right side \PYGZsh{}ytick.labelleft : True \PYGZsh{}\PYGZsh{} draw tick labels on the left side \PYGZsh{}ytick.labelright : False \PYGZsh{}\PYGZsh{} draw tick labels on the right side \PYGZsh{}ytick.major.size : 3.5 \PYGZsh{}\PYGZsh{} major tick size in points \PYGZsh{}ytick.minor.size : 2 \PYGZsh{}\PYGZsh{} minor tick size in points \PYGZsh{}ytick.major.width : 0.8 \PYGZsh{}\PYGZsh{} major tick width in points \PYGZsh{}ytick.minor.width : 0.6 \PYGZsh{}\PYGZsh{} minor tick width in points \PYGZsh{}ytick.major.pad : 3.5 \PYGZsh{}\PYGZsh{} distance to major tick label in points \PYGZsh{}ytick.minor.pad : 3.4 \PYGZsh{}\PYGZsh{} distance to the minor tick label in points \PYGZsh{}ytick.color : k \PYGZsh{}\PYGZsh{} color of the tick labels \PYGZsh{}ytick.labelsize : medium \PYGZsh{}\PYGZsh{} fontsize of the tick labels \PYGZsh{}ytick.direction : out \PYGZsh{}\PYGZsh{} direction: in, out, or inout \PYGZsh{}ytick.minor.visible : False \PYGZsh{}\PYGZsh{} visibility of minor ticks on y\PYGZhy{}axis \PYGZsh{}ytick.major.left : True \PYGZsh{}\PYGZsh{} draw y axis left major ticks \PYGZsh{}ytick.major.right : True \PYGZsh{}\PYGZsh{} draw y axis right major ticks \PYGZsh{}ytick.minor.left : True \PYGZsh{}\PYGZsh{} draw y axis left minor ticks \PYGZsh{}ytick.minor.right : True \PYGZsh{}\PYGZsh{} draw y axis right minor ticks \PYGZsh{}ytick.alignment : center\PYGZus{}baseline \PYGZsh{}\PYGZsh{} alignment of yticks \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} GRIDS \PYGZsh{}grid.color : b0b0b0 \PYGZsh{}\PYGZsh{} grid color \PYGZsh{}grid.linestyle : \PYGZhy{} \PYGZsh{}\PYGZsh{} solid \PYGZsh{}grid.linewidth : 0.8 \PYGZsh{}\PYGZsh{} in points \PYGZsh{}grid.alpha : 1.0 \PYGZsh{}\PYGZsh{} transparency, between 0.0 and 1.0 \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} Legend \PYGZsh{}legend.loc : best \PYGZsh{}legend.frameon : True \PYGZsh{}\PYGZsh{} if True, draw the legend on a background patch \PYGZsh{}legend.framealpha : 0.8 \PYGZsh{}\PYGZsh{} legend patch transparency \PYGZsh{}legend.facecolor : inherit \PYGZsh{}\PYGZsh{} inherit from axes.facecolor; or color spec \PYGZsh{}legend.edgecolor : 0.8 \PYGZsh{}\PYGZsh{} background patch boundary color \PYGZsh{}legend.fancybox : True \PYGZsh{}\PYGZsh{} if True, use a rounded box for the \PYGZsh{}\PYGZsh{} legend background, else a rectangle \PYGZsh{}legend.shadow : False \PYGZsh{}\PYGZsh{} if True, give background a shadow effect \PYGZsh{}legend.numpoints : 1 \PYGZsh{}\PYGZsh{} the number of marker points in the legend line \PYGZsh{}legend.scatterpoints : 1 \PYGZsh{}\PYGZsh{} number of scatter points \PYGZsh{}legend.markerscale : 1.0 \PYGZsh{}\PYGZsh{} the relative size of legend markers vs. original \PYGZsh{}legend.fontsize : medium \PYGZsh{}\PYGZsh{} Dimensions as fraction of fontsize: \PYGZsh{}legend.borderpad : 0.4 \PYGZsh{}\PYGZsh{} border whitespace \PYGZsh{}legend.labelspacing : 0.5 \PYGZsh{}\PYGZsh{} the vertical space between the legend entries \PYGZsh{}legend.handlelength : 2.0 \PYGZsh{}\PYGZsh{} the length of the legend lines \PYGZsh{}legend.handleheight : 0.7 \PYGZsh{}\PYGZsh{} the height of the legend handle \PYGZsh{}legend.handletextpad : 0.8 \PYGZsh{}\PYGZsh{} the space between the legend line and legend text \PYGZsh{}legend.borderaxespad : 0.5 \PYGZsh{}\PYGZsh{} the border between the axes and legend edge \PYGZsh{}legend.columnspacing : 2.0 \PYGZsh{}\PYGZsh{} column separation \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} FIGURE \PYGZsh{}\PYGZsh{} See http://matplotlib.org/api/figure\PYGZus{}api.html\PYGZsh{}matplotlib.figure.Figure \PYGZsh{}figure.titlesize : large \PYGZsh{}\PYGZsh{} size of the figure title (Figure.suptitle()) \PYGZsh{}figure.titleweight : normal \PYGZsh{}\PYGZsh{} weight of the figure title \PYGZsh{}figure.figsize : 6.4, 4.8 \PYGZsh{}\PYGZsh{} figure size in inches \PYGZsh{}figure.dpi : 100 \PYGZsh{}\PYGZsh{} figure dots per inch \PYGZsh{}figure.facecolor : w \PYGZsh{}\PYGZsh{} figure facecolor; 0.75 is scalar gray \PYGZsh{}figure.edgecolor : w \PYGZsh{}\PYGZsh{} figure edgecolor \PYGZsh{}figure.frameon : True \PYGZsh{}\PYGZsh{} enable figure frame \PYGZsh{}figure.max\PYGZus{}open\PYGZus{}warning : 20 \PYGZsh{}\PYGZsh{} The maximum number of figures to open through \PYGZsh{}\PYGZsh{} the pyplot interface before emitting a warning. \PYGZsh{}\PYGZsh{} If less than one this feature is disabled. \PYGZsh{}\PYGZsh{} The figure subplot parameters. All dimensions are a fraction of the \PYGZsh{}figure.subplot.left : 0.125 \PYGZsh{}\PYGZsh{} the left side of the subplots of the figure \PYGZsh{}figure.subplot.right : 0.9 \PYGZsh{}\PYGZsh{} the right side of the subplots of the figure \PYGZsh{}figure.subplot.bottom : 0.11 \PYGZsh{}\PYGZsh{} the bottom of the subplots of the figure \PYGZsh{}figure.subplot.top : 0.88 \PYGZsh{}\PYGZsh{} the top of the subplots of the figure \PYGZsh{}figure.subplot.wspace : 0.2 \PYGZsh{}\PYGZsh{} the amount of width reserved for space between subplots, \PYGZsh{}\PYGZsh{} expressed as a fraction of the average axis width \PYGZsh{}figure.subplot.hspace : 0.2 \PYGZsh{}\PYGZsh{} the amount of height reserved for space between subplots, \PYGZsh{}\PYGZsh{} expressed as a fraction of the average axis height \PYGZsh{}\PYGZsh{} Figure layout \PYGZsh{}figure.autolayout : False \PYGZsh{}\PYGZsh{} When True, automatically adjust subplot \PYGZsh{}\PYGZsh{} parameters to make the plot fit the figure \PYGZsh{}\PYGZsh{} using {}`tight\PYGZus{}layout{}` \PYGZsh{}figure.constrained\PYGZus{}layout.use: False \PYGZsh{}\PYGZsh{} When True, automatically make plot \PYGZsh{}\PYGZsh{} elements fit on the figure. (Not compatible \PYGZsh{}\PYGZsh{} with {}`autolayout{}`, above). \PYGZsh{}figure.constrained\PYGZus{}layout.h\PYGZus{}pad : 0.04167 \PYGZsh{}\PYGZsh{} Padding around axes objects. Float representing \PYGZsh{}figure.constrained\PYGZus{}layout.w\PYGZus{}pad : 0.04167 \PYGZsh{}\PYGZsh{} inches. Default is 3./72. inches (3 pts) \PYGZsh{}figure.constrained\PYGZus{}layout.hspace : 0.02 \PYGZsh{}\PYGZsh{} Space between subplot groups. Float representing \PYGZsh{}figure.constrained\PYGZus{}layout.wspace : 0.02 \PYGZsh{}\PYGZsh{} a fraction of the subplot widths being separated. \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} IMAGES \PYGZsh{}image.aspect : equal \PYGZsh{}\PYGZsh{} equal \textbar{} auto \textbar{} a number \PYGZsh{}image.interpolation : nearest \PYGZsh{}\PYGZsh{} see help(imshow) for options \PYGZsh{}image.cmap : viridis \PYGZsh{}\PYGZsh{} A colormap name, gray etc... \PYGZsh{}image.lut : 256 \PYGZsh{}\PYGZsh{} the size of the colormap lookup table \PYGZsh{}image.origin : upper \PYGZsh{}\PYGZsh{} lower \textbar{} upper \PYGZsh{}image.resample : True \PYGZsh{}image.composite\PYGZus{}image : True \PYGZsh{}\PYGZsh{} When True, all the images on a set of axes are \PYGZsh{}\PYGZsh{} combined into a single composite image before \PYGZsh{}\PYGZsh{} saving a figure as a vector graphics file, \PYGZsh{}\PYGZsh{} such as a PDF. \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} CONTOUR PLOTS \PYGZsh{}contour.negative\PYGZus{}linestyle : dashed \PYGZsh{}\PYGZsh{} string or on\PYGZhy{}off ink sequence \PYGZsh{}contour.corner\PYGZus{}mask : True \PYGZsh{}\PYGZsh{} True \textbar{} False \textbar{} legacy \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} ERRORBAR PLOTS \PYGZsh{}errorbar.capsize : 0 \PYGZsh{}\PYGZsh{} length of end cap on error bars in pixels \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} HISTOGRAM PLOTS \PYGZsh{}hist.bins : 10 \PYGZsh{}\PYGZsh{} The default number of histogram bins. \PYGZsh{}\PYGZsh{} If Numpy 1.11 or later is \PYGZsh{}\PYGZsh{} installed, may also be {}`auto{}` \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} SCATTER PLOTS \PYGZsh{}scatter.marker : o \PYGZsh{}\PYGZsh{} The default marker type for scatter plots. \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} Agg rendering \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} Warning: experimental, 2008/10/10 \PYGZsh{}agg.path.chunksize : 0 \PYGZsh{}\PYGZsh{} 0 to disable; values in the range \PYGZsh{}\PYGZsh{} 10000 to 100000 can improve speed slightly \PYGZsh{}\PYGZsh{} and prevent an Agg rendering failure \PYGZsh{}\PYGZsh{} when plotting very large data sets, \PYGZsh{}\PYGZsh{} especially if they are very gappy. \PYGZsh{}\PYGZsh{} It may cause minor artifacts, though. \PYGZsh{}\PYGZsh{} A value of 20000 is probably a good \PYGZsh{}\PYGZsh{} starting point. \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} PATHS \PYGZsh{}path.simplify : True \PYGZsh{}\PYGZsh{} When True, simplify paths by removing \PYGZdq{}invisible\PYGZdq{} \PYGZsh{}\PYGZsh{} points to reduce file size and increase rendering \PYGZsh{}\PYGZsh{} speed \PYGZsh{}path.simplify\PYGZus{}threshold : 0.111111111111 \PYGZsh{}\PYGZsh{} The threshold of similarity below which \PYGZsh{}\PYGZsh{} vertices will be removed in the \PYGZsh{}\PYGZsh{} simplification process \PYGZsh{}path.snap : True \PYGZsh{}\PYGZsh{} When True, rectilinear axis\PYGZhy{}aligned paths will be snapped to \PYGZsh{}\PYGZsh{} the nearest pixel when certain criteria are met. When False, \PYGZsh{}\PYGZsh{} paths will never be snapped. \PYGZsh{}path.sketch : None \PYGZsh{}\PYGZsh{} May be none, or a 3\PYGZhy{}tuple of the form (scale, length, \PYGZsh{}\PYGZsh{} randomness). \PYGZsh{}\PYGZsh{} *scale* is the amplitude of the wiggle \PYGZsh{}\PYGZsh{} perpendicular to the line (in pixels). *length* \PYGZsh{}\PYGZsh{} is the length of the wiggle along the line (in \PYGZsh{}\PYGZsh{} pixels). *randomness* is the factor by which \PYGZsh{}\PYGZsh{} the length is randomly scaled. \PYGZsh{}path.effects : [] \PYGZsh{}\PYGZsh{} \PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{} SAVING FIGURES \PYGZsh{}\PYGZsh{} the default savefig params can be different from the display params \PYGZsh{}\PYGZsh{} e.g., you may want a higher resolution, or to make the figure \PYGZsh{}\PYGZsh{} background white \PYGZsh{}savefig.dpi : figure \PYGZsh{}\PYGZsh{} figure dots per inch or \PYGZsq{}figure\PYGZsq{} \PYGZsh{}savefig.facecolor : w \PYGZsh{}\PYGZsh{} figure facecolor when saving \PYGZsh{}savefig.edgecolor : w \PYGZsh{}\PYGZsh{} figure edgecolor when saving \PYGZsh{}savefig.format : png \PYGZsh{}\PYGZsh{} png, ps, pdf, svg \PYGZsh{}savefig.bbox : standard \PYGZsh{}\PYGZsh{} \PYGZsq{}tight\PYGZsq{} or \PYGZsq{}standard\PYGZsq{}. \PYGZsh{}\PYGZsh{} \PYGZsq{}tight\PYGZsq{} is incompatible with pipe\PYGZhy{}based animation \PYGZsh{}\PYGZsh{} backends but will workd with temporary file based ones: \PYGZsh{}\PYGZsh{} e.g. setting animation.writer to ffmpeg will not work, \PYGZsh{}\PYGZsh{} use ffmpeg\PYGZus{}file instead \PYGZsh{}savefig.pad\PYGZus{}inches : 0.1 \PYGZsh{}\PYGZsh{} Padding to be used when bbox is set to \PYGZsq{}tight\PYGZsq{} \PYGZsh{}savefig.jpeg\PYGZus{}quality: 95 \PYGZsh{}\PYGZsh{} when a jpeg is saved, the default quality parameter. \PYGZsh{}savefig.directory : \PYGZti{} \PYGZsh{}\PYGZsh{} default directory in savefig dialog box, \PYGZsh{}\PYGZsh{} leave empty to always use current working directory \PYGZsh{}savefig.transparent : False \PYGZsh{}\PYGZsh{} setting that controls whether figures are saved with a \PYGZsh{}\PYGZsh{} transparent background by default \PYGZsh{}savefig.frameon : True \PYGZsh{}\PYGZsh{} enable frame of figure when saving \PYGZsh{}savefig.orientation : portrait \PYGZsh{}\PYGZsh{} Orientation of saved figure \PYGZsh{}\PYGZsh{}\PYGZsh{} tk backend params \PYGZsh{}tk.window\PYGZus{}focus : False \PYGZsh{}\PYGZsh{} Maintain shell focus for TkAgg \PYGZsh{}\PYGZsh{}\PYGZsh{} ps backend params \PYGZsh{}ps.papersize : letter \PYGZsh{}\PYGZsh{} auto, letter, legal, ledger, A0\PYGZhy{}A10, B0\PYGZhy{}B10 \PYGZsh{}ps.useafm : False \PYGZsh{}\PYGZsh{} use of afm fonts, results in small files \PYGZsh{}ps.usedistiller : False \PYGZsh{}\PYGZsh{} can be: None, ghostscript or xpdf \PYGZsh{}\PYGZsh{} Experimental: may produce smaller files. \PYGZsh{}\PYGZsh{} xpdf intended for production of publication quality files, \PYGZsh{}\PYGZsh{} but requires ghostscript, xpdf and ps2eps \PYGZsh{}ps.distiller.res : 6000 \PYGZsh{}\PYGZsh{} dpi \PYGZsh{}ps.fonttype : 3 \PYGZsh{}\PYGZsh{} Output Type 3 (Type3) or Type 42 (TrueType) \PYGZsh{}\PYGZsh{}\PYGZsh{} pdf backend params \PYGZsh{}pdf.compression : 6 \PYGZsh{}\PYGZsh{} integer from 0 to 9 \PYGZsh{}\PYGZsh{} 0 disables compression (good for debugging) \PYGZsh{}pdf.fonttype : 3 \PYGZsh{}\PYGZsh{} Output Type 3 (Type3) or Type 42 (TrueType) \PYGZsh{}pdf.use14corefonts : False \PYGZsh{}pdf.inheritcolor : False \PYGZsh{}\PYGZsh{}\PYGZsh{} svg backend params \PYGZsh{}svg.image\PYGZus{}inline : True \PYGZsh{}\PYGZsh{} write raster image data directly into the svg file \PYGZsh{}svg.fonttype : path \PYGZsh{}\PYGZsh{} How to handle SVG fonts: \PYGZsh{}\PYGZsh{} none: Assume fonts are installed on the machine where the SVG will be viewed. \PYGZsh{}\PYGZsh{} path: Embed characters as paths \PYGZhy{}\PYGZhy{} supported by most SVG renderers \PYGZsh{}\PYGZsh{} svgfont: Embed characters as SVG fonts \PYGZhy{}\PYGZhy{} supported only by Chrome, \PYGZsh{}\PYGZsh{} Opera and Safari \PYGZsh{}svg.hashsalt : None \PYGZsh{}\PYGZsh{} if not None, use this string as hash salt \PYGZsh{}\PYGZsh{} instead of uuid4 \PYGZsh{}\PYGZsh{}\PYGZsh{} pgf parameter \PYGZsh{}pgf.rcfonts : True \PYGZsh{}pgf.preamble : \PYGZsh{}pgf.texsystem : xelatex \PYGZsh{}pgf.debug : False \PYGZsh{}\PYGZsh{}\PYGZsh{} docstring params \PYGZsh{}\PYGZsh{}docstring.hardcopy = False \PYGZsh{}\PYGZsh{} set this when you want to generate hardcopy docstring \PYGZsh{}\PYGZsh{} Event keys to interact with figures/plots via keyboard. \PYGZsh{}\PYGZsh{} Customize these settings according to your needs. \PYGZsh{}\PYGZsh{} Leave the field(s) empty if you don\PYGZsq{}t need a key\PYGZhy{}map. (i.e., fullscreen : \PYGZsq{}\PYGZsq{}) \PYGZsh{}keymap.fullscreen : f, ctrl+f \PYGZsh{}\PYGZsh{} toggling \PYGZsh{}keymap.home : h, r, home \PYGZsh{}\PYGZsh{} home or reset mnemonic \PYGZsh{}keymap.back : left, c, backspace \PYGZsh{}\PYGZsh{} forward / backward keys to enable \PYGZsh{}keymap.forward : right, v \PYGZsh{}\PYGZsh{} left handed quick navigation \PYGZsh{}keymap.pan : p \PYGZsh{}\PYGZsh{} pan mnemonic \PYGZsh{}keymap.zoom : o \PYGZsh{}\PYGZsh{} zoom mnemonic \PYGZsh{}keymap.save : s, ctrl+s \PYGZsh{}\PYGZsh{} saving current figure \PYGZsh{}keymap.quit : ctrl+w, cmd+w, q \PYGZsh{}\PYGZsh{} close the current figure \PYGZsh{}keymap.quit\PYGZus{}all : W, cmd+W, Q \PYGZsh{}\PYGZsh{} close all figures \PYGZsh{}keymap.grid : g \PYGZsh{}\PYGZsh{} switching on/off major grids in current axes \PYGZsh{}keymap.grid\PYGZus{}minor : G \PYGZsh{}\PYGZsh{} switching on/off minor grids in current axes \PYGZsh{}keymap.yscale : l \PYGZsh{}\PYGZsh{} toggle scaling of y\PYGZhy{}axes (\PYGZsq{}log\PYGZsq{}/\PYGZsq{}linear\PYGZsq{}) \PYGZsh{}keymap.xscale : k, L \PYGZsh{}\PYGZsh{} toggle scaling of x\PYGZhy{}axes (\PYGZsq{}log\PYGZsq{}/\PYGZsq{}linear\PYGZsq{}) \PYGZsh{}keymap.all\PYGZus{}axes : a \PYGZsh{}\PYGZsh{} enable all axes \PYGZsh{}\PYGZsh{} Control location of examples data files \PYGZsh{}examples.directory : \PYGZsh{}\PYGZsh{} directory to look in for custom installation \PYGZsh{}\PYGZsh{}\PYGZsh{}ANIMATION settings \PYGZsh{}animation.html : none \PYGZsh{}\PYGZsh{} How to display the animation as HTML in \PYGZsh{}\PYGZsh{} the IPython notebook. \PYGZsq{}html5\PYGZsq{} uses \PYGZsh{}\PYGZsh{} HTML5 video tag; \PYGZsq{}jshtml\PYGZsq{} creates a \PYGZsh{}\PYGZsh{} Javascript animation \PYGZsh{}animation.writer : ffmpeg \PYGZsh{}\PYGZsh{} MovieWriter \PYGZsq{}backend\PYGZsq{} to use \PYGZsh{}animation.codec : h264 \PYGZsh{}\PYGZsh{} Codec to use for writing movie \PYGZsh{}animation.bitrate: \PYGZhy{}1 \PYGZsh{}\PYGZsh{} Controls size/quality tradeoff for movie. \PYGZsh{}\PYGZsh{} \PYGZhy{}1 implies let utility auto\PYGZhy{}determine \PYGZsh{}animation.frame\PYGZus{}format: png \PYGZsh{}\PYGZsh{} Controls frame format used by temp files \PYGZsh{}animation.html\PYGZus{}args: \PYGZsh{}\PYGZsh{} Additional arguments to pass to html writer \PYGZsh{}animation.ffmpeg\PYGZus{}path: ffmpeg \PYGZsh{}\PYGZsh{} Path to ffmpeg binary. Without full path \PYGZsh{}\PYGZsh{} \PYGZdl{}PATH is searched \PYGZsh{}animation.ffmpeg\PYGZus{}args: \PYGZsh{}\PYGZsh{} Additional arguments to pass to ffmpeg \PYGZsh{}animation.avconv\PYGZus{}path: avconv \PYGZsh{}\PYGZsh{} Path to avconv binary. Without full path \PYGZsh{}\PYGZsh{} \PYGZdl{}PATH is searched \PYGZsh{}animation.avconv\PYGZus{}args: \PYGZsh{}\PYGZsh{} Additional arguments to pass to avconv \PYGZsh{}animation.convert\PYGZus{}path: convert \PYGZsh{}\PYGZsh{} Path to ImageMagick\PYGZsq{}s convert binary. \PYGZsh{}\PYGZsh{} On Windows use the full path since convert \PYGZsh{}\PYGZsh{} is also the name of a system tool. \PYGZsh{}animation.convert\PYGZus{}args: \PYGZsh{}\PYGZsh{} Additional arguments to pass to convert \PYGZsh{}animation.embed\PYGZus{}limit : 20.0 \end{sphinxVerbatim} \phantomsection\label{\detokenize{tutorials/introductory/customizing:sphx-glr-download-tutorials-introductory-customizing-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/introductory/images:sphx-glr-download-tutorials-introductory-images-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Image tutorial} \label{\detokenize{tutorials/introductory/images:image-tutorial}}\label{\detokenize{tutorials/introductory/images:sphx-glr-tutorials-introductory-images-py}}\label{\detokenize{tutorials/introductory/images::doc}} A short tutorial on plotting images with Matplotlib. \subsubsection{Startup commands} \label{\detokenize{tutorials/introductory/images:startup-commands}}\label{\detokenize{tutorials/introductory/images:imaging-startup}} First, let’s start IPython. It is a most excellent enhancement to the standard Python prompt, and it ties in especially well with Matplotlib. Start IPython either at a shell, or the IPython Notebook now. With IPython started, we now need to connect to a GUI event loop. This tells IPython where (and how) to display plots. To connect to a GUI loop, execute the \sphinxstylestrong{\%matplotlib} magic at your IPython prompt. There’s more detail on exactly what this does at \sphinxhref{http://ipython.org/ipython-doc/2/interactive/reference.html\#gui-event-loop-support}{IPython’s documentation on GUI event loops}. If you’re using IPython Notebook, the same commands are available, but people commonly use a specific argument to the \%matplotlib magic: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [1]: }\PYG{o}{\PYGZpc{}}\PYG{k}{matplotlib} inline \end{sphinxVerbatim} This turns on inline plotting, where plot graphics will appear in your notebook. This has important implications for interactivity. For inline plotting, commands in cells below the cell that outputs a plot will not affect the plot. For example, changing the color map is not possible from cells below the cell that creates a plot. However, for other backends, such as Qt5, that open a separate window, cells below those that create the plot will change the plot - it is a live object in memory. This tutorial will use matplotlib’s imperative-style plotting interface, pyplot. This interface maintains global state, and is very useful for quickly and easily experimenting with various plot settings. The alternative is the object-oriented interface, which is also very powerful, and generally more suitable for large application development. If you’d like to learn about the object-oriented interface, a great place to start is our \sphinxhref{http://matplotlib.org/faq/usage\_faq.html}{FAQ on usage}. For now, let’s get on with the imperative-style approach: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.image} \PYG{k+kn}{as} \PYG{n+nn}{mpimg} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \end{sphinxVerbatim} \subsubsection{Importing image data into Numpy arrays} \label{\detokenize{tutorials/introductory/images:importing-image-data-into-numpy-arrays}}\label{\detokenize{tutorials/introductory/images:importing-data}} Loading image data is supported by the \sphinxhref{https://pillow.readthedocs.io/en/latest/}{Pillow} library. Natively, Matplotlib only supports PNG images. The commands shown below fall back on Pillow if the native read fails. The image used in this example is a PNG file, but keep that Pillow requirement in mind for your own data. Here’s the image we’re going to play with: \noindent\sphinxincludegraphics{{stinkbug}.png} It’s a 24-bit RGB PNG image (8 bits for each of R, G, B). Depending on where you get your data, the other kinds of image that you’ll most likely encounter are RGBA images, which allow for transparency, or single-channel grayscale (luminosity) images. You can right click on it and choose “Save image as” to download it to your computer for the rest of this tutorial. And here we go… \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{img} \PYG{o}{=} \PYG{n}{mpimg}\PYG{o}{.}\PYG{n}{imread}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{../../doc/\PYGZus{}static/stinkbug.png}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k}{print}\PYG{p}{(}\PYG{n}{img}\PYG{p}{)} \end{sphinxVerbatim} Out: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] [[[0.40784314 0.40784314 0.40784314] [0.40784314 0.40784314 0.40784314] [0.40784314 0.40784314 0.40784314] ... [0.42745098 0.42745098 0.42745098] [0.42745098 0.42745098 0.42745098] [0.42745098 0.42745098 0.42745098]] [[0.4117647 0.4117647 0.4117647 ] [0.4117647 0.4117647 0.4117647 ] [0.4117647 0.4117647 0.4117647 ] ... [0.42745098 0.42745098 0.42745098] [0.42745098 0.42745098 0.42745098] [0.42745098 0.42745098 0.42745098]] [[0.41960785 0.41960785 0.41960785] [0.41568628 0.41568628 0.41568628] [0.41568628 0.41568628 0.41568628] ... [0.43137255 0.43137255 0.43137255] [0.43137255 0.43137255 0.43137255] [0.43137255 0.43137255 0.43137255]] ... [[0.4392157 0.4392157 0.4392157 ] [0.43529412 0.43529412 0.43529412] [0.43137255 0.43137255 0.43137255] ... [0.45490196 0.45490196 0.45490196] [0.4509804 0.4509804 0.4509804 ] [0.4509804 0.4509804 0.4509804 ]] [[0.44313726 0.44313726 0.44313726] [0.44313726 0.44313726 0.44313726] [0.4392157 0.4392157 0.4392157 ] ... [0.4509804 0.4509804 0.4509804 ] [0.44705883 0.44705883 0.44705883] [0.44705883 0.44705883 0.44705883]] [[0.44313726 0.44313726 0.44313726] [0.4509804 0.4509804 0.4509804 ] [0.4509804 0.4509804 0.4509804 ] ... [0.44705883 0.44705883 0.44705883] [0.44705883 0.44705883 0.44705883] [0.44313726 0.44313726 0.44313726]]] \end{sphinxVerbatim} Note the dtype there - float32. Matplotlib has rescaled the 8 bit data from each channel to floating point data between 0.0 and 1.0. As a side note, the only datatype that Pillow can work with is uint8. Matplotlib plotting can handle float32 and uint8, but image reading/writing for any format other than PNG is limited to uint8 data. Why 8 bits? Most displays can only render 8 bits per channel worth of color gradation. Why can they only render 8 bits/channel? Because that’s about all the human eye can see. More here (from a photography standpoint): \sphinxhref{https://luminous-landscape.com/bit-depth/}{Luminous Landscape bit depth tutorial}. Each inner list represents a pixel. Here, with an RGB image, there are 3 values. Since it’s a black and white image, R, G, and B are all similar. An RGBA (where A is alpha, or transparency), has 4 values per inner list, and a simple luminance image just has one value (and is thus only a 2-D array, not a 3-D array). For RGB and RGBA images, matplotlib supports float32 and uint8 data types. For grayscale, matplotlib supports only float32. If your array data does not meet one of these descriptions, you need to rescale it. \subsubsection{Plotting numpy arrays as images} \label{\detokenize{tutorials/introductory/images:plotting-numpy-arrays-as-images}}\label{\detokenize{tutorials/introductory/images:plotting-data}} So, you have your data in a numpy array (either by importing it, or by generating it). Let’s render it. In Matplotlib, this is performed using the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow()}}}}} function. Here we’ll grab the plot object. This object gives you an easy way to manipulate the plot from the prompt. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{imgplot} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{img}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_images_001}.png} You can also plot any numpy array. \paragraph{Applying pseudocolor schemes to image plots} \label{\detokenize{tutorials/introductory/images:applying-pseudocolor-schemes-to-image-plots}}\label{\detokenize{tutorials/introductory/images:pseudocolor}} Pseudocolor can be a useful tool for enhancing contrast and visualizing your data more easily. This is especially useful when making presentations of your data using projectors - their contrast is typically quite poor. Pseudocolor is only relevant to single-channel, grayscale, luminosity images. We currently have an RGB image. Since R, G, and B are all similar (see for yourself above or in your data), we can just pick one channel of our data: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{lum\PYGZus{}img} \PYG{o}{=} \PYG{n}{img}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]} \PYG{c+c1}{\PYGZsh{} This is array slicing. You can read more in the {}`Numpy tutorial} \PYG{c+c1}{\PYGZsh{} \PYGZlt{}https://docs.scipy.org/doc/numpy/user/quickstart.html\PYGZgt{}{}`\PYGZus{}.} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{lum\PYGZus{}img}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_images_002}.png} Now, with a luminosity (2D, no color) image, the default colormap (aka lookup table, LUT), is applied. The default is called viridis. There are plenty of others to choose from. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{lum\PYGZus{}img}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{hot}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_images_003}.png} Note that you can also change colormaps on existing plot objects using the \sphinxcode{\sphinxupquote{set\_cmap()}} method: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{imgplot} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{lum\PYGZus{}img}\PYG{p}{)} \PYG{n}{imgplot}\PYG{o}{.}\PYG{n}{set\PYGZus{}cmap}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{nipy\PYGZus{}spectral}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_images_004}.png} \begin{sphinxadmonition}{note}{Note:} However, remember that in the IPython notebook with the inline backend, you can’t make changes to plots that have already been rendered. If you create imgplot here in one cell, you cannot call set\_cmap() on it in a later cell and expect the earlier plot to change. Make sure that you enter these commands together in one cell. plt commands will not change plots from earlier cells. \end{sphinxadmonition} There are many other colormap schemes available. See the \sphinxhref{../colors/colormaps.html}{list and images of the colormaps}. \paragraph{Color scale reference} \label{\detokenize{tutorials/introductory/images:color-scale-reference}}\label{\detokenize{tutorials/introductory/images:color-bars}} It’s helpful to have an idea of what value a color represents. We can do that by adding color bars. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{imgplot} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{lum\PYGZus{}img}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_images_005}.png} This adds a colorbar to your existing figure. This won’t automatically change if you change you switch to a different colormap - you have to re-create your plot, and add in the colorbar again. \paragraph{Examining a specific data range} \label{\detokenize{tutorials/introductory/images:examining-a-specific-data-range}}\label{\detokenize{tutorials/introductory/images:data-ranges}} Sometimes you want to enhance the contrast in your image, or expand the contrast in a particular region while sacrificing the detail in colors that don’t vary much, or don’t matter. A good tool to find interesting regions is the histogram. To create a histogram of our image data, we use the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hist:matplotlib.pyplot.hist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hist()}}}}} function. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{hist}\PYG{p}{(}\PYG{n}{lum\PYGZus{}img}\PYG{o}{.}\PYG{n}{ravel}\PYG{p}{(}\PYG{p}{)}\PYG{p}{,} \PYG{n}{bins}\PYG{o}{=}\PYG{l+m+mi}{256}\PYG{p}{,} \PYG{n+nb}{range}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{)}\PYG{p}{,} \PYG{n}{fc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ec}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_images_006}.png} Most often, the “interesting” part of the image is around the peak, and you can get extra contrast by clipping the regions above and/or below the peak. In our histogram, it looks like there’s not much useful information in the high end (not many white things in the image). Let’s adjust the upper limit, so that we effectively “zoom in on” part of the histogram. We do this by passing the clim argument to imshow. You could also do this by calling the \sphinxcode{\sphinxupquote{set\_clim()}} method of the image plot object, but make sure that you do so in the same cell as your plot command when working with the IPython Notebook - it will not change plots from earlier cells. You can specify the clim in the call to \sphinxcode{\sphinxupquote{plot}}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{imgplot} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{lum\PYGZus{}img}\PYG{p}{,} \PYG{n}{clim}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{0.7}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_images_007}.png} You can also specify the clim using the returned object \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{a} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{imgplot} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{lum\PYGZus{}img}\PYG{p}{)} \PYG{n}{a}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Before}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{ticks}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.3}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.7}\PYG{p}{]}\PYG{p}{,} \PYG{n}{orientation}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{horizontal}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{a} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{imgplot} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{lum\PYGZus{}img}\PYG{p}{)} \PYG{n}{imgplot}\PYG{o}{.}\PYG{n}{set\PYGZus{}clim}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{0.7}\PYG{p}{)} \PYG{n}{a}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{After}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{ticks}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.3}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.7}\PYG{p}{]}\PYG{p}{,} \PYG{n}{orientation}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{horizontal}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_images_008}.png} \paragraph{Array Interpolation schemes} \label{\detokenize{tutorials/introductory/images:array-interpolation-schemes}}\label{\detokenize{tutorials/introductory/images:interpolation}} Interpolation calculates what the color or value of a pixel “should” be, according to different mathematical schemes. One common place that this happens is when you resize an image. The number of pixels change, but you want the same information. Since pixels are discrete, there’s missing space. Interpolation is how you fill that space. This is why your images sometimes come out looking pixelated when you blow them up. The effect is more pronounced when the difference between the original image and the expanded image is greater. Let’s take our image and shrink it. We’re effectively discarding pixels, only keeping a select few. Now when we plot it, that data gets blown up to the size on your screen. The old pixels aren’t there anymore, and the computer has to draw in pixels to fill that space. We’ll use the Pillow library that we used to load the image also to resize the image. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{PIL} \PYG{k+kn}{import} \PYG{n}{Image} \PYG{n}{img} \PYG{o}{=} \PYG{n}{Image}\PYG{o}{.}\PYG{n}{open}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{../../doc/\PYGZus{}static/stinkbug.png}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{img}\PYG{o}{.}\PYG{n}{thumbnail}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{64}\PYG{p}{,} \PYG{l+m+mi}{64}\PYG{p}{)}\PYG{p}{,} \PYG{n}{Image}\PYG{o}{.}\PYG{n}{ANTIALIAS}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} resizes image in\PYGZhy{}place} \PYG{n}{imgplot} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{img}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_images_009}.png} Here we have the default interpolation, bilinear, since we did not give {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow()}}}}} any interpolation argument. Let’s try some others. Here’s “nearest”, which does no interpolation. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{imgplot} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{img}\PYG{p}{,} \PYG{n}{interpolation}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{nearest}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_images_010}.png} and bicubic: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{imgplot} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{img}\PYG{p}{,} \PYG{n}{interpolation}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{bicubic}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_images_011}.png} Bicubic interpolation is often used when blowing up photos - people tend to prefer blurry over pixelated. \phantomsection\label{\detokenize{tutorials/introductory/images:sphx-glr-download-tutorials-introductory-images-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/introductory/usage:sphx-glr-download-tutorials-introductory-usage-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Usage Guide} \label{\detokenize{tutorials/introductory/usage:usage-guide}}\label{\detokenize{tutorials/introductory/usage:sphx-glr-tutorials-introductory-usage-py}}\label{\detokenize{tutorials/introductory/usage::doc}} This tutorial covers some basic usage patterns and best-practices to help you get started with Matplotlib. \subsubsection{General Concepts} \label{\detokenize{tutorials/introductory/usage:general-concepts}}\label{\detokenize{tutorials/introductory/usage:id1}} \sphinxcode{\sphinxupquote{matplotlib}} has an extensive codebase that can be daunting to many new users. However, most of matplotlib can be understood with a fairly simple conceptual framework and knowledge of a few important points. Plotting requires action on a range of levels, from the most general (e.g., ‘contour this 2-D array’) to the most specific (e.g., ‘color this screen pixel red’). The purpose of a plotting package is to assist you in visualizing your data as easily as possible, with all the necessary control \textendash{} that is, by using relatively high-level commands most of the time, and still have the ability to use the low-level commands when needed. Therefore, everything in matplotlib is organized in a hierarchy. At the top of the hierarchy is the matplotlib “state-machine environment” which is provided by the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot}}}}} module. At this level, simple functions are used to add plot elements (lines, images, text, etc.) to the current axes in the current figure. \begin{sphinxadmonition}{note}{Note:} Pyplot’s state-machine environment behaves similarly to MATLAB and should be most familiar to users with MATLAB experience. \end{sphinxadmonition} The next level down in the hierarchy is the first level of the object-oriented interface, in which pyplot is used only for a few functions such as figure creation, and the user explicitly creates and keeps track of the figure and axes objects. At this level, the user uses pyplot to create figures, and through those figures, one or more axes objects can be created. These axes objects are then used for most plotting actions. For even more control \textendash{} which is essential for things like embedding matplotlib plots in GUI applications \textendash{} the pyplot level may be dropped completely, leaving a purely object-oriented approach. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} sphinx\PYGZus{}gallery\PYGZus{}thumbnail\PYGZus{}number = 3} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \end{sphinxVerbatim} \subsubsection{Parts of a Figure} \label{\detokenize{tutorials/introductory/usage:parts-of-a-figure}}\label{\detokenize{tutorials/introductory/usage:figure-parts}} \noindent\sphinxincludegraphics{{anatomy}.png} \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{Figure}}} \label{\detokenize{tutorials/introductory/usage:figure}} The \sphinxstylestrong{whole} figure. The figure keeps track of all the child {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}, a smattering of ‘special’ artists (titles, figure legends, etc), and the \sphinxstylestrong{canvas}. (Don’t worry too much about the canvas, it is crucial as it is the object that actually does the drawing to get you your plot, but as the user it is more-or-less invisible to you). A figure can have any number of {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}, but to be useful should have at least one. The easiest way to create a new figure is with pyplot: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} an empty figure with no axes} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{suptitle}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{No axes on this figure}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Add a title so we know which it is} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax\PYGZus{}lst} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} a figure with a 2x2 grid of Axes} \end{sphinxVerbatim} \begin{itemize} \item {} \noindent\sphinxincludegraphics{{sphx_glr_usage_001}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_usage_002}.png} \end{itemize} \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{Axes}}} \label{\detokenize{tutorials/introductory/usage:axes}} This is what you think of as ‘a plot’, it is the region of the image with the data space. A given figure can contain many Axes, but a given {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} object can only be in one {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. The Axes contains two (or three in the case of 3D) {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} objects (be aware of the difference between \sphinxstylestrong{Axes} and \sphinxstylestrong{Axis}) which take care of the data limits (the data limits can also be controlled via set via the {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim:matplotlib.axes.Axes.set_xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xlim()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:matplotlib.axes.Axes.set_ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_ylim()}}}}} \sphinxcode{\sphinxupquote{Axes}} methods). Each \sphinxcode{\sphinxupquote{Axes}} has a title (set via {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_title:matplotlib.axes.Axes.set_title}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_title()}}}}}), an x-label (set via {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlabel:matplotlib.axes.Axes.set_xlabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xlabel()}}}}}), and a y-label set via {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylabel:matplotlib.axes.Axes.set_ylabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_ylabel()}}}}}). The \sphinxcode{\sphinxupquote{Axes}} class and it’s member functions are the primary entry point to working with the OO interface. \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{Axis}}} \label{\detokenize{tutorials/introductory/usage:axis}} These are the number-line-like objects. They take care of setting the graph limits and generating the ticks (the marks on the axis) and ticklabels (strings labeling the ticks). The location of the ticks is determined by a {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Locator}}}}} object and the ticklabel strings are formatted by a {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Formatter}}}}}. The combination of the correct \sphinxcode{\sphinxupquote{Locator}} and \sphinxcode{\sphinxupquote{Formatter}} gives very fine control over the tick locations and labels. \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{Artist}}} \label{\detokenize{tutorials/introductory/usage:artist}} Basically everything you can see on the figure is an artist (even the \sphinxcode{\sphinxupquote{Figure}}, \sphinxcode{\sphinxupquote{Axes}}, and \sphinxcode{\sphinxupquote{Axis}} objects). This includes \sphinxcode{\sphinxupquote{Text}} objects, \sphinxcode{\sphinxupquote{Line2D}} objects, \sphinxcode{\sphinxupquote{collection}} objects, \sphinxcode{\sphinxupquote{Patch}} objects … (you get the idea). When the figure is rendered, all of the artists are drawn to the \sphinxstylestrong{canvas}. Most Artists are tied to an Axes; such an Artist cannot be shared by multiple Axes, or moved from one to another. \subsubsection{Types of inputs to plotting functions} \label{\detokenize{tutorials/introductory/usage:types-of-inputs-to-plotting-functions}}\label{\detokenize{tutorials/introductory/usage:input-types}} All of plotting functions expect \sphinxcode{\sphinxupquote{np.array}} or \sphinxcode{\sphinxupquote{np.ma.masked\_array}} as input. Classes that are ‘array-like’ such as \sphinxhref{https://pandas.pydata.org/pandas-docs/stable/index.html\#module-pandas}{\sphinxcode{\sphinxupquote{pandas}}} data objects and \sphinxcode{\sphinxupquote{np.matrix}} may or may not work as intended. It is best to convert these to \sphinxcode{\sphinxupquote{np.array}} objects prior to plotting. For example, to convert a \sphinxhref{https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html\#pandas.DataFrame}{\sphinxcode{\sphinxupquote{pandas.DataFrame}}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{a} \PYG{o}{=} \PYG{n}{pandas}\PYG{o}{.}\PYG{n}{DataFrame}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{4}\PYG{p}{,}\PYG{l+m+mi}{5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{columns} \PYG{o}{=} \PYG{n+nb}{list}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{abcde}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{)} \PYG{n}{a\PYGZus{}asndarray} \PYG{o}{=} \PYG{n}{a}\PYG{o}{.}\PYG{n}{values} \end{sphinxVerbatim} and to covert a \sphinxcode{\sphinxupquote{np.matrix}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{b} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{matrix}\PYG{p}{(}\PYG{p}{[}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{,}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{,}\PYG{l+m+mi}{4}\PYG{p}{]}\PYG{p}{]}\PYG{p}{)} \PYG{n}{b\PYGZus{}asarray} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{asarray}\PYG{p}{(}\PYG{n}{b}\PYG{p}{)} \end{sphinxVerbatim} \subsubsection{Matplotlib, pyplot and pylab: how are they related?} \label{\detokenize{tutorials/introductory/usage:matplotlib-pyplot-and-pylab-how-are-they-related}}\label{\detokenize{tutorials/introductory/usage:pylab}} Matplotlib is the whole package; {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot}}}}} is a module in matplotlib; and \sphinxcode{\sphinxupquote{pylab}} is a module that gets installed alongside \sphinxcode{\sphinxupquote{matplotlib}}. Pyplot provides the state-machine interface to the underlying object-oriented plotting library. The state-machine implicitly and automatically creates figures and axes to achieve the desired plot. For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{x}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linear}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{x}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{quadratic}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{x}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{cubic}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{x label}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{y label}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{title}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Simple Plot}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_usage_003}.png} The first call to \sphinxcode{\sphinxupquote{plt.plot}} will automatically create the necessary figure and axes to achieve the desired plot. Subsequent calls to \sphinxcode{\sphinxupquote{plt.plot}} re-use the current axes and each add another line. Setting the title, legend, and axis labels also automatically use the current axes and set the title, create the legend, and label the axis respectively. \sphinxcode{\sphinxupquote{pylab}} is a convenience module that bulk imports {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot}}}}} (for plotting) and \sphinxhref{https://docs.scipy.org/doc/numpy/reference/index.html\#module-numpy}{\sphinxcode{\sphinxupquote{numpy}}} (for mathematics and working with arrays) in a single name space. Although many examples use \sphinxcode{\sphinxupquote{pylab}}, it is no longer recommended. For non-interactive plotting it is suggested to use pyplot to create the figures and then the OO interface for plotting. \subsubsection{Coding Styles} \label{\detokenize{tutorials/introductory/usage:coding-styles}}\label{\detokenize{tutorials/introductory/usage:id2}} When viewing this documentation and examples, you will find different coding styles and usage patterns. These styles are perfectly valid and have their pros and cons. Just about all of the examples can be converted into another style and achieve the same results. The only caveat is to avoid mixing the coding styles for your own code. \begin{sphinxadmonition}{note}{Note:} Developers for matplotlib have to follow a specific style and guidelines. See {\hyperref[\detokenize{devel/index:developers-guide-index}]{\sphinxcrossref{\DUrole{std,std-ref}{The Matplotlib Developers’ Guide}}}}. \end{sphinxadmonition} Of the different styles, there are two that are officially supported. Therefore, these are the preferred ways to use matplotlib. For the pyplot style, the imports at the top of your scripts will typically be: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \end{sphinxVerbatim} Then one calls, for example, np.arange, np.zeros, np.pi, plt.figure, plt.plot, plt.show, etc. Use the pyplot interface for creating figures, and then use the object methods for the rest: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mf}{0.2}\PYG{p}{)} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_usage_004}.png} So, why all the extra typing instead of the MATLAB-style (which relies on global state and a flat namespace)? For very simple things like this example, the only advantage is academic: the wordier styles are more explicit, more clear as to where things come from and what is going on. For more complicated applications, this explicitness and clarity becomes increasingly valuable, and the richer and more complete object-oriented interface will likely make the program easier to write and maintain. Typically one finds oneself making the same plots over and over again, but with different data sets, which leads to needing to write specialized functions to do the plotting. The recommended function signature is something like: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{my\PYGZus{}plotter}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{data1}\PYG{p}{,} \PYG{n}{data2}\PYG{p}{,} \PYG{n}{param\PYGZus{}dict}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ A helper function to make a graph} \PYG{l+s+sd}{ Parameters} \PYG{l+s+sd}{ \PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}} \PYG{l+s+sd}{ ax : Axes} \PYG{l+s+sd}{ The axes to draw to} \PYG{l+s+sd}{ data1 : array} \PYG{l+s+sd}{ The x data} \PYG{l+s+sd}{ data2 : array} \PYG{l+s+sd}{ The y data} \PYG{l+s+sd}{ param\PYGZus{}dict : dict} \PYG{l+s+sd}{ Dictionary of kwargs to pass to ax.plot} \PYG{l+s+sd}{ Returns} \PYG{l+s+sd}{ \PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}} \PYG{l+s+sd}{ out : list} \PYG{l+s+sd}{ list of artists added} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{n}{out} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{data1}\PYG{p}{,} \PYG{n}{data2}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{param\PYGZus{}dict}\PYG{p}{)} \PYG{k}{return} \PYG{n}{out} \PYG{c+c1}{\PYGZsh{} which you would then use as:} \PYG{n}{data1}\PYG{p}{,} \PYG{n}{data2}\PYG{p}{,} \PYG{n}{data3}\PYG{p}{,} \PYG{n}{data4} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{my\PYGZus{}plotter}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{data1}\PYG{p}{,} \PYG{n}{data2}\PYG{p}{,} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{marker}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{x}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_usage_005}.png} or if you wanted to have 2 sub-plots: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{p}{(}\PYG{n}{ax1}\PYG{p}{,} \PYG{n}{ax2}\PYG{p}{)} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{my\PYGZus{}plotter}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{,} \PYG{n}{data1}\PYG{p}{,} \PYG{n}{data2}\PYG{p}{,} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{marker}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{x}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \PYG{n}{my\PYGZus{}plotter}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{,} \PYG{n}{data3}\PYG{p}{,} \PYG{n}{data4}\PYG{p}{,} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{marker}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{o}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_usage_006}.png} Again, for these simple examples this style seems like overkill, however once the graphs get slightly more complex it pays off. \subsubsection{Backends} \label{\detokenize{tutorials/introductory/usage:backends}} \paragraph{What is a backend?} \label{\detokenize{tutorials/introductory/usage:what-is-a-backend}}\label{\detokenize{tutorials/introductory/usage:id3}} A lot of documentation on the website and in the mailing lists refers to the “backend” and many new users are confused by this term. matplotlib targets many different use cases and output formats. Some people use matplotlib interactively from the python shell and have plotting windows pop up when they type commands. Some people embed matplotlib into graphical user interfaces like wxpython or pygtk to build rich applications. Others use matplotlib in batch scripts to generate postscript images from some numerical simulations, and still others in web application servers to dynamically serve up graphs. To support all of these use cases, matplotlib can target different outputs, and each of these capabilities is called a backend; the “frontend” is the user facing code, i.e., the plotting code, whereas the “backend” does all the hard work behind-the-scenes to make the figure. There are two types of backends: user interface backends (for use in pygtk, wxpython, tkinter, qt4, or macosx; also referred to as “interactive backends”) and hardcopy backends to make image files (PNG, SVG, PDF, PS; also referred to as “non-interactive backends”). There are four ways to configure your backend. If they conflict each other, the method mentioned last in the following list will be used, e.g. calling {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.use}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{use()}}}}} will override the setting in your \sphinxcode{\sphinxupquote{matplotlibrc}}. \begin{enumerate} \item {} The \sphinxcode{\sphinxupquote{backend}} parameter in your \sphinxcode{\sphinxupquote{matplotlibrc}} file (see {\hyperref[\detokenize{tutorials/introductory/customizing:sphx-glr-tutorials-introductory-customizing-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Matplotlib with style sheets and rcParams}}}}): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{backend} \PYG{p}{:} \PYG{n}{WXAgg} \PYG{c+c1}{\PYGZsh{} use wxpython with antigrain (agg) rendering} \end{sphinxVerbatim} \item {} Setting the \index{MPLBACKEND}\index{environment variable!MPLBACKEND}{\hyperref[\detokenize{faq/environment_variables_faq:envvar-MPLBACKEND}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MPLBACKEND}}}}} environment variable, either for your current shell or for a single script. On Unix: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{\PYGZgt{}} \PYG{n}{export} \PYG{n}{MPLBACKEND}\PYG{o}{=}\PYG{n}{module}\PYG{p}{:}\PYG{o}{/}\PYG{o}{/}\PYG{n}{my\PYGZus{}backend} \PYG{o}{\PYGZgt{}} \PYG{n}{python} \PYG{n}{simple\PYGZus{}plot}\PYG{o}{.}\PYG{n}{py} \PYG{o}{\PYGZgt{}} \PYG{n}{MPLBACKEND}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{module://my\PYGZus{}backend}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{python} \PYG{n}{simple\PYGZus{}plot}\PYG{o}{.}\PYG{n}{py} \end{sphinxVerbatim} On Windows, only the former is possible: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{\PYGZgt{}} \PYG{n+nb}{set} \PYG{n}{MPLBACKEND}\PYG{o}{=}\PYG{n}{module}\PYG{p}{:}\PYG{o}{/}\PYG{o}{/}\PYG{n}{my\PYGZus{}backend} \PYG{o}{\PYGZgt{}} \PYG{n}{python} \PYG{n}{simple\PYGZus{}plot}\PYG{o}{.}\PYG{n}{py} \end{sphinxVerbatim} Setting this environment variable will override the \sphinxcode{\sphinxupquote{backend}} parameter in \sphinxstyleemphasis{any} \sphinxcode{\sphinxupquote{matplotlibrc}}, even if there is a \sphinxcode{\sphinxupquote{matplotlibrc}} in your current working directory. Therefore setting \index{MPLBACKEND}\index{environment variable!MPLBACKEND}{\hyperref[\detokenize{faq/environment_variables_faq:envvar-MPLBACKEND}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MPLBACKEND}}}}} globally, e.g. in your \sphinxcode{\sphinxupquote{.bashrc}} or \sphinxcode{\sphinxupquote{.profile}}, is discouraged as it might lead to counter-intuitive behavior. \item {} If your script depends on a specific backend you can use the {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.use}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{use()}}}}} function: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{PS}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} generate postscript output by default} \end{sphinxVerbatim} If you use the {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.use}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{use()}}}}} function, this must be done before importing {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot}}}}}. Calling {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.use}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{use()}}}}} after pyplot has been imported will have no effect. Using {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.use}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{use()}}}}} will require changes in your code if users want to use a different backend. Therefore, you should avoid explicitly calling {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.use}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{use()}}}}} unless absolutely necessary. \end{enumerate} \begin{sphinxadmonition}{note}{Note:} Backend name specifications are not case-sensitive; e.g., ‘GTKAgg’ and ‘gtkagg’ are equivalent. \end{sphinxadmonition} With a typical installation of matplotlib, such as from a binary installer or a linux distribution package, a good default backend will already be set, allowing both interactive work and plotting from scripts, with output to the screen and/or to a file, so at least initially you will not need to use any of the methods given above. If, however, you want to write graphical user interfaces, or a web application server ({\hyperref[\detokenize{faq/howto_faq:howto-webapp}]{\sphinxcrossref{\DUrole{std,std-ref}{Matplotlib in a web application server}}}}), or need a better understanding of what is going on, read on. To make things a little more customizable for graphical user interfaces, matplotlib separates the concept of the renderer (the thing that actually does the drawing) from the canvas (the place where the drawing goes). The canonical renderer for user interfaces is \sphinxcode{\sphinxupquote{Agg}} which uses the \sphinxhref{http://antigrain.com/}{Anti-Grain Geometry} C++ library to make a raster (pixel) image of the figure. All of the user interfaces except \sphinxcode{\sphinxupquote{macosx}} can be used with agg rendering, e.g., \sphinxcode{\sphinxupquote{WXAgg}}, \sphinxcode{\sphinxupquote{GTKAgg}}, \sphinxcode{\sphinxupquote{QT4Agg}}, \sphinxcode{\sphinxupquote{QT5Agg}}, \sphinxcode{\sphinxupquote{TkAgg}}. In addition, some of the user interfaces support other rendering engines. For example, with GTK, you can also select GDK rendering (backend \sphinxcode{\sphinxupquote{GTK}} deprecated in 2.0) or Cairo rendering (backend \sphinxcode{\sphinxupquote{GTKCairo}}). For the rendering engines, one can also distinguish between \sphinxhref{https://en.wikipedia.org/wiki/Vector\_graphics}{vector} or \sphinxhref{https://en.wikipedia.org/wiki/Raster\_graphics}{raster} renderers. Vector graphics languages issue drawing commands like “draw a line from this point to this point” and hence are scale free, and raster backends generate a pixel representation of the line whose accuracy depends on a DPI setting. Here is a summary of the matplotlib renderers (there is an eponymous backed for each; these are \sphinxstyleemphasis{non-interactive backends}, capable of writing to a file): \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily Renderer &\sphinxstyletheadfamily Filetypes &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{glossary/index:term-agg}]{\sphinxtermref{\DUrole{xref,std,std-term}{AGG}}}} & {\hyperref[\detokenize{glossary/index:term-png}]{\sphinxtermref{\DUrole{xref,std,std-term}{png}}}} & {\hyperref[\detokenize{glossary/index:term-raster-graphics}]{\sphinxtermref{\DUrole{xref,std,std-term}{raster graphics}}}} \textendash{} high quality images using the \sphinxhref{http://antigrain.com/}{Anti-Grain Geometry} engine \\ \hline PS & {\hyperref[\detokenize{glossary/index:term-ps}]{\sphinxtermref{\DUrole{xref,std,std-term}{ps}}}} {\hyperref[\detokenize{glossary/index:term-eps}]{\sphinxtermref{\DUrole{xref,std,std-term}{eps}}}} & {\hyperref[\detokenize{glossary/index:term-vector-graphics}]{\sphinxtermref{\DUrole{xref,std,std-term}{vector graphics}}}} \textendash{} \sphinxhref{https://en.wikipedia.org/wiki/PostScript}{Postscript} output \\ \hline PDF & {\hyperref[\detokenize{glossary/index:term-pdf}]{\sphinxtermref{\DUrole{xref,std,std-term}{pdf}}}} & {\hyperref[\detokenize{glossary/index:term-vector-graphics}]{\sphinxtermref{\DUrole{xref,std,std-term}{vector graphics}}}} \textendash{} \sphinxhref{https://en.wikipedia.org/wiki/Portable\_Document\_Format}{Portable Document Format} \\ \hline SVG & {\hyperref[\detokenize{glossary/index:term-svg}]{\sphinxtermref{\DUrole{xref,std,std-term}{svg}}}} & {\hyperref[\detokenize{glossary/index:term-vector-graphics}]{\sphinxtermref{\DUrole{xref,std,std-term}{vector graphics}}}} \textendash{} \sphinxhref{https://en.wikipedia.org/wiki/Scalable\_Vector\_Graphics}{Scalable Vector Graphics} \\ \hline {\hyperref[\detokenize{glossary/index:term-cairo}]{\sphinxtermref{\DUrole{xref,std,std-term}{Cairo}}}} & {\hyperref[\detokenize{glossary/index:term-png}]{\sphinxtermref{\DUrole{xref,std,std-term}{png}}}} {\hyperref[\detokenize{glossary/index:term-ps}]{\sphinxtermref{\DUrole{xref,std,std-term}{ps}}}} {\hyperref[\detokenize{glossary/index:term-pdf}]{\sphinxtermref{\DUrole{xref,std,std-term}{pdf}}}} {\hyperref[\detokenize{glossary/index:term-svg}]{\sphinxtermref{\DUrole{xref,std,std-term}{svg}}}} & {\hyperref[\detokenize{glossary/index:term-raster-graphics}]{\sphinxtermref{\DUrole{xref,std,std-term}{raster graphics}}}} and {\hyperref[\detokenize{glossary/index:term-vector-graphics}]{\sphinxtermref{\DUrole{xref,std,std-term}{vector graphics}}}} \textendash{} using the \sphinxhref{https://wwW.cairographics.org}{Cairo graphics} library \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} And here are the user interfaces and renderer combinations supported; these are \sphinxstyleemphasis{interactive backends}, capable of displaying to the screen and of using appropriate renderers from the table above to write to a file: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Backend &\sphinxstyletheadfamily Description \\ \hline Qt5Agg & Agg rendering in a {\hyperref[\detokenize{glossary/index:term-qt5}]{\sphinxtermref{\DUrole{xref,std,std-term}{Qt5}}}} canvas (requires \sphinxhref{https://riverbankcomputing.com/software/pyqt/intro}{PyQt5}). This backend can be activated in IPython with \sphinxcode{\sphinxupquote{\%matplotlib qt5}}. \\ \hline ipympl & Agg rendering embedded in a Jupyter widget. (requires ipympl). This backend can be enabled in a Jupyter notebook with \sphinxcode{\sphinxupquote{\%matplotlib ipympl}}. \\ \hline GTK3Agg & Agg rendering to a {\hyperref[\detokenize{glossary/index:term-gtk}]{\sphinxtermref{\DUrole{xref,std,std-term}{GTK}}}} 3.x canvas (requires \sphinxhref{https://wiki.gnome.org/action/show/Projects/PyGObject}{PyGObject}, and \sphinxhref{https://www.cairographics.org/pycairo/}{pycairo} or \sphinxhref{https://pythonhosted.org/cairocffi/}{cairocffi}). This backend can be activated in IPython with \sphinxcode{\sphinxupquote{\%matplotlib gtk3}}. \\ \hline macosx & Agg rendering into a Cocoa canvas in OSX. This backend can be activated in IPython with \sphinxcode{\sphinxupquote{\%matplotlib osx}}. \\ \hline TkAgg & Agg rendering to a {\hyperref[\detokenize{glossary/index:term-tk}]{\sphinxtermref{\DUrole{xref,std,std-term}{Tk}}}} canvas (requires \sphinxhref{https://wiki.python.org/moin/TkInter}{TkInter}). This backend can be activated in IPython with \sphinxcode{\sphinxupquote{\%matplotlib tk}}. \\ \hline nbAgg & Embed an interactive figure in a Jupyter classic notebook. This backend can be enabled in Jupyter notebooks via \sphinxcode{\sphinxupquote{\%matplotlib notebook}}. \\ \hline WebAgg & On \sphinxcode{\sphinxupquote{show()}} will start a tornado server with an interactive figure. \\ \hline GTK3Cairo & Cairo rendering to a {\hyperref[\detokenize{glossary/index:term-gtk}]{\sphinxtermref{\DUrole{xref,std,std-term}{GTK}}}} 3.x canvas (requires \sphinxhref{https://wiki.gnome.org/action/show/Projects/PyGObject}{PyGObject}, and \sphinxhref{https://www.cairographics.org/pycairo/}{pycairo} or \sphinxhref{https://pythonhosted.org/cairocffi/}{cairocffi}). \\ \hline Qt4Agg & Agg rendering to a {\hyperref[\detokenize{glossary/index:term-qt4}]{\sphinxtermref{\DUrole{xref,std,std-term}{Qt4}}}} canvas (requires \sphinxhref{https://riverbankcomputing.com/software/pyqt/intro}{PyQt4} or \sphinxcode{\sphinxupquote{pyside}}). This backend can be activated in IPython with \sphinxcode{\sphinxupquote{\%matplotlib qt4}}. \\ \hline GTKAgg & Agg rendering to a {\hyperref[\detokenize{glossary/index:term-gtk}]{\sphinxtermref{\DUrole{xref,std,std-term}{GTK}}}} 2.x canvas (requires \sphinxhref{http://www.pygtk.org}{PyGTK}, and \sphinxhref{https://www.cairographics.org/pycairo/}{pycairo} or \sphinxhref{https://pythonhosted.org/cairocffi/}{cairocffi}; Python2 only). This backend can be activated in IPython with \sphinxcode{\sphinxupquote{\%matplotlib gtk}}. \\ \hline GTKCairo & Cairo rendering to a {\hyperref[\detokenize{glossary/index:term-gtk}]{\sphinxtermref{\DUrole{xref,std,std-term}{GTK}}}} 2.x canvas (requires \sphinxhref{http://www.pygtk.org}{PyGTK}, and \sphinxhref{https://www.cairographics.org/pycairo/}{pycairo} or \sphinxhref{https://pythonhosted.org/cairocffi/}{cairocffi}; Python2 only). \\ \hline WXAgg & Agg rendering to a {\hyperref[\detokenize{glossary/index:term-wxwidgets}]{\sphinxtermref{\DUrole{xref,std,std-term}{wxWidgets}}}} canvas (requires \sphinxhref{https://www.wxpython.org/}{wxPython}; v4.0 (in beta) is required for Python3). This backend can be activated in IPython with \sphinxcode{\sphinxupquote{\%matplotlib wx}}.\# \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \paragraph{ipympl} \label{\detokenize{tutorials/introductory/usage:ipympl}} The Jupyter widget ecosystem is moving too fast to support directly in Matplotlib. To install ipympl \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] pip install ipympl jupyter nbextension \PYG{n+nb}{enable} \PYGZhy{}\PYGZhy{}py \PYGZhy{}\PYGZhy{}sys\PYGZhy{}prefix ipympl \end{sphinxVerbatim} or \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] conda install ipympl \PYGZhy{}c conda\PYGZhy{}forge \end{sphinxVerbatim} See \sphinxhref{https://github.com/matplotlib/jupyter-matplotlib}{jupyter-matplotlib} for more details. \paragraph{GTK and Cairo} \label{\detokenize{tutorials/introductory/usage:gtk-and-cairo}} Both \sphinxcode{\sphinxupquote{GTK2}} and \sphinxcode{\sphinxupquote{GTK3}} have implicit dependencies on PyCairo regardless of the specific Matplotlib backend used. Unfortunately the latest release of PyCairo for Python3 does not implement the Python wrappers needed for the \sphinxcode{\sphinxupquote{GTK3Agg}} backend. \sphinxcode{\sphinxupquote{Cairocffi}} can be used as a replacement which implements the correct wrapper. \paragraph{How do I select PyQt4 or PySide?} \label{\detokenize{tutorials/introductory/usage:how-do-i-select-pyqt4-or-pyside}} The \sphinxcode{\sphinxupquote{QT\_API}} environment variable can be set to either \sphinxcode{\sphinxupquote{pyqt}} or \sphinxcode{\sphinxupquote{pyside}} to use \sphinxcode{\sphinxupquote{PyQt4}} or \sphinxcode{\sphinxupquote{PySide}}, respectively. Since the default value for the bindings to be used is \sphinxcode{\sphinxupquote{PyQt4}}, \sphinxcode{\sphinxupquote{matplotlib}} first tries to import it, if the import fails, it tries to import \sphinxcode{\sphinxupquote{PySide}}. \subsubsection{What is interactive mode?} \label{\detokenize{tutorials/introductory/usage:what-is-interactive-mode}}\label{\detokenize{tutorials/introductory/usage:interactive-mode}} Use of an interactive backend (see {\hyperref[\detokenize{tutorials/introductory/usage:what-is-a-backend}]{\sphinxcrossref{\DUrole{std,std-ref}{What is a backend?}}}}) permits\textendash{}but does not by itself require or ensure\textendash{}plotting to the screen. Whether and when plotting to the screen occurs, and whether a script or shell session continues after a plot is drawn on the screen, depends on the functions and methods that are called, and on a state variable that determines whether matplotlib is in “interactive mode”. The default Boolean value is set by the \sphinxcode{\sphinxupquote{matplotlibrc}} file, and may be customized like any other configuration parameter (see {\hyperref[\detokenize{tutorials/introductory/customizing:sphx-glr-tutorials-introductory-customizing-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Matplotlib with style sheets and rcParams}}}}). It may also be set via {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.interactive}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.interactive()}}}}}, and its value may be queried via {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.is_interactive}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.is\_interactive()}}}}}. Turning interactive mode on and off in the middle of a stream of plotting commands, whether in a script or in a shell, is rarely needed and potentially confusing, so in the following we will assume all plotting is done with interactive mode either on or off. \begin{sphinxadmonition}{note}{Note:} Major changes related to interactivity, and in particular the role and behavior of {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.show:matplotlib.pyplot.show}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{show()}}}}}, were made in the transition to matplotlib version 1.0, and bugs were fixed in 1.0.1. Here we describe the version 1.0.1 behavior for the primary interactive backends, with the partial exception of \sphinxstyleemphasis{macosx}. \end{sphinxadmonition} Interactive mode may also be turned on via {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ion:matplotlib.pyplot.ion}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.ion()}}}}}, and turned off via {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ioff:matplotlib.pyplot.ioff}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.ioff()}}}}}. \begin{sphinxadmonition}{note}{Note:} Interactive mode works with suitable backends in ipython and in the ordinary python shell, but it does \sphinxstyleemphasis{not} work in the IDLE IDE. If the default backend does not support interactivity, an interactive backend can be explicitly activated using any of the methods discussed in {\hyperref[\detokenize{tutorials/introductory/usage:id3}]{\sphinxcrossref{What is a backend?}}}. \end{sphinxadmonition} \paragraph{Interactive example} \label{\detokenize{tutorials/introductory/usage:interactive-example}} From an ordinary python prompt, or after invoking ipython with no options, try this: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{ion}\PYG{p}{(}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mf}{1.6}\PYG{p}{,} \PYG{l+m+mf}{2.7}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} Assuming you are running version 1.0.1 or higher, and you have an interactive backend installed and selected by default, you should see a plot, and your terminal prompt should also be active; you can type additional commands such as: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{title}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{interactive test}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{xlabel}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{index}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} and you will see the plot being updated after each line. Since version 1.5, modifying the plot by other means \sphinxstyleemphasis{should} also automatically update the display on most backends. Get a reference to the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance, and call a method of that instance: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{gca}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mf}{3.1}\PYG{p}{,} \PYG{l+m+mf}{2.2}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} If you are using certain backends (like \sphinxcode{\sphinxupquote{macosx}}), or an older version of matplotlib, you may not see the new line added to the plot immediately. In this case, you need to explicitly call {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.draw:matplotlib.pyplot.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw()}}}}} in order to update the plot: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \paragraph{Non-interactive example} \label{\detokenize{tutorials/introductory/usage:non-interactive-example}} Start a fresh session as in the previous example, but now turn interactive mode off: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{ioff}\PYG{p}{(}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mf}{1.6}\PYG{p}{,} \PYG{l+m+mf}{2.7}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} Nothing happened\textendash{}or at least nothing has shown up on the screen (unless you are using \sphinxstyleemphasis{macosx} backend, which is anomalous). To make the plot appear, you need to do this: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} Now you see the plot, but your terminal command line is unresponsive; the \sphinxcode{\sphinxupquote{show()}} command \sphinxstyleemphasis{blocks} the input of additional commands until you manually kill the plot window. What good is this\textendash{}being forced to use a blocking function? Suppose you need a script that plots the contents of a file to the screen. You want to look at that plot, and then end the script. Without some blocking command such as show(), the script would flash up the plot and then end immediately, leaving nothing on the screen. In addition, non-interactive mode delays all drawing until show() is called; this is more efficient than redrawing the plot each time a line in the script adds a new feature. Prior to version 1.0, show() generally could not be called more than once in a single script (although sometimes one could get away with it); for version 1.0.1 and above, this restriction is lifted, so one can write a script like this: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{ioff}\PYG{p}{(}\PYG{p}{)} \PYG{k}{for} \PYG{n}{i} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{:} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_usage_007}.png} which makes three plots, one at a time. \paragraph{Summary} \label{\detokenize{tutorials/introductory/usage:summary}} In interactive mode, pyplot functions automatically draw to the screen. When plotting interactively, if using object method calls in addition to pyplot functions, then call {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.draw:matplotlib.pyplot.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw()}}}}} whenever you want to refresh the plot. Use non-interactive mode in scripts in which you want to generate one or more figures and display them before ending or generating a new set of figures. In that case, use {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.show:matplotlib.pyplot.show}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{show()}}}}} to display the figure(s) and to block execution until you have manually destroyed them. \subsubsection{Performance} \label{\detokenize{tutorials/introductory/usage:performance}}\label{\detokenize{tutorials/introductory/usage:id4}} Whether exploring data in interactive mode or programmatically saving lots of plots, rendering performance can be a painful bottleneck in your pipeline. Matplotlib provides a couple ways to greatly reduce rendering time at the cost of a slight change (to a settable tolerance) in your plot’s appearance. The methods available to reduce rendering time depend on the type of plot that is being created. \paragraph{Line segment simplification} \label{\detokenize{tutorials/introductory/usage:line-segment-simplification}} For plots that have line segments (e.g. typical line plots, outlines of polygons, etc.), rendering performance can be controlled by the \sphinxcode{\sphinxupquote{path.simplify}} and \sphinxcode{\sphinxupquote{path.simplify\_threshold}} parameters in your \sphinxcode{\sphinxupquote{matplotlibrc}} file (see {\hyperref[\detokenize{tutorials/introductory/customizing:sphx-glr-tutorials-introductory-customizing-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Matplotlib with style sheets and rcParams}}}} for more information about the \sphinxcode{\sphinxupquote{matplotlibrc}} file). The \sphinxcode{\sphinxupquote{path.simplify}} parameter is a boolean indicating whether or not line segments are simplified at all. The \sphinxcode{\sphinxupquote{path.simplify\_threshold}} parameter controls how much line segments are simplified; higher thresholds result in quicker rendering. The following script will first display the data without any simplification, and then display the same data with simplification. Try interacting with both of them: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{k}{as} \PYG{n+nn}{mpl} \PYG{c+c1}{\PYGZsh{} Setup, and create the data to plot} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{100000}\PYG{p}{)} \PYG{n}{y}\PYG{p}{[}\PYG{l+m+mi}{50000}\PYG{p}{:}\PYG{p}{]} \PYG{o}{*}\PYG{o}{=} \PYG{l+m+mi}{2} \PYG{n}{y}\PYG{p}{[}\PYG{n}{np}\PYG{o}{.}\PYG{n}{logspace}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{log10}\PYG{p}{(}\PYG{l+m+mi}{50000}\PYG{p}{)}\PYG{p}{,} \PYG{l+m+mi}{400}\PYG{p}{)}\PYG{o}{.}\PYG{n}{astype}\PYG{p}{(}\PYG{n+nb}{int}\PYG{p}{)}\PYG{p}{]} \PYG{o}{=} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{path.simplify}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{k+kc}{True} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{path.simplify\PYGZus{}threshold}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mf}{0.0} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{path.simplify\PYGZus{}threshold}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mf}{1.0} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} Matplotlib currently defaults to a conservative simplification threshold of \sphinxcode{\sphinxupquote{1/9}}. If you want to change your default settings to use a different value, you can change your \sphinxcode{\sphinxupquote{matplotlibrc}} file. Alternatively, you could create a new style for interactive plotting (with maximal simplification) and another style for publication quality plotting (with minimal simplification) and activate them as necessary. See {\hyperref[\detokenize{tutorials/introductory/customizing:sphx-glr-tutorials-introductory-customizing-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Matplotlib with style sheets and rcParams}}}} for instructions on how to perform these actions. The simplification works by iteratively merging line segments into a single vector until the next line segment’s perpendicular distance to the vector (measured in display-coordinate space) is greater than the \sphinxcode{\sphinxupquote{path.simplify\_threshold}} parameter. \begin{sphinxadmonition}{note}{Note:} Changes related to how line segments are simplified were made in version 2.1. Rendering time will still be improved by these parameters prior to 2.1, but rendering time for some kinds of data will be vastly improved in versions 2.1 and greater. \end{sphinxadmonition} \paragraph{Marker simplification} \label{\detokenize{tutorials/introductory/usage:marker-simplification}} Markers can also be simplified, albeit less robustly than line segments. Marker simplification is only available to {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} objects (through the \sphinxcode{\sphinxupquote{markevery}} property). Wherever {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} construction parameter are passed through, such as {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.plot()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.plot()}}}}}, the \sphinxcode{\sphinxupquote{markevery}} parameter can be used: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{markevery}\PYG{o}{=}\PYG{l+m+mi}{10}\PYG{p}{)} \end{sphinxVerbatim} The markevery argument allows for naive subsampling, or an attempt at evenly spaced (along the \sphinxstyleemphasis{x} axis) sampling. See the \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_markevery\_demo.py} for more information. \paragraph{Splitting lines into smaller chunks} \label{\detokenize{tutorials/introductory/usage:splitting-lines-into-smaller-chunks}} If you are using the Agg backend (see {\hyperref[\detokenize{tutorials/introductory/usage:what-is-a-backend}]{\sphinxcrossref{\DUrole{std,std-ref}{What is a backend?}}}}), then you can make use of the \sphinxcode{\sphinxupquote{agg.path.chunksize}} rc parameter. This allows you to specify a chunk size, and any lines with greater than that many vertices will be split into multiple lines, each of which have no more than \sphinxcode{\sphinxupquote{agg.path.chunksize}} many vertices. (Unless \sphinxcode{\sphinxupquote{agg.path.chunksize}} is zero, in which case there is no chunking.) For some kind of data, chunking the line up into reasonable sizes can greatly decrease rendering time. The following script will first display the data without any chunk size restriction, and then display the same data with a chunk size of 10,000. The difference can best be seen when the figures are large, try maximizing the GUI and then interacting with them: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{k}{as} \PYG{n+nn}{mpl} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{path.simplify\PYGZus{}threshold}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mf}{1.0} \PYG{c+c1}{\PYGZsh{} Setup, and create the data to plot} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{100000}\PYG{p}{)} \PYG{n}{y}\PYG{p}{[}\PYG{l+m+mi}{50000}\PYG{p}{:}\PYG{p}{]} \PYG{o}{*}\PYG{o}{=} \PYG{l+m+mi}{2} \PYG{n}{y}\PYG{p}{[}\PYG{n}{np}\PYG{o}{.}\PYG{n}{logspace}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{n}{np}\PYG{o}{.}\PYG{n}{log10}\PYG{p}{(}\PYG{l+m+mi}{50000}\PYG{p}{)}\PYG{p}{,} \PYG{l+m+mi}{400}\PYG{p}{)}\PYG{o}{.}\PYG{n}{astype}\PYG{p}{(}\PYG{n+nb}{int}\PYG{p}{)}\PYG{p}{]} \PYG{o}{=} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{path.simplify}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{k+kc}{True} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{agg.path.chunksize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mi}{0} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{agg.path.chunksize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mi}{10000} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \paragraph{Using the \sphinxstyleemphasis{fast} style} \label{\detokenize{tutorials/introductory/usage:using-the-fast-style}} The \sphinxstyleemphasis{fast} style can be used to automatically set simplification and chunking parameters to reasonable settings to speed up plotting large amounts of data. It can be used simply by running: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{style} \PYG{k}{as} \PYG{n+nn}{mplstyle} \PYG{n}{mplstyle}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{fast}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} It is very light weight, so it plays nicely with other styles, just make sure the fast style is applied last so that other styles do not overwrite the settings: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mplstyle}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{dark\PYGZus{}background}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ggplot}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{fast}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \phantomsection\label{\detokenize{tutorials/introductory/usage:sphx-glr-download-tutorials-introductory-usage-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-download-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Pyplot tutorial} \label{\detokenize{tutorials/introductory/pyplot:pyplot-tutorial}}\label{\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}}\label{\detokenize{tutorials/introductory/pyplot::doc}} An introduction to the pyplot interface. \subsubsection{Intro to pyplot} \label{\detokenize{tutorials/introductory/pyplot:intro-to-pyplot}} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot}}}}} is a collection of command style functions that make matplotlib work like MATLAB. Each \sphinxcode{\sphinxupquote{pyplot}} function makes some change to a figure: e.g., creates a figure, creates a plotting area in a figure, plots some lines in a plotting area, decorates the plot with labels, etc. In {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot}}}}} various states are preserved across function calls, so that it keeps track of things like the current figure and plotting area, and the plotting functions are directed to the current axes (please note that “axes” here and in most places in the documentation refers to the \sphinxstyleemphasis{axes} \sphinxhref{http://matplotlib.org/faq/usage\_faq.html\#parts-of-a-figure}{part of a figure} and not the strict mathematical term for more than one axis). \begin{sphinxadmonition}{note}{Note:} the pyplot API is generally less-flexible than the object-oriented API. Most of the function calls you see here can also be called as methods from an \sphinxcode{\sphinxupquote{Axes}} object. We recommend browsing the tutorials and examples to see how this works. \end{sphinxadmonition} Generating visualizations with pyplot is very quick: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{]}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{some numbers}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_pyplot_001}.png} You may be wondering why the x-axis ranges from 0-3 and the y-axis from 1-4. If you provide a single list or array to the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot()}}}}} command, matplotlib assumes it is a sequence of y values, and automatically generates the x values for you. Since python ranges start with 0, the default x vector has the same length as y but starts with 0. Hence the x data are \sphinxcode{\sphinxupquote{{[}0,1,2,3{]}}}. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot()}}}}} is a versatile command, and will take an arbitrary number of arguments. For example, to plot x versus y, you can issue the command: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{9}\PYG{p}{,} \PYG{l+m+mi}{16}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_pyplot_002}.png} \paragraph{Formatting the style of your plot} \label{\detokenize{tutorials/introductory/pyplot:formatting-the-style-of-your-plot}} For every x, y pair of arguments, there is an optional third argument which is the format string that indicates the color and line type of the plot. The letters and symbols of the format string are from MATLAB, and you concatenate a color string with a line style string. The default format string is ‘b-‘, which is a solid blue line. For example, to plot the above with red circles, you would issue \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{9}\PYG{p}{,} \PYG{l+m+mi}{16}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ro}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{6}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{20}\PYG{p}{]}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_pyplot_003}.png} See the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot()}}}}} documentation for a complete list of line styles and format strings. The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axis:matplotlib.pyplot.axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axis()}}}}} command in the example above takes a list of \sphinxcode{\sphinxupquote{{[}xmin, xmax, ymin, ymax{]}}} and specifies the viewport of the axes. If matplotlib were limited to working with lists, it would be fairly useless for numeric processing. Generally, you will use \sphinxhref{http://www.numpy.org}{numpy} arrays. In fact, all sequences are converted to numpy arrays internally. The example below illustrates a plotting several lines with different format styles in one command using arrays. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{c+c1}{\PYGZsh{} evenly sampled time at 200ms intervals} \PYG{n}{t} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mf}{0.}\PYG{p}{,} \PYG{l+m+mf}{5.}\PYG{p}{,} \PYG{l+m+mf}{0.2}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} red dashes, blue squares and green triangles} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{t}\PYG{p}{,} \PYG{n}{t}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{t}\PYG{p}{,} \PYG{n}{t}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bs}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{t}\PYG{p}{,} \PYG{n}{t}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g\PYGZca{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_pyplot_004}.png} \subsubsection{Plotting with keyword strings} \label{\detokenize{tutorials/introductory/pyplot:plotting-with-keyword-strings}}\label{\detokenize{tutorials/introductory/pyplot:plotting-with-keywords}} There are some instances where you have data in a format that lets you access particular variables with strings. For example, with \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.recarray.html\#numpy.recarray}{\sphinxcode{\sphinxupquote{numpy.recarray}}} or \sphinxhref{https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html\#pandas.DataFrame}{\sphinxcode{\sphinxupquote{pandas.DataFrame}}}. Matplotlib allows you provide such an object with the \sphinxcode{\sphinxupquote{data}} keyword argument. If provided, then you may generate plots with the strings corresponding to these variables. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{data} \PYG{o}{=} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{a}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{50}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{c}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randint}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{50}\PYG{p}{,} \PYG{l+m+mi}{50}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{d}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{50}\PYG{p}{)}\PYG{p}{\PYGZcb{}} \PYG{n}{data}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{n}{data}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{a}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{+} \PYG{l+m+mi}{10} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{50}\PYG{p}{)} \PYG{n}{data}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{d}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{abs}\PYG{p}{(}\PYG{n}{data}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{d}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \PYG{o}{*} \PYG{l+m+mi}{100} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{scatter}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{a}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{c}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{c}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{s}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{d}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{data}\PYG{o}{=}\PYG{n}{data}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{entry a}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{entry b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_pyplot_005}.png} \subsubsection{Plotting with categorical variables} \label{\detokenize{tutorials/introductory/pyplot:plotting-with-categorical-variables}}\label{\detokenize{tutorials/introductory/pyplot:plotting-with-categorical-vars}} It is also possible to create a plot using categorical variables. Matplotlib allows you to pass categorical variables directly to many plotting functions. For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{names} \PYG{o}{=} \PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{group\PYGZus{}a}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{group\PYGZus{}b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{group\PYGZus{}c}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{n}{values} \PYG{o}{=} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{]} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{9}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{131}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{bar}\PYG{p}{(}\PYG{n}{names}\PYG{p}{,} \PYG{n}{values}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{132}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{scatter}\PYG{p}{(}\PYG{n}{names}\PYG{p}{,} \PYG{n}{values}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{133}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{names}\PYG{p}{,} \PYG{n}{values}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{suptitle}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Categorical Plotting}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_pyplot_006}.png} \subsubsection{Controlling line properties} \label{\detokenize{tutorials/introductory/pyplot:controlling-line-properties}}\label{\detokenize{tutorials/introductory/pyplot:id1}} Lines have many attributes that you can set: linewidth, dash style, antialiased, etc; see {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.lines.Line2D}}}}}. There are several ways to set line properties \begin{itemize} \item {} Use keyword args: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mf}{2.0}\PYG{p}{)} \end{sphinxVerbatim} \item {} Use the setter methods of a \sphinxcode{\sphinxupquote{Line2D}} instance. \sphinxcode{\sphinxupquote{plot}} returns a list of \sphinxcode{\sphinxupquote{Line2D}} objects; e.g., \sphinxcode{\sphinxupquote{line1, line2 = plot(x1, y1, x2, y2)}}. In the code below we will suppose that we have only one line so that the list returned is of length 1. We use tuple unpacking with \sphinxcode{\sphinxupquote{line,}} to get the first element of that list: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}antialiased}\PYG{p}{(}\PYG{k+kc}{False}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} turn off antialising} \end{sphinxVerbatim} \item {} Use the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.setp:matplotlib.pyplot.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setp()}}}}} command. The example below uses a MATLAB-style command to set multiple properties on a list of lines. \sphinxcode{\sphinxupquote{setp}} works transparently with a list of objects or a single object. You can either use python keyword arguments or MATLAB-style string/value pairs: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{lines} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{,} \PYG{n}{x2}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} use keyword args} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{setp}\PYG{p}{(}\PYG{n}{lines}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mf}{2.0}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} or MATLAB style string value pairs} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{setp}\PYG{p}{(}\PYG{n}{lines}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linewidth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+m+mf}{2.0}\PYG{p}{)} \end{sphinxVerbatim} \end{itemize} Here are the available {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties. \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Value Type \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Value Type \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot alpha & float \\ \hline animated & {[}True \textbar{} False{]} \\ \hline antialiased or aa & {[}True \textbar{} False{]} \\ \hline clip\_box & a matplotlib.transform.Bbox instance \\ \hline clip\_on & {[}True \textbar{} False{]} \\ \hline clip\_path & a Path instance and a Transform instance, a Patch \\ \hline color or c & any matplotlib color \\ \hline contains & the hit testing function \\ \hline dash\_capstyle & {[}\sphinxcode{\sphinxupquote{'butt'}} \textbar{} \sphinxcode{\sphinxupquote{'round'}} \textbar{} \sphinxcode{\sphinxupquote{'projecting'}}{]} \\ \hline dash\_joinstyle & {[}\sphinxcode{\sphinxupquote{'miter'}} \textbar{} \sphinxcode{\sphinxupquote{'round'}} \textbar{} \sphinxcode{\sphinxupquote{'bevel'}}{]} \\ \hline dashes & sequence of on/off ink in points \\ \hline data & (np.array xdata, np.array ydata) \\ \hline figure & a matplotlib.figure.Figure instance \\ \hline label & any string \\ \hline linestyle or ls & {[} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'steps'}} \textbar{} …{]} \\ \hline linewidth or lw & float value in points \\ \hline lod & {[}True \textbar{} False{]} \\ \hline marker & {[} \sphinxcode{\sphinxupquote{'+'}} \textbar{} \sphinxcode{\sphinxupquote{','}} \textbar{} \sphinxcode{\sphinxupquote{'.'}} \textbar{} \sphinxcode{\sphinxupquote{'1'}} \textbar{} \sphinxcode{\sphinxupquote{'2'}} \textbar{} \sphinxcode{\sphinxupquote{'3'}} \textbar{} \sphinxcode{\sphinxupquote{'4'}} {]} \\ \hline markeredgecolor or mec & any matplotlib color \\ \hline markeredgewidth or mew & float value in points \\ \hline markerfacecolor or mfc & any matplotlib color \\ \hline markersize or ms & float \\ \hline markevery & {[} None \textbar{} integer \textbar{} (startind, stride) {]} \\ \hline picker & used in interactive line selection \\ \hline pickradius & the line pick selection radius \\ \hline solid\_capstyle & {[}\sphinxcode{\sphinxupquote{'butt'}} \textbar{} \sphinxcode{\sphinxupquote{'round'}} \textbar{} \sphinxcode{\sphinxupquote{'projecting'}}{]} \\ \hline solid\_joinstyle & {[}\sphinxcode{\sphinxupquote{'miter'}} \textbar{} \sphinxcode{\sphinxupquote{'round'}} \textbar{} \sphinxcode{\sphinxupquote{'bevel'}}{]} \\ \hline transform & a matplotlib.transforms.Transform instance \\ \hline visible & {[}True \textbar{} False{]} \\ \hline xdata & np.array \\ \hline ydata & np.array \\ \hline zorder & any number \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} To get a list of settable line properties, call the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.setp:matplotlib.pyplot.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setp()}}}}} function with a line or lines as argument \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [69]: }\PYG{n}{lines} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \PYG{g+gp}{In [70]: }\PYG{n}{plt}\PYG{o}{.}\PYG{n}{setp}\PYG{p}{(}\PYG{n}{lines}\PYG{p}{)} \PYG{g+go}{ alpha: float} \PYG{g+go}{ animated: [True \textbar{} False]} \PYG{g+go}{ antialiased or aa: [True \textbar{} False]} \PYG{g+go}{ ...snip} \end{sphinxVerbatim} \subsubsection{Working with multiple figures and axes} \label{\detokenize{tutorials/introductory/pyplot:working-with-multiple-figures-and-axes}}\label{\detokenize{tutorials/introductory/pyplot:multiple-figs-axes}} MATLAB, and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pyplot}}}}}, have the concept of the current figure and the current axes. All plotting commands apply to the current axes. The function {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.gca:matplotlib.pyplot.gca}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gca()}}}}} returns the current axes (a {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} instance), and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.gcf:matplotlib.pyplot.gcf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gcf()}}}}} returns the current figure ({\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure}}}}} instance). Normally, you don’t have to worry about this, because it is all taken care of behind the scenes. Below is a script to create two subplots. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{f}\PYG{p}{(}\PYG{n}{t}\PYG{p}{)}\PYG{p}{:} \PYG{k}{return} \PYG{n}{np}\PYG{o}{.}\PYG{n}{exp}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{n}{t}\PYG{p}{)} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{cos}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{t}\PYG{p}{)} \PYG{n}{t1} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{5.0}\PYG{p}{,} \PYG{l+m+mf}{0.1}\PYG{p}{)} \PYG{n}{t2} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{5.0}\PYG{p}{,} \PYG{l+m+mf}{0.02}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{211}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{t1}\PYG{p}{,} \PYG{n}{f}\PYG{p}{(}\PYG{n}{t1}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bo}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{t2}\PYG{p}{,} \PYG{n}{f}\PYG{p}{(}\PYG{n}{t2}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{212}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{t2}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{cos}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{t2}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_pyplot_007}.png} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figure:matplotlib.pyplot.figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure()}}}}} command here is optional because \sphinxcode{\sphinxupquote{figure(1)}} will be created by default, just as a \sphinxcode{\sphinxupquote{subplot(111)}} will be created by default if you don’t manually specify any axes. The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot:matplotlib.pyplot.subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot()}}}}} command specifies \sphinxcode{\sphinxupquote{numrows, numcols, plot\_number}} where \sphinxcode{\sphinxupquote{plot\_number}} ranges from 1 to \sphinxcode{\sphinxupquote{numrows*numcols}}. The commas in the \sphinxcode{\sphinxupquote{subplot}} command are optional if \sphinxcode{\sphinxupquote{numrows*numcols\textless{}10}}. So \sphinxcode{\sphinxupquote{subplot(211)}} is identical to \sphinxcode{\sphinxupquote{subplot(2, 1, 1)}}. You can create an arbitrary number of subplots and axes. If you want to place an axes manually, i.e., not on a rectangular grid, use the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axes:matplotlib.pyplot.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axes()}}}}} command, which allows you to specify the location as \sphinxcode{\sphinxupquote{axes({[}left, bottom, width, height{]})}} where all values are in fractional (0 to 1) coordinates. See \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_demo.py} for an example of placing axes manually and \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplot\_demo.py} for an example with lots of subplots. You can create multiple figures by using multiple {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figure:matplotlib.pyplot.figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure()}}}}} calls with an increasing figure number. Of course, each figure can contain as many axes and subplots as your heart desires: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} the first figure} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{211}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} the first subplot in the first figure} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{212}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} the second subplot in the first figure} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{6}\PYG{p}{]}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} a second figure} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{6}\PYG{p}{]}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} creates a subplot(111) by default} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} figure 1 current; subplot(212) still current} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{211}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} make subplot(211) in figure1 current} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Easy as 1, 2, 3}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} subplot 211 title} \end{sphinxVerbatim} You can clear the current figure with {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.clf:matplotlib.pyplot.clf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clf()}}}}} and the current axes with {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.cla:matplotlib.pyplot.cla}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cla()}}}}}. If you find it annoying that states (specifically the current image, figure and axes) are being maintained for you behind the scenes, don’t despair: this is just a thin stateful wrapper around an object oriented API, which you can use instead (see {\hyperref[\detokenize{tutorials/intermediate/artists:sphx-glr-tutorials-intermediate-artists-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Artist tutorial}}}}) If you are making lots of figures, you need to be aware of one more thing: the memory required for a figure is not completely released until the figure is explicitly closed with {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.close:matplotlib.pyplot.close}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{close()}}}}}. Deleting all references to the figure, and/or using the window manager to kill the window in which the figure appears on the screen, is not enough, because pyplot maintains internal references until {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.close:matplotlib.pyplot.close}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{close()}}}}} is called. \subsubsection{Working with text} \label{\detokenize{tutorials/introductory/pyplot:working-with-text}}\label{\detokenize{tutorials/introductory/pyplot:id2}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.text:matplotlib.pyplot.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text()}}}}} command can be used to add text in an arbitrary location, and the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xlabel:matplotlib.pyplot.xlabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xlabel()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ylabel:matplotlib.pyplot.ylabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ylabel()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.title:matplotlib.pyplot.title}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{title()}}}}} are used to add text in the indicated locations (see {\hyperref[\detokenize{tutorials/text/text_intro:sphx-glr-tutorials-text-text-intro-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Text in Matplotlib Plots}}}} for a more detailed example) \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mu}\PYG{p}{,} \PYG{n}{sigma} \PYG{o}{=} \PYG{l+m+mi}{100}\PYG{p}{,} \PYG{l+m+mi}{15} \PYG{n}{x} \PYG{o}{=} \PYG{n}{mu} \PYG{o}{+} \PYG{n}{sigma} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{10000}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} the histogram of the data} \PYG{n}{n}\PYG{p}{,} \PYG{n}{bins}\PYG{p}{,} \PYG{n}{patches} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{hist}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{l+m+mi}{50}\PYG{p}{,} \PYG{n}{density}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.75}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Smarts}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Probability}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Histogram of IQ}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mi}{60}\PYG{p}{,} \PYG{o}{.}\PYG{l+m+mo}{025}\PYG{p}{,} \PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{mu=100,}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{ }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{sigma=15\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{40}\PYG{p}{,} \PYG{l+m+mi}{160}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mf}{0.03}\PYG{p}{]}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{grid}\PYG{p}{(}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_pyplot_008}.png} All of the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.text:matplotlib.pyplot.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text()}}}}} commands return an {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}} instance. Just as with with lines above, you can customize the properties by passing keyword arguments into the text functions or using {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.setp:matplotlib.pyplot.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setp()}}}}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{t} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{my data}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{14}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} These properties are covered in more detail in {\hyperref[\detokenize{tutorials/text/text_props:sphx-glr-tutorials-text-text-props-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Text properties and layout}}}}. \paragraph{Using mathematical expressions in text} \label{\detokenize{tutorials/introductory/pyplot:using-mathematical-expressions-in-text}} matplotlib accepts TeX equation expressions in any text expression. For example to write the expression $\sigma_i=15$ in the title, you can write a TeX expression surrounded by dollar signs: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{title}\PYG{p}{(}\PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{sigma\PYGZus{}i=15\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} The \sphinxcode{\sphinxupquote{r}} preceding the title string is important \textendash{} it signifies that the string is a \sphinxstyleemphasis{raw} string and not to treat backslashes as python escapes. matplotlib has a built-in TeX expression parser and layout engine, and ships its own math fonts \textendash{} for details see {\hyperref[\detokenize{tutorials/text/mathtext:sphx-glr-tutorials-text-mathtext-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Writing mathematical expressions}}}}. Thus you can use mathematical text across platforms without requiring a TeX installation. For those who have LaTeX and dvipng installed, you can also use LaTeX to format your text and incorporate the output directly into your display figures or saved postscript \textendash{} see {\hyperref[\detokenize{tutorials/text/usetex:sphx-glr-tutorials-text-usetex-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Text rendering With LaTeX}}}}. \paragraph{Annotating text} \label{\detokenize{tutorials/introductory/pyplot:annotating-text}} The uses of the basic {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.text:matplotlib.pyplot.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text()}}}}} command above place text at an arbitrary position on the Axes. A common use for text is to annotate some feature of the plot, and the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.annotate:matplotlib.pyplot.annotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{annotate()}}}}} method provides helper functionality to make annotations easy. In an annotation, there are two points to consider: the location being annotated represented by the argument \sphinxcode{\sphinxupquote{xy}} and the location of the text \sphinxcode{\sphinxupquote{xytext}}. Both of these arguments are \sphinxcode{\sphinxupquote{(x,y)}} tuples. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{t} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{5.0}\PYG{p}{,} \PYG{l+m+mf}{0.01}\PYG{p}{)} \PYG{n}{s} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{cos}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{t}\PYG{p}{)} \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{t}\PYG{p}{,} \PYG{n}{s}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{local max}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xytext}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mf}{1.5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{arrowprops}\PYG{o}{=}\PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{black}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{shrink}\PYG{o}{=}\PYG{l+m+mf}{0.05}\PYG{p}{)}\PYG{p}{,} \PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{ylim}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_pyplot_009}.png} In this basic example, both the \sphinxcode{\sphinxupquote{xy}} (arrow tip) and \sphinxcode{\sphinxupquote{xytext}} locations (text location) are in data coordinates. There are a variety of other coordinate systems one can choose \textendash{} see {\hyperref[\detokenize{tutorials/text/annotations:annotations-tutorial}]{\sphinxcrossref{\DUrole{std,std-ref}{Basic annotation}}}} and {\hyperref[\detokenize{tutorials/text/annotations:plotting-guide-annotation}]{\sphinxcrossref{\DUrole{std,std-ref}{Advanced Annotation}}}} for details. More examples can be found in \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_annotation\_demo.py}. \subsubsection{Logarithmic and other nonlinear axes} \label{\detokenize{tutorials/introductory/pyplot:logarithmic-and-other-nonlinear-axes}} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot}}}}} supports not only linear axis scales, but also logarithmic and logit scales. This is commonly used if data spans many orders of magnitude. Changing the scale of an axis is easy: \begin{quote} plt.xscale(‘log’) \end{quote} An example of four plots with the same data and different scales for the y axis is shown below. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib.ticker} \PYG{k+kn}{import} \PYG{n}{NullFormatter} \PYG{c+c1}{\PYGZsh{} useful for {}`logit{}` scale} \PYG{c+c1}{\PYGZsh{} Fixing random state for reproducibility} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{19680801}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} make up some data in the interval ]0, 1[} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{normal}\PYG{p}{(}\PYG{n}{loc}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{n}{scale}\PYG{o}{=}\PYG{l+m+mf}{0.4}\PYG{p}{,} \PYG{n}{size}\PYG{o}{=}\PYG{l+m+mi}{1000}\PYG{p}{)} \PYG{n}{y} \PYG{o}{=} \PYG{n}{y}\PYG{p}{[}\PYG{p}{(}\PYG{n}{y} \PYG{o}{\PYGZgt{}} \PYG{l+m+mi}{0}\PYG{p}{)} \PYG{o}{\PYGZam{}} \PYG{p}{(}\PYG{n}{y} \PYG{o}{\PYGZlt{}} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{]} \PYG{n}{y}\PYG{o}{.}\PYG{n}{sort}\PYG{p}{(}\PYG{p}{)} \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} plot with various axes scales} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} linear} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{221}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{yscale}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linear}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linear}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{grid}\PYG{p}{(}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} log} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{222}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{yscale}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{log}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{log}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{grid}\PYG{p}{(}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} symmetric log} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{223}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y} \PYG{o}{\PYGZhy{}} \PYG{n}{y}\PYG{o}{.}\PYG{n}{mean}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{yscale}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{symlog}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linthreshy}\PYG{o}{=}\PYG{l+m+mf}{0.01}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{symlog}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{grid}\PYG{p}{(}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} logit} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{224}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{yscale}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{logit}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{logit}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{grid}\PYG{p}{(}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Format the minor tick labels of the y\PYGZhy{}axis into empty strings with} \PYG{c+c1}{\PYGZsh{} {}`NullFormatter{}`, to avoid cumbering the axis with too many labels.} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{gca}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{yaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}minor\PYGZus{}formatter}\PYG{p}{(}\PYG{n}{NullFormatter}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Adjust the subplot layout, because the logit one may take more space} \PYG{c+c1}{\PYGZsh{} than usual, due to y\PYGZhy{}tick labels like \PYGZdq{}1 \PYGZhy{} 10\PYGZca{}\PYGZob{}\PYGZhy{}3\PYGZcb{}\PYGZdq{}} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots\PYGZus{}adjust}\PYG{p}{(}\PYG{n}{top}\PYG{o}{=}\PYG{l+m+mf}{0.92}\PYG{p}{,} \PYG{n}{bottom}\PYG{o}{=}\PYG{l+m+mf}{0.08}\PYG{p}{,} \PYG{n}{left}\PYG{o}{=}\PYG{l+m+mf}{0.10}\PYG{p}{,} \PYG{n}{right}\PYG{o}{=}\PYG{l+m+mf}{0.95}\PYG{p}{,} \PYG{n}{hspace}\PYG{o}{=}\PYG{l+m+mf}{0.25}\PYG{p}{,} \PYG{n}{wspace}\PYG{o}{=}\PYG{l+m+mf}{0.35}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_pyplot_010}.png} It is also possible to add your own scale, see {\hyperref[\detokenize{devel/add_new_projection:adding-new-scales}]{\sphinxcrossref{\DUrole{std,std-ref}{Developer’s guide for creating scales and transformations}}}} for details. \phantomsection\label{\detokenize{tutorials/introductory/pyplot:sphx-glr-download-tutorials-introductory-pyplot-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/introductory/lifecycle:sphx-glr-download-tutorials-introductory-lifecycle-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{The Lifecycle of a Plot} \label{\detokenize{tutorials/introductory/lifecycle:the-lifecycle-of-a-plot}}\label{\detokenize{tutorials/introductory/lifecycle:sphx-glr-tutorials-introductory-lifecycle-py}}\label{\detokenize{tutorials/introductory/lifecycle::doc}} This tutorial aims to show the beginning, middle, and end of a single visualization using Matplotlib. We’ll begin with some raw data and end by saving a figure of a customized visualization. Along the way we’ll try to highlight some neat features and best-practices using Matplotlib. \begin{sphinxadmonition}{note}{Note:} This tutorial is based off of \sphinxhref{http://pbpython.com/effective-matplotlib.html}{this excellent blog post} by Chris Moffitt. It was transformed into this tutorial by Chris Holdgraf. \end{sphinxadmonition} \subsubsection{A note on the Object-Oriented API vs Pyplot} \label{\detokenize{tutorials/introductory/lifecycle:a-note-on-the-object-oriented-api-vs-pyplot}} Matplotlib has two interfaces. The first is an object-oriented (OO) interface. In this case, we utilize an instance of {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axes.Axes}}}}} in order to render visualizations on an instance of {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure.Figure}}}}}. The second is based on MATLAB and uses a state-based interface. This is encapsulated in the \sphinxcode{\sphinxupquote{pyplot}} module. See the {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{pyplot tutorials}}}} for a more in-depth look at the pyplot interface. Most of the terms are straightforward but the main thing to remember is that: \begin{itemize} \item {} The Figure is the final image that may contain 1 or more Axes. \item {} The Axes represent an individual plot (don’t confuse this with the word “axis”, which refers to the x/y axis of a plot). \end{itemize} We call methods that do the plotting directly from the Axes, which gives us much more flexibility and power in customizing our plot. See the \DUrole{xref,std,std-ref}{object-oriented examples} for many examples of how this approach is used. \begin{sphinxadmonition}{note}{Note:} In general, try to use the object-oriented interface over the pyplot interface. \end{sphinxadmonition} \subsubsection{Our data} \label{\detokenize{tutorials/introductory/lifecycle:our-data}} We’ll use the data from the post from which this tutorial was derived. It contains sales information for a number of companies. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} sphinx\PYGZus{}gallery\PYGZus{}thumbnail\PYGZus{}number = 10} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib.ticker} \PYG{k+kn}{import} \PYG{n}{FuncFormatter} \PYG{n}{data} \PYG{o}{=} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Barton LLC}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{109438.50}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Frami, Hills and Schmidt}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{103569.59}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Fritsch, Russel and Anderson}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{112214.71}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Jerde\PYGZhy{}Hilpert}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{112591.43}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Keeling LLC}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{100934.30}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Koepp Ltd}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{103660.54}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Kulas Inc}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{137351.96}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Trantow\PYGZhy{}Barrows}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{123381.38}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{White\PYGZhy{}Trantow}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{135841.99}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Will LLC}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{104437.60}\PYG{p}{\PYGZcb{}} \PYG{n}{group\PYGZus{}data} \PYG{o}{=} \PYG{n+nb}{list}\PYG{p}{(}\PYG{n}{data}\PYG{o}{.}\PYG{n}{values}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{n}{group\PYGZus{}names} \PYG{o}{=} \PYG{n+nb}{list}\PYG{p}{(}\PYG{n}{data}\PYG{o}{.}\PYG{n}{keys}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{n}{group\PYGZus{}mean} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{mean}\PYG{p}{(}\PYG{n}{group\PYGZus{}data}\PYG{p}{)} \end{sphinxVerbatim} \subsubsection{Getting started} \label{\detokenize{tutorials/introductory/lifecycle:getting-started}} This data is naturally visualized as a barplot, with one bar per group. To do this with the object-oriented approach, we’ll first generate an instance of {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure.Figure}}}}} and {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axes.Axes}}}}}. The Figure is like a canvas, and the Axes is a part of that canvas on which we will make a particular visualization. \begin{sphinxadmonition}{note}{Note:} Figures can have multiple axes on them. For information on how to do this, see the {\hyperref[\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-tutorials-intermediate-tight-layout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Tight Layout tutorial}}}}. \end{sphinxadmonition} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_lifecycle_001}.png} Now that we have an Axes instance, we can plot on top of it. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{barh}\PYG{p}{(}\PYG{n}{group\PYGZus{}names}\PYG{p}{,} \PYG{n}{group\PYGZus{}data}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_lifecycle_002}.png} \subsubsection{Controlling the style} \label{\detokenize{tutorials/introductory/lifecycle:controlling-the-style}} There are many styles available in Matplotlib in order to let you tailor your visualization to your needs. To see a list of styles, we can use \sphinxcode{\sphinxupquote{pyplot.style}}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{print}\PYG{p}{(}\PYG{n}{plt}\PYG{o}{.}\PYG{n}{style}\PYG{o}{.}\PYG{n}{available}\PYG{p}{)} \end{sphinxVerbatim} Out: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] [\PYGZsq{}seaborn\PYGZhy{}ticks\PYGZsq{}, \PYGZsq{}ggplot\PYGZsq{}, \PYGZsq{}dark\PYGZus{}background\PYGZsq{}, \PYGZsq{}bmh\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}poster\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}notebook\PYGZsq{}, \PYGZsq{}fast\PYGZsq{}, \PYGZsq{}seaborn\PYGZsq{}, \PYGZsq{}classic\PYGZsq{}, \PYGZsq{}Solarize\PYGZus{}Light2\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}dark\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}pastel\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}muted\PYGZsq{}, \PYGZsq{}\PYGZus{}classic\PYGZus{}test\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}paper\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}colorblind\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}bright\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}talk\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}dark\PYGZhy{}palette\PYGZsq{}, \PYGZsq{}tableau\PYGZhy{}colorblind10\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}darkgrid\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}whitegrid\PYGZsq{}, \PYGZsq{}fivethirtyeight\PYGZsq{}, \PYGZsq{}grayscale\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}white\PYGZsq{}, \PYGZsq{}seaborn\PYGZhy{}deep\PYGZsq{}] \end{sphinxVerbatim} You can activate a style with the following: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{style}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{fivethirtyeight}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} Now let’s remake the above plot to see how it looks: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{barh}\PYG{p}{(}\PYG{n}{group\PYGZus{}names}\PYG{p}{,} \PYG{n}{group\PYGZus{}data}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_lifecycle_003}.png} The style controls many things, such as color, linewidths, backgrounds, etc. \subsubsection{Customizing the plot} \label{\detokenize{tutorials/introductory/lifecycle:customizing-the-plot}} Now we’ve got a plot with the general look that we want, so let’s fine-tune it so that it’s ready for print. First let’s rotate the labels on the x-axis so that they show up more clearly. We can gain access to these labels with the {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xticklabels:matplotlib.axes.Axes.get_xticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axes.Axes.get\_xticklabels()}}}}} method: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{barh}\PYG{p}{(}\PYG{n}{group\PYGZus{}names}\PYG{p}{,} \PYG{n}{group\PYGZus{}data}\PYG{p}{)} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}xticklabels}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_lifecycle_004}.png} If we’d like to set the property of many items at once, it’s useful to use the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.setp:matplotlib.pyplot.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pyplot.setp()}}}}} function. This will take a list (or many lists) of Matplotlib objects, and attempt to set some style element of each one. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{barh}\PYG{p}{(}\PYG{n}{group\PYGZus{}names}\PYG{p}{,} \PYG{n}{group\PYGZus{}data}\PYG{p}{)} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}xticklabels}\PYG{p}{(}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{setp}\PYG{p}{(}\PYG{n}{labels}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{45}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_lifecycle_005}.png} It looks like this cut off some of the labels on the bottom. We can tell Matplotlib to automatically make room for elements in the figures that we create. To do this we’ll set the \sphinxcode{\sphinxupquote{autolayout}} value of our rcParams. For more information on controlling the style, layout, and other features of plots with rcParams, see {\hyperref[\detokenize{tutorials/introductory/customizing:sphx-glr-tutorials-introductory-customizing-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Matplotlib with style sheets and rcParams}}}}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{rcParams}\PYG{o}{.}\PYG{n}{update}\PYG{p}{(}\PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{figure.autolayout}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n+nb+bp}{True}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{barh}\PYG{p}{(}\PYG{n}{group\PYGZus{}names}\PYG{p}{,} \PYG{n}{group\PYGZus{}data}\PYG{p}{)} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}xticklabels}\PYG{p}{(}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{setp}\PYG{p}{(}\PYG{n}{labels}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{45}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_lifecycle_006}.png} Next, we’ll add labels to the plot. To do this with the OO interface, we can use the {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set:matplotlib.axes.Axes.set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axes.Axes.set()}}}}} method to set properties of this Axes object. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{barh}\PYG{p}{(}\PYG{n}{group\PYGZus{}names}\PYG{p}{,} \PYG{n}{group\PYGZus{}data}\PYG{p}{)} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}xticklabels}\PYG{p}{(}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{setp}\PYG{p}{(}\PYG{n}{labels}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{45}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set}\PYG{p}{(}\PYG{n}{xlim}\PYG{o}{=}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{10000}\PYG{p}{,} \PYG{l+m+mi}{140000}\PYG{p}{]}\PYG{p}{,} \PYG{n}{xlabel}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Total Revenue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ylabel}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Company}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{title}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Company Revenue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_lifecycle_007}.png} We can also adjust the size of this plot using the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots:matplotlib.pyplot.subplots}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pyplot.subplots()}}}}} function. We can do this with the \sphinxcode{\sphinxupquote{figsize}} kwarg. \begin{sphinxadmonition}{note}{Note:} While indexing in NumPy follows the form (row, column), the figsize kwarg follows the form (width, height). This follows conventions in visualization, which unfortunately are different from those of linear algebra. \end{sphinxadmonition} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{8}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{barh}\PYG{p}{(}\PYG{n}{group\PYGZus{}names}\PYG{p}{,} \PYG{n}{group\PYGZus{}data}\PYG{p}{)} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}xticklabels}\PYG{p}{(}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{setp}\PYG{p}{(}\PYG{n}{labels}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{45}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set}\PYG{p}{(}\PYG{n}{xlim}\PYG{o}{=}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{10000}\PYG{p}{,} \PYG{l+m+mi}{140000}\PYG{p}{]}\PYG{p}{,} \PYG{n}{xlabel}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Total Revenue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ylabel}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Company}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{title}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Company Revenue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_lifecycle_008}.png} For labels, we can specify custom formatting guidelines in the form of functions by using the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.FuncFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ticker.FuncFormatter}}}}} class. Below we’ll define a function that takes an integer as input, and returns a string as an output. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{currency}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{pos}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}The two args are the value and tick position\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{k}{if} \PYG{n}{x} \PYG{o}{\PYGZgt{}}\PYG{o}{=} \PYG{l+m+mf}{1e6}\PYG{p}{:} \PYG{n}{s} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}\PYGZob{}:1.1f\PYGZcb{}M}\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{x}\PYG{o}{*}\PYG{l+m+mf}{1e\PYGZhy{}6}\PYG{p}{)} \PYG{k}{else}\PYG{p}{:} \PYG{n}{s} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}\PYGZob{}:1.0f\PYGZcb{}K}\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{x}\PYG{o}{*}\PYG{l+m+mf}{1e\PYGZhy{}3}\PYG{p}{)} \PYG{k}{return} \PYG{n}{s} \PYG{n}{formatter} \PYG{o}{=} \PYG{n}{FuncFormatter}\PYG{p}{(}\PYG{n}{currency}\PYG{p}{)} \end{sphinxVerbatim} We can then apply this formatter to the labels on our plot. To do this, we’ll use the \sphinxcode{\sphinxupquote{xaxis}} attribute of our axis. This lets you perform actions on a specific axis on our plot. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{6}\PYG{p}{,} \PYG{l+m+mi}{8}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{barh}\PYG{p}{(}\PYG{n}{group\PYGZus{}names}\PYG{p}{,} \PYG{n}{group\PYGZus{}data}\PYG{p}{)} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}xticklabels}\PYG{p}{(}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{setp}\PYG{p}{(}\PYG{n}{labels}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{45}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set}\PYG{p}{(}\PYG{n}{xlim}\PYG{o}{=}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{10000}\PYG{p}{,} \PYG{l+m+mi}{140000}\PYG{p}{]}\PYG{p}{,} \PYG{n}{xlabel}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Total Revenue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ylabel}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Company}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{title}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Company Revenue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}formatter}\PYG{p}{(}\PYG{n}{formatter}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_lifecycle_009}.png} \subsubsection{Combining multiple visualizations} \label{\detokenize{tutorials/introductory/lifecycle:combining-multiple-visualizations}} It is possible to draw multiple plot elements on the same instance of {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axes.Axes}}}}}. To do this we simply need to call another one of the plot methods on that axes object. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{8}\PYG{p}{,} \PYG{l+m+mi}{8}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{barh}\PYG{p}{(}\PYG{n}{group\PYGZus{}names}\PYG{p}{,} \PYG{n}{group\PYGZus{}data}\PYG{p}{)} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}xticklabels}\PYG{p}{(}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{setp}\PYG{p}{(}\PYG{n}{labels}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{45}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Add a vertical line, here we set the style in the function call} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axvline}\PYG{p}{(}\PYG{n}{group\PYGZus{}mean}\PYG{p}{,} \PYG{n}{ls}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Annotate new companies} \PYG{k}{for} \PYG{n}{group} \PYG{o+ow}{in} \PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{8}\PYG{p}{]}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mi}{145000}\PYG{p}{,} \PYG{n}{group}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{New Company}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{10}\PYG{p}{,} \PYG{n}{verticalalignment}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{center}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Now we\PYGZsq{}ll move our title up since it\PYGZsq{}s getting a little cramped} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{title}\PYG{o}{.}\PYG{n}{set}\PYG{p}{(}\PYG{n}{y}\PYG{o}{=}\PYG{l+m+mf}{1.05}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set}\PYG{p}{(}\PYG{n}{xlim}\PYG{o}{=}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{10000}\PYG{p}{,} \PYG{l+m+mi}{140000}\PYG{p}{]}\PYG{p}{,} \PYG{n}{xlabel}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Total Revenue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ylabel}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Company}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{title}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Company Revenue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}formatter}\PYG{p}{(}\PYG{n}{formatter}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xticks}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mf}{25e3}\PYG{p}{,} \PYG{l+m+mf}{50e3}\PYG{p}{,} \PYG{l+m+mf}{75e3}\PYG{p}{,} \PYG{l+m+mf}{100e3}\PYG{p}{,} \PYG{l+m+mf}{125e3}\PYG{p}{]}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{subplots\PYGZus{}adjust}\PYG{p}{(}\PYG{n}{right}\PYG{o}{=}\PYG{o}{.}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_lifecycle_010}.png} \subsubsection{Saving our plot} \label{\detokenize{tutorials/introductory/lifecycle:saving-our-plot}} Now that we’re happy with the outcome of our plot, we want to save it to disk. There are many file formats we can save to in Matplotlib. To see a list of available options, use: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{print}\PYG{p}{(}\PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{get\PYGZus{}supported\PYGZus{}filetypes}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} Out: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYGZob{}\PYGZsq{}ps\PYGZsq{}: \PYGZsq{}Postscript\PYGZsq{}, \PYGZsq{}eps\PYGZsq{}: \PYGZsq{}Encapsulated Postscript\PYGZsq{}, \PYGZsq{}pdf\PYGZsq{}: \PYGZsq{}Portable Document Format\PYGZsq{}, \PYGZsq{}pgf\PYGZsq{}: \PYGZsq{}PGF code for LaTeX\PYGZsq{}, \PYGZsq{}png\PYGZsq{}: \PYGZsq{}Portable Network Graphics\PYGZsq{}, \PYGZsq{}raw\PYGZsq{}: \PYGZsq{}Raw RGBA bitmap\PYGZsq{}, \PYGZsq{}rgba\PYGZsq{}: \PYGZsq{}Raw RGBA bitmap\PYGZsq{}, \PYGZsq{}svg\PYGZsq{}: \PYGZsq{}Scalable Vector Graphics\PYGZsq{}, \PYGZsq{}svgz\PYGZsq{}: \PYGZsq{}Scalable Vector Graphics\PYGZsq{}, \PYGZsq{}jpg\PYGZsq{}: \PYGZsq{}Joint Photographic Experts Group\PYGZsq{}, \PYGZsq{}jpeg\PYGZsq{}: \PYGZsq{}Joint Photographic Experts Group\PYGZsq{}, \PYGZsq{}tif\PYGZsq{}: \PYGZsq{}Tagged Image File Format\PYGZsq{}, \PYGZsq{}tiff\PYGZsq{}: \PYGZsq{}Tagged Image File Format\PYGZsq{}\PYGZcb{} \end{sphinxVerbatim} We can then use the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.savefig}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure.Figure.savefig()}}}}} in order to save the figure to disk. Note that there are several useful flags we’ll show below: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{transparent=True}} makes the background of the saved figure transparent if the format supports it. \item {} \sphinxcode{\sphinxupquote{dpi=80}} controls the resolution (dots per square inch) of the output. \item {} \sphinxcode{\sphinxupquote{bbox\_inches="tight"}} fits the bounds of the figure to our plot. \end{itemize} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} Uncomment this line to save the figure.} \PYG{c+c1}{\PYGZsh{} fig.savefig(\PYGZsq{}sales.png\PYGZsq{}, transparent=False, dpi=80, bbox\PYGZus{}inches=\PYGZdq{}tight\PYGZdq{})} \end{sphinxVerbatim} \phantomsection\label{\detokenize{tutorials/introductory/lifecycle:sphx-glr-download-tutorials-introductory-lifecycle-py}} \section{Intermediate} \label{\detokenize{tutorials/index:intermediate}}\label{\detokenize{tutorials/index:tutorials-intermediate}} These tutorials cover some of the more complicated classes and functions in Matplotlib. They can be useful for particular custom and complex visualizations. \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/intermediate/color_cycle:sphx-glr-download-tutorials-intermediate-color-cycle-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Styling with cycler} \label{\detokenize{tutorials/intermediate/color_cycle:styling-with-cycler}}\label{\detokenize{tutorials/intermediate/color_cycle:sphx-glr-tutorials-intermediate-color-cycle-py}}\label{\detokenize{tutorials/intermediate/color_cycle::doc}} Demo of custom property-cycle settings to control colors and other style properties for multi-line plots. \begin{sphinxadmonition}{note}{Note:} More complete documentation of the \sphinxcode{\sphinxupquote{cycler}} API can be found \sphinxhref{http://matplotlib.org/cycler/}{here}. \end{sphinxadmonition} This example demonstrates two different APIs: \begin{enumerate} \item {} Setting the default rc parameter specifying the property cycle. This affects all subsequent axes (but not axes already created). \item {} Setting the property cycle for a single pair of axes. \end{enumerate} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{cycler} \PYG{k+kn}{import} \PYG{n}{cycler} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \end{sphinxVerbatim} First we’ll generate some sample data, in this case, four offset sine curves. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{,} \PYG{l+m+mi}{50}\PYG{p}{)} \PYG{n}{offsets} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{,} \PYG{n}{endpoint}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{)} \PYG{n}{yy} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{transpose}\PYG{p}{(}\PYG{p}{[}\PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{x} \PYG{o}{+} \PYG{n}{phi}\PYG{p}{)} \PYG{k}{for} \PYG{n}{phi} \PYG{o+ow}{in} \PYG{n}{offsets}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} Now \sphinxcode{\sphinxupquote{yy}} has shape \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{print}\PYG{p}{(}\PYG{n}{yy}\PYG{o}{.}\PYG{n}{shape}\PYG{p}{)} \end{sphinxVerbatim} Out: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] (50, 4) \end{sphinxVerbatim} So \sphinxcode{\sphinxupquote{yy{[}:, i{]}}} will give you the \sphinxcode{\sphinxupquote{i}}-th offset sine curve. Let’s set the default prop\_cycle using {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.rc:matplotlib.pyplot.rc}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.rc()}}}}}. We’ll combine a color cycler and a linestyle cycler by adding (\sphinxcode{\sphinxupquote{+}}) two \sphinxcode{\sphinxupquote{cycler}}’s together. See the bottom of this tutorial for more information about combining different cyclers. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{default\PYGZus{}cycler} \PYG{o}{=} \PYG{n}{cycler}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{y}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \PYGZbs{} \PYG{o}{+} \PYG{n}{cycler}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{:}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}.}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{rc}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{rc}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{prop\PYGZus{}cycle}\PYG{o}{=}\PYG{n}{default\PYGZus{}cycler}\PYG{p}{)} \end{sphinxVerbatim} Now we’ll generate a figure with two axes, one on top of the other. On the first axis, we’ll plot with the default cycler. On the second axis, we’ll set the prop\_cycler using {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_prop_cycle:matplotlib.axes.Axes.set_prop_cycle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_prop\_cycle()}}}}} which will only set the \sphinxcode{\sphinxupquote{prop\_cycle}} for this {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} instance. We’ll use a second \sphinxcode{\sphinxupquote{cycler}} that combines a color cycler and a linewidth cycler. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{custom\PYGZus{}cycler} \PYG{o}{=} \PYG{n}{cycler}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{c}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{m}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{y}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \PYGZbs{} \PYG{o}{+} \PYG{n}{cycler}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lw}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{]}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{p}{(}\PYG{n}{ax0}\PYG{p}{,} \PYG{n}{ax1}\PYG{p}{)} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{nrows}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{ax0}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{yy}\PYG{p}{)} \PYG{n}{ax0}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Set default color cycle to rgby}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{set\PYGZus{}prop\PYGZus{}cycle}\PYG{p}{(}\PYG{n}{custom\PYGZus{}cycler}\PYG{p}{)} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{yy}\PYG{p}{)} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Set axes color cycle to cmyk}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Add a bit more space between the two plots.} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{subplots\PYGZus{}adjust}\PYG{p}{(}\PYG{n}{hspace}\PYG{o}{=}\PYG{l+m+mf}{0.3}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_color_cycle_001}.png} \subsubsection{Setting \sphinxstyleliteralintitle{\sphinxupquote{prop\_cycler}} in the \sphinxstyleliteralintitle{\sphinxupquote{matplotlibrc}} file or style files} \label{\detokenize{tutorials/intermediate/color_cycle:setting-prop-cycler-in-the-matplotlibrc-file-or-style-files}} Remember, if you want to set a custom \sphinxcode{\sphinxupquote{prop\_cycler}} in your \sphinxcode{\sphinxupquote{.matplotlibrc}} file or a style file (\sphinxcode{\sphinxupquote{style.mplstyle}}), you can set the \sphinxcode{\sphinxupquote{axes.prop\_cycle}} property: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{axes}\PYG{o}{.}\PYG{n}{prop\PYGZus{}cycle} \PYG{p}{:} \PYG{n}{cycler}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bgrcmyk}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \subsubsection{Cycling through multiple properties} \label{\detokenize{tutorials/intermediate/color_cycle:cycling-through-multiple-properties}} You can add cyclers: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{cycler} \PYG{k+kn}{import} \PYG{n}{cycler} \PYG{n}{cc} \PYG{o}{=} \PYG{p}{(}\PYG{n}{cycler}\PYG{p}{(}\PYG{n}{color}\PYG{o}{=}\PYG{n+nb}{list}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{rgb}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{)} \PYG{o}{+} \PYG{n}{cycler}\PYG{p}{(}\PYG{n}{linestyle}\PYG{o}{=}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}.}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)}\PYG{p}{)} \PYG{k}{for} \PYG{n}{d} \PYG{o+ow}{in} \PYG{n}{cc}\PYG{p}{:} \PYG{k}{print}\PYG{p}{(}\PYG{n}{d}\PYG{p}{)} \end{sphinxVerbatim} Results in: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}.}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}} \end{sphinxVerbatim} You can multiply cyclers: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{cycler} \PYG{k+kn}{import} \PYG{n}{cycler} \PYG{n}{cc} \PYG{o}{=} \PYG{p}{(}\PYG{n}{cycler}\PYG{p}{(}\PYG{n}{color}\PYG{o}{=}\PYG{n+nb}{list}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{rgb}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{)} \PYG{o}{*} \PYG{n}{cycler}\PYG{p}{(}\PYG{n}{linestyle}\PYG{o}{=}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}.}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)}\PYG{p}{)} \PYG{k}{for} \PYG{n}{d} \PYG{o+ow}{in} \PYG{n}{cc}\PYG{p}{:} \PYG{k}{print}\PYG{p}{(}\PYG{n}{d}\PYG{p}{)} \end{sphinxVerbatim} Results in: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}.}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}.}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}.}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}} \end{sphinxVerbatim} \phantomsection\label{\detokenize{tutorials/intermediate/color_cycle:sphx-glr-download-tutorials-intermediate-color-cycle-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-download-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Legend guide} \label{\detokenize{tutorials/intermediate/legend_guide:legend-guide}}\label{\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}}\label{\detokenize{tutorials/intermediate/legend_guide::doc}} Generating legends flexibly in Matplotlib. This legend guide is an extension of the documentation available at {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.legend:matplotlib.pyplot.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend()}}}}} - please ensure you are familiar with contents of that documentation before proceeding with this guide. This guide makes use of some common terms, which are documented here for clarity: \begin{description} \item[{legend entry\index{legend entry|textbf}\phantomsection\label{\detokenize{tutorials/intermediate/legend_guide:term-legend-entry}}}] \leavevmode A legend is made up of one or more legend entries. An entry is made up of exactly one key and one label. \item[{legend key\index{legend key|textbf}\phantomsection\label{\detokenize{tutorials/intermediate/legend_guide:term-legend-key}}}] \leavevmode The colored/patterned marker to the left of each legend label. \item[{legend label\index{legend label|textbf}\phantomsection\label{\detokenize{tutorials/intermediate/legend_guide:term-legend-label}}}] \leavevmode The text which describes the handle represented by the key. \item[{legend handle\index{legend handle|textbf}\phantomsection\label{\detokenize{tutorials/intermediate/legend_guide:term-legend-handle}}}] \leavevmode The original object which is used to generate an appropriate entry in the legend. \end{description} \subsubsection{Controlling the legend entries} \label{\detokenize{tutorials/intermediate/legend_guide:controlling-the-legend-entries}} Calling {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.legend:matplotlib.pyplot.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend()}}}}} with no arguments automatically fetches the legend handles and their associated labels. This functionality is equivalent to: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{handles}\PYG{p}{,} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}legend\PYGZus{}handles\PYGZus{}labels}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{n}{handles}\PYG{p}{,} \PYG{n}{labels}\PYG{p}{)} \end{sphinxVerbatim} The {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_legend_handles_labels:matplotlib.axes.Axes.get_legend_handles_labels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_legend\_handles\_labels()}}}}} function returns a list of handles/artists which exist on the Axes which can be used to generate entries for the resulting legend - it is worth noting however that not all artists can be added to a legend, at which point a “proxy” will have to be created (see {\hyperref[\detokenize{tutorials/intermediate/legend_guide:proxy-legend-handles}]{\sphinxcrossref{\DUrole{std,std-ref}{Creating artists specifically for adding to the legend (aka. Proxy artists)}}}} for further details). For full control of what is being added to the legend, it is common to pass the appropriate handles directly to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.legend:matplotlib.pyplot.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend()}}}}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{line\PYGZus{}up}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Line 2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{line\PYGZus{}down}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Line 1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{n}{handles}\PYG{o}{=}\PYG{p}{[}\PYG{n}{line\PYGZus{}up}\PYG{p}{,} \PYG{n}{line\PYGZus{}down}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} In some cases, it is not possible to set the label of the handle, so it is possible to pass through the list of labels to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.legend:matplotlib.pyplot.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend()}}}}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{line\PYGZus{}up}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Line 2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{line\PYGZus{}down}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Line 1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{p}{[}\PYG{n}{line\PYGZus{}up}\PYG{p}{,} \PYG{n}{line\PYGZus{}down}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Line Up}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Line Down}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \subsubsection{Creating artists specifically for adding to the legend (aka. Proxy artists)} \label{\detokenize{tutorials/intermediate/legend_guide:creating-artists-specifically-for-adding-to-the-legend-aka-proxy-artists}}\label{\detokenize{tutorials/intermediate/legend_guide:proxy-legend-handles}} Not all handles can be turned into legend entries automatically, so it is often necessary to create an artist which \sphinxstyleemphasis{can}. Legend handles don’t have to exists on the Figure or Axes in order to be used. Suppose we wanted to create a legend which has an entry for some data which is represented by a red color: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.patches} \PYG{k+kn}{as} \PYG{n+nn}{mpatches} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{n}{red\PYGZus{}patch} \PYG{o}{=} \PYG{n}{mpatches}\PYG{o}{.}\PYG{n}{Patch}\PYG{p}{(}\PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{The red data}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{n}{handles}\PYG{o}{=}\PYG{p}{[}\PYG{n}{red\PYGZus{}patch}\PYG{p}{]}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_legend_guide_001}.png} There are many supported legend handles, instead of creating a patch of color we could have created a line with a marker: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.lines} \PYG{k+kn}{as} \PYG{n+nn}{mlines} \PYG{n}{blue\PYGZus{}line} \PYG{o}{=} \PYG{n}{mlines}\PYG{o}{.}\PYG{n}{Line2D}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{blue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{marker}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{*}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{markersize}\PYG{o}{=}\PYG{l+m+mi}{15}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Blue stars}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{n}{handles}\PYG{o}{=}\PYG{p}{[}\PYG{n}{blue\PYGZus{}line}\PYG{p}{]}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_legend_guide_002}.png} \subsubsection{Legend location} \label{\detokenize{tutorials/intermediate/legend_guide:legend-location}} The location of the legend can be specified by the keyword argument \sphinxstyleemphasis{loc}. Please see the documentation at {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.legend:matplotlib.pyplot.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend()}}}}} for more details. The \sphinxcode{\sphinxupquote{bbox\_to\_anchor}} keyword gives a great degree of control for manual legend placement. For example, if you want your axes legend located at the figure’s top right-hand corner instead of the axes’ corner, simply specify the corner’s location, and the coordinate system of that location: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{n}{bbox\PYGZus{}to\PYGZus{}anchor}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{,} \PYG{n}{bbox\PYGZus{}transform}\PYG{o}{=}\PYG{n}{plt}\PYG{o}{.}\PYG{n}{gcf}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{transFigure}\PYG{p}{)} \end{sphinxVerbatim} More examples of custom legend placement: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{211}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{test1}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{test2}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Place a legend above this subplot, expanding itself to} \PYG{c+c1}{\PYGZsh{} fully use the given bounding box.} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{n}{bbox\PYGZus{}to\PYGZus{}anchor}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.}\PYG{p}{,} \PYG{l+m+mf}{1.02}\PYG{p}{,} \PYG{l+m+mf}{1.}\PYG{p}{,} \PYG{o}{.}\PYG{l+m+mi}{102}\PYG{p}{)}\PYG{p}{,} \PYG{n}{loc}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{ncol}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{mode}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{expand}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{borderaxespad}\PYG{o}{=}\PYG{l+m+mf}{0.}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{223}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{test1}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{test2}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Place a legend to the right of this smaller subplot.} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{n}{bbox\PYGZus{}to\PYGZus{}anchor}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{1.05}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{,} \PYG{n}{loc}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{borderaxespad}\PYG{o}{=}\PYG{l+m+mf}{0.}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_legend_guide_003}.png} \subsubsection{Multiple legends on the same Axes} \label{\detokenize{tutorials/intermediate/legend_guide:multiple-legends-on-the-same-axes}} Sometimes it is more clear to split legend entries across multiple legends. Whilst the instinctive approach to doing this might be to call the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.legend:matplotlib.pyplot.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend()}}}}} function multiple times, you will find that only one legend ever exists on the Axes. This has been done so that it is possible to call {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.legend:matplotlib.pyplot.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend()}}}}} repeatedly to update the legend to the latest handles on the Axes, so to persist old legend instances, we must add them manually to the Axes: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{line1}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Line 1}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{linestyle}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{line2}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Line 2}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Create a legend for the first line.} \PYG{n}{first\PYGZus{}legend} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{n}{handles}\PYG{o}{=}\PYG{p}{[}\PYG{n}{line1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{loc}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Add the legend manually to the current Axes.} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{gca}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{add\PYGZus{}artist}\PYG{p}{(}\PYG{n}{first\PYGZus{}legend}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Create another legend for the second line.} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{n}{handles}\PYG{o}{=}\PYG{p}{[}\PYG{n}{line2}\PYG{p}{]}\PYG{p}{,} \PYG{n}{loc}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_legend_guide_004}.png} \subsubsection{Legend Handlers} \label{\detokenize{tutorials/intermediate/legend_guide:legend-handlers}} In order to create legend entries, handles are given as an argument to an appropriate {\hyperref[\detokenize{api/legend_api:matplotlib.legend_handler.HandlerBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{HandlerBase}}}}} subclass. The choice of handler subclass is determined by the following rules: \begin{enumerate} \item {} Update {\hyperref[\detokenize{api/legend_api:matplotlib.legend.Legend.get_legend_handler_map}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_legend\_handler\_map()}}}}} with the value in the \sphinxcode{\sphinxupquote{handler\_map}} keyword. \item {} Check if the \sphinxcode{\sphinxupquote{handle}} is in the newly created \sphinxcode{\sphinxupquote{handler\_map}}. \item {} Check if the type of \sphinxcode{\sphinxupquote{handle}} is in the newly created \sphinxcode{\sphinxupquote{handler\_map}}. \item {} Check if any of the types in the \sphinxcode{\sphinxupquote{handle}}’s mro is in the newly created \sphinxcode{\sphinxupquote{handler\_map}}. \end{enumerate} For completeness, this logic is mostly implemented in {\hyperref[\detokenize{api/legend_api:matplotlib.legend.Legend.get_legend_handler}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_legend\_handler()}}}}}. All of this flexibility means that we have the necessary hooks to implement custom handlers for our own type of legend key. The simplest example of using custom handlers is to instantiate one of the existing {\hyperref[\detokenize{api/legend_api:matplotlib.legend_handler.HandlerBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{HandlerBase}}}}} subclasses. For the sake of simplicity, let’s choose {\hyperref[\detokenize{api/legend_api:matplotlib.legend_handler.HandlerLine2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.legend\_handler.HandlerLine2D}}}}} which accepts a \sphinxcode{\sphinxupquote{numpoints}} argument (note numpoints is a keyword on the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.legend:matplotlib.pyplot.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend()}}}}} function for convenience). We can then pass the mapping of instance to Handler as a keyword to legend. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib.legend\PYGZus{}handler} \PYG{k+kn}{import} \PYG{n}{HandlerLine2D} \PYG{n}{line1}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{marker}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{o}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Line 1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{line2}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{n}{marker}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{o}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Line 2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{n}{handler\PYGZus{}map}\PYG{o}{=}\PYG{p}{\PYGZob{}}\PYG{n}{line1}\PYG{p}{:} \PYG{n}{HandlerLine2D}\PYG{p}{(}\PYG{n}{numpoints}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_legend_guide_005}.png} As you can see, “Line 1” now has 4 marker points, where “Line 2” has 2 (the default). Try the above code, only change the map’s key from \sphinxcode{\sphinxupquote{line1}} to \sphinxcode{\sphinxupquote{type(line1)}}. Notice how now both {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instances get 4 markers. Along with handlers for complex plot types such as errorbars, stem plots and histograms, the default \sphinxcode{\sphinxupquote{handler\_map}} has a special \sphinxcode{\sphinxupquote{tuple}} handler ({\hyperref[\detokenize{api/legend_api:matplotlib.legend_handler.HandlerTuple}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{HandlerTuple}}}}}) which simply plots the handles on top of one another for each item in the given tuple. The following example demonstrates combining two legend keys on top of one another: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{numpy.random} \PYG{k+kn}{import} \PYG{n}{randn} \PYG{n}{z} \PYG{o}{=} \PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)} \PYG{n}{red\PYGZus{}dot}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{z}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{ro}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{markersize}\PYG{o}{=}\PYG{l+m+mi}{15}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Put a white cross over some of the data.} \PYG{n}{white\PYGZus{}cross}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{z}\PYG{p}{[}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{w+}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{markeredgewidth}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{markersize}\PYG{o}{=}\PYG{l+m+mi}{15}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{p}{[}\PYG{n}{red\PYGZus{}dot}\PYG{p}{,} \PYG{p}{(}\PYG{n}{red\PYGZus{}dot}\PYG{p}{,} \PYG{n}{white\PYGZus{}cross}\PYG{p}{)}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Attr A}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Attr A+B}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_legend_guide_006}.png} The {\hyperref[\detokenize{api/legend_api:matplotlib.legend_handler.HandlerTuple}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{HandlerTuple}}}}} class can also be used to assign several legend keys to the same entry: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib.legend\PYGZus{}handler} \PYG{k+kn}{import} \PYG{n}{HandlerLine2D}\PYG{p}{,} \PYG{n}{HandlerTuple} \PYG{n}{p1}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mf}{2.5}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r\PYGZhy{}d}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{p2}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k\PYGZhy{}o}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{l} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{p}{[}\PYG{p}{(}\PYG{n}{p1}\PYG{p}{,} \PYG{n}{p2}\PYG{p}{)}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Two keys}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{n}{numpoints}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{handler\PYGZus{}map}\PYG{o}{=}\PYG{p}{\PYGZob{}}\PYG{n+nb}{tuple}\PYG{p}{:} \PYG{n}{HandlerTuple}\PYG{p}{(}\PYG{n}{ndivide}\PYG{o}{=}\PYG{n+nb+bp}{None}\PYG{p}{)}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_legend_guide_007}.png} \paragraph{Implementing a custom legend handler} \label{\detokenize{tutorials/intermediate/legend_guide:implementing-a-custom-legend-handler}} A custom handler can be implemented to turn any handle into a legend key (handles don’t necessarily need to be matplotlib artists). The handler must implement a “legend\_artist” method which returns a single artist for the legend to use. Signature details about the “legend\_artist” are documented at {\hyperref[\detokenize{api/legend_api:matplotlib.legend_handler.HandlerBase.legend_artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend\_artist()}}}}}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.patches} \PYG{k+kn}{as} \PYG{n+nn}{mpatches} \PYG{k}{class} \PYG{n+nc}{AnyObject}\PYG{p}{(}\PYG{n+nb}{object}\PYG{p}{)}\PYG{p}{:} \PYG{k}{pass} \PYG{k}{class} \PYG{n+nc}{AnyObjectHandler}\PYG{p}{(}\PYG{n+nb}{object}\PYG{p}{)}\PYG{p}{:} \PYG{k}{def} \PYG{n+nf}{legend\PYGZus{}artist}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{legend}\PYG{p}{,} \PYG{n}{orig\PYGZus{}handle}\PYG{p}{,} \PYG{n}{fontsize}\PYG{p}{,} \PYG{n}{handlebox}\PYG{p}{)}\PYG{p}{:} \PYG{n}{x0}\PYG{p}{,} \PYG{n}{y0} \PYG{o}{=} \PYG{n}{handlebox}\PYG{o}{.}\PYG{n}{xdescent}\PYG{p}{,} \PYG{n}{handlebox}\PYG{o}{.}\PYG{n}{ydescent} \PYG{n}{width}\PYG{p}{,} \PYG{n}{height} \PYG{o}{=} \PYG{n}{handlebox}\PYG{o}{.}\PYG{n}{width}\PYG{p}{,} \PYG{n}{handlebox}\PYG{o}{.}\PYG{n}{height} \PYG{n}{patch} \PYG{o}{=} \PYG{n}{mpatches}\PYG{o}{.}\PYG{n}{Rectangle}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x0}\PYG{p}{,} \PYG{n}{y0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{edgecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{black}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{hatch}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{xx}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{handlebox}\PYG{o}{.}\PYG{n}{get\PYGZus{}transform}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{n}{handlebox}\PYG{o}{.}\PYG{n}{add\PYGZus{}artist}\PYG{p}{(}\PYG{n}{patch}\PYG{p}{)} \PYG{k}{return} \PYG{n}{patch} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{p}{[}\PYG{n}{AnyObject}\PYG{p}{(}\PYG{p}{)}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{My first handler}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{n}{handler\PYGZus{}map}\PYG{o}{=}\PYG{p}{\PYGZob{}}\PYG{n}{AnyObject}\PYG{p}{:} \PYG{n}{AnyObjectHandler}\PYG{p}{(}\PYG{p}{)}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_legend_guide_008}.png} Alternatively, had we wanted to globally accept \sphinxcode{\sphinxupquote{AnyObject}} instances without needing to manually set the \sphinxcode{\sphinxupquote{handler\_map}} keyword all the time, we could have registered the new handler with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{legend} \PYG{k}{import} \PYG{n}{Legend} \PYG{n}{Legend}\PYG{o}{.}\PYG{n}{update\PYGZus{}default\PYGZus{}handler\PYGZus{}map}\PYG{p}{(}\PYG{p}{\PYGZob{}}\PYG{n}{AnyObject}\PYG{p}{:} \PYG{n}{AnyObjectHandler}\PYG{p}{(}\PYG{p}{)}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \end{sphinxVerbatim} Whilst the power here is clear, remember that there are already many handlers implemented and what you want to achieve may already be easily possible with existing classes. For example, to produce elliptical legend keys, rather than rectangular ones: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib.legend\PYGZus{}handler} \PYG{k+kn}{import} \PYG{n}{HandlerPatch} \PYG{k}{class} \PYG{n+nc}{HandlerEllipse}\PYG{p}{(}\PYG{n}{HandlerPatch}\PYG{p}{)}\PYG{p}{:} \PYG{k}{def} \PYG{n+nf}{create\PYGZus{}artists}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{legend}\PYG{p}{,} \PYG{n}{orig\PYGZus{}handle}\PYG{p}{,} \PYG{n}{xdescent}\PYG{p}{,} \PYG{n}{ydescent}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{n}{fontsize}\PYG{p}{,} \PYG{n}{trans}\PYG{p}{)}\PYG{p}{:} \PYG{n}{center} \PYG{o}{=} \PYG{l+m+mf}{0.5} \PYG{o}{*} \PYG{n}{width} \PYG{o}{\PYGZhy{}} \PYG{l+m+mf}{0.5} \PYG{o}{*} \PYG{n}{xdescent}\PYG{p}{,} \PYG{l+m+mf}{0.5} \PYG{o}{*} \PYG{n}{height} \PYG{o}{\PYGZhy{}} \PYG{l+m+mf}{0.5} \PYG{o}{*} \PYG{n}{ydescent} \PYG{n}{p} \PYG{o}{=} \PYG{n}{mpatches}\PYG{o}{.}\PYG{n}{Ellipse}\PYG{p}{(}\PYG{n}{xy}\PYG{o}{=}\PYG{n}{center}\PYG{p}{,} \PYG{n}{width}\PYG{o}{=}\PYG{n}{width} \PYG{o}{+} \PYG{n}{xdescent}\PYG{p}{,} \PYG{n}{height}\PYG{o}{=}\PYG{n}{height} \PYG{o}{+} \PYG{n}{ydescent}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{update\PYGZus{}prop}\PYG{p}{(}\PYG{n}{p}\PYG{p}{,} \PYG{n}{orig\PYGZus{}handle}\PYG{p}{,} \PYG{n}{legend}\PYG{p}{)} \PYG{n}{p}\PYG{o}{.}\PYG{n}{set\PYGZus{}transform}\PYG{p}{(}\PYG{n}{trans}\PYG{p}{)} \PYG{k}{return} \PYG{p}{[}\PYG{n}{p}\PYG{p}{]} \PYG{n}{c} \PYG{o}{=} \PYG{n}{mpatches}\PYG{o}{.}\PYG{n}{Circle}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{l+m+mf}{0.25}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{green}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{edgecolor}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{red}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{gca}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{add\PYGZus{}patch}\PYG{p}{(}\PYG{n}{c}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{p}{[}\PYG{n}{c}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{An ellipse, not a rectangle}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{p}{,} \PYG{n}{handler\PYGZus{}map}\PYG{o}{=}\PYG{p}{\PYGZob{}}\PYG{n}{mpatches}\PYG{o}{.}\PYG{n}{Circle}\PYG{p}{:} \PYG{n}{HandlerEllipse}\PYG{p}{(}\PYG{p}{)}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_legend_guide_009}.png} \phantomsection\label{\detokenize{tutorials/intermediate/legend_guide:sphx-glr-download-tutorials-intermediate-legend-guide-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/intermediate/artists:sphx-glr-download-tutorials-intermediate-artists-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Artist tutorial} \label{\detokenize{tutorials/intermediate/artists:artist-tutorial}}\label{\detokenize{tutorials/intermediate/artists:sphx-glr-tutorials-intermediate-artists-py}}\label{\detokenize{tutorials/intermediate/artists::doc}} Using Artist objects to render on the canvas. There are three layers to the matplotlib API. \begin{itemize} \item {} the \sphinxcode{\sphinxupquote{matplotlib.backend\_bases.FigureCanvas}} is the area onto which the figure is drawn \item {} the \sphinxcode{\sphinxupquote{matplotlib.backend\_bases.Renderer}} is the object which knows how to draw on the \sphinxcode{\sphinxupquote{FigureCanvas}} \item {} and the {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.Artist}}}}} is the object that knows how to use a renderer to paint onto the canvas. \end{itemize} The \sphinxcode{\sphinxupquote{FigureCanvas}} and \sphinxcode{\sphinxupquote{Renderer}} handle all the details of talking to user interface toolkits like \sphinxhref{https://www.wxpython.org}{wxPython} or drawing languages like PostScript®, and the \sphinxcode{\sphinxupquote{Artist}} handles all the high level constructs like representing and laying out the figure, text, and lines. The typical user will spend 95\% of their time working with the \sphinxcode{\sphinxupquote{Artists}}. There are two types of \sphinxcode{\sphinxupquote{Artists}}: primitives and containers. The primitives represent the standard graphical objects we want to paint onto our canvas: {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}}, {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}}, {\hyperref[\detokenize{api/image_api:matplotlib.image.AxesImage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AxesImage}}}}}, etc., and the containers are places to put them ({\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}}, {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}). The standard use is to create a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance, use the \sphinxcode{\sphinxupquote{Figure}} to create one or more {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} or \sphinxcode{\sphinxupquote{Subplot}} instances, and use the \sphinxcode{\sphinxupquote{Axes}} instance helper methods to create the primitives. In the example below, we create a \sphinxcode{\sphinxupquote{Figure}} instance using {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figure:matplotlib.pyplot.figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.figure()}}}}}, which is a convenience method for instantiating \sphinxcode{\sphinxupquote{Figure}} instances and connecting them with your user interface or drawing toolkit \sphinxcode{\sphinxupquote{FigureCanvas}}. As we will discuss below, this is not necessary \textendash{} you can work directly with PostScript, PDF Gtk+, or wxPython \sphinxcode{\sphinxupquote{FigureCanvas}} instances, instantiate your \sphinxcode{\sphinxupquote{Figures}} directly and connect them yourselves \textendash{} but since we are focusing here on the \sphinxcode{\sphinxupquote{Artist}} API we’ll let {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pyplot}}}}} handle some of those details for us: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} two rows, one column, first plot} \end{sphinxVerbatim} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} is probably the most important class in the matplotlib API, and the one you will be working with most of the time. This is because the \sphinxcode{\sphinxupquote{Axes}} is the plotting area into which most of the objects go, and the \sphinxcode{\sphinxupquote{Axes}} has many special helper methods ({\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.text:matplotlib.axes.Axes.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hist:matplotlib.axes.Axes.hist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hist()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.imshow:matplotlib.axes.Axes.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow()}}}}}) to create the most common graphics primitives ({\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}}, {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}}, \sphinxcode{\sphinxupquote{Image}}, respectively). These helper methods will take your data (e.g., \sphinxcode{\sphinxupquote{numpy}} arrays and strings) and create primitive \sphinxcode{\sphinxupquote{Artist}} instances as needed (e.g., \sphinxcode{\sphinxupquote{Line2D}}), add them to the relevant containers, and draw them when requested. Most of you are probably familiar with the \sphinxcode{\sphinxupquote{Subplot}}, which is just a special case of an \sphinxcode{\sphinxupquote{Axes}} that lives on a regular rows by columns grid of \sphinxcode{\sphinxupquote{Subplot}} instances. If you want to create an \sphinxcode{\sphinxupquote{Axes}} at an arbitrary location, simply use the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_axes()}}}}} method which takes a list of \sphinxcode{\sphinxupquote{{[}left, bottom, width, height{]}}} values in 0-1 relative figure coordinates: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig2} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig2}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mf}{0.15}\PYG{p}{,} \PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.7}\PYG{p}{,} \PYG{l+m+mf}{0.3}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} Continuing with our example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{n}{t} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{l+m+mf}{0.01}\PYG{p}{)} \PYG{n}{s} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{t}\PYG{p}{)} \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{t}\PYG{p}{,} \PYG{n}{s}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{blue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \end{sphinxVerbatim} In this example, \sphinxcode{\sphinxupquote{ax}} is the \sphinxcode{\sphinxupquote{Axes}} instance created by the \sphinxcode{\sphinxupquote{fig.add\_subplot}} call above (remember \sphinxcode{\sphinxupquote{Subplot}} is just a subclass of \sphinxcode{\sphinxupquote{Axes}}) and when you call \sphinxcode{\sphinxupquote{ax.plot}}, it creates a \sphinxcode{\sphinxupquote{Line2D}} instance and adds it to the \sphinxcode{\sphinxupquote{Axes.lines}} list. In the interactive \sphinxhref{http://ipython.org/}{ipython} session below, you can see that the \sphinxcode{\sphinxupquote{Axes.lines}} list is length one and contains the same line that was returned by the \sphinxcode{\sphinxupquote{line, = ax.plot...}} call: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [101]: }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{lines}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{g+gh}{Out[101]: }\PYG{g+go}{\PYGZlt{}matplotlib.lines.Line2D instance at 0x19a95710\PYGZgt{}} \PYG{g+gp}{In [102]: }\PYG{n}{line} \PYG{g+gh}{Out[102]: }\PYG{g+go}{\PYGZlt{}matplotlib.lines.Line2D instance at 0x19a95710\PYGZgt{}} \end{sphinxVerbatim} If you make subsequent calls to \sphinxcode{\sphinxupquote{ax.plot}} (and the hold state is “on” which is the default) then additional lines will be added to the list. You can remove lines later simply by calling the list methods; either of these will work: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{del} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{lines}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{lines}\PYG{o}{.}\PYG{n}{remove}\PYG{p}{(}\PYG{n}{line}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} one or the other, not both!} \end{sphinxVerbatim} The Axes also has helper methods to configure and decorate the x-axis and y-axis tick, tick labels and axis labels: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{xtext} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{my xdata}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} returns a Text instance} \PYG{n}{ytext} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{my ydata}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} When you call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlabel:matplotlib.axes.Axes.set_xlabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ax.set\_xlabel}}}}}, it passes the information on the {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instance of the {\hyperref[\detokenize{api/axis_api:matplotlib.axis.XAxis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis}}}}}. Each \sphinxcode{\sphinxupquote{Axes}} instance contains an {\hyperref[\detokenize{api/axis_api:matplotlib.axis.XAxis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis}}}}} and a {\hyperref[\detokenize{api/axis_api:matplotlib.axis.YAxis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis}}}}} instance, which handle the layout and drawing of the ticks, tick labels and axis labels. Try creating the figure below. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{subplots\PYGZus{}adjust}\PYG{p}{(}\PYG{n}{top}\PYG{o}{=}\PYG{l+m+mf}{0.8}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{211}\PYG{p}{)} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{volts}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{a sine wave}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{t} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{l+m+mf}{0.01}\PYG{p}{)} \PYG{n}{s} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{t}\PYG{p}{)} \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{t}\PYG{p}{,} \PYG{n}{s}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{blue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Fixing random state for reproducibility} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{19680801}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mf}{0.15}\PYG{p}{,} \PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.7}\PYG{p}{,} \PYG{l+m+mf}{0.3}\PYG{p}{]}\PYG{p}{)} \PYG{n}{n}\PYG{p}{,} \PYG{n}{bins}\PYG{p}{,} \PYG{n}{patches} \PYG{o}{=} \PYG{n}{ax2}\PYG{o}{.}\PYG{n}{hist}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{1000}\PYG{p}{)}\PYG{p}{,} \PYG{l+m+mi}{50}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{yellow}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{edgecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{yellow}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax2}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{time (s)}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_artists_001}.png} \subsubsection{Customizing your objects} \label{\detokenize{tutorials/intermediate/artists:customizing-your-objects}}\label{\detokenize{tutorials/intermediate/artists:customizing-artists}} Every element in the figure is represented by a matplotlib {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}}, and each has an extensive list of properties to configure its appearance. The figure itself contains a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}} exactly the size of the figure, which you can use to set the background color and transparency of the figures. Likewise, each {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} bounding box (the standard white box with black edges in the typical matplotlib plot, has a \sphinxcode{\sphinxupquote{Rectangle}} instance that determines the color, transparency, and other properties of the Axes. These instances are stored as member variables \sphinxcode{\sphinxupquote{Figure.patch}} and \sphinxcode{\sphinxupquote{Axes.patch}} (“Patch” is a name inherited from MATLAB, and is a 2D “patch” of color on the figure, e.g., rectangles, circles and polygons). Every matplotlib \sphinxcode{\sphinxupquote{Artist}} has the following properties \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline alpha & The transparency - a scalar from 0-1 \\ \hline animated & A boolean that is used to facilitate animated drawing \\ \hline axes & The axes that the Artist lives in, possibly None \\ \hline clip\_box & The bounding box that clips the Artist \\ \hline clip\_on & Whether clipping is enabled \\ \hline clip\_path & The path the artist is clipped to \\ \hline contains & A picking function to test whether the artist contains the pick point \\ \hline figure & The figure instance the artist lives in, possibly None \\ \hline label & A text label (e.g., for auto-labeling) \\ \hline picker & A python object that controls object picking \\ \hline transform & The transformation \\ \hline visible & A boolean whether the artist should be drawn \\ \hline zorder & A number which determines the drawing order \\ \hline rasterized & Boolean; Turns vectors into rastergraphics: (for compression \& eps transparency) \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Each of the properties is accessed with an old-fashioned setter or getter (yes we know this irritates Pythonistas and we plan to support direct access via properties or traits but it hasn’t been done yet). For example, to multiply the current alpha by a half: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{a} \PYG{o}{=} \PYG{n}{o}\PYG{o}{.}\PYG{n}{get\PYGZus{}alpha}\PYG{p}{(}\PYG{p}{)} \PYG{n}{o}\PYG{o}{.}\PYG{n}{set\PYGZus{}alpha}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{o}{*}\PYG{n}{a}\PYG{p}{)} \end{sphinxVerbatim} If you want to set a number of properties at once, you can also use the \sphinxcode{\sphinxupquote{set}} method with keyword arguments. For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{o}\PYG{o}{.}\PYG{n}{set}\PYG{p}{(}\PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{n}{zorder}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \end{sphinxVerbatim} If you are working interactively at the python shell, a handy way to inspect the \sphinxcode{\sphinxupquote{Artist}} properties is to use the {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.getp:matplotlib.artist.getp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.getp()}}}}} function (simply \sphinxcode{\sphinxupquote{getp()}} in pylab), which lists the properties and their values. This works for classes derived from \sphinxcode{\sphinxupquote{Artist}} as well, e.g., \sphinxcode{\sphinxupquote{Figure}} and \sphinxcode{\sphinxupquote{Rectangle}}. Here are the \sphinxcode{\sphinxupquote{Figure}} rectangle properties mentioned above: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [149]: }\PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{artist}\PYG{o}{.}\PYG{n}{getp}\PYG{p}{(}\PYG{n}{fig}\PYG{o}{.}\PYG{n}{patch}\PYG{p}{)} \PYG{g+go}{ alpha = 1.0} \PYG{g+go}{ animated = False} \PYG{g+go}{ antialiased or aa = True} \PYG{g+go}{ axes = None} \PYG{g+go}{ clip\PYGZus{}box = None} \PYG{g+go}{ clip\PYGZus{}on = False} \PYG{g+go}{ clip\PYGZus{}path = None} \PYG{g+go}{ contains = None} \PYG{g+go}{ edgecolor or ec = w} \PYG{g+go}{ facecolor or fc = 0.75} \PYG{g+go}{ figure = Figure(8.125x6.125)} \PYG{g+go}{ fill = 1} \PYG{g+go}{ hatch = None} \PYG{g+go}{ height = 1} \PYG{g+go}{ label =} \PYG{g+go}{ linewidth or lw = 1.0} \PYG{g+go}{ picker = None} \PYG{g+go}{ transform = \PYGZlt{}Affine object at 0x134cca84\PYGZgt{}} \PYG{g+go}{ verts = ((0, 0), (0, 1), (1, 1), (1, 0))} \PYG{g+go}{ visible = True} \PYG{g+go}{ width = 1} \PYG{g+go}{ window\PYGZus{}extent = \PYGZlt{}Bbox object at 0x134acbcc\PYGZgt{}} \PYG{g+go}{ x = 0} \PYG{g+go}{ y = 0} \PYG{g+go}{ zorder = 1} \end{sphinxVerbatim} The docstrings for all of the classes also contain the \sphinxcode{\sphinxupquote{Artist}} properties, so you can consult the interactive “help” or the {\hyperref[\detokenize{api/artist_api:artist-api}]{\sphinxcrossref{\DUrole{std,std-ref}{artist Module}}}} for a listing of properties for a given object. \subsubsection{Object containers} \label{\detokenize{tutorials/intermediate/artists:object-containers}}\label{\detokenize{tutorials/intermediate/artists:id1}} Now that we know how to inspect and set the properties of a given object we want to configure, we need to know how to get at that object. As mentioned in the introduction, there are two kinds of objects: primitives and containers. The primitives are usually the things you want to configure (the font of a {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instance, the width of a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}}) although the containers also have some properties as well \textendash{} for example the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} is a container that contains many of the primitives in your plot, but it also has properties like the \sphinxcode{\sphinxupquote{xscale}} to control whether the xaxis is ‘linear’ or ‘log’. In this section we’ll review where the various container objects store the \sphinxcode{\sphinxupquote{Artists}} that you want to get at. \paragraph{Figure container} \label{\detokenize{tutorials/intermediate/artists:figure-container}}\label{\detokenize{tutorials/intermediate/artists:id2}} The top level container \sphinxcode{\sphinxupquote{Artist}} is the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure}}}}}, and it contains everything in the figure. The background of the figure is a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}} which is stored in \sphinxcode{\sphinxupquote{Figure.patch}}. As you add subplots ({\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_subplot()}}}}}) and axes ({\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_axes()}}}}}) to the figure these will be appended to the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure.axes}}}}}. These are also returned by the methods that create them: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [156]: }\PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{g+gp}{In [157]: }\PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{211}\PYG{p}{)} \PYG{g+gp}{In [158]: }\PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.7}\PYG{p}{,} \PYG{l+m+mf}{0.3}\PYG{p}{]}\PYG{p}{)} \PYG{g+gp}{In [159]: }\PYG{n}{ax1} \PYG{g+gh}{Out[159]: }\PYG{g+go}{\PYGZlt{}matplotlib.axes.Subplot instance at 0xd54b26c\PYGZgt{}} \PYG{g+gp}{In [160]: }\PYG{k}{print}\PYG{p}{(}\PYG{n}{fig}\PYG{o}{.}\PYG{n}{axes}\PYG{p}{)} \PYG{g+go}{[\PYGZlt{}matplotlib.axes.Subplot instance at 0xd54b26c\PYGZgt{}, \PYGZlt{}matplotlib.axes.Axes instance at 0xd3f0b2c\PYGZgt{}]} \end{sphinxVerbatim} Because the figure maintains the concept of the “current axes” (see {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.gca}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure.gca}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.sca}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure.sca}}}}}) to support the pylab/pyplot state machine, you should not insert or remove axes directly from the axes list, but rather use the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_subplot()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_axes()}}}}} methods to insert, and the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.delaxes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{delaxes()}}}}} method to delete. You are free however, to iterate over the list of axes or index into it to get access to \sphinxcode{\sphinxupquote{Axes}} instances you want to customize. Here is an example which turns all the axes grids on: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{axes}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{grid}\PYG{p}{(}\PYG{k+kc}{True}\PYG{p}{)} \end{sphinxVerbatim} The figure also has its own text, lines, patches and images, which you can use to add primitives directly. The default coordinate system for the \sphinxcode{\sphinxupquote{Figure}} will simply be in pixels (which is not usually what you want) but you can control this by setting the transform property of the \sphinxcode{\sphinxupquote{Artist}} you are adding to the figure. More useful is “figure coordinates” where (0, 0) is the bottom-left of the figure and (1, 1) is the top-right of the figure which you can obtain by setting the \sphinxcode{\sphinxupquote{Artist}} transform to \sphinxcode{\sphinxupquote{fig.transFigure}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.lines} \PYG{k+kn}{as} \PYG{n+nn}{lines} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{l1} \PYG{o}{=} \PYG{n}{lines}\PYG{o}{.}\PYG{n}{Line2D}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{fig}\PYG{o}{.}\PYG{n}{transFigure}\PYG{p}{,} \PYG{n}{figure}\PYG{o}{=}\PYG{n}{fig}\PYG{p}{)} \PYG{n}{l2} \PYG{o}{=} \PYG{n}{lines}\PYG{o}{.}\PYG{n}{Line2D}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{fig}\PYG{o}{.}\PYG{n}{transFigure}\PYG{p}{,} \PYG{n}{figure}\PYG{o}{=}\PYG{n}{fig}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{lines}\PYG{o}{.}\PYG{n}{extend}\PYG{p}{(}\PYG{p}{[}\PYG{n}{l1}\PYG{p}{,} \PYG{n}{l2}\PYG{p}{]}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_artists_002}.png} Here is a summary of the Artists the figure contains \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Figure attribute &\sphinxstyletheadfamily Description \\ \hline axes & A list of Axes instances (includes Subplot) \\ \hline patch & The Rectangle background \\ \hline images & A list of FigureImages patches - useful for raw pixel display \\ \hline legends & A list of Figure Legend instances (different from Axes.legends) \\ \hline lines & A list of Figure Line2D instances (rarely used, see Axes.lines) \\ \hline patches & A list of Figure patches (rarely used, see Axes.patches) \\ \hline texts & A list Figure Text instances \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \paragraph{Axes container} \label{\detokenize{tutorials/intermediate/artists:axes-container}}\label{\detokenize{tutorials/intermediate/artists:id3}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} is the center of the matplotlib universe \textendash{} it contains the vast majority of all the \sphinxcode{\sphinxupquote{Artists}} used in a figure with many helper methods to create and add these \sphinxcode{\sphinxupquote{Artists}} to itself, as well as helper methods to access and customize the \sphinxcode{\sphinxupquote{Artists}} it contains. Like the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}, it contains a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \sphinxcode{\sphinxupquote{patch}} which is a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}} for Cartesian coordinates and a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Circle:matplotlib.patches.Circle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Circle}}}}} for polar coordinates; this patch determines the shape, background and border of the plotting region: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{rect} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{patch} \PYG{c+c1}{\PYGZsh{} a Rectangle instance} \PYG{n}{rect}\PYG{o}{.}\PYG{n}{set\PYGZus{}facecolor}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{green}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} When you call a plotting method, e.g., the canonical {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot()}}}}} and pass in arrays or lists of values, the method will create a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.lines.Line2D()}}}}} instance, update the line with all the \sphinxcode{\sphinxupquote{Line2D}} properties passed as keyword arguments, add the line to the \sphinxcode{\sphinxupquote{Axes.lines}} container, and returns it to you: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [213]: }\PYG{n}{x}\PYG{p}{,} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{)} \PYG{g+gp}{In [214]: }\PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{blue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \end{sphinxVerbatim} \sphinxcode{\sphinxupquote{plot}} returns a list of lines because you can pass in multiple x, y pairs to plot, and we are unpacking the first element of the length one list into the line variable. The line has been added to the \sphinxcode{\sphinxupquote{Axes.lines}} list: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [229]: }\PYG{k}{print}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{lines}\PYG{p}{)} \PYG{g+go}{[\PYGZlt{}matplotlib.lines.Line2D instance at 0xd378b0c\PYGZgt{}]} \end{sphinxVerbatim} Similarly, methods that create patches, like {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.bar:matplotlib.axes.Axes.bar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bar()}}}}} creates a list of rectangles, will add the patches to the \sphinxcode{\sphinxupquote{Axes.patches}} list: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [233]: }\PYG{n}{n}\PYG{p}{,} \PYG{n}{bins}\PYG{p}{,} \PYG{n}{rectangles} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{hist}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{1000}\PYG{p}{)}\PYG{p}{,} \PYG{l+m+mi}{50}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{yellow}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{g+gp}{In [234]: }\PYG{n}{rectangles} \PYG{g+gh}{Out[234]: }\PYG{g+go}{\PYGZlt{}a list of 50 Patch objects\PYGZgt{}} \PYG{g+gp}{In [235]: }\PYG{k}{print}\PYG{p}{(}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{patches}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} You should not add objects directly to the \sphinxcode{\sphinxupquote{Axes.lines}} or \sphinxcode{\sphinxupquote{Axes.patches}} lists unless you know exactly what you are doing, because the \sphinxcode{\sphinxupquote{Axes}} needs to do a few things when it creates and adds an object. It sets the figure and axes property of the \sphinxcode{\sphinxupquote{Artist}}, as well as the default \sphinxcode{\sphinxupquote{Axes}} transformation (unless a transformation is set). It also inspects the data contained in the \sphinxcode{\sphinxupquote{Artist}} to update the data structures controlling auto-scaling, so that the view limits can be adjusted to contain the plotted data. You can, nonetheless, create objects yourself and add them directly to the \sphinxcode{\sphinxupquote{Axes}} using helper methods like {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.add_line:matplotlib.axes.Axes.add_line}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_line()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.add_patch:matplotlib.axes.Axes.add_patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_patch()}}}}}. Here is an annotated interactive session illustrating what is going on: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [261]: }\PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{g+gp}{In [262]: }\PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{g+go}{\PYGZsh{} create a rectangle instance} \PYG{g+gp}{In [263]: }\PYG{n}{rect} \PYG{o}{=} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{patches}\PYG{o}{.}\PYG{n}{Rectangle}\PYG{p}{(} \PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{,} \PYG{n}{width}\PYG{o}{=}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{n}{height}\PYG{o}{=}\PYG{l+m+mi}{12}\PYG{p}{)} \PYG{g+go}{\PYGZsh{} by default the axes instance is None} \PYG{g+gp}{In [264]: }\PYG{k}{print}\PYG{p}{(}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{get\PYGZus{}axes}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{None} \PYG{g+go}{\PYGZsh{} and the transformation instance is set to the \PYGZdq{}identity transform\PYGZdq{}} \PYG{g+gp}{In [265]: }\PYG{k}{print}\PYG{p}{(}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{get\PYGZus{}transform}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{\PYGZlt{}Affine object at 0x13695544\PYGZgt{}} \PYG{g+go}{\PYGZsh{} now we add the Rectangle to the Axes} \PYG{g+gp}{In [266]: }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{add\PYGZus{}patch}\PYG{p}{(}\PYG{n}{rect}\PYG{p}{)} \PYG{g+go}{\PYGZsh{} and notice that the ax.add\PYGZus{}patch method has set the axes} \PYG{g+go}{\PYGZsh{} instance} \PYG{g+gp}{In [267]: }\PYG{k}{print}\PYG{p}{(}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{get\PYGZus{}axes}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{Axes(0.125,0.1;0.775x0.8)} \PYG{g+go}{\PYGZsh{} and the transformation has been set too} \PYG{g+gp}{In [268]: }\PYG{k}{print}\PYG{p}{(}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{get\PYGZus{}transform}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{\PYGZlt{}Affine object at 0x15009ca4\PYGZgt{}} \PYG{g+go}{\PYGZsh{} the default axes transformation is ax.transData} \PYG{g+gp}{In [269]: }\PYG{k}{print}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{p}{)} \PYG{g+go}{\PYGZlt{}Affine object at 0x15009ca4\PYGZgt{}} \PYG{g+go}{\PYGZsh{} notice that the xlimits of the Axes have not been changed} \PYG{g+gp}{In [270]: }\PYG{k}{print}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}xlim}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{(0.0, 1.0)} \PYG{g+go}{\PYGZsh{} but the data limits have been updated to encompass the rectangle} \PYG{g+gp}{In [271]: }\PYG{k}{print}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{dataLim}\PYG{o}{.}\PYG{n}{bounds}\PYG{p}{)} \PYG{g+go}{(1.0, 1.0, 5.0, 12.0)} \PYG{g+go}{\PYGZsh{} we can manually invoke the auto\PYGZhy{}scaling machinery} \PYG{g+gp}{In [272]: }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{autoscale\PYGZus{}view}\PYG{p}{(}\PYG{p}{)} \PYG{g+go}{\PYGZsh{} and now the xlim are updated to encompass the rectangle} \PYG{g+gp}{In [273]: }\PYG{k}{print}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}xlim}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{(1.0, 6.0)} \PYG{g+go}{\PYGZsh{} we have to manually force a figure draw} \PYG{g+gp}{In [274]: }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} There are many, many \sphinxcode{\sphinxupquote{Axes}} helper methods for creating primitive \sphinxcode{\sphinxupquote{Artists}} and adding them to their respective containers. The table below summarizes a small sampling of them, the kinds of \sphinxcode{\sphinxupquote{Artist}} they create, and where they store them \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily Helper method &\sphinxstyletheadfamily Artist &\sphinxstyletheadfamily Container \\ \hline ax.annotate - text annotations & Annotate & ax.texts \\ \hline ax.bar - bar charts & Rectangle & ax.patches \\ \hline ax.errorbar - error bar plots & Line2D and Rectangle & ax.lines and ax.patches \\ \hline ax.fill - shared area & Polygon & ax.patches \\ \hline ax.hist - histograms & Rectangle & ax.patches \\ \hline ax.imshow - image data & AxesImage & ax.images \\ \hline ax.legend - axes legends & Legend & ax.legends \\ \hline ax.plot - xy plots & Line2D & ax.lines \\ \hline ax.scatter - scatter charts & PolygonCollection & ax.collections \\ \hline ax.text - text & Text & ax.texts \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} In addition to all of these \sphinxcode{\sphinxupquote{Artists}}, the \sphinxcode{\sphinxupquote{Axes}} contains two important \sphinxcode{\sphinxupquote{Artist}} containers: the {\hyperref[\detokenize{api/axis_api:matplotlib.axis.XAxis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis}}}}} and {\hyperref[\detokenize{api/axis_api:matplotlib.axis.YAxis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis}}}}}, which handle the drawing of the ticks and labels. These are stored as instance variables \sphinxcode{\sphinxupquote{xaxis}} and \sphinxcode{\sphinxupquote{yaxis}}. The \sphinxcode{\sphinxupquote{XAxis}} and \sphinxcode{\sphinxupquote{YAxis}} containers will be detailed below, but note that the \sphinxcode{\sphinxupquote{Axes}} contains many helper methods which forward calls on to the {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} instances so you often do not need to work with them directly unless you want to. For example, you can set the font color of the \sphinxcode{\sphinxupquote{XAxis}} ticklabels using the \sphinxcode{\sphinxupquote{Axes}} helper method: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{for} \PYG{n}{label} \PYG{o+ow}{in} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}xticklabels}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{label}\PYG{o}{.}\PYG{n}{set\PYGZus{}color}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{orange}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} Below is a summary of the Artists that the Axes contains \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Axes attribute &\sphinxstyletheadfamily Description \\ \hline artists & A list of Artist instances \\ \hline patch & Rectangle instance for Axes background \\ \hline collections & A list of Collection instances \\ \hline images & A list of AxesImage \\ \hline legends & A list of Legend instances \\ \hline lines & A list of Line2D instances \\ \hline patches & A list of Patch instances \\ \hline texts & A list of Text instances \\ \hline xaxis & matplotlib.axis.XAxis instance \\ \hline yaxis & matplotlib.axis.YAxis instance \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \paragraph{Axis containers} \label{\detokenize{tutorials/intermediate/artists:axis-containers}}\label{\detokenize{tutorials/intermediate/artists:axis-container}} The {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axis.Axis}}}}} instances handle the drawing of the tick lines, the grid lines, the tick labels and the axis label. You can configure the left and right ticks separately for the y-axis, and the upper and lower ticks separately for the x-axis. The \sphinxcode{\sphinxupquote{Axis}} also stores the data and view intervals used in auto-scaling, panning and zooming, as well as the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Locator}}}}} and {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Formatter}}}}} instances which control where the ticks are placed and how they are represented as strings. Each \sphinxcode{\sphinxupquote{Axis}} object contains a \sphinxcode{\sphinxupquote{label}} attribute (this is what \sphinxcode{\sphinxupquote{pylab}} modifies in calls to \sphinxcode{\sphinxupquote{xlabel()}} and \sphinxcode{\sphinxupquote{ylabel()}}) as well as a list of major and minor ticks. The ticks are {\hyperref[\detokenize{api/axis_api:matplotlib.axis.XTick}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick}}}}} and {\hyperref[\detokenize{api/axis_api:matplotlib.axis.YTick}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick}}}}} instances, which contain the actual line and text primitives that render the ticks and ticklabels. Because the ticks are dynamically created as needed (e.g., when panning and zooming), you should access the lists of major and minor ticks through their accessor methods {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_major_ticks:matplotlib.axis.Axis.get_major_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_major\_ticks()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minor_ticks:matplotlib.axis.Axis.get_minor_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_minor\_ticks()}}}}}. Although the ticks contain all the primitives and will be covered below, \sphinxcode{\sphinxupquote{Axis}} instances have accessor methods that return the tick lines, tick labels, tick locations etc.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{axis} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis} \PYG{n}{axis}\PYG{o}{.}\PYG{n}{get\PYGZus{}ticklocs}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_artists_003}.png} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{axis}\PYG{o}{.}\PYG{n}{get\PYGZus{}ticklabels}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \begin{description} \item[{note there are twice as many ticklines as labels because by}] \leavevmode default there are tick lines at the top and bottom but only tick labels below the xaxis; this can be customized \end{description} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{axis}\PYG{o}{.}\PYG{n}{get\PYGZus{}ticklines}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} by default you get the major ticks back \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{axis}\PYG{o}{.}\PYG{n}{get\PYGZus{}ticklines}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} but you can also ask for the minor ticks \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{axis}\PYG{o}{.}\PYG{n}{get\PYGZus{}ticklines}\PYG{p}{(}\PYG{n}{minor}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Here is a summary of some of the useful accessor methods of the {}`{}`Axis{}`{}`} \PYG{c+c1}{\PYGZsh{} (these have corresponding setters where useful, such as} \PYG{c+c1}{\PYGZsh{} set\PYGZus{}major\PYGZus{}formatter)} \PYG{c+c1}{\PYGZsh{}} \PYG{c+c1}{\PYGZsh{} ====================== =========================================================} \PYG{c+c1}{\PYGZsh{} Accessor method Description} \PYG{c+c1}{\PYGZsh{} ====================== =========================================================} \PYG{c+c1}{\PYGZsh{} get\PYGZus{}scale The scale of the axis, e.g., \PYGZsq{}log\PYGZsq{} or \PYGZsq{}linear\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} get\PYGZus{}view\PYGZus{}interval The interval instance of the axis view limits} \PYG{c+c1}{\PYGZsh{} get\PYGZus{}data\PYGZus{}interval The interval instance of the axis data limits} \PYG{c+c1}{\PYGZsh{} get\PYGZus{}gridlines A list of grid lines for the Axis} \PYG{c+c1}{\PYGZsh{} get\PYGZus{}label The axis label \PYGZhy{} a Text instance} \PYG{c+c1}{\PYGZsh{} get\PYGZus{}ticklabels A list of Text instances \PYGZhy{} keyword minor=True\textbar{}False} \PYG{c+c1}{\PYGZsh{} get\PYGZus{}ticklines A list of Line2D instances \PYGZhy{} keyword minor=True\textbar{}False} \PYG{c+c1}{\PYGZsh{} get\PYGZus{}ticklocs A list of Tick locations \PYGZhy{} keyword minor=True\textbar{}False} \PYG{c+c1}{\PYGZsh{} get\PYGZus{}major\PYGZus{}locator The matplotlib.ticker.Locator instance for major ticks} \PYG{c+c1}{\PYGZsh{} get\PYGZus{}major\PYGZus{}formatter The matplotlib.ticker.Formatter instance for major ticks} \PYG{c+c1}{\PYGZsh{} get\PYGZus{}minor\PYGZus{}locator The matplotlib.ticker.Locator instance for minor ticks} \PYG{c+c1}{\PYGZsh{} get\PYGZus{}minor\PYGZus{}formatter The matplotlib.ticker.Formatter instance for minor ticks} \PYG{c+c1}{\PYGZsh{} get\PYGZus{}major\PYGZus{}ticks A list of Tick instances for major ticks} \PYG{c+c1}{\PYGZsh{} get\PYGZus{}minor\PYGZus{}ticks A list of Tick instances for minor ticks} \PYG{c+c1}{\PYGZsh{} grid Turn the grid on or off for the major or minor ticks} \PYG{c+c1}{\PYGZsh{} ====================== =========================================================} \PYG{c+c1}{\PYGZsh{}} \PYG{c+c1}{\PYGZsh{} Here is an example, not recommended for its beauty, which customizes} \PYG{c+c1}{\PYGZsh{} the axes and tick properties} \PYG{c+c1}{\PYGZsh{} plt.figure creates a matplotlib.figure.Figure instance} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{rect} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{patch} \PYG{c+c1}{\PYGZsh{} a rectangle instance} \PYG{n}{rect}\PYG{o}{.}\PYG{n}{set\PYGZus{}facecolor}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lightgoldenrodyellow}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.3}\PYG{p}{,} \PYG{l+m+mf}{0.4}\PYG{p}{,} \PYG{l+m+mf}{0.4}\PYG{p}{]}\PYG{p}{)} \PYG{n}{rect} \PYG{o}{=} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{patch} \PYG{n}{rect}\PYG{o}{.}\PYG{n}{set\PYGZus{}facecolor}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lightslategray}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k}{for} \PYG{n}{label} \PYG{o+ow}{in} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{get\PYGZus{}ticklabels}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} label is a Text instance} \PYG{n}{label}\PYG{o}{.}\PYG{n}{set\PYGZus{}color}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{label}\PYG{o}{.}\PYG{n}{set\PYGZus{}rotation}\PYG{p}{(}\PYG{l+m+mi}{45}\PYG{p}{)} \PYG{n}{label}\PYG{o}{.}\PYG{n}{set\PYGZus{}fontsize}\PYG{p}{(}\PYG{l+m+mi}{16}\PYG{p}{)} \PYG{k}{for} \PYG{n}{line} \PYG{o+ow}{in} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{yaxis}\PYG{o}{.}\PYG{n}{get\PYGZus{}ticklines}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} line is a Line2D instance} \PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}color}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{green}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}markersize}\PYG{p}{(}\PYG{l+m+mi}{25}\PYG{p}{)} \PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}markeredgewidth}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_artists_004}.png} \paragraph{Tick containers} \label{\detokenize{tutorials/intermediate/artists:tick-containers}}\label{\detokenize{tutorials/intermediate/artists:tick-container}} The {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Tick}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axis.Tick}}}}} is the final container object in our descent from the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} to the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} to the {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} to the {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Tick}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick}}}}}. The \sphinxcode{\sphinxupquote{Tick}} contains the tick and grid line instances, as well as the label instances for the upper and lower ticks. Each of these is accessible directly as an attribute of the \sphinxcode{\sphinxupquote{Tick}}. In addition, there are boolean variables that determine whether the upper labels and ticks are on for the x-axis and whether the right labels and ticks are on for the y-axis. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Tick attribute &\sphinxstyletheadfamily Description \\ \hline tick1line & Line2D instance \\ \hline tick2line & Line2D instance \\ \hline gridline & Line2D instance \\ \hline label1 & Text instance \\ \hline label2 & Text instance \\ \hline gridOn & boolean which determines whether to draw the gridline \\ \hline tick1On & boolean which determines whether to draw the 1st tickline \\ \hline tick2On & boolean which determines whether to draw the 2nd tickline \\ \hline label1On & boolean which determines whether to draw the 1st tick label \\ \hline label2On & boolean which determines whether to draw the 2nd tick label \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Here is an example which sets the formatter for the right side ticks with dollar signs and colors them green on the right side of the yaxis \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.ticker} \PYG{k+kn}{as} \PYG{n+nn}{ticker} \PYG{c+c1}{\PYGZsh{} Fixing random state for reproducibility} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{19680801}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{20}\PYG{p}{)}\PYG{p}{)} \PYG{n}{formatter} \PYG{o}{=} \PYG{n}{ticker}\PYG{o}{.}\PYG{n}{FormatStrFormatter}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+si}{\PYGZpc{}1.2f}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{yaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}formatter}\PYG{p}{(}\PYG{n}{formatter}\PYG{p}{)} \PYG{k}{for} \PYG{n}{tick} \PYG{o+ow}{in} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{yaxis}\PYG{o}{.}\PYG{n}{get\PYGZus{}major\PYGZus{}ticks}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{tick}\PYG{o}{.}\PYG{n}{label1On} \PYG{o}{=} \PYG{n+nb+bp}{False} \PYG{n}{tick}\PYG{o}{.}\PYG{n}{label2On} \PYG{o}{=} \PYG{n+nb+bp}{True} \PYG{n}{tick}\PYG{o}{.}\PYG{n}{label2}\PYG{o}{.}\PYG{n}{set\PYGZus{}color}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{green}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_artists_005}.png} \phantomsection\label{\detokenize{tutorials/intermediate/artists:sphx-glr-download-tutorials-intermediate-artists-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/intermediate/gridspec:sphx-glr-download-tutorials-intermediate-gridspec-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Customizing Figure Layouts Using GridSpec and Other Functions} \label{\detokenize{tutorials/intermediate/gridspec:customizing-figure-layouts-using-gridspec-and-other-functions}}\label{\detokenize{tutorials/intermediate/gridspec:sphx-glr-tutorials-intermediate-gridspec-py}}\label{\detokenize{tutorials/intermediate/gridspec::doc}} How to create grid-shaped combinations of axes. \begin{quote} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots:matplotlib.pyplot.subplots}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots()}}}}}}] \leavevmode Perhaps the primary function used to create figures and axes. It’s also similar to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot:matplotlib.pyplot.subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot()}}}}}, but creates and places all axes on the figure at once. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpec}}}}}}] \leavevmode Specifies the geometry of the grid that a subplot will be placed. The number of rows and number of columns of the grid need to be set. Optionally, the subplot layout parameters (e.g., left, right, etc.) can be tuned. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.SubplotSpec:matplotlib.gridspec.SubplotSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SubplotSpec}}}}}}] \leavevmode Specifies the location of the subplot in the given \sphinxstyleemphasis{GridSpec}. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot2grid:matplotlib.pyplot.subplot2grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot2grid()}}}}}}] \leavevmode A helper function that is similar to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot:matplotlib.pyplot.subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot()}}}}}, but uses 0-based indexing and let subplot to occupy multiple cells. This function is not covered in this tutorial. \end{description} \end{quote} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.gridspec} \PYG{k+kn}{as} \PYG{n+nn}{gridspec} \end{sphinxVerbatim} \subsubsection{Basic Quickstart Guide} \label{\detokenize{tutorials/intermediate/gridspec:basic-quickstart-guide}} These first two examples show how to create a basic 4-by-4 grid using both {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots:matplotlib.pyplot.subplots}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots()}}}}} and {\hyperref[\detokenize{api/gridspec_api:module-matplotlib.gridspec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gridspec}}}}}. Using {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots:matplotlib.pyplot.subplots}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots()}}}}} is quite simple. It returns a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance and an array of {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} objects. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig1}\PYG{p}{,} \PYG{n}{f1\PYGZus{}axes} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{ncols}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{nrows}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{fig1}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_gridspec_001}.png} For a simple use case such as this, {\hyperref[\detokenize{api/gridspec_api:module-matplotlib.gridspec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gridspec}}}}} is perhaps overly verbose. You have to create the figure and {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpec}}}}} instance separately, then pass elements of gridspec instance to the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_subplot()}}}}} method to create the axes objects. The elements of the gridspec are accessed in generally the same manner as numpy arrays. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig2} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{spec2} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{n}{ncols}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{nrows}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{f2\PYGZus{}ax1} \PYG{o}{=} \PYG{n}{fig2}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{spec2}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{f2\PYGZus{}ax2} \PYG{o}{=} \PYG{n}{fig2}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{spec2}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{f2\PYGZus{}ax3} \PYG{o}{=} \PYG{n}{fig2}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{spec2}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{f2\PYGZus{}ax4} \PYG{o}{=} \PYG{n}{fig2}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{spec2}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{fig2}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_gridspec_002}.png} When you want to have subplots of different sizes, however, {\hyperref[\detokenize{api/gridspec_api:module-matplotlib.gridspec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gridspec}}}}} becomes indispensable and provides a couple of options. The method shown here initializes a uniform grid specification, and then uses typical numpy indexing and slices to allocate multiple “cells” for a given subplot. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig3} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{spec3} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{n}{ncols}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{nrows}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{)} \PYG{n}{anno\PYGZus{}opts} \PYG{o}{=} \PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xycoords}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes fraction}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig3}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{spec3}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{GridSpec[0, 0]}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{anno\PYGZus{}opts}\PYG{p}{)} \PYG{n}{fig3}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{spec3}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{]}\PYG{p}{)}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{GridSpec[0, 1:]}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{anno\PYGZus{}opts}\PYG{p}{)} \PYG{n}{fig3}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{spec3}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{GridSpec[1:, 0]}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{anno\PYGZus{}opts}\PYG{p}{)} \PYG{n}{fig3}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{spec3}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{]}\PYG{p}{)}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{GridSpec[1:, 1:]}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{anno\PYGZus{}opts}\PYG{p}{)} \PYG{n}{fig3}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_gridspec_003}.png} Other option is to use the \sphinxcode{\sphinxupquote{width\_ratios}} and \sphinxcode{\sphinxupquote{height\_ratios}} parameters. These keyword arguments are lists of numbers. Note that absolute values are meaningless, only their relative ratios matter. That means that \sphinxcode{\sphinxupquote{width\_ratios={[}2, 4, 8{]}}} is equivalent to \sphinxcode{\sphinxupquote{width\_ratios={[}1, 2, 4{]}}} within equally wide figures. For the sake of demonstration, we’ll blindly create the axes within \sphinxcode{\sphinxupquote{for}} loops since we won’t need them later. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig4} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{widths} \PYG{o}{=} \PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mf}{1.5}\PYG{p}{]} \PYG{n}{heights} \PYG{o}{=} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{]} \PYG{n}{spec4} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{n}{ncols}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{nrows}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{width\PYGZus{}ratios}\PYG{o}{=}\PYG{n}{widths}\PYG{p}{,} \PYG{n}{height\PYGZus{}ratios}\PYG{o}{=}\PYG{n}{heights}\PYG{p}{)} \PYG{k}{for} \PYG{n}{row} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{:} \PYG{k}{for} \PYG{n}{col} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig4}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{spec4}\PYG{p}{[}\PYG{n}{row}\PYG{p}{,} \PYG{n}{col}\PYG{p}{]}\PYG{p}{)} \PYG{n}{label} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Width: \PYGZob{}\PYGZcb{}}\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s1}{Height: \PYGZob{}\PYGZcb{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{widths}\PYG{p}{[}\PYG{n}{col}\PYG{p}{]}\PYG{p}{,} \PYG{n}{heights}\PYG{p}{[}\PYG{n}{row}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{n}{label}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xycoords}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes fraction}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig4}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_gridspec_004}.png} Learning to use \sphinxcode{\sphinxupquote{width\_ratios}} and \sphinxcode{\sphinxupquote{height\_ratios}} is particularly useful since the top-level function {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots:matplotlib.pyplot.subplots}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots()}}}}} accepts them within the \sphinxcode{\sphinxupquote{gridspec\_kw}} parameter. For that matter, any parameter accepted by {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpec}}}}} can be passed to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots:matplotlib.pyplot.subplots}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots()}}}}} via the \sphinxcode{\sphinxupquote{gridspec\_kw}} parameter. This example recreates the previous figure without directly using a gridspec instance. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{gs\PYGZus{}kw} \PYG{o}{=} \PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{width\PYGZus{}ratios}\PYG{o}{=}\PYG{n}{widths}\PYG{p}{,} \PYG{n}{height\PYGZus{}ratios}\PYG{o}{=}\PYG{n}{heights}\PYG{p}{)} \PYG{n}{fig5}\PYG{p}{,} \PYG{n}{f5\PYGZus{}axes} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{ncols}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{nrows}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{gridspec\PYGZus{}kw}\PYG{o}{=}\PYG{n}{gs\PYGZus{}kw}\PYG{p}{)} \PYG{k}{for} \PYG{n}{r}\PYG{p}{,} \PYG{n}{row} \PYG{o+ow}{in} \PYG{n+nb}{enumerate}\PYG{p}{(}\PYG{n}{f5\PYGZus{}axes}\PYG{p}{)}\PYG{p}{:} \PYG{k}{for} \PYG{n}{c}\PYG{p}{,} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n+nb}{enumerate}\PYG{p}{(}\PYG{n}{row}\PYG{p}{)}\PYG{p}{:} \PYG{n}{label} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Width: \PYGZob{}\PYGZcb{}}\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s1}{Height: \PYGZob{}\PYGZcb{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{widths}\PYG{p}{[}\PYG{n}{c}\PYG{p}{]}\PYG{p}{,} \PYG{n}{heights}\PYG{p}{[}\PYG{n}{r}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{n}{label}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xycoords}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes fraction}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig5}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_gridspec_005}.png} \subsubsection{Fine Adjustments to a Gridspec Layout} \label{\detokenize{tutorials/intermediate/gridspec:fine-adjustments-to-a-gridspec-layout}} When a GridSpec is explicitly used, you can adjust the layout parameters of subplots that are created from the GridSpec. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{gs1} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{n}{nrows}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{ncols}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{left}\PYG{o}{=}\PYG{l+m+mf}{0.05}\PYG{p}{,} \PYG{n}{right}\PYG{o}{=}\PYG{l+m+mf}{0.48}\PYG{p}{,} \PYG{n}{wspace}\PYG{o}{=}\PYG{l+m+mf}{0.05}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{p}{:}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{p}{:}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{p}{:}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax3} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_gridspec_006}.png} This is similar to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots_adjust:matplotlib.pyplot.subplots_adjust}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots\_adjust()}}}}}, but it only affects the subplots that are created from the given GridSpec. For example, compare the left and right sides of this figure: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{gs1} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{n}{nrows}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{ncols}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{left}\PYG{o}{=}\PYG{l+m+mf}{0.05}\PYG{p}{,} \PYG{n}{right}\PYG{o}{=}\PYG{l+m+mf}{0.48}\PYG{p}{,} \PYG{n}{wspace}\PYG{o}{=}\PYG{l+m+mf}{0.05}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{p}{:}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{p}{:}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{p}{:}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax3} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{gs2} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{n}{nrows}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{ncols}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{left}\PYG{o}{=}\PYG{l+m+mf}{0.55}\PYG{p}{,} \PYG{n}{right}\PYG{o}{=}\PYG{l+m+mf}{0.98}\PYG{p}{,} \PYG{n}{hspace}\PYG{o}{=}\PYG{l+m+mf}{0.05}\PYG{p}{)} \PYG{n}{ax4} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs2}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{p}{:}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax5} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs2}\PYG{p}{[}\PYG{p}{:}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax6} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs2}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_gridspec_007}.png} \subsubsection{GridSpec using SubplotSpec} \label{\detokenize{tutorials/intermediate/gridspec:gridspec-using-subplotspec}} You can create GridSpec from the {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.SubplotSpec:matplotlib.gridspec.SubplotSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SubplotSpec}}}}}, in which case its layout parameters are set to that of the location of the given SubplotSpec. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{gs0} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{gs00} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpecFromSubplotSpec}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{subplot\PYGZus{}spec}\PYG{o}{=}\PYG{n}{gs0}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{gs01} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpecFromSubplotSpec}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{subplot\PYGZus{}spec}\PYG{o}{=}\PYG{n}{gs0}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{k}{for} \PYG{n}{a} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{:} \PYG{k}{for} \PYG{n}{b} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{:} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs00}\PYG{p}{[}\PYG{n}{a}\PYG{p}{,} \PYG{n}{b}\PYG{p}{]}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs01}\PYG{p}{[}\PYG{n}{b}\PYG{p}{,} \PYG{n}{a}\PYG{p}{]}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_gridspec_008}.png} \subsubsection{A Complex Nested GridSpec using SubplotSpec} \label{\detokenize{tutorials/intermediate/gridspec:a-complex-nested-gridspec-using-subplotspec}} Here’s a more sophisticated example of nested GridSpec where we put a box around each cell of the outer 4x4 grid, by hiding appropriate spines in each of the inner 3x3 grids. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{from} \PYG{n+nn}{itertools} \PYG{k+kn}{import} \PYG{n}{product} \PYG{k}{def} \PYG{n+nf}{squiggle\PYGZus{}xy}\PYG{p}{(}\PYG{n}{a}\PYG{p}{,} \PYG{n}{b}\PYG{p}{,} \PYG{n}{c}\PYG{p}{,} \PYG{n}{d}\PYG{p}{,} \PYG{n}{i}\PYG{o}{=}\PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{,} \PYG{l+m+mf}{0.05}\PYG{p}{)}\PYG{p}{)}\PYG{p}{:} \PYG{k}{return} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{i}\PYG{o}{*}\PYG{n}{a}\PYG{p}{)}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{cos}\PYG{p}{(}\PYG{n}{i}\PYG{o}{*}\PYG{n}{b}\PYG{p}{)}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{i}\PYG{o}{*}\PYG{n}{c}\PYG{p}{)}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{cos}\PYG{p}{(}\PYG{n}{i}\PYG{o}{*}\PYG{n}{d}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{8}\PYG{p}{,} \PYG{l+m+mi}{8}\PYG{p}{)}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} gridspec inside gridspec} \PYG{n}{outer\PYGZus{}grid} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{,} \PYG{n}{wspace}\PYG{o}{=}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{n}{hspace}\PYG{o}{=}\PYG{l+m+mf}{0.0}\PYG{p}{)} \PYG{k}{for} \PYG{n}{i} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{16}\PYG{p}{)}\PYG{p}{:} \PYG{n}{inner\PYGZus{}grid} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpecFromSubplotSpec}\PYG{p}{(} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{subplot\PYGZus{}spec}\PYG{o}{=}\PYG{n}{outer\PYGZus{}grid}\PYG{p}{[}\PYG{n}{i}\PYG{p}{]}\PYG{p}{,} \PYG{n}{wspace}\PYG{o}{=}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{n}{hspace}\PYG{o}{=}\PYG{l+m+mf}{0.0}\PYG{p}{)} \PYG{n}{a}\PYG{p}{,} \PYG{n}{b} \PYG{o}{=} \PYG{n+nb}{int}\PYG{p}{(}\PYG{n}{i}\PYG{o}{/}\PYG{l+m+mi}{4}\PYG{p}{)}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{i} \PYG{o}{\PYGZpc{}} \PYG{l+m+mi}{4}\PYG{o}{+}\PYG{l+m+mi}{1} \PYG{k}{for} \PYG{n}{j}\PYG{p}{,} \PYG{p}{(}\PYG{n}{c}\PYG{p}{,} \PYG{n}{d}\PYG{p}{)} \PYG{o+ow}{in} \PYG{n+nb}{enumerate}\PYG{p}{(}\PYG{n}{product}\PYG{p}{(}\PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{,} \PYG{n}{repeat}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{Subplot}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{inner\PYGZus{}grid}\PYG{p}{[}\PYG{n}{j}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{o}{*}\PYG{n}{squiggle\PYGZus{}xy}\PYG{p}{(}\PYG{n}{a}\PYG{p}{,} \PYG{n}{b}\PYG{p}{,} \PYG{n}{c}\PYG{p}{,} \PYG{n}{d}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xticks}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}yticks}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \PYG{n}{all\PYGZus{}axes} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{get\PYGZus{}axes}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} show only the outside spines} \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{all\PYGZus{}axes}\PYG{p}{:} \PYG{k}{for} \PYG{n}{sp} \PYG{o+ow}{in} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{spines}\PYG{o}{.}\PYG{n}{values}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{sp}\PYG{o}{.}\PYG{n}{set\PYGZus{}visible}\PYG{p}{(}\PYG{n+nb+bp}{False}\PYG{p}{)} \PYG{k}{if} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{is\PYGZus{}first\PYGZus{}row}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{spines}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{top}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}visible}\PYG{p}{(}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{k}{if} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{is\PYGZus{}last\PYGZus{}row}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{spines}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bottom}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}visible}\PYG{p}{(}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{k}{if} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{is\PYGZus{}first\PYGZus{}col}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{spines}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{left}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}visible}\PYG{p}{(}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{k}{if} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{is\PYGZus{}last\PYGZus{}col}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{spines}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}visible}\PYG{p}{(}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_gridspec_009}.png} \sphinxstylestrong{Total running time of the script:} ( 0 minutes 1.834 seconds) \phantomsection\label{\detokenize{tutorials/intermediate/gridspec:sphx-glr-download-tutorials-intermediate-gridspec-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-download-tutorials-intermediate-tight-layout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Tight Layout guide} \label{\detokenize{tutorials/intermediate/tight_layout_guide:tight-layout-guide}}\label{\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-tutorials-intermediate-tight-layout-guide-py}}\label{\detokenize{tutorials/intermediate/tight_layout_guide::doc}} How to use tight-layout to fit plots within your figure cleanly. \sphinxstyleemphasis{tight\_layout} automatically adjusts subplot params so that the subplot(s) fits in to the figure area. This is an experimental feature and may not work for some cases. It only checks the extents of ticklabels, axis labels, and titles. \subsubsection{Simple Example} \label{\detokenize{tutorials/intermediate/tight_layout_guide:simple-example}} In matplotlib, the location of axes (including subplots) are specified in normalized figure coordinates. It can happen that your axis labels or titles (or sometimes even ticklabels) go outside the figure area, and are thus clipped. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} sphinx\PYGZus{}gallery\PYGZus{}thumbnail\PYGZus{}number = 7} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{savefig.facecolor}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{0.8}\PYG{l+s+s2}{\PYGZdq{}} \PYG{k}{def} \PYG{n+nf}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{12}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{locator\PYGZus{}params}\PYG{p}{(}\PYG{n}{nbins}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{x\PYGZhy{}label}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{n}{fontsize}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{y\PYGZhy{}label}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{n}{fontsize}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Title}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{n}{fontsize}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{close}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{all}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{24}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_tight_layout_guide_001}.png} To prevent this, the location of axes needs to be adjusted. For subplots, this can be done by adjusting the subplot params ({\hyperref[\detokenize{faq/howto_faq:howto-subplots-adjust}]{\sphinxcrossref{\DUrole{std,std-ref}{Move the edge of an axes to make room for tick labels}}}}). Matplotlib v1.1 introduces a new command {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tight_layout:matplotlib.pyplot.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout()}}}}} that does this automatically for you. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{24}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_tight_layout_guide_002}.png} Note that {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tight_layout:matplotlib.pyplot.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.tight\_layout()}}}}} will only adjust the subplot params when it is called. In order to perform this adjustment each time the figure is redrawn, you can call \sphinxcode{\sphinxupquote{fig.set\_tight\_layout(True)}}, or, equivalently, set the \sphinxcode{\sphinxupquote{figure.autolayout}} rcParam to \sphinxcode{\sphinxupquote{True}}. When you have multiple subplots, often you see labels of different axes overlapping each other. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{close}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{all}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{p}{(}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{,} \PYG{n}{ax2}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{n}{ax3}\PYG{p}{,} \PYG{n}{ax4}\PYG{p}{)}\PYG{p}{)} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{nrows}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{ncols}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax3}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax4}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_tight_layout_guide_003}.png} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tight_layout:matplotlib.pyplot.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout()}}}}} will also adjust spacing between subplots to minimize the overlaps. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{p}{(}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{,} \PYG{n}{ax2}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{n}{ax3}\PYG{p}{,} \PYG{n}{ax4}\PYG{p}{)}\PYG{p}{)} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{nrows}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{ncols}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax3}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax4}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_tight_layout_guide_004}.png} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tight_layout:matplotlib.pyplot.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout()}}}}} can take keyword arguments of \sphinxstyleemphasis{pad}, \sphinxstyleemphasis{w\_pad} and \sphinxstyleemphasis{h\_pad}. These control the extra padding around the figure border and between subplots. The pads are specified in fraction of fontsize. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{p}{(}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{,} \PYG{n}{ax2}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{n}{ax3}\PYG{p}{,} \PYG{n}{ax4}\PYG{p}{)}\PYG{p}{)} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{nrows}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{ncols}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax3}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax4}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{n}{pad}\PYG{o}{=}\PYG{l+m+mf}{0.4}\PYG{p}{,} \PYG{n}{w\PYGZus{}pad}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{n}{h\PYGZus{}pad}\PYG{o}{=}\PYG{l+m+mf}{1.0}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_tight_layout_guide_005}.png} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tight_layout:matplotlib.pyplot.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout()}}}}} will work even if the sizes of subplots are different as far as their grid specification is compatible. In the example below, \sphinxstyleemphasis{ax1} and \sphinxstyleemphasis{ax2} are subplots of a 2x2 grid, while \sphinxstyleemphasis{ax3} is of a 1x2 grid. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{close}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{all}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{221}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{223}\PYG{p}{)} \PYG{n}{ax3} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{122}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax3}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_tight_layout_guide_006}.png} It works with subplots created with {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot2grid:matplotlib.pyplot.subplot2grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot2grid()}}}}}. In general, subplots created from the gridspec ({\hyperref[\detokenize{tutorials/intermediate/gridspec:sphx-glr-tutorials-intermediate-gridspec-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Figure Layouts Using GridSpec and Other Functions}}}}) will work. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{close}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{all}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot2grid}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot2grid}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{,} \PYG{n}{colspan}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{ax3} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot2grid}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{,} \PYG{n}{colspan}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{rowspan}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{ax4} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot2grid}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{,} \PYG{n}{rowspan}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax3}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax4}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_tight_layout_guide_007}.png} Although not thoroughly tested, it seems to work for subplots with aspect != “auto” (e.g., axes with images). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{arr} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{)}\PYG{o}{.}\PYG{n}{reshape}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{close}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{all}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{n}{interpolation}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_tight_layout_guide_008}.png} \subsubsection{Caveats} \label{\detokenize{tutorials/intermediate/tight_layout_guide:caveats}}\begin{itemize} \item {} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tight_layout:matplotlib.pyplot.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout()}}}}} only considers ticklabels, axis labels, and titles. Thus, other artists may be clipped and also may overlap. \item {} It assumes that the extra space needed for ticklabels, axis labels, and titles is independent of original location of axes. This is often true, but there are rare cases where it is not. \item {} pad=0 clips some of the texts by a few pixels. This may be a bug or a limitation of the current algorithm and it is not clear why it happens. Meanwhile, use of pad at least larger than 0.3 is recommended. \end{itemize} \subsubsection{Use with GridSpec} \label{\detokenize{tutorials/intermediate/tight_layout_guide:use-with-gridspec}} GridSpec has its own {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout()}}}}} method (the pyplot api {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tight_layout:matplotlib.pyplot.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout()}}}}} also works). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.gridspec} \PYG{k+kn}{as} \PYG{n+nn}{gridspec} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{close}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{all}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{gs1} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{)} \PYG{n}{gs1}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_tight_layout_guide_009}.png} You may provide an optional \sphinxstyleemphasis{rect} parameter, which specifies the bounding box that the subplots will be fit inside. The coordinates must be in normalized figure coordinates and the default is (0, 0, 1, 1). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{gs1} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{)} \PYG{n}{gs1}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{rect}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_tight_layout_guide_010}.png} For example, this can be used for a figure with multiple gridspecs. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{gs1} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{)} \PYG{n}{gs1}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{rect}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{gs2} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ss} \PYG{o+ow}{in} \PYG{n}{gs2}\PYG{p}{:} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{ss}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{x\PYGZhy{}label}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{12}\PYG{p}{)} \PYG{n}{gs2}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{rect}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{h\PYGZus{}pad}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} We may try to match the top and bottom of two grids ::} \PYG{n}{top} \PYG{o}{=} \PYG{n+nb}{min}\PYG{p}{(}\PYG{n}{gs1}\PYG{o}{.}\PYG{n}{top}\PYG{p}{,} \PYG{n}{gs2}\PYG{o}{.}\PYG{n}{top}\PYG{p}{)} \PYG{n}{bottom} \PYG{o}{=} \PYG{n+nb}{max}\PYG{p}{(}\PYG{n}{gs1}\PYG{o}{.}\PYG{n}{bottom}\PYG{p}{,} \PYG{n}{gs2}\PYG{o}{.}\PYG{n}{bottom}\PYG{p}{)} \PYG{n}{gs1}\PYG{o}{.}\PYG{n}{update}\PYG{p}{(}\PYG{n}{top}\PYG{o}{=}\PYG{n}{top}\PYG{p}{,} \PYG{n}{bottom}\PYG{o}{=}\PYG{n}{bottom}\PYG{p}{)} \PYG{n}{gs2}\PYG{o}{.}\PYG{n}{update}\PYG{p}{(}\PYG{n}{top}\PYG{o}{=}\PYG{n}{top}\PYG{p}{,} \PYG{n}{bottom}\PYG{o}{=}\PYG{n}{bottom}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_tight_layout_guide_011}.png} While this should be mostly good enough, adjusting top and bottom may require adjustment of hspace also. To update hspace \& vspace, we call {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout()}}}}} again with updated rect argument. Note that the rect argument specifies the area including the ticklabels, etc. Thus, we will increase the bottom (which is 0 for the normal case) by the difference between the \sphinxstyleemphasis{bottom} from above and the bottom of each gridspec. Same thing for the top. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{gcf}\PYG{p}{(}\PYG{p}{)} \PYG{n}{gs1} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{)} \PYG{n}{gs1}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{rect}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{gs2} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ss} \PYG{o+ow}{in} \PYG{n}{gs2}\PYG{p}{:} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{ss}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{x\PYGZhy{}label}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{12}\PYG{p}{)} \PYG{n}{gs2}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{rect}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{h\PYGZus{}pad}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \PYG{n}{top} \PYG{o}{=} \PYG{n+nb}{min}\PYG{p}{(}\PYG{n}{gs1}\PYG{o}{.}\PYG{n}{top}\PYG{p}{,} \PYG{n}{gs2}\PYG{o}{.}\PYG{n}{top}\PYG{p}{)} \PYG{n}{bottom} \PYG{o}{=} \PYG{n+nb}{max}\PYG{p}{(}\PYG{n}{gs1}\PYG{o}{.}\PYG{n}{bottom}\PYG{p}{,} \PYG{n}{gs2}\PYG{o}{.}\PYG{n}{bottom}\PYG{p}{)} \PYG{n}{gs1}\PYG{o}{.}\PYG{n}{update}\PYG{p}{(}\PYG{n}{top}\PYG{o}{=}\PYG{n}{top}\PYG{p}{,} \PYG{n}{bottom}\PYG{o}{=}\PYG{n}{bottom}\PYG{p}{)} \PYG{n}{gs2}\PYG{o}{.}\PYG{n}{update}\PYG{p}{(}\PYG{n}{top}\PYG{o}{=}\PYG{n}{top}\PYG{p}{,} \PYG{n}{bottom}\PYG{o}{=}\PYG{n}{bottom}\PYG{p}{)} \PYG{n}{top} \PYG{o}{=} \PYG{n+nb}{min}\PYG{p}{(}\PYG{n}{gs1}\PYG{o}{.}\PYG{n}{top}\PYG{p}{,} \PYG{n}{gs2}\PYG{o}{.}\PYG{n}{top}\PYG{p}{)} \PYG{n}{bottom} \PYG{o}{=} \PYG{n+nb}{max}\PYG{p}{(}\PYG{n}{gs1}\PYG{o}{.}\PYG{n}{bottom}\PYG{p}{,} \PYG{n}{gs2}\PYG{o}{.}\PYG{n}{bottom}\PYG{p}{)} \PYG{n}{gs1}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{rect}\PYG{o}{=}\PYG{p}{[}\PYG{n+nb+bp}{None}\PYG{p}{,} \PYG{l+m+mi}{0} \PYG{o}{+} \PYG{p}{(}\PYG{n}{bottom}\PYG{o}{\PYGZhy{}}\PYG{n}{gs1}\PYG{o}{.}\PYG{n}{bottom}\PYG{p}{)}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mi}{1} \PYG{o}{\PYGZhy{}} \PYG{p}{(}\PYG{n}{gs1}\PYG{o}{.}\PYG{n}{top}\PYG{o}{\PYGZhy{}}\PYG{n}{top}\PYG{p}{)}\PYG{p}{]}\PYG{p}{)} \PYG{n}{gs2}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{rect}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mi}{0} \PYG{o}{+} \PYG{p}{(}\PYG{n}{bottom}\PYG{o}{\PYGZhy{}}\PYG{n}{gs2}\PYG{o}{.}\PYG{n}{bottom}\PYG{p}{)}\PYG{p}{,} \PYG{n+nb+bp}{None}\PYG{p}{,} \PYG{l+m+mi}{1} \PYG{o}{\PYGZhy{}} \PYG{p}{(}\PYG{n}{gs2}\PYG{o}{.}\PYG{n}{top}\PYG{o}{\PYGZhy{}}\PYG{n}{top}\PYG{p}{)}\PYG{p}{]}\PYG{p}{,} \PYG{n}{h\PYGZus{}pad}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_tight_layout_guide_012}.png} \subsubsection{Use with AxesGrid1} \label{\detokenize{tutorials/intermediate/tight_layout_guide:use-with-axesgrid1}} While limited, the axes\_grid1 toolkit is also supported. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{mpl\PYGZus{}toolkits.axes\PYGZus{}grid1} \PYG{k+kn}{import} \PYG{n}{Grid} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{close}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{all}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{grid} \PYG{o}{=} \PYG{n}{Grid}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{rect}\PYG{o}{=}\PYG{l+m+mi}{111}\PYG{p}{,} \PYG{n}{nrows\PYGZus{}ncols}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{,} \PYG{n}{axes\PYGZus{}pad}\PYG{o}{=}\PYG{l+m+mf}{0.25}\PYG{p}{,} \PYG{n}{label\PYGZus{}mode}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{L}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{p}{)} \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{grid}\PYG{p}{:} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{title}\PYG{o}{.}\PYG{n}{set\PYGZus{}visible}\PYG{p}{(}\PYG{n+nb+bp}{False}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_tight_layout_guide_013}.png} \subsubsection{Colorbar} \label{\detokenize{tutorials/intermediate/tight_layout_guide:colorbar}} If you create a colorbar with the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.colorbar:matplotlib.pyplot.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} command, the created colorbar is an instance of Axes, \sphinxstyleemphasis{not} Subplot, so tight\_layout does not work. With Matplotlib v1.1, you may create a colorbar as a subplot using the gridspec. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{close}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{all}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{arr} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{)}\PYG{o}{.}\PYG{n}{reshape}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{)} \PYG{n}{im} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{n}{interpolation}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{im}\PYG{p}{,} \PYG{n}{use\PYGZus{}gridspec}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_tight_layout_guide_014}.png} Another option is to use AxesGrid1 toolkit to explicitly create an axes for colorbar. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{mpl\PYGZus{}toolkits.axes\PYGZus{}grid1} \PYG{k+kn}{import} \PYG{n}{make\PYGZus{}axes\PYGZus{}locatable} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{close}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{all}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{arr} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{)}\PYG{o}{.}\PYG{n}{reshape}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{)} \PYG{n}{im} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{n}{interpolation}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{none}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{divider} \PYG{o}{=} \PYG{n}{make\PYGZus{}axes\PYGZus{}locatable}\PYG{p}{(}\PYG{n}{plt}\PYG{o}{.}\PYG{n}{gca}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{n}{cax} \PYG{o}{=} \PYG{n}{divider}\PYG{o}{.}\PYG{n}{append\PYGZus{}axes}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{right}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{5}\PYG{l+s+s2}{\PYGZpc{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{pad}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{3}\PYG{l+s+s2}{\PYGZpc{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{im}\PYG{p}{,} \PYG{n}{cax}\PYG{o}{=}\PYG{n}{cax}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_tight_layout_guide_015}.png} \phantomsection\label{\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-download-tutorials-intermediate-tight-layout-guide-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/intermediate/imshow_extent:sphx-glr-download-tutorials-intermediate-imshow-extent-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{\sphinxstyleemphasis{origin} and \sphinxstyleemphasis{extent} in \sphinxstyleliteralintitle{\sphinxupquote{imshow}}} \label{\detokenize{tutorials/intermediate/imshow_extent:origin-and-extent-in-imshow}}\label{\detokenize{tutorials/intermediate/imshow_extent:sphx-glr-tutorials-intermediate-imshow-extent-py}}\label{\detokenize{tutorials/intermediate/imshow_extent::doc}} {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.imshow:matplotlib.axes.Axes.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow()}}}}} allows you to render an image (either a 2D array which will be color-mapped (based on \sphinxstyleemphasis{norm} and \sphinxstyleemphasis{cmap}) or and 3D RGB(A) array which will be used as-is) to a rectangular region in dataspace. The orientation of the image in the final rendering is controlled by the \sphinxstyleemphasis{origin} and \sphinxstyleemphasis{extent} kwargs (and attributes on the resulting {\hyperref[\detokenize{api/image_api:matplotlib.image.AxesImage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AxesImage}}}}} instance) and the data limits of the axes. The \sphinxstyleemphasis{extent} kwarg controls the bounding box in data coordinates that the image will fill specified as \sphinxcode{\sphinxupquote{(left, right, bottom, top)}} in \sphinxstylestrong{data coordinates}, the \sphinxstyleemphasis{origin} kwarg controls how the image fills that bounding box, and the orientation in the final rendered image is also affected by the axes limits. \begin{sphinxadmonition}{hint}{Hint:} Most of the code below is used for adding labels and informative text to the plots. The described effects of \sphinxstyleemphasis{origin} and \sphinxstyleemphasis{extent} can be seen in the plots without the need to follow all code details. For a quick understanding, you may want to skip the code details below and directly continue with the discussion of the results. \end{sphinxadmonition} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib.gridspec} \PYG{k+kn}{import} \PYG{n}{GridSpec} \PYG{k}{def} \PYG{n+nf}{index\PYGZus{}to\PYGZus{}coordinate}\PYG{p}{(}\PYG{n}{index}\PYG{p}{,} \PYG{n}{extent}\PYG{p}{,} \PYG{n}{origin}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}Return the pixel center of an index.\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{p}{,} \PYG{n}{bottom}\PYG{p}{,} \PYG{n}{top} \PYG{o}{=} \PYG{n}{extent} \PYG{n}{hshift} \PYG{o}{=} \PYG{l+m+mf}{0.5} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sign}\PYG{p}{(}\PYG{n}{right} \PYG{o}{\PYGZhy{}} \PYG{n}{left}\PYG{p}{)} \PYG{n}{left}\PYG{p}{,} \PYG{n}{right} \PYG{o}{=} \PYG{n}{left} \PYG{o}{+} \PYG{n}{hshift}\PYG{p}{,} \PYG{n}{right} \PYG{o}{\PYGZhy{}} \PYG{n}{hshift} \PYG{n}{vshift} \PYG{o}{=} \PYG{l+m+mf}{0.5} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sign}\PYG{p}{(}\PYG{n}{top} \PYG{o}{\PYGZhy{}} \PYG{n}{bottom}\PYG{p}{)} \PYG{n}{bottom}\PYG{p}{,} \PYG{n}{top} \PYG{o}{=} \PYG{n}{bottom} \PYG{o}{+} \PYG{n}{vshift}\PYG{p}{,} \PYG{n}{top} \PYG{o}{\PYGZhy{}} \PYG{n}{vshift} \PYG{k}{if} \PYG{n}{origin} \PYG{o}{==} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{upper}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{bottom}\PYG{p}{,} \PYG{n}{top} \PYG{o}{=} \PYG{n}{top}\PYG{p}{,} \PYG{n}{bottom} \PYG{k}{return} \PYG{p}{\PYGZob{}} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{[0, 0]}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{p}{(}\PYG{n}{left}\PYG{p}{,} \PYG{n}{bottom}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{[M}\PYG{l+s+s2}{\PYGZsq{}}\PYG{l+s+s2}{, 0]}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{p}{(}\PYG{n}{left}\PYG{p}{,} \PYG{n}{top}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{[0, N}\PYG{l+s+s2}{\PYGZsq{}}\PYG{l+s+s2}{]}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{p}{(}\PYG{n}{right}\PYG{p}{,} \PYG{n}{bottom}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{[M}\PYG{l+s+s2}{\PYGZsq{}}\PYG{l+s+s2}{, N}\PYG{l+s+s2}{\PYGZsq{}}\PYG{l+s+s2}{]}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{p}{(}\PYG{n}{right}\PYG{p}{,} \PYG{n}{top}\PYG{p}{)}\PYG{p}{,} \PYG{p}{\PYGZcb{}}\PYG{p}{[}\PYG{n}{index}\PYG{p}{]} \PYG{k}{def} \PYG{n+nf}{get\PYGZus{}index\PYGZus{}label\PYGZus{}pos}\PYG{p}{(}\PYG{n}{index}\PYG{p}{,} \PYG{n}{extent}\PYG{p}{,} \PYG{n}{origin}\PYG{p}{,} \PYG{n}{inverted\PYGZus{}xindex}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ Return the desired position and horizontal alignment of an index label.} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{k}{if} \PYG{n}{extent} \PYG{o+ow}{is} \PYG{n+nb+bp}{None}\PYG{p}{:} \PYG{n}{extent} \PYG{o}{=} \PYG{n}{lookup\PYGZus{}extent}\PYG{p}{(}\PYG{n}{origin}\PYG{p}{)} \PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{p}{,} \PYG{n}{bottom}\PYG{p}{,} \PYG{n}{top} \PYG{o}{=} \PYG{n}{extent} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y} \PYG{o}{=} \PYG{n}{index\PYGZus{}to\PYGZus{}coordinate}\PYG{p}{(}\PYG{n}{index}\PYG{p}{,} \PYG{n}{extent}\PYG{p}{,} \PYG{n}{origin}\PYG{p}{)} \PYG{n}{is\PYGZus{}x0} \PYG{o}{=} \PYG{n}{index}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{p}{]} \PYG{o}{==} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{0]}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{halign} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{left}\PYG{l+s+s1}{\PYGZsq{}} \PYG{k}{if} \PYG{n}{is\PYGZus{}x0} \PYG{o}{\PYGZca{}} \PYG{n}{inverted\PYGZus{}xindex} \PYG{k}{else} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{hshift} \PYG{o}{=} \PYG{l+m+mf}{0.5} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sign}\PYG{p}{(}\PYG{n}{left} \PYG{o}{\PYGZhy{}} \PYG{n}{right}\PYG{p}{)} \PYG{n}{x} \PYG{o}{+}\PYG{o}{=} \PYG{n}{hshift} \PYG{o}{*} \PYG{p}{(}\PYG{l+m+mi}{1} \PYG{k}{if} \PYG{n}{is\PYGZus{}x0} \PYG{k}{else} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{k}{return} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{halign} \PYG{k}{def} \PYG{n+nf}{get\PYGZus{}color}\PYG{p}{(}\PYG{n}{index}\PYG{p}{,} \PYG{n}{data}\PYG{p}{,} \PYG{n}{cmap}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}Return the data color of an index.\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{n}{val} \PYG{o}{=} \PYG{p}{\PYGZob{}} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{[0, 0]}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{n}{data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{[0, N}\PYG{l+s+s2}{\PYGZsq{}}\PYG{l+s+s2}{]}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{n}{data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{[M}\PYG{l+s+s2}{\PYGZsq{}}\PYG{l+s+s2}{, 0]}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{n}{data}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{[M}\PYG{l+s+s2}{\PYGZsq{}}\PYG{l+s+s2}{, N}\PYG{l+s+s2}{\PYGZsq{}}\PYG{l+s+s2}{]}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{n}{data}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{p}{\PYGZcb{}}\PYG{p}{[}\PYG{n}{index}\PYG{p}{]} \PYG{k}{return} \PYG{n}{cmap}\PYG{p}{(}\PYG{n}{val} \PYG{o}{/} \PYG{n}{data}\PYG{o}{.}\PYG{n}{max}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{lookup\PYGZus{}extent}\PYG{p}{(}\PYG{n}{origin}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}Return extent for label positioning when not given explicitly.\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{k}{if} \PYG{n}{origin} \PYG{o}{==} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lower}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{k}{return} \PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{6.5}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{5.5}\PYG{p}{)} \PYG{k}{else}\PYG{p}{:} \PYG{k}{return} \PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{6.5}\PYG{p}{,} \PYG{l+m+mf}{5.5}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.5}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{set\PYGZus{}extent\PYGZus{}None\PYGZus{}text}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mf}{2.5}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{equals}\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s1}{extent=None}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{size}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{large}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{w}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{plot\PYGZus{}imshow\PYGZus{}with\PYGZus{}labels}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{data}\PYG{p}{,} \PYG{n}{extent}\PYG{p}{,} \PYG{n}{origin}\PYG{p}{,} \PYG{n}{xlim}\PYG{p}{,} \PYG{n}{ylim}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}Actually run {}`{}`imshow(){}`{}` and add extent and index labels.\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{data}\PYG{p}{,} \PYG{n}{origin}\PYG{o}{=}\PYG{n}{origin}\PYG{p}{,} \PYG{n}{extent}\PYG{o}{=}\PYG{n}{extent}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} extent labels (left, right, bottom, top)} \PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{p}{,} \PYG{n}{bottom}\PYG{p}{,} \PYG{n}{top} \PYG{o}{=} \PYG{n}{im}\PYG{o}{.}\PYG{n}{get\PYGZus{}extent}\PYG{p}{(}\PYG{p}{)} \PYG{k}{if} \PYG{n}{xlim} \PYG{o+ow}{is} \PYG{n+nb+bp}{None} \PYG{o+ow}{or} \PYG{n}{top} \PYG{o}{\PYGZgt{}} \PYG{n}{bottom}\PYG{p}{:} \PYG{n}{upper\PYGZus{}string}\PYG{p}{,} \PYG{n}{lower\PYGZus{}string} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{top}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bottom}\PYG{l+s+s1}{\PYGZsq{}} \PYG{k}{else}\PYG{p}{:} \PYG{n}{upper\PYGZus{}string}\PYG{p}{,} \PYG{n}{lower\PYGZus{}string} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bottom}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{top}\PYG{l+s+s1}{\PYGZsq{}} \PYG{k}{if} \PYG{n}{ylim} \PYG{o+ow}{is} \PYG{n+nb+bp}{None} \PYG{o+ow}{or} \PYG{n}{left} \PYG{o}{\PYGZlt{}} \PYG{n}{right}\PYG{p}{:} \PYG{n}{port\PYGZus{}string}\PYG{p}{,} \PYG{n}{starboard\PYGZus{}string} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{left}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{inverted\PYGZus{}xindex} \PYG{o}{=} \PYG{n+nb+bp}{False} \PYG{k}{else}\PYG{p}{:} \PYG{n}{port\PYGZus{}string}\PYG{p}{,} \PYG{n}{starboard\PYGZus{}string} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{left}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{inverted\PYGZus{}xindex} \PYG{o}{=} \PYG{n+nb+bp}{True} \PYG{n}{bbox\PYGZus{}kwargs} \PYG{o}{=} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{fc}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{w}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{alpha}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{o}{.}\PYG{l+m+mi}{75}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxstyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{round4}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{\PYGZcb{}} \PYG{n}{ann\PYGZus{}kwargs} \PYG{o}{=} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{xycoords}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes fraction}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{textcoords}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{offset points}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bbox}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{bbox\PYGZus{}kwargs}\PYG{p}{\PYGZcb{}} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{n}{upper\PYGZus{}string}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{o}{.}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xytext}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{top}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{ann\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{n}{lower\PYGZus{}string}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{o}{.}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xytext}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bottom}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{ann\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{n}{port\PYGZus{}string}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{o}{.}\PYG{l+m+mi}{5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xytext}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{left}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{90}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{ann\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{n}{starboard\PYGZus{}string}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{o}{.}\PYG{l+m+mi}{5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xytext}\PYG{o}{=}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{90}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{ann\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{origin: \PYGZob{}origin\PYGZcb{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{origin}\PYG{o}{=}\PYG{n}{origin}\PYG{p}{)}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} index labels} \PYG{k}{for} \PYG{n}{index} \PYG{o+ow}{in} \PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{[0, 0]}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{[0, N}\PYG{l+s+s2}{\PYGZsq{}}\PYG{l+s+s2}{]}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{[M}\PYG{l+s+s2}{\PYGZsq{}}\PYG{l+s+s2}{, 0]}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{[M}\PYG{l+s+s2}{\PYGZsq{}}\PYG{l+s+s2}{, N}\PYG{l+s+s2}{\PYGZsq{}}\PYG{l+s+s2}{]}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{p}{:} \PYG{n}{tx}\PYG{p}{,} \PYG{n}{ty}\PYG{p}{,} \PYG{n}{halign} \PYG{o}{=} \PYG{n}{get\PYGZus{}index\PYGZus{}label\PYGZus{}pos}\PYG{p}{(}\PYG{n}{index}\PYG{p}{,} \PYG{n}{extent}\PYG{p}{,} \PYG{n}{origin}\PYG{p}{,} \PYG{n}{inverted\PYGZus{}xindex}\PYG{p}{)} \PYG{n}{facecolor} \PYG{o}{=} \PYG{n}{get\PYGZus{}color}\PYG{p}{(}\PYG{n}{index}\PYG{p}{,} \PYG{n}{data}\PYG{p}{,} \PYG{n}{im}\PYG{o}{.}\PYG{n}{get\PYGZus{}cmap}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{n}{tx}\PYG{p}{,} \PYG{n}{ty}\PYG{p}{,} \PYG{n}{index}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{white}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{n}{halign}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{bbox}\PYG{o}{=}\PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxstyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{square}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{facecolor}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{facecolor}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \PYG{k}{if} \PYG{n}{xlim}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{o}{*}\PYG{n}{xlim}\PYG{p}{)} \PYG{k}{if} \PYG{n}{ylim}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{o}{*}\PYG{n}{ylim}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{generate\PYGZus{}imshow\PYGZus{}demo\PYGZus{}grid}\PYG{p}{(}\PYG{n}{extents}\PYG{p}{,} \PYG{n}{xlim}\PYG{o}{=}\PYG{n+nb+bp}{None}\PYG{p}{,} \PYG{n}{ylim}\PYG{o}{=}\PYG{n+nb+bp}{None}\PYG{p}{)}\PYG{p}{:} \PYG{n}{N} \PYG{o}{=} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{extents}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{tight\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{set\PYGZus{}size\PYGZus{}inches}\PYG{p}{(}\PYG{l+m+mi}{6}\PYG{p}{,} \PYG{n}{N} \PYG{o}{*} \PYG{p}{(}\PYG{l+m+mf}{11.25}\PYG{p}{)} \PYG{o}{/} \PYG{l+m+mi}{5}\PYG{p}{)} \PYG{n}{gs} \PYG{o}{=} \PYG{n}{GridSpec}\PYG{p}{(}\PYG{n}{N}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{n}{figure}\PYG{o}{=}\PYG{n}{fig}\PYG{p}{)} \PYG{n}{columns} \PYG{o}{=} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{p}{[}\PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{n}{j}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{k}{for} \PYG{n}{j} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{n}{N}\PYG{p}{)}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{upper}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{p}{[}\PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{n}{j}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{:}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \PYG{k}{for} \PYG{n}{j} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{n}{N}\PYG{p}{)}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lower}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{p}{[}\PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{n}{j}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{]}\PYG{p}{)} \PYG{k}{for} \PYG{n}{j} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{n}{N}\PYG{p}{)}\PYG{p}{]}\PYG{p}{\PYGZcb{}} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{ogrid}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{:}\PYG{l+m+mi}{6}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{:}\PYG{l+m+mi}{7}\PYG{p}{]} \PYG{n}{data} \PYG{o}{=} \PYG{n}{x} \PYG{o}{+} \PYG{n}{y} \PYG{k}{for} \PYG{n}{origin} \PYG{o+ow}{in} \PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{upper}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lower}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{:} \PYG{k}{for} \PYG{n}{ax}\PYG{p}{,} \PYG{n}{extent} \PYG{o+ow}{in} \PYG{n+nb}{zip}\PYG{p}{(}\PYG{n}{columns}\PYG{p}{[}\PYG{n}{origin}\PYG{p}{]}\PYG{p}{,} \PYG{n}{extents}\PYG{p}{)}\PYG{p}{:} \PYG{n}{plot\PYGZus{}imshow\PYGZus{}with\PYGZus{}labels}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{data}\PYG{p}{,} \PYG{n}{extent}\PYG{p}{,} \PYG{n}{origin}\PYG{p}{,} \PYG{n}{xlim}\PYG{p}{,} \PYG{n}{ylim}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ax}\PYG{p}{,} \PYG{n}{extent} \PYG{o+ow}{in} \PYG{n+nb}{zip}\PYG{p}{(}\PYG{n}{columns}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{n}{extents}\PYG{p}{)}\PYG{p}{:} \PYG{n}{text\PYGZus{}kwargs} \PYG{o}{=} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ha}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{va}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{xycoords}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes fraction}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{xy}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{o}{.}\PYG{l+m+mi}{5}\PYG{p}{)}\PYG{p}{\PYGZcb{}} \PYG{k}{if} \PYG{n}{extent} \PYG{o+ow}{is} \PYG{n+nb+bp}{None}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{None}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{text\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{extent=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k}{else}\PYG{p}{:} \PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{p}{,} \PYG{n}{bottom}\PYG{p}{,} \PYG{n}{top} \PYG{o}{=} \PYG{n}{extent} \PYG{n}{text} \PYG{o}{=} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{left: \PYGZob{}left:0.1f\PYGZcb{}}\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s1}{right: \PYGZob{}right:0.1f\PYGZcb{}}\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s1}{\PYGZsq{}} \PYG{o}{+} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bottom: \PYGZob{}bottom:0.1f\PYGZcb{}}\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s1}{top: \PYGZob{}top:0.1f\PYGZcb{}}\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(} \PYG{n}{left}\PYG{o}{=}\PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{o}{=}\PYG{n}{right}\PYG{p}{,} \PYG{n}{bottom}\PYG{o}{=}\PYG{n}{bottom}\PYG{p}{,} \PYG{n}{top}\PYG{o}{=}\PYG{n}{top}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{n}{text}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{text\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{off}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k}{return} \PYG{n}{columns} \end{sphinxVerbatim} \subsubsection{Default extent} \label{\detokenize{tutorials/intermediate/imshow_extent:default-extent}} First, let’s have a look at the default \sphinxcode{\sphinxupquote{extent=None}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{generate\PYGZus{}imshow\PYGZus{}demo\PYGZus{}grid}\PYG{p}{(}\PYG{n}{extents}\PYG{o}{=}\PYG{p}{[}\PYG{n+nb+bp}{None}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_imshow_extent_001}.png} Generally, for an array of shape (M, N), the first index runs along the vertical, the second index runs along the horizontal. The pixel centers are at integer positions ranging from 0 to \sphinxcode{\sphinxupquote{N' = N - 1}} horizontally and from 0 to \sphinxcode{\sphinxupquote{M' = M - 1}} vertically. \sphinxstyleemphasis{origin} determines how to the data is filled in the bounding box. For \sphinxcode{\sphinxupquote{origin='lower'}}: \begin{itemize} \item {} {[}0, 0{]} is at (left, bottom) \item {} {[}M’, 0{]} is at (left, top) \item {} {[}0, N’{]} is at (right, bottom) \item {} {[}M’, N’{]} is at (right, top) \end{itemize} \sphinxcode{\sphinxupquote{origin='upper'}} reverses the vertical axes direction and filling: \begin{itemize} \item {} {[}0, 0{]} is at (left, top) \item {} {[}M’, 0{]} is at (left, bottom) \item {} {[}0, N’{]} is at (right, top) \item {} {[}M’, N’{]} is at (right, bottom) \end{itemize} In summary, the position of the {[}0, 0{]} index as well as the extent are influenced by \sphinxstyleemphasis{origin}: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily origin &\sphinxstyletheadfamily {[}0, 0{]} position &\sphinxstyletheadfamily extent \\ \hline upper & top left & \sphinxcode{\sphinxupquote{(-0.5, numcols-0.5, numrows-0.5, -0.5)}} \\ \hline lower & bottom left & \sphinxcode{\sphinxupquote{(-0.5, numcols-0.5, -0.5, numrows-0.5)}} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} The default value of \sphinxstyleemphasis{origin} is set by \sphinxcode{\sphinxupquote{rcParams{[}"image.origin"{]}}} which defaults to \sphinxcode{\sphinxupquote{'upper'}} to match the matrix indexing conventions in math and computer graphics image indexing conventions. \subsubsection{Explicit extent} \label{\detokenize{tutorials/intermediate/imshow_extent:explicit-extent}} By setting \sphinxstyleemphasis{extent} we define the coordinates of the image area. The underlying image data is interpolated/resampled to fill that area. If the axes is set to autoscale, then the view limits of the axes are set to match the \sphinxstyleemphasis{extent} which ensures that the coordinate set by \sphinxcode{\sphinxupquote{(left, bottom)}} is at the bottom left of the axes! However, this may invert the axis so they do not increase in the ‘natural’ direction. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{extents} \PYG{o}{=} \PYG{p}{[}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{6.5}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{5.5}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{6.5}\PYG{p}{,} \PYG{l+m+mf}{5.5}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mf}{6.5}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{5.5}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mf}{6.5}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{5.5}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{]} \PYG{n}{columns} \PYG{o}{=} \PYG{n}{generate\PYGZus{}imshow\PYGZus{}demo\PYGZus{}grid}\PYG{p}{(}\PYG{n}{extents}\PYG{p}{)} \PYG{n}{set\PYGZus{}extent\PYGZus{}None\PYGZus{}text}\PYG{p}{(}\PYG{n}{columns}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{upper}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{set\PYGZus{}extent\PYGZus{}None\PYGZus{}text}\PYG{p}{(}\PYG{n}{columns}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lower}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_imshow_extent_002}.png} \subsubsection{Explicit extent and axes limits} \label{\detokenize{tutorials/intermediate/imshow_extent:explicit-extent-and-axes-limits}} If we fix the axes limits by explicity setting \sphinxcode{\sphinxupquote{set\_xlim}} / \sphinxcode{\sphinxupquote{set\_ylim}}, we force a certain size and orientation of the axes. This can decouple the ‘left-right’ and ‘top-bottom’ sense of the image from the orientation on the screen. In the example below we have chosen the limits slightly larger than the extent (note the white areas within the Axes). While we keep the extents as in the examples before, the coordinate (0, 0) is now explicitly put at the bottom left and values increase to up and to the right (from the viewer point of view). We can see that: \begin{itemize} \item {} The coordinate \sphinxcode{\sphinxupquote{(left, bottom)}} anchors the image which then fills the box going towards the \sphinxcode{\sphinxupquote{(right, top)}} point in data space. \item {} The first column is always closest to the ‘left’. \item {} \sphinxstyleemphasis{origin} controls if the first row is closest to ‘top’ or ‘bottom’. \item {} The image may be inverted along either direction. \item {} The ‘left-right’ and ‘top-bottom’ sense of the image may be uncoupled from the orientation on the screen. \end{itemize} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{generate\PYGZus{}imshow\PYGZus{}demo\PYGZus{}grid}\PYG{p}{(}\PYG{n}{extents}\PYG{o}{=}\PYG{p}{[}\PYG{n+nb+bp}{None}\PYG{p}{]} \PYG{o}{+} \PYG{n}{extents}\PYG{p}{,} \PYG{n}{xlim}\PYG{o}{=}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{8}\PYG{p}{)}\PYG{p}{,} \PYG{n}{ylim}\PYG{o}{=}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{6}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_imshow_extent_003}.png} \phantomsection\label{\detokenize{tutorials/intermediate/imshow_extent:sphx-glr-download-tutorials-intermediate-imshow-extent-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/intermediate/constrainedlayout_guide:sphx-glr-download-tutorials-intermediate-constrainedlayout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Constrained Layout Guide} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:constrained-layout-guide}}\label{\detokenize{tutorials/intermediate/constrainedlayout_guide:sphx-glr-tutorials-intermediate-constrainedlayout-guide-py}}\label{\detokenize{tutorials/intermediate/constrainedlayout_guide::doc}} How to use constrained-layout to fit plots within your figure cleanly. \sphinxstyleemphasis{constrained\_layout} automatically adjusts subplots and decorations like legends and colorbars so that they fit in the figure window while still preserving, as best they can, the logical layout requested by the user. \sphinxstyleemphasis{constrained\_layout} is similar to \sphinxstyleemphasis{tight\_layout}, but uses a constraint solver to determine the size of axes that allows them to fit. \begin{sphinxadmonition}{warning}{Warning:} As of Matplotlib 2.2, Constrained Layout is \sphinxstylestrong{experimental}. The behaviour and API are subject to change, or the whole functionality may be removed without a deprecation period. If you \sphinxstyleemphasis{require} your plots to be absolutely reproducible, get the Axes positions after running Constrained Layout and use \sphinxcode{\sphinxupquote{ax.set\_position()}} in your code with \sphinxcode{\sphinxupquote{constrained\_layout=False}}. \end{sphinxadmonition} \subsubsection{Simple Example} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:simple-example}} In Matplotlib, the location of axes (including subplots) are specified in normalized figure coordinates. It can happen that your axis labels or titles (or sometimes even ticklabels) go outside the figure area, and are thus clipped. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} sphinx\PYGZus{}gallery\PYGZus{}thumbnail\PYGZus{}number = 18} \PYG{c+c1}{\PYGZsh{}import matplotlib} \PYG{c+c1}{\PYGZsh{}matplotlib.use(\PYGZsq{}Qt5Agg\PYGZsq{})} \PYG{k+kn}{import} \PYG{n+nn}{warnings} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.colors} \PYG{k+kn}{as} \PYG{n+nn}{mcolors} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.gridspec} \PYG{k+kn}{as} \PYG{n+nn}{gridspec} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.\PYGZus{}layoutbox} \PYG{k+kn}{as} \PYG{n+nn}{layoutbox} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{savefig.facecolor}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{0.8}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{figure.figsize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mf}{4.5}\PYG{p}{,} \PYG{l+m+mf}{4.} \PYG{k}{def} \PYG{n+nf}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{12}\PYG{p}{,} \PYG{n}{nodec}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{locator\PYGZus{}params}\PYG{p}{(}\PYG{n}{nbins}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{)} \PYG{k}{if} \PYG{o+ow}{not} \PYG{n}{nodec}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{x\PYGZhy{}label}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{n}{fontsize}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{y\PYGZhy{}label}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{n}{fontsize}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Title}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{n}{fontsize}\PYG{p}{)} \PYG{k}{else}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xticklabels}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}yticklabels}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{24}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_001}.png} To prevent this, the location of axes needs to be adjusted. For subplots, this can be done by adjusting the subplot params ({\hyperref[\detokenize{faq/howto_faq:howto-subplots-adjust}]{\sphinxcrossref{\DUrole{std,std-ref}{Move the edge of an axes to make room for tick labels}}}}). However, specifying your figure with the \sphinxcode{\sphinxupquote{constrained\_layout=True}} kwarg will do the adjusting automatically. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{24}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_002}.png} When you have multiple subplots, often you see labels of different axes overlapping each other. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{axs}\PYG{o}{.}\PYG{n}{flatten}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_003}.png} Specifying \sphinxcode{\sphinxupquote{constrained\_layout=True}} in the call to \sphinxcode{\sphinxupquote{plt.subplots}} causes the layout to be properly constrained. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{axs}\PYG{o}{.}\PYG{n}{flatten}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_004}.png} \subsubsection{Colorbars} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:colorbars}} If you create a colorbar with the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.colorbar:matplotlib.pyplot.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} command you need to make room for it. \sphinxcode{\sphinxupquote{constrained\_layout}} does this automatically. Note that if you specify \sphinxcode{\sphinxupquote{use\_gridspec=True}} it will be ignored because this option is made for improving the layout via \sphinxcode{\sphinxupquote{tight\_layout}}. \begin{sphinxadmonition}{note}{Note:} For the \sphinxcode{\sphinxupquote{pcolormesh}} kwargs (\sphinxcode{\sphinxupquote{pc\_kwargs}}) we use a dictionary. Below we will assign one colorbar to a number of axes each containing a \sphinxcode{\sphinxupquote{ScalarMappable}}; specifying the norm and colormap ensures the colorbar is accurate for all the axes. \end{sphinxadmonition} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{arr} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{)}\PYG{o}{.}\PYG{n}{reshape}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{)} \PYG{n}{norm} \PYG{o}{=} \PYG{n}{mcolors}\PYG{o}{.}\PYG{n}{Normalize}\PYG{p}{(}\PYG{n}{vmin}\PYG{o}{=}\PYG{l+m+mf}{0.}\PYG{p}{,} \PYG{n}{vmax}\PYG{o}{=}\PYG{l+m+mf}{100.}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} see note above: this makes all pcolormesh calls consistent:} \PYG{n}{pc\PYGZus{}kwargs} \PYG{o}{=} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{rasterized}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:}\PYG{n+nb+bp}{True}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{cmap}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{viridis}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{norm}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:}\PYG{n}{norm}\PYG{p}{\PYGZcb{}} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{im}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{shrink}\PYG{o}{=}\PYG{l+m+mf}{0.6}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_005}.png} If you specify a list of axes (or other iterable container) to the \sphinxcode{\sphinxupquote{ax}} argument of \sphinxcode{\sphinxupquote{colorbar}}, constrained\_layout will take space from all \# axes that share the same gridspec. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{axs}\PYG{o}{.}\PYG{n}{flatten}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{im}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{axs}\PYG{p}{,} \PYG{n}{shrink}\PYG{o}{=}\PYG{l+m+mf}{0.6}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_006}.png} Note that there is a bit of a subtlety when specifying a single axes as the parent. In the following, it might be desirable and expected for the colorbars to line up, but they don’t because the colorbar paired with the bottom axes is tied to the subplotspec of the axes, and hence shrinks when the gridspec-level colorbar is added. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{axs}\PYG{p}{[}\PYG{p}{:}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{:} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{im}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{axs}\PYG{p}{[}\PYG{p}{:}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{,} \PYG{n}{shrink}\PYG{o}{=}\PYG{l+m+mf}{0.6}\PYG{p}{)} \PYG{n}{im} \PYG{o}{=} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{im}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{,} \PYG{n}{shrink}\PYG{o}{=}\PYG{l+m+mf}{0.6}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_007}.png} The API to make a single-axes behave like a list of axes is to specify it as a list (or other iterable container), as below: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{axs}\PYG{p}{[}\PYG{p}{:}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{:} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{im}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{axs}\PYG{p}{[}\PYG{p}{:}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{,} \PYG{n}{shrink}\PYG{o}{=}\PYG{l+m+mf}{0.6}\PYG{p}{)} \PYG{n}{im} \PYG{o}{=} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{im}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{p}{[}\PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{]}\PYG{p}{,} \PYG{n}{shrink}\PYG{o}{=}\PYG{l+m+mf}{0.6}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_008}.png} \subsubsection{Suptitle} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:suptitle}} \sphinxcode{\sphinxupquote{constrained\_layout}} can also make room for \sphinxcode{\sphinxupquote{suptitle}}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{axs}\PYG{o}{.}\PYG{n}{flatten}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{im}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{axs}\PYG{p}{,} \PYG{n}{shrink}\PYG{o}{=}\PYG{l+m+mf}{0.6}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{suptitle}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Big Suptitle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_009}.png} \subsubsection{Legends} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:legends}} Legends can be placed outside of their parent axis. Constrained-layout is designed to handle this. However, constrained-layout does \sphinxstyleemphasis{not} handle legends being created via \sphinxcode{\sphinxupquote{fig.legend()}} (yet). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{This is a plot}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{n}{loc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center left}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{bbox\PYGZus{}to\PYGZus{}anchor}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.9}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_010}.png} However, this will steal space from a subplot layout: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{axs}\PYG{o}{.}\PYG{n}{flatten}\PYG{p}{(}\PYG{p}{)}\PYG{p}{[}\PYG{p}{:}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{This is a plot}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{n}{loc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center left}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{bbox\PYGZus{}to\PYGZus{}anchor}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.9}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_011}.png} \subsubsection{Padding and Spacing} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:padding-and-spacing}} For constrained\_layout, we have implemented a padding around the edge of each axes. This padding sets the distance from the edge of the plot, and the minimum distance between adjacent plots. It is specified in inches by the keyword arguments \sphinxcode{\sphinxupquote{w\_pad}} and \sphinxcode{\sphinxupquote{h\_pad}} to the function \sphinxcode{\sphinxupquote{fig.set\_constrained\_layout\_pads}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{axs}\PYG{o}{.}\PYG{n}{flatten}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{nodec}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xticklabels}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}yticklabels}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{set\PYGZus{}constrained\PYGZus{}layout\PYGZus{}pads}\PYG{p}{(}\PYG{n}{w\PYGZus{}pad}\PYG{o}{=}\PYG{l+m+mf}{4.}\PYG{o}{/}\PYG{l+m+mf}{72.}\PYG{p}{,} \PYG{n}{h\PYGZus{}pad}\PYG{o}{=}\PYG{l+m+mf}{4.}\PYG{o}{/}\PYG{l+m+mf}{72.}\PYG{p}{,} \PYG{n}{hspace}\PYG{o}{=}\PYG{l+m+mf}{0.}\PYG{p}{,} \PYG{n}{wspace}\PYG{o}{=}\PYG{l+m+mf}{0.}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{axs}\PYG{o}{.}\PYG{n}{flatten}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{nodec}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xticklabels}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}yticklabels}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{set\PYGZus{}constrained\PYGZus{}layout\PYGZus{}pads}\PYG{p}{(}\PYG{n}{w\PYGZus{}pad}\PYG{o}{=}\PYG{l+m+mf}{2.}\PYG{o}{/}\PYG{l+m+mf}{72.}\PYG{p}{,} \PYG{n}{h\PYGZus{}pad}\PYG{o}{=}\PYG{l+m+mf}{2.}\PYG{o}{/}\PYG{l+m+mf}{72.}\PYG{p}{,} \PYG{n}{hspace}\PYG{o}{=}\PYG{l+m+mf}{0.}\PYG{p}{,} \PYG{n}{wspace}\PYG{o}{=}\PYG{l+m+mf}{0.}\PYG{p}{)} \end{sphinxVerbatim} \begin{itemize} \item {} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_012}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_013}.png} \end{itemize} Spacing between subplots is set by \sphinxcode{\sphinxupquote{wspace}} and \sphinxcode{\sphinxupquote{hspace}}. There are specified as a fraction of the size of the subplot group as a whole. If the size of the figure is changed, then these spaces change in proportion. Note in the blow how the space at the edges doesn’t change from the above, but the space between subplots does. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{axs}\PYG{o}{.}\PYG{n}{flatten}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{nodec}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xticklabels}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}yticklabels}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{set\PYGZus{}constrained\PYGZus{}layout\PYGZus{}pads}\PYG{p}{(}\PYG{n}{w\PYGZus{}pad}\PYG{o}{=}\PYG{l+m+mf}{2.}\PYG{o}{/}\PYG{l+m+mf}{72.}\PYG{p}{,} \PYG{n}{h\PYGZus{}pad}\PYG{o}{=}\PYG{l+m+mf}{2.}\PYG{o}{/}\PYG{l+m+mf}{72.}\PYG{p}{,} \PYG{n}{hspace}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{n}{wspace}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_014}.png} \paragraph{Spacing with colorbars} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:spacing-with-colorbars}} Colorbars still respect the \sphinxcode{\sphinxupquote{w\_pad}} and \sphinxcode{\sphinxupquote{h\_pad}} values. However they will be \sphinxcode{\sphinxupquote{wspace}} and \sphinxcode{\sphinxupquote{hsapce}} apart from other subplots. Note the use of a \sphinxcode{\sphinxupquote{pad}} kwarg here in the \sphinxcode{\sphinxupquote{colorbar}} call. It defaults to 0.02 of the size of the axis it is attached to. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{axs}\PYG{o}{.}\PYG{n}{flatten}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{pc} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{im}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{shrink}\PYG{o}{=}\PYG{l+m+mf}{0.6}\PYG{p}{,} \PYG{n}{pad}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xticklabels}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}yticklabels}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{set\PYGZus{}constrained\PYGZus{}layout\PYGZus{}pads}\PYG{p}{(}\PYG{n}{w\PYGZus{}pad}\PYG{o}{=}\PYG{l+m+mf}{2.}\PYG{o}{/}\PYG{l+m+mf}{72.}\PYG{p}{,} \PYG{n}{h\PYGZus{}pad}\PYG{o}{=}\PYG{l+m+mf}{2.}\PYG{o}{/}\PYG{l+m+mf}{72.}\PYG{p}{,} \PYG{n}{hspace}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{n}{wspace}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_015}.png} In the above example, the colorbar will not ever be closer than 2 pts to the plot, but if we want it a bit further away, we can specify its value for \sphinxcode{\sphinxupquote{pad}} to be non-zero. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{axs}\PYG{o}{.}\PYG{n}{flatten}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{pc} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{im}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{shrink}\PYG{o}{=}\PYG{l+m+mf}{0.6}\PYG{p}{,} \PYG{n}{pad}\PYG{o}{=}\PYG{l+m+mf}{0.05}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xticklabels}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}yticklabels}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{set\PYGZus{}constrained\PYGZus{}layout\PYGZus{}pads}\PYG{p}{(}\PYG{n}{w\PYGZus{}pad}\PYG{o}{=}\PYG{l+m+mf}{2.}\PYG{o}{/}\PYG{l+m+mf}{72.}\PYG{p}{,} \PYG{n}{h\PYGZus{}pad}\PYG{o}{=}\PYG{l+m+mf}{2.}\PYG{o}{/}\PYG{l+m+mf}{72.}\PYG{p}{,} \PYG{n}{hspace}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{n}{wspace}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_016}.png} \paragraph{rcParams} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:rcparams}} There are five \sphinxcode{\sphinxupquote{rcParams}} that can be set, either in a script or in the \sphinxcode{\sphinxupquote{matplotlibrc}} file. They all have the prefix \sphinxcode{\sphinxupquote{figure.constrained\_layout}}: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{use}}: Whether to use constrained\_layout. Default is False \item {} \begin{description} \item[{\sphinxcode{\sphinxupquote{w\_pad}}, \sphinxcode{\sphinxupquote{h\_pad}} Padding around axes objects.}] \leavevmode Float representing inches. Default is 3./72. inches (3 pts) \end{description} \item {} \begin{description} \item[{\sphinxcode{\sphinxupquote{wspace}}, \sphinxcode{\sphinxupquote{hspace}} Space between subplot groups.}] \leavevmode Float representing a fraction of the subplot widths being separated. Default is 0.02. \end{description} \end{itemize} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{figure.constrained\PYGZus{}layout.use}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{n+nb+bp}{True} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{axs}\PYG{o}{.}\PYG{n}{flatten}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_017}.png} \subsubsection{Use with GridSpec} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:use-with-gridspec}} constrained\_layout is meant to be used with {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.subplots}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots()}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpec()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_subplot()}}}}}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{gs1} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{figure}\PYG{o}{=}\PYG{n}{fig}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_018}.png} More complicated gridspec layouts are possible… \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{gs0} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{figure}\PYG{o}{=}\PYG{n}{fig}\PYG{p}{)} \PYG{n}{gs1} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpecFromSubplotSpec}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{gs0}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs1}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{)} \PYG{n}{gs2} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpecFromSubplotSpec}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{gs0}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ss} \PYG{o+ow}{in} \PYG{n}{gs2}\PYG{p}{:} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{ss}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{x\PYGZhy{}label}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{12}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_019}.png} Note that in the above the left and columns don’t have the same vertical extent. If we want the top and bottom of the two grids to line up then they need to be in the same gridspec: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{gs0} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{l+m+mi}{6}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{figure}\PYG{o}{=}\PYG{n}{fig}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs0}\PYG{p}{[}\PYG{p}{:}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs0}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs0}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{:}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs0}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs0}\PYG{p}{[}\PYG{l+m+mi}{4}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_020}.png} This example uses two gridspecs to have the colorbar only pertain to one set of pcolors. Note how the left column is wider than the two right-hand columns because of this. Of course, if you wanted the subplots to be the same size you only needed one gridspec. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{docomplicated}\PYG{p}{(}\PYG{n}{suptitle}\PYG{o}{=}\PYG{n+nb+bp}{None}\PYG{p}{)}\PYG{p}{:} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{gs0} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{figure}\PYG{o}{=}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{width\PYGZus{}ratios}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mf}{1.}\PYG{p}{,} \PYG{l+m+mf}{2.}\PYG{p}{]}\PYG{p}{)} \PYG{n}{gsl} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpecFromSubplotSpec}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{gs0}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{gsr} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpecFromSubplotSpec}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{gs0}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{k}{for} \PYG{n}{gs} \PYG{o+ow}{in} \PYG{n}{gsl}\PYG{p}{:} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \PYG{n}{axs} \PYG{o}{=} \PYG{p}{[}\PYG{p}{]} \PYG{k}{for} \PYG{n}{gs} \PYG{o+ow}{in} \PYG{n}{gsr}\PYG{p}{:} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{)} \PYG{n}{pcm} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{x\PYGZhy{}label}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{y\PYGZhy{}label}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{title}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{axs} \PYG{o}{+}\PYG{o}{=} \PYG{p}{[}\PYG{n}{ax}\PYG{p}{]} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{pcm}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{axs}\PYG{p}{)} \PYG{k}{if} \PYG{n}{suptitle} \PYG{o+ow}{is} \PYG{o+ow}{not} \PYG{n+nb+bp}{None}\PYG{p}{:} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{suptitle}\PYG{p}{(}\PYG{n}{suptitle}\PYG{p}{)} \PYG{n}{docomplicated}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_021}.png} \subsubsection{Manually setting axes positions} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:manually-setting-axes-positions}} There can be good reasons to manually set an axes position. A manual call to \sphinxcode{\sphinxupquote{ax.set\_position()}} will set the axes so constrained\_layout has no effect on it anymore. (Note that constrained\_layout still leaves the space for the axes that is moved). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{12}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}position}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{l+m+mf}{0.4}\PYG{p}{,} \PYG{l+m+mf}{0.4}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_022}.png} If you want an inset axes in data-space, you need to manually execute the layout using \sphinxcode{\sphinxupquote{fig.execute\_constrained\_layout()}} call. The inset figure will then be properly positioned. However, it will not be properly positioned if the size of the figure is subsequently changed. Similarly, if the figure is printed to another backend, there may be slight changes of location due to small differences in how the backends render fonts. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib.transforms} \PYG{k+kn}{import} \PYG{n}{Bbox} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{12}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{execute\PYGZus{}constrained\PYGZus{}layout}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} put into data\PYGZhy{}space:} \PYG{n}{bb\PYGZus{}data\PYGZus{}ax2} \PYG{o}{=} \PYG{n}{Bbox}\PYG{o}{.}\PYG{n}{from\PYGZus{}bounds}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{1.}\PYG{p}{,} \PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{l+m+mf}{0.4}\PYG{p}{)} \PYG{n}{disp\PYGZus{}coords} \PYG{o}{=} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{transData}\PYG{o}{.}\PYG{n}{transform}\PYG{p}{(}\PYG{n}{bb\PYGZus{}data\PYGZus{}ax2}\PYG{p}{)} \PYG{n}{fig\PYGZus{}coords\PYGZus{}ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{transFigure}\PYG{o}{.}\PYG{n}{inverted}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{transform}\PYG{p}{(}\PYG{n}{disp\PYGZus{}coords}\PYG{p}{)} \PYG{n}{bb\PYGZus{}ax2} \PYG{o}{=} \PYG{n}{Bbox}\PYG{p}{(}\PYG{n}{fig\PYGZus{}coords\PYGZus{}ax2}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{n}{bb\PYGZus{}ax2}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_023}.png} \subsubsection{Limitations} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:limitations}} \paragraph{Incompatible functions} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:incompatible-functions}} \sphinxcode{\sphinxupquote{constrained\_layout}} will not work on subplots created via the \sphinxcode{\sphinxupquote{subplot}} command. The reason is that each of these commands creates a separate \sphinxcode{\sphinxupquote{GridSpec}} instance and \sphinxcode{\sphinxupquote{constrained\_layout}} uses (nested) gridspecs to carry out the layout. So the following fails to yield a nice layout: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{221}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{223}\PYG{p}{)} \PYG{n}{ax3} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{122}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax3}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_024}.png} Of course that layout is possible using a gridspec: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{gs} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{figure}\PYG{o}{=}\PYG{n}{fig}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax3} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax3}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_025}.png} Similarly, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot2grid:matplotlib.pyplot.subplot2grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot2grid()}}}}} doesn’t work for the same reason: each call creates a different parent gridspec. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot2grid}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot2grid}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{,} \PYG{n}{colspan}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{ax3} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot2grid}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{,} \PYG{n}{colspan}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{rowspan}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{ax4} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot2grid}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{,} \PYG{n}{rowspan}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax3}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax4}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_026}.png} The way to make this plot compatible with \sphinxcode{\sphinxupquote{constrained\_layout}} is again to use \sphinxcode{\sphinxupquote{gridspec}} directly \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{gs} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{figure}\PYG{o}{=}\PYG{n}{fig}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax3} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{:}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax4} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax3}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax4}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_027}.png} \paragraph{Other Caveats} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:other-caveats}}\begin{itemize} \item {} \sphinxcode{\sphinxupquote{constrained\_layout}} only considers ticklabels, axis labels, titles, and legends. Thus, other artists may be clipped and also may overlap. \item {} It assumes that the extra space needed for ticklabels, axis labels, and titles is independent of original location of axes. This is often true, but there are rare cases where it is not. \item {} There are small differences in how the backends handle rendering fonts, so the results will not be pixel-identical. \end{itemize} \subsubsection{Debugging} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:debugging}} Constrained-layout can fail in somewhat unexpected ways. Because it uses a constraint solver the solver can find solutions that are mathematically correct, but that aren’t at all what the user wants. The usual failure mode is for all sizes to collapse to their smallest allowable value. If this happens, it is for one of two reasons: \begin{enumerate} \item {} There was not enough room for the elements you were requesting to draw. \item {} There is a bug - in which case open an issue at \sphinxurl{https://github.com/matplotlib/matplotlib/issues}. \end{enumerate} If there is a bug, please report with a self-contained example that does not require outside data or dependencies (other than numpy). \subsubsection{Notes on the algorithm} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:notes-on-the-algorithm}} The algorithm for the constraint is relatively straightforward, but has some complexity due to the complex ways we can layout a figure. \paragraph{Figure layout} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:figure-layout}} Figures are laid out in a hierarchy: \begin{enumerate} \item {} Figure: \sphinxcode{\sphinxupquote{fig = plt.figure()}} \end{enumerate} \begin{enumerate} \item {} Gridspec \sphinxcode{\sphinxupquote{gs0 = gridspec.GridSpec(1, 2, figure=fig)}} \begin{quote} \begin{enumerate} \item {} Subplotspec: \sphinxcode{\sphinxupquote{ss = gs{[}0, 0{]}}} \begin{enumerate} \item {} Axes: \sphinxcode{\sphinxupquote{ax0 = fig.add\_subplot(ss)}} \end{enumerate} \item {} Subplotspec: \sphinxcode{\sphinxupquote{ss = gs{[}0, 1{]}}} \end{enumerate} \begin{enumerate} \item {} Gridspec: \sphinxcode{\sphinxupquote{gsR = gridspec.GridSpecFromSubplotSpec(2, 1, ss)}} \begin{itemize} \item {} Subplotspec: ss = gsR{[}0, 0{]} \begin{itemize} \item {} Axes: \sphinxcode{\sphinxupquote{axR0 = fig.add\_subplot(ss)}} \end{itemize} \item {} Subplotspec: ss = gsR{[}1, 0{]} \begin{itemize} \item {} Axes: \sphinxcode{\sphinxupquote{axR1 = fig.add\_subplot(ss)}} \end{itemize} \end{itemize} \end{enumerate} \end{quote} \end{enumerate} Each item has a layoutbox associated with it. The nesting of gridspecs created with {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecFromSubplotSpec:matplotlib.gridspec.GridSpecFromSubplotSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpecFromSubplotSpec}}}}} can be arbitrarily deep. Each {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} has \sphinxstyleemphasis{two} layoutboxes. The first one \sphinxcode{\sphinxupquote{ax.\_layoutbox}} represents the outside of the Axes and all its decorations (i.e. ticklabels, axis labels, etc.). The second layoutbox corresponds to the Axes’ \sphinxcode{\sphinxupquote{ax.position}}, which sets where in the figure the spines are placed. Why so many stacked containers? Ideally, all that would be needed are the Axes layout boxes. For the Gridspec case, a container is needed if the Gridspec is nested via {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecFromSubplotSpec:matplotlib.gridspec.GridSpecFromSubplotSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpecFromSubplotSpec}}}}}. At the top level, it is desirable for symmetry, but it also makes room for {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.suptitle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{suptitle}}}}}. For the Subplotspec/Axes case, Axes often have colorbars or other annotations that need to be packaged inside the Subplotspec, hence the need for the outer layer. \paragraph{Simple case: one Axes} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:simple-case-one-axes}} For a single Axes the layout is straight forward. The Figure and outer Gridspec layoutboxes coincide. The Subplotspec and Axes boxes also coincide because the Axes has no colorbar. Note the difference between the red \sphinxcode{\sphinxupquote{pos}} box and the green \sphinxcode{\sphinxupquote{ax}} box is set by the size of the decorations around the Axes. In the code, this is accomplished by the entries in \sphinxcode{\sphinxupquote{do\_constrained\_layout}} like: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{\PYGZus{}poslayoutbox}\PYG{o}{.}\PYG{n}{edit\PYGZus{}left\PYGZus{}margin\PYGZus{}min}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{n}{bbox}\PYG{o}{.}\PYG{n}{x0} \PYG{o}{+} \PYG{n}{pos}\PYG{o}{.}\PYG{n}{x0} \PYG{o}{+} \PYG{n}{w\PYGZus{}padt}\PYG{p}{)} \end{sphinxVerbatim} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib.\PYGZus{}layoutbox} \PYG{k+kn}{import} \PYG{n}{plot\PYGZus{}children} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{24}\PYG{p}{)} \PYG{n}{plot\PYGZus{}children}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{\PYGZus{}layoutbox}\PYG{p}{,} \PYG{n}{printit}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_028}.png} \paragraph{Simple case: two Axes} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:simple-case-two-axes}} For this case, the Axes layoutboxes and the Subplotspec boxes still co-incide. However, because the decorations in the right-hand plot are so much smaller than the left-hand, so the right-hand layoutboxes are smaller. The Subplotspec boxes are laid out in the code in the subroutine \sphinxcode{\sphinxupquote{arange\_subplotspecs}}, which simply checks the subplotspecs in the code against one another and stacks them appropriately. The two \sphinxcode{\sphinxupquote{pos}} axes are lined up. Because they have the same minimum row, they are lined up at the top. Because they have the same maximum row they are lined up at the bottom. In the code this is accomplished via the calls to \sphinxcode{\sphinxupquote{layoutbox.align}}. If there was more than one row, then the same horizontal alignment would occur between the rows. The two \sphinxcode{\sphinxupquote{pos}} axes are given the same width because the subplotspecs occupy the same number of columns. This is accomplished in the code where \sphinxcode{\sphinxupquote{dcols0}} is compared to \sphinxcode{\sphinxupquote{dcolsC}}. If they are equal, then their widths are constrained to be equal. While it is a bit subtle in this case, note that the division between the Subplotspecs is \sphinxstyleemphasis{not} centered, but has been moved to the right to make space for the larger labels on the left-hand plot. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{32}\PYG{p}{)} \PYG{n}{example\PYGZus{}plot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{8}\PYG{p}{)} \PYG{n}{plot\PYGZus{}children}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{\PYGZus{}layoutbox}\PYG{p}{,} \PYG{n}{printit}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_029}.png} \paragraph{Two Axes and colorbar} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:two-axes-and-colorbar}} Adding a colorbar makes it clear why the Subplotspec layoutboxes must be different from the axes layoutboxes. Here we see the left-hand subplotspec has more room to accommodate the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar}}}}}, and that there are two green \sphinxcode{\sphinxupquote{ax}} boxes inside the \sphinxcode{\sphinxupquote{ss}} box. Note that the width of the \sphinxcode{\sphinxupquote{pos}} boxes is still the same because of the constraint on their widths because their subplotspecs occupy the same number of columns (one in this example). The colorbar layout logic is contained in {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.make_axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{make\_axes}}}}} which call \sphinxcode{\sphinxupquote{\_constrained\_layout.layoutcolorbarsingle}} for cbars attached to a single axes, and \sphinxcode{\sphinxupquote{\_constrained\_layout.layoutcolorbargridspec}} if the colorbar is associated wiht a gridspec. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{im}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{shrink}\PYG{o}{=}\PYG{l+m+mf}{0.6}\PYG{p}{)} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{plot\PYGZus{}children}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{\PYGZus{}layoutbox}\PYG{p}{,} \PYG{n}{printit}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_030}.png} \paragraph{Colorbar associated with a Gridspec} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:colorbar-associated-with-a-gridspec}} This example shows the Subplotspec layoutboxes being made smaller by a colorbar layoutbox. The size of the colorbar layoutbox is set to be \sphinxstyleemphasis{shrink} smaller than the vertical extent of the \sphinxcode{\sphinxupquote{pos}} layoutboxes in the gridspec, and it is made to be centered between those two points. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{k}{for} \PYG{n}{a} \PYG{o+ow}{in} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{flatten}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{im} \PYG{o}{=} \PYG{n}{a}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{im}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{shrink}\PYG{o}{=}\PYG{l+m+mf}{0.6}\PYG{p}{)} \PYG{n}{plot\PYGZus{}children}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{\PYGZus{}layoutbox}\PYG{p}{,} \PYG{n}{printit}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_031}.png} \paragraph{Uneven sized Axes} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:uneven-sized-axes}} There are two ways to make axes have an uneven size in a Gridspec layout, either by specifying them to cross Gridspecs rows or columns, or by specifying width and height ratios. The first method is used here. The constraint that makes the heights be correct is in the code where \sphinxcode{\sphinxupquote{drowsC \textless{} drows0}} which in this case would be 1 is less than 2. So we constrain the height of the 1-row Axes to be less than half the height of the 2-row Axes. \begin{sphinxadmonition}{note}{Note:} This algorithm can be wrong if the decorations attached to the smaller axes are very large, so there is an unaccounted-for edge case. \end{sphinxadmonition} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{gs} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{figure}\PYG{o}{=}\PYG{n}{fig}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{plot\PYGZus{}children}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{\PYGZus{}layoutbox}\PYG{p}{,} \PYG{n}{printit}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_032}.png} Height and width ratios are accommodated with the same part of the code with the smaller axes always constrained to be less in size than the larger. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{gs} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{figure}\PYG{o}{=}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{height\PYGZus{}ratios}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mf}{1.}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{1.5}\PYG{p}{]}\PYG{p}{,} \PYG{n}{width\PYGZus{}ratios}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mf}{1.2}\PYG{p}{,} \PYG{l+m+mf}{0.8}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{p}{:}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{plot\PYGZus{}children}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{\PYGZus{}layoutbox}\PYG{p}{,} \PYG{n}{printit}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_033}.png} \paragraph{Empty gridspec slots} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:empty-gridspec-slots}} The final piece of the code that has not been explained is what happens if there is an empty gridspec opening. In that case a fake invisible axes is added and we proceed as before. The empty gridspec has no decorations, but the axes position in made the same size as the occupied Axes positions. This is done at the start of \sphinxcode{\sphinxupquote{do\_constrained\_layout}} (\sphinxcode{\sphinxupquote{hassubplotspec}}). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{constrained\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{gs} \PYG{o}{=} \PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{figure}\PYG{o}{=}\PYG{n}{fig}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{gs}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{im} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{arr}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{pc\PYGZus{}kwargs}\PYG{p}{)} \PYG{n}{plot\PYGZus{}children}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{\PYGZus{}layoutbox}\PYG{p}{,} \PYG{n}{printit}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_constrainedlayout_guide_034}.png} \paragraph{Other notes} \label{\detokenize{tutorials/intermediate/constrainedlayout_guide:other-notes}} The layout is called only once. This is OK if the original layout was pretty close (which it should be in most cases). However, if the layout changes a lot from the default layout then the decorators can change size. In particular the x and ytick labels can change. If this happens, then we should probably call the whole routine twice. \sphinxstylestrong{Total running time of the script:} ( 0 minutes 1.904 seconds) \phantomsection\label{\detokenize{tutorials/intermediate/constrainedlayout_guide:sphx-glr-download-tutorials-intermediate-constrainedlayout-guide-py}} \section{Advanced} \label{\detokenize{tutorials/index:advanced}}\label{\detokenize{tutorials/index:tutorials-advanced}} These tutorials cover advanced topics for experienced Matplotlib users and developers. \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/advanced/patheffects_guide:sphx-glr-download-tutorials-advanced-patheffects-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Path effects guide} \label{\detokenize{tutorials/advanced/patheffects_guide:path-effects-guide}}\label{\detokenize{tutorials/advanced/patheffects_guide:sphx-glr-tutorials-advanced-patheffects-guide-py}}\label{\detokenize{tutorials/advanced/patheffects_guide::doc}} Defining paths that objects follow on a canvas. \phantomsection\label{\detokenize{tutorials/advanced/patheffects_guide:module-matplotlib.patheffects}}\index{matplotlib.patheffects (module)} Matplotlib’s {\hyperref[\detokenize{tutorials/advanced/patheffects_guide:module-matplotlib.patheffects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{patheffects}}}}} module provides functionality to apply a multiple draw stage to any Artist which can be rendered via a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}. Artists which can have a path effect applied to them include {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}}, {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Collection}}}}} and even {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}}. Each artist’s path effects can be controlled via the \sphinxcode{\sphinxupquote{set\_path\_effects}} method ({\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_path\_effects}}}}}), which takes an iterable of {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} instances. The simplest path effect is the {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.Normal}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normal}}}}} effect, which simply draws the artist without any effect: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.patheffects} \PYG{k+kn}{as} \PYG{n+nn}{path\PYGZus{}effects} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mf}{1.5}\PYG{p}{)}\PYG{p}{)} \PYG{n}{text} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Hello path effects world!}\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s1}{This is the normal }\PYG{l+s+s1}{\PYGZsq{}} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{path effect.}\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s1}{Pretty dull, huh?}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{size}\PYG{o}{=}\PYG{l+m+mi}{20}\PYG{p}{)} \PYG{n}{text}\PYG{o}{.}\PYG{n}{set\PYGZus{}path\PYGZus{}effects}\PYG{p}{(}\PYG{p}{[}\PYG{n}{path\PYGZus{}effects}\PYG{o}{.}\PYG{n}{Normal}\PYG{p}{(}\PYG{p}{)}\PYG{p}{]}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_patheffects_guide_001}.png} Whilst the plot doesn’t look any different to what you would expect without any path effects, the drawing of the text now been changed to use the path effects framework, opening up the possibilities for more interesting examples. \subsubsection{Adding a shadow} \label{\detokenize{tutorials/advanced/patheffects_guide:adding-a-shadow}} A far more interesting path effect than {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.Normal}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normal}}}}} is the drop-shadow, which we can apply to any of our path based artists. The classes {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.SimplePatchShadow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SimplePatchShadow}}}}} and {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.SimpleLineShadow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SimpleLineShadow}}}}} do precisely this by drawing either a filled patch or a line patch below the original artist: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.patheffects} \PYG{k+kn}{as} \PYG{n+nn}{path\PYGZus{}effects} \PYG{n}{text} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Hello path effects world!}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{path\PYGZus{}effects}\PYG{o}{=}\PYG{p}{[}\PYG{n}{path\PYGZus{}effects}\PYG{o}{.}\PYG{n}{withSimplePatchShadow}\PYG{p}{(}\PYG{p}{)}\PYG{p}{]}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{]}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{blue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{path\PYGZus{}effects}\PYG{o}{=}\PYG{p}{[}\PYG{n}{path\PYGZus{}effects}\PYG{o}{.}\PYG{n}{SimpleLineShadow}\PYG{p}{(}\PYG{p}{)}\PYG{p}{,} \PYG{n}{path\PYGZus{}effects}\PYG{o}{.}\PYG{n}{Normal}\PYG{p}{(}\PYG{p}{)}\PYG{p}{]}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_patheffects_guide_002}.png} Notice the two approaches to setting the path effects in this example. The first uses the \sphinxcode{\sphinxupquote{with*}} classes to include the desired functionality automatically followed with the “normal” effect, whereas the latter explicitly defines the two path effects to draw. \subsubsection{Making an artist stand out} \label{\detokenize{tutorials/advanced/patheffects_guide:making-an-artist-stand-out}} One nice way of making artists visually stand out is to draw an outline in a bold color below the actual artist. The {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.Stroke}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Stroke}}}}} path effect makes this a relatively simple task: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{7}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{)} \PYG{n}{text} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{This text stands out because of}\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s1}{\PYGZsq{}} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{its black border.}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{white}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{size}\PYG{o}{=}\PYG{l+m+mi}{30}\PYG{p}{)} \PYG{n}{text}\PYG{o}{.}\PYG{n}{set\PYGZus{}path\PYGZus{}effects}\PYG{p}{(}\PYG{p}{[}\PYG{n}{path\PYGZus{}effects}\PYG{o}{.}\PYG{n}{Stroke}\PYG{p}{(}\PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{foreground}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{black}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{,} \PYG{n}{path\PYGZus{}effects}\PYG{o}{.}\PYG{n}{Normal}\PYG{p}{(}\PYG{p}{)}\PYG{p}{]}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_patheffects_guide_003}.png} It is important to note that this effect only works because we have drawn the text path twice; once with a thick black line, and then once with the original text path on top. You may have noticed that the keywords to {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.Stroke}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Stroke}}}}} and {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.SimplePatchShadow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SimplePatchShadow}}}}} and {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.SimpleLineShadow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SimpleLineShadow}}}}} are not the usual Artist keywords (such as \sphinxcode{\sphinxupquote{facecolor}} and \sphinxcode{\sphinxupquote{edgecolor}} etc.). This is because with these path effects we are operating at lower level of matplotlib. In fact, the keywords which are accepted are those for a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.GraphicsContextBase}}}}} instance, which have been designed for making it easy to create new backends - and not for its user interface. \subsubsection{Greater control of the path effect artist} \label{\detokenize{tutorials/advanced/patheffects_guide:greater-control-of-the-path-effect-artist}} As already mentioned, some of the path effects operate at a lower level than most users will be used to, meaning that setting keywords such as \sphinxcode{\sphinxupquote{facecolor}} and \sphinxcode{\sphinxupquote{edgecolor}} raise an AttributeError. Luckily there is a generic {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.PathPatchEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathPatchEffect}}}}} path effect which creates a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.PathPatch:matplotlib.patches.PathPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathPatch}}}}} class with the original path. The keywords to this effect are identical to those of {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.PathPatch:matplotlib.patches.PathPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathPatch}}}}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{8}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{)} \PYG{n}{t} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.02}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Hatch shadow}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{75}\PYG{p}{,} \PYG{n}{weight}\PYG{o}{=}\PYG{l+m+mi}{1000}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{t}\PYG{o}{.}\PYG{n}{set\PYGZus{}path\PYGZus{}effects}\PYG{p}{(}\PYG{p}{[}\PYG{n}{path\PYGZus{}effects}\PYG{o}{.}\PYG{n}{PathPatchEffect}\PYG{p}{(}\PYG{n}{offset}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{,} \PYG{n}{hatch}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{xxxx}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{gray}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{,} \PYG{n}{path\PYGZus{}effects}\PYG{o}{.}\PYG{n}{PathPatchEffect}\PYG{p}{(}\PYG{n}{edgecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{white}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mf}{1.1}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{black}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{]}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_patheffects_guide_004}.png} \phantomsection\label{\detokenize{tutorials/advanced/patheffects_guide:sphx-glr-download-tutorials-advanced-patheffects-guide-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/advanced/path_tutorial:sphx-glr-download-tutorials-advanced-path-tutorial-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Path Tutorial} \label{\detokenize{tutorials/advanced/path_tutorial:path-tutorial}}\label{\detokenize{tutorials/advanced/path_tutorial:sphx-glr-tutorials-advanced-path-tutorial-py}}\label{\detokenize{tutorials/advanced/path_tutorial::doc}} Defining paths in your Matplotlib visualization. The object underlying all of the \sphinxcode{\sphinxupquote{matplotlib.patch}} objects is the {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, which supports the standard set of moveto, lineto, curveto commands to draw simple and compound outlines consisting of line segments and splines. The \sphinxcode{\sphinxupquote{Path}} is instantiated with a (N,2) array of (x,y) vertices, and a N-length array of path codes. For example to draw the unit rectangle from (0,0) to (1,1), we could use this code \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib.path} \PYG{k+kn}{import} \PYG{n}{Path} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.patches} \PYG{k+kn}{as} \PYG{n+nn}{patches} \PYG{n}{verts} \PYG{o}{=} \PYG{p}{[} \PYG{p}{(}\PYG{l+m+mf}{0.}\PYG{p}{,} \PYG{l+m+mf}{0.}\PYG{p}{)}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} left, bottom} \PYG{p}{(}\PYG{l+m+mf}{0.}\PYG{p}{,} \PYG{l+m+mf}{1.}\PYG{p}{)}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} left, top} \PYG{p}{(}\PYG{l+m+mf}{1.}\PYG{p}{,} \PYG{l+m+mf}{1.}\PYG{p}{)}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} right, top} \PYG{p}{(}\PYG{l+m+mf}{1.}\PYG{p}{,} \PYG{l+m+mf}{0.}\PYG{p}{)}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} right, bottom} \PYG{p}{(}\PYG{l+m+mf}{0.}\PYG{p}{,} \PYG{l+m+mf}{0.}\PYG{p}{)}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} ignored} \PYG{p}{]} \PYG{n}{codes} \PYG{o}{=} \PYG{p}{[} \PYG{n}{Path}\PYG{o}{.}\PYG{n}{MOVETO}\PYG{p}{,} \PYG{n}{Path}\PYG{o}{.}\PYG{n}{LINETO}\PYG{p}{,} \PYG{n}{Path}\PYG{o}{.}\PYG{n}{LINETO}\PYG{p}{,} \PYG{n}{Path}\PYG{o}{.}\PYG{n}{LINETO}\PYG{p}{,} \PYG{n}{Path}\PYG{o}{.}\PYG{n}{CLOSEPOLY}\PYG{p}{,} \PYG{p}{]} \PYG{n}{path} \PYG{o}{=} \PYG{n}{Path}\PYG{p}{(}\PYG{n}{verts}\PYG{p}{,} \PYG{n}{codes}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{patch} \PYG{o}{=} \PYG{n}{patches}\PYG{o}{.}\PYG{n}{PathPatch}\PYG{p}{(}\PYG{n}{path}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{orange}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{add\PYGZus{}patch}\PYG{p}{(}\PYG{n}{patch}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_path_tutorial_001}.png} The following path codes are recognized \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily Code &\sphinxstyletheadfamily Vertices &\sphinxstyletheadfamily Description \\ \hline \sphinxcode{\sphinxupquote{STOP}} & 1 (ignored) & A marker for the end of the entire path (currently not required and ignored) \\ \hline \sphinxcode{\sphinxupquote{MOVETO}} & 1 & Pick up the pen and move to the given vertex. \\ \hline \sphinxcode{\sphinxupquote{LINETO}} & 1 & Draw a line from the current position to the given vertex. \\ \hline \sphinxcode{\sphinxupquote{CURVE3}} & 2 (1 control point, 1 endpoint) & Draw a quadratic Bézier curve from the current position, with the given control point, to the given end point. \\ \hline \sphinxcode{\sphinxupquote{CURVE4}} & 3 (2 control points, 1 endpoint) & Draw a cubic Bézier curve from the current position, with the given control points, to the given end point. \\ \hline \sphinxcode{\sphinxupquote{CLOSEPOLY}} & 1 (point itself is ignored) & Draw a line segment to the start point of the current polyline. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \subsubsection{Bézier example} \label{\detokenize{tutorials/advanced/path_tutorial:bezier-example}} Some of the path components require multiple vertices to specify them: for example CURVE 3 is a \sphinxhref{https://en.wikipedia.org/wiki/B\%C3\%A9zier\_curve}{bézier} curve with one control point and one end point, and CURVE4 has three vertices for the two control points and the end point. The example below shows a CURVE4 Bézier spline \textendash{} the bézier curve will be contained in the convex hull of the start point, the two control points, and the end point \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{verts} \PYG{o}{=} \PYG{p}{[} \PYG{p}{(}\PYG{l+m+mf}{0.}\PYG{p}{,} \PYG{l+m+mf}{0.}\PYG{p}{)}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} P0} \PYG{p}{(}\PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{l+m+mf}{1.}\PYG{p}{)}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} P1} \PYG{p}{(}\PYG{l+m+mf}{1.}\PYG{p}{,} \PYG{l+m+mf}{0.8}\PYG{p}{)}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} P2} \PYG{p}{(}\PYG{l+m+mf}{0.8}\PYG{p}{,} \PYG{l+m+mf}{0.}\PYG{p}{)}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} P3} \PYG{p}{]} \PYG{n}{codes} \PYG{o}{=} \PYG{p}{[} \PYG{n}{Path}\PYG{o}{.}\PYG{n}{MOVETO}\PYG{p}{,} \PYG{n}{Path}\PYG{o}{.}\PYG{n}{CURVE4}\PYG{p}{,} \PYG{n}{Path}\PYG{o}{.}\PYG{n}{CURVE4}\PYG{p}{,} \PYG{n}{Path}\PYG{o}{.}\PYG{n}{CURVE4}\PYG{p}{,} \PYG{p}{]} \PYG{n}{path} \PYG{o}{=} \PYG{n}{Path}\PYG{p}{(}\PYG{n}{verts}\PYG{p}{,} \PYG{n}{codes}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{patch} \PYG{o}{=} \PYG{n}{patches}\PYG{o}{.}\PYG{n}{PathPatch}\PYG{p}{(}\PYG{n}{path}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{none}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{add\PYGZus{}patch}\PYG{p}{(}\PYG{n}{patch}\PYG{p}{)} \PYG{n}{xs}\PYG{p}{,} \PYG{n}{ys} \PYG{o}{=} \PYG{n+nb}{zip}\PYG{p}{(}\PYG{o}{*}\PYG{n}{verts}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{xs}\PYG{p}{,} \PYG{n}{ys}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{x\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{black}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ms}\PYG{o}{=}\PYG{l+m+mi}{10}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.05}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.05}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{P0}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.15}\PYG{p}{,} \PYG{l+m+mf}{1.05}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{P1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{1.05}\PYG{p}{,} \PYG{l+m+mf}{0.85}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{P2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.85}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.05}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{P3}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{1.1}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{1.1}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_path_tutorial_002}.png} \subsubsection{Compound paths} \label{\detokenize{tutorials/advanced/path_tutorial:compound-paths}} All of the simple patch primitives in matplotlib, Rectangle, Circle, Polygon, etc, are implemented with simple path. Plotting functions like {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hist:matplotlib.axes.Axes.hist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hist()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.bar:matplotlib.axes.Axes.bar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bar()}}}}}, which create a number of primitives, e.g., a bunch of Rectangles, can usually be implemented more efficiently using a compound path. The reason \sphinxcode{\sphinxupquote{bar}} creates a list of rectangles and not a compound path is largely historical: the {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} code is comparatively new and \sphinxcode{\sphinxupquote{bar}} predates it. While we could change it now, it would break old code, so here we will cover how to create compound paths, replacing the functionality in bar, in case you need to do so in your own code for efficiency reasons, e.g., you are creating an animated bar plot. We will make the histogram chart by creating a series of rectangles for each histogram bar: the rectangle width is the bin width and the rectangle height is the number of datapoints in that bin. First we’ll create some random normally distributed data and compute the histogram. Because numpy returns the bin edges and not centers, the length of \sphinxcode{\sphinxupquote{bins}} is 1 greater than the length of \sphinxcode{\sphinxupquote{n}} in the example below: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} histogram our data with numpy} \PYG{n}{data} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{1000}\PYG{p}{)} \PYG{n}{n}\PYG{p}{,} \PYG{n}{bins} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{histogram}\PYG{p}{(}\PYG{n}{data}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{)} \end{sphinxVerbatim} We’ll now extract the corners of the rectangles. Each of the \sphinxcode{\sphinxupquote{left}}, \sphinxcode{\sphinxupquote{bottom}}, etc, arrays below is \sphinxcode{\sphinxupquote{len(n)}}, where \sphinxcode{\sphinxupquote{n}} is the array of counts for each histogram bar: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} get the corners of the rectangles for the histogram} \PYG{n}{left} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{array}\PYG{p}{(}\PYG{n}{bins}\PYG{p}{[}\PYG{p}{:}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{right} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{array}\PYG{p}{(}\PYG{n}{bins}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{]}\PYG{p}{)} \PYG{n}{bottom} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{zeros}\PYG{p}{(}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{left}\PYG{p}{)}\PYG{p}{)} \PYG{n}{top} \PYG{o}{=} \PYG{n}{bottom} \PYG{o}{+} \PYG{n}{n} \end{sphinxVerbatim} Now we have to construct our compound path, which will consist of a series of \sphinxcode{\sphinxupquote{MOVETO}}, \sphinxcode{\sphinxupquote{LINETO}} and \sphinxcode{\sphinxupquote{CLOSEPOLY}} for each rectangle. For each rectangle, we need 5 vertices: 1 for the \sphinxcode{\sphinxupquote{MOVETO}}, 3 for the \sphinxcode{\sphinxupquote{LINETO}}, and 1 for the \sphinxcode{\sphinxupquote{CLOSEPOLY}}. As indicated in the table above, the vertex for the closepoly is ignored but we still need it to keep the codes aligned with the vertices: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{nverts} \PYG{o}{=} \PYG{n}{nrects}\PYG{o}{*}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{o}{+}\PYG{l+m+mi}{3}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{verts} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{zeros}\PYG{p}{(}\PYG{p}{(}\PYG{n}{nverts}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{)} \PYG{n}{codes} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{ones}\PYG{p}{(}\PYG{n}{nverts}\PYG{p}{,} \PYG{n+nb}{int}\PYG{p}{)} \PYG{o}{*} \PYG{n}{path}\PYG{o}{.}\PYG{n}{Path}\PYG{o}{.}\PYG{n}{LINETO} \PYG{n}{codes}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{]} \PYG{o}{=} \PYG{n}{path}\PYG{o}{.}\PYG{n}{Path}\PYG{o}{.}\PYG{n}{MOVETO} \PYG{n}{codes}\PYG{p}{[}\PYG{l+m+mi}{4}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{]} \PYG{o}{=} \PYG{n}{path}\PYG{o}{.}\PYG{n}{Path}\PYG{o}{.}\PYG{n}{CLOSEPOLY} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{n}{left} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{=} \PYG{n}{bottom} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{n}{left} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{=} \PYG{n}{top} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{n}{right} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{=} \PYG{n}{top} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{n}{right} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{=} \PYG{n}{bottom} \end{sphinxVerbatim} All that remains is to create the path, attach it to a \sphinxcode{\sphinxupquote{PathPatch}}, and add it to our axes: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{barpath} \PYG{o}{=} \PYG{n}{path}\PYG{o}{.}\PYG{n}{Path}\PYG{p}{(}\PYG{n}{verts}\PYG{p}{,} \PYG{n}{codes}\PYG{p}{)} \PYG{n}{patch} \PYG{o}{=} \PYG{n}{patches}\PYG{o}{.}\PYG{n}{PathPatch}\PYG{p}{(}\PYG{n}{barpath}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{green}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{edgecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{yellow}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{add\PYGZus{}patch}\PYG{p}{(}\PYG{n}{patch}\PYG{p}{)} \end{sphinxVerbatim} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.patches} \PYG{k+kn}{as} \PYG{n+nn}{patches} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.path} \PYG{k+kn}{as} \PYG{n+nn}{path} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Fixing random state for reproducibility} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{19680801}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} histogram our data with numpy} \PYG{n}{data} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{1000}\PYG{p}{)} \PYG{n}{n}\PYG{p}{,} \PYG{n}{bins} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{histogram}\PYG{p}{(}\PYG{n}{data}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} get the corners of the rectangles for the histogram} \PYG{n}{left} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{array}\PYG{p}{(}\PYG{n}{bins}\PYG{p}{[}\PYG{p}{:}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{right} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{array}\PYG{p}{(}\PYG{n}{bins}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{]}\PYG{p}{)} \PYG{n}{bottom} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{zeros}\PYG{p}{(}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{left}\PYG{p}{)}\PYG{p}{)} \PYG{n}{top} \PYG{o}{=} \PYG{n}{bottom} \PYG{o}{+} \PYG{n}{n} \PYG{n}{nrects} \PYG{o}{=} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{left}\PYG{p}{)} \PYG{n}{nverts} \PYG{o}{=} \PYG{n}{nrects}\PYG{o}{*}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{o}{+}\PYG{l+m+mi}{3}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{verts} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{zeros}\PYG{p}{(}\PYG{p}{(}\PYG{n}{nverts}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{)} \PYG{n}{codes} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{ones}\PYG{p}{(}\PYG{n}{nverts}\PYG{p}{,} \PYG{n+nb}{int}\PYG{p}{)} \PYG{o}{*} \PYG{n}{path}\PYG{o}{.}\PYG{n}{Path}\PYG{o}{.}\PYG{n}{LINETO} \PYG{n}{codes}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{]} \PYG{o}{=} \PYG{n}{path}\PYG{o}{.}\PYG{n}{Path}\PYG{o}{.}\PYG{n}{MOVETO} \PYG{n}{codes}\PYG{p}{[}\PYG{l+m+mi}{4}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{]} \PYG{o}{=} \PYG{n}{path}\PYG{o}{.}\PYG{n}{Path}\PYG{o}{.}\PYG{n}{CLOSEPOLY} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{n}{left} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{=} \PYG{n}{bottom} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{n}{left} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{=} \PYG{n}{top} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{n}{right} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{=} \PYG{n}{top} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{n}{right} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{=} \PYG{n}{bottom} \PYG{n}{barpath} \PYG{o}{=} \PYG{n}{path}\PYG{o}{.}\PYG{n}{Path}\PYG{p}{(}\PYG{n}{verts}\PYG{p}{,} \PYG{n}{codes}\PYG{p}{)} \PYG{n}{patch} \PYG{o}{=} \PYG{n}{patches}\PYG{o}{.}\PYG{n}{PathPatch}\PYG{p}{(}\PYG{n}{barpath}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{green}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{edgecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{yellow}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{add\PYGZus{}patch}\PYG{p}{(}\PYG{n}{patch}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{n}{left}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{right}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{n}{bottom}\PYG{o}{.}\PYG{n}{min}\PYG{p}{(}\PYG{p}{)}\PYG{p}{,} \PYG{n}{top}\PYG{o}{.}\PYG{n}{max}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_path_tutorial_003}.png} \phantomsection\label{\detokenize{tutorials/advanced/path_tutorial:sphx-glr-download-tutorials-advanced-path-tutorial-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/advanced/transforms_tutorial:sphx-glr-download-tutorials-advanced-transforms-tutorial-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Transformations Tutorial} \label{\detokenize{tutorials/advanced/transforms_tutorial:transformations-tutorial}}\label{\detokenize{tutorials/advanced/transforms_tutorial:sphx-glr-tutorials-advanced-transforms-tutorial-py}}\label{\detokenize{tutorials/advanced/transforms_tutorial::doc}} Like any graphics packages, Matplotlib is built on top of a transformation framework to easily move between coordinate systems, the userland \sphinxcode{\sphinxupquote{data}} coordinate system, the \sphinxcode{\sphinxupquote{axes}} coordinate system, the \sphinxcode{\sphinxupquote{figure}} coordinate system, and the \sphinxcode{\sphinxupquote{display}} coordinate system. In 95\% of your plotting, you won’t need to think about this, as it happens under the hood, but as you push the limits of custom figure generation, it helps to have an understanding of these objects so you can reuse the existing transformations Matplotlib makes available to you, or create your own (see {\hyperref[\detokenize{api/transformations:module-matplotlib.transforms}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms}}}}}). The table below summarizes the some useful coordinate systems, the transformation object you should use to work in that coordinate system, and the description of that system. In the \sphinxcode{\sphinxupquote{Transformation Object}} column, \sphinxcode{\sphinxupquote{ax}} is a {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance, and \sphinxcode{\sphinxupquote{fig}} is a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline Coordinates & Transformation object & Description \\ \hline “data” & \sphinxcode{\sphinxupquote{ax.transData}} & The coordinate system for the data, controlled by xlim and ylim. \\ \hline “axes” & \sphinxcode{\sphinxupquote{ax.transAxes}} & The coordinate system of the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}; (0, 0) is bottom left of the axes, and (1, 1) is top right of the axes. \\ \hline “figure” & \sphinxcode{\sphinxupquote{fig.transFigure}} & The coordinate system of the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}; (0, 0) is bottom left of the figure, and (1, 1) is top right of the figure. \\ \hline “display” & \sphinxcode{\sphinxupquote{None}}, or \sphinxcode{\sphinxupquote{IdentityTransform()}} & The pixel coordinate system of the display; (0, 0) is bottom left of the display, and (width, height) is top right of the display in pixels. \\ \hline “xaxis”, “yaxis” & \sphinxcode{\sphinxupquote{ax.get\_xaxis\_transform()}}, \sphinxcode{\sphinxupquote{ax.get\_yaxis\_transform()}} & Blended coordinate systems; use data coordinates on one of the axis and axes coordinates on the other. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} All of the transformation objects in the table above take inputs in their coordinate system, and transform the input to the \sphinxcode{\sphinxupquote{display}} coordinate system. That is why the \sphinxcode{\sphinxupquote{display}} coordinate system has \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}} for the \sphinxcode{\sphinxupquote{Transformation Object}} column \textendash{} it already is in display coordinates. The transformations also know how to invert themselves, to go from \sphinxcode{\sphinxupquote{display}} back to the native coordinate system. This is particularly useful when processing events from the user interface, which typically occur in display space, and you want to know where the mouse click or key-press occurred in your data coordinate system. \subsubsection{Data coordinates} \label{\detokenize{tutorials/advanced/transforms_tutorial:data-coordinates}}\label{\detokenize{tutorials/advanced/transforms_tutorial:data-coords}} Let’s start with the most commonly used coordinate, the \sphinxcode{\sphinxupquote{data}} coordinate system. Whenever you add data to the axes, Matplotlib updates the datalimits, most commonly updated with the {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim:matplotlib.axes.Axes.set_xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xlim()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:matplotlib.axes.Axes.set_ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_ylim()}}}}} methods. For example, in the figure below, the data limits stretch from 0 to 10 on the x-axis, and -1 to 1 on the y-axis. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mf}{0.005}\PYG{p}{)} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{exp}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{n}{x}\PYG{o}{/}\PYG{l+m+mf}{2.}\PYG{p}{)} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{x}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_transforms_tutorial_001}.png} You can use the \sphinxcode{\sphinxupquote{ax.transData}} instance to transform from your \sphinxcode{\sphinxupquote{data}} to your \sphinxcode{\sphinxupquote{display}} coordinate system, either a single point or a sequence of points as shown below: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [14]: }\PYG{n+nb}{type}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{p}{)} \PYG{g+gh}{Out[14]: }\PYG{g+go}{\PYGZlt{}class \PYGZsq{}matplotlib.transforms.CompositeGenericTransform\PYGZsq{}\PYGZgt{}} \PYG{g+gp}{In [15]: }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{o}{.}\PYG{n}{transform}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{)} \PYG{g+gh}{Out[15]: }\PYG{g+go}{array([ 335.175, 247. ])} \PYG{g+gp}{In [16]: }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{o}{.}\PYG{n}{transform}\PYG{p}{(}\PYG{p}{[}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{]}\PYG{p}{)} \PYG{g+gh}{Out[16]:} \PYG{g+go}{array([[ 335.175, 247. ],} \PYG{g+go}{ [ 132.435, 642.2 ]])} \end{sphinxVerbatim} You can use the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.inverted}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{inverted()}}}}} method to create a transform which will take you from display to data coordinates: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [41]: }\PYG{n}{inv} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{o}{.}\PYG{n}{inverted}\PYG{p}{(}\PYG{p}{)} \PYG{g+gp}{In [42]: }\PYG{n+nb}{type}\PYG{p}{(}\PYG{n}{inv}\PYG{p}{)} \PYG{g+gh}{Out[42]: }\PYG{g+go}{\PYGZlt{}class \PYGZsq{}matplotlib.transforms.CompositeGenericTransform\PYGZsq{}\PYGZgt{}} \PYG{g+gp}{In [43]: }\PYG{n}{inv}\PYG{o}{.}\PYG{n}{transform}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mf}{335.175}\PYG{p}{,} \PYG{l+m+mf}{247.}\PYG{p}{)}\PYG{p}{)} \PYG{g+gh}{Out[43]: }\PYG{g+go}{array([ 5., 0.])} \end{sphinxVerbatim} If your are typing along with this tutorial, the exact values of the display coordinates may differ if you have a different window size or dpi setting. Likewise, in the figure below, the display labeled points are probably not the same as in the ipython session because the documentation figure size defaults are different. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mf}{0.005}\PYG{p}{)} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{exp}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{n}{x}\PYG{o}{/}\PYG{l+m+mf}{2.}\PYG{p}{)} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{x}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{xdata}\PYG{p}{,} \PYG{n}{ydata} \PYG{o}{=} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{0} \PYG{n}{xdisplay}\PYG{p}{,} \PYG{n}{ydisplay} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{o}{.}\PYG{n}{transform\PYGZus{}point}\PYG{p}{(}\PYG{p}{(}\PYG{n}{xdata}\PYG{p}{,} \PYG{n}{ydata}\PYG{p}{)}\PYG{p}{)} \PYG{n}{bbox} \PYG{o}{=} \PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{boxstyle}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{round}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{fc}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{0.8}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{arrowprops} \PYG{o}{=} \PYG{n+nb}{dict}\PYG{p}{(} \PYG{n}{arrowstyle}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZhy{}\PYGZgt{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{connectionstyle}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{angle,angleA=0,angleB=90,rad=10}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{offset} \PYG{o}{=} \PYG{l+m+mi}{72} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{data = (}\PYG{l+s+si}{\PYGZpc{}.1f}\PYG{l+s+s1}{, }\PYG{l+s+si}{\PYGZpc{}.1f}\PYG{l+s+s1}{)}\PYG{l+s+s1}{\PYGZsq{}} \PYG{o}{\PYGZpc{}} \PYG{p}{(}\PYG{n}{xdata}\PYG{p}{,} \PYG{n}{ydata}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{n}{xdata}\PYG{p}{,} \PYG{n}{ydata}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xytext}\PYG{o}{=}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{offset}\PYG{p}{)}\PYG{p}{,} \PYG{n}{textcoords}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{offset points}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{bbox}\PYG{o}{=}\PYG{n}{bbox}\PYG{p}{,} \PYG{n}{arrowprops}\PYG{o}{=}\PYG{n}{arrowprops}\PYG{p}{)} \PYG{n}{disp} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{display = (}\PYG{l+s+si}{\PYGZpc{}.1f}\PYG{l+s+s1}{, }\PYG{l+s+si}{\PYGZpc{}.1f}\PYG{l+s+s1}{)}\PYG{l+s+s1}{\PYGZsq{}} \PYG{o}{\PYGZpc{}} \PYG{p}{(}\PYG{n}{xdisplay}\PYG{p}{,} \PYG{n}{ydisplay}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{n}{xdisplay}\PYG{p}{,} \PYG{n}{ydisplay}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xytext}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{o}{*}\PYG{n}{offset}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{n}{offset}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xycoords}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{figure pixels}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{textcoords}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{offset points}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{bbox}\PYG{o}{=}\PYG{n}{bbox}\PYG{p}{,} \PYG{n}{arrowprops}\PYG{o}{=}\PYG{n}{arrowprops}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_transforms_tutorial_002}.png} \begin{sphinxadmonition}{note}{Note:} If you run the source code in the example above in a GUI backend, you may also find that the two arrows for the \sphinxcode{\sphinxupquote{data}} and \sphinxcode{\sphinxupquote{display}} annotations do not point to exactly the same point. This is because the display point was computed before the figure was displayed, and the GUI backend may slightly resize the figure when it is created. The effect is more pronounced if you resize the figure yourself. This is one good reason why you rarely want to work in display space, but you can connect to the \sphinxcode{\sphinxupquote{'on\_draw'}} {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Event}}}}} to update figure coordinates on figure draws; see {\hyperref[\detokenize{users/event_handling:event-handling-tutorial}]{\sphinxcrossref{\DUrole{std,std-ref}{Event handling and picking}}}}. \end{sphinxadmonition} When you change the x or y limits of your axes, the data limits are updated so the transformation yields a new display point. Note that when we just change the ylim, only the y-display coordinate is altered, and when we change the xlim too, both are altered. More on this later when we talk about the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [54]: }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{o}{.}\PYG{n}{transform}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{)} \PYG{g+gh}{Out[54]: }\PYG{g+go}{array([ 335.175, 247. ])} \PYG{g+gp}{In [55]: }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)} \PYG{g+gh}{Out[55]: }\PYG{g+go}{(\PYGZhy{}1, 2)} \PYG{g+gp}{In [56]: }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{o}{.}\PYG{n}{transform}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{)} \PYG{g+gh}{Out[56]: }\PYG{g+go}{array([ 335.175 , 181.13333333])} \PYG{g+gp}{In [57]: }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mi}{20}\PYG{p}{)} \PYG{g+gh}{Out[57]: }\PYG{g+go}{(10, 20)} \PYG{g+gp}{In [58]: }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{o}{.}\PYG{n}{transform}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{)} \PYG{g+gh}{Out[58]: }\PYG{g+go}{array([\PYGZhy{}171.675 , 181.13333333])} \end{sphinxVerbatim} \subsubsection{Axes coordinates} \label{\detokenize{tutorials/advanced/transforms_tutorial:axes-coordinates}}\label{\detokenize{tutorials/advanced/transforms_tutorial:axes-coords}} After the \sphinxcode{\sphinxupquote{data}} coordinate system, \sphinxcode{\sphinxupquote{axes}} is probably the second most useful coordinate system. Here the point (0, 0) is the bottom left of your axes or subplot, (0.5, 0.5) is the center, and (1.0, 1.0) is the top right. You can also refer to points outside the range, so (-0.1, 1.1) is to the left and above your axes. This coordinate system is extremely useful when placing text in your axes, because you often want a text bubble in a fixed, location, e.g., the upper left of the axes pane, and have that location remain fixed when you pan or zoom. Here is a simple example that creates four panels and labels them ‘A’, ‘B’, ‘C’, ‘D’ as you often see in journals. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{k}{for} \PYG{n}{i}\PYG{p}{,} \PYG{n}{label} \PYG{o+ow}{in} \PYG{n+nb}{enumerate}\PYG{p}{(}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{A}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{B}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{C}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{D}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{i}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.05}\PYG{p}{,} \PYG{l+m+mf}{0.95}\PYG{p}{,} \PYG{n}{label}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{16}\PYG{p}{,} \PYG{n}{fontweight}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bold}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{top}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_transforms_tutorial_003}.png} You can also make lines or patches in the axes coordinate system, but this is less useful in my experience than using \sphinxcode{\sphinxupquote{ax.transAxes}} for placing text. Nonetheless, here is a silly example which plots some random dots in \sphinxcode{\sphinxupquote{data}} space, and overlays a semi-transparent {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Circle:matplotlib.patches.Circle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Circle}}}}} centered in the middle of the axes with a radius one quarter of the axes \textendash{} if your axes does not preserve aspect ratio (see {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_aspect:matplotlib.axes.Axes.set_aspect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_aspect()}}}}}), this will look like an ellipse. Use the pan/zoom tool to move around, or manually change the data xlim and ylim, and you will see the data move, but the circle will remain fixed because it is not in \sphinxcode{\sphinxupquote{data}} coordinates and will always remain at the center of the axes. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.patches} \PYG{k+kn}{as} \PYG{n+nn}{patches} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y} \PYG{o}{=} \PYG{l+m+mi}{10}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1000}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{go}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} plot some data in data coordinates} \PYG{n}{circ} \PYG{o}{=} \PYG{n}{patches}\PYG{o}{.}\PYG{n}{Circle}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{l+m+mf}{0.25}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{yellow}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{add\PYGZus{}patch}\PYG{p}{(}\PYG{n}{circ}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_transforms_tutorial_004}.png} \subsubsection{Blended transformations} \label{\detokenize{tutorials/advanced/transforms_tutorial:blended-transformations}} Drawing in \sphinxcode{\sphinxupquote{blended}} coordinate spaces which mix \sphinxcode{\sphinxupquote{axes}} with \sphinxcode{\sphinxupquote{data}} coordinates is extremely useful, for example to create a horizontal span which highlights some region of the y-data but spans across the x-axis regardless of the data limits, pan or zoom level, etc. In fact these blended lines and spans are so useful, we have built in functions to make them easy to plot (see {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.axhline:matplotlib.axes.Axes.axhline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axhline()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.axvline:matplotlib.axes.Axes.axvline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axvline()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.axhspan:matplotlib.axes.Axes.axhspan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axhspan()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.axvspan:matplotlib.axes.Axes.axvspan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axvspan()}}}}}) but for didactic purposes we will implement the horizontal span here using a blended transformation. This trick only works for separable transformations, like you see in normal Cartesian coordinate systems, but not on inseparable transformations like the {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.PolarTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolarTransform}}}}}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.transforms} \PYG{k+kn}{as} \PYG{n+nn}{transforms} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{1000}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{hist}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{l+m+mi}{30}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{sigma=1 }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{/ }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{dots }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{/ }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{sigma=2\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{16}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} the x coords of this transformation are data, and the} \PYG{c+c1}{\PYGZsh{} y coord are axes} \PYG{n}{trans} \PYG{o}{=} \PYG{n}{transforms}\PYG{o}{.}\PYG{n}{blended\PYGZus{}transform\PYGZus{}factory}\PYG{p}{(} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} highlight the 1..2 stddev region with a span.} \PYG{c+c1}{\PYGZsh{} We want x to be in data coordinates and y to} \PYG{c+c1}{\PYGZsh{} span from 0..1 in axes coords} \PYG{n}{rect} \PYG{o}{=} \PYG{n}{patches}\PYG{o}{.}\PYG{n}{Rectangle}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{,} \PYG{n}{width}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{height}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{trans}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{yellow}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{add\PYGZus{}patch}\PYG{p}{(}\PYG{n}{rect}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_transforms_tutorial_005}.png} \begin{sphinxadmonition}{note}{Note:} The blended transformations where x is in data coords and y in axes coordinates is so useful that we have helper methods to return the versions mpl uses internally for drawing ticks, ticklabels, etc. The methods are {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xaxis_transform:matplotlib.axes.Axes.get_xaxis_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.get\_xaxis\_transform()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yaxis_transform:matplotlib.axes.Axes.get_yaxis_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.get\_yaxis\_transform()}}}}}. So in the example above, the call to {\hyperref[\detokenize{api/transformations:matplotlib.transforms.blended_transform_factory}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{blended\_transform\_factory()}}}}} can be replaced by \sphinxcode{\sphinxupquote{get\_xaxis\_transform}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{trans} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}xaxis\PYGZus{}transform}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \end{sphinxadmonition} \subsubsection{Using offset transforms to create a shadow effect} \label{\detokenize{tutorials/advanced/transforms_tutorial:using-offset-transforms-to-create-a-shadow-effect}} One use of transformations is to create a new transformation that is offset from another transformation, e.g., to place one object shifted a bit relative to another object. Typically you want the shift to be in some physical dimension, like points or inches rather than in data coordinates, so that the shift effect is constant at different zoom levels and dpi settings. One use for an offset is to create a shadow effect, where you draw one object identical to the first just to the right of it, and just below it, adjusting the zorder to make sure the shadow is drawn first and then the object it is shadowing above it. The transforms module has a helper transformation {\hyperref[\detokenize{api/transformations:matplotlib.transforms.ScaledTranslation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScaledTranslation}}}}}. It is instantiated with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{trans} \PYG{o}{=} \PYG{n}{ScaledTranslation}\PYG{p}{(}\PYG{n}{xt}\PYG{p}{,} \PYG{n}{yt}\PYG{p}{,} \PYG{n}{scale\PYGZus{}trans}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{xt}} and \sphinxcode{\sphinxupquote{yt}} are the translation offsets, and \sphinxcode{\sphinxupquote{scale\_trans}} is a transformation which scales \sphinxcode{\sphinxupquote{xt}} and \sphinxcode{\sphinxupquote{yt}} at transformation time before applying the offsets. A typical use case is to use the figure \sphinxcode{\sphinxupquote{fig.dpi\_scale\_trans}} transformation for the \sphinxcode{\sphinxupquote{scale\_trans}} argument, to first scale \sphinxcode{\sphinxupquote{xt}} and \sphinxcode{\sphinxupquote{yt}} specified in points to \sphinxcode{\sphinxupquote{display}} space before doing the final offset. The dpi and inches offset is a common-enough use case that we have a special helper function to create it in {\hyperref[\detokenize{api/transformations:matplotlib.transforms.offset_copy}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.offset\_copy()}}}}}, which returns a new transform with an added offset. But in the example below, we’ll create the offset transform ourselves. Note the use of the plus operator in: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{offset} \PYG{o}{=} \PYG{n}{transforms}\PYG{o}{.}\PYG{n}{ScaledTranslation}\PYG{p}{(}\PYG{n}{dx}\PYG{p}{,} \PYG{n}{dy}\PYG{p}{,} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{dpi\PYGZus{}scale\PYGZus{}trans}\PYG{p}{)} \PYG{n}{shadow\PYGZus{}transform} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData} \PYG{o}{+} \PYG{n}{offset} \end{sphinxVerbatim} showing that can chain transformations using the addition operator. This code says: first apply the data transformation \sphinxcode{\sphinxupquote{ax.transData}} and then translate the data by \sphinxcode{\sphinxupquote{dx}} and \sphinxcode{\sphinxupquote{dy}} points. In typography, a{}`point \textless{}\sphinxurl{https://en.wikipedia.org/wiki/Point\_\%28typography\%29}\textgreater{}{}`\_ is 1/72 inches, and by specifying your offsets in points, your figure will look the same regardless of the dpi resolution it is saved in. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} make a simple sine wave} \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mf}{0.}\PYG{p}{,} \PYG{l+m+mf}{2.}\PYG{p}{,} \PYG{l+m+mf}{0.01}\PYG{p}{)} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{x}\PYG{p}{)} \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{blue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} shift the object over 2 points, and down 2 points} \PYG{n}{dx}\PYG{p}{,} \PYG{n}{dy} \PYG{o}{=} \PYG{l+m+mi}{2}\PYG{o}{/}\PYG{l+m+mf}{72.}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{2}\PYG{o}{/}\PYG{l+m+mf}{72.} \PYG{n}{offset} \PYG{o}{=} \PYG{n}{transforms}\PYG{o}{.}\PYG{n}{ScaledTranslation}\PYG{p}{(}\PYG{n}{dx}\PYG{p}{,} \PYG{n}{dy}\PYG{p}{,} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{dpi\PYGZus{}scale\PYGZus{}trans}\PYG{p}{)} \PYG{n}{shadow\PYGZus{}transform} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData} \PYG{o}{+} \PYG{n}{offset} \PYG{c+c1}{\PYGZsh{} now plot the same data with our offset transform;} \PYG{c+c1}{\PYGZsh{} use the zorder to make sure we are below the line} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{gray}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{shadow\PYGZus{}transform}\PYG{p}{,} \PYG{n}{zorder}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{o}{*}\PYG{n}{line}\PYG{o}{.}\PYG{n}{get\PYGZus{}zorder}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{creating a shadow effect with an offset transform}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_transforms_tutorial_006}.png} \subsubsection{The transformation pipeline} \label{\detokenize{tutorials/advanced/transforms_tutorial:the-transformation-pipeline}} The \sphinxcode{\sphinxupquote{ax.transData}} transform we have been working with in this tutorial is a composite of three different transformations that comprise the transformation pipeline from \sphinxcode{\sphinxupquote{data}} -\textgreater{} \sphinxcode{\sphinxupquote{display}} coordinates. Michael Droettboom implemented the transformations framework, taking care to provide a clean API that segregated the nonlinear projections and scales that happen in polar and logarithmic plots, from the linear affine transformations that happen when you pan and zoom. There is an efficiency here, because you can pan and zoom in your axes which affects the affine transformation, but you may not need to compute the potentially expensive nonlinear scales or projections on simple navigation events. It is also possible to multiply affine transformation matrices together, and then apply them to coordinates in one step. This is not true of all possible transformations. Here is how the \sphinxcode{\sphinxupquote{ax.transData}} instance is defined in the basic separable axis {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} class: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{transData} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{transScale} \PYG{o}{+} \PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{transLimits} \PYG{o}{+} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \end{sphinxVerbatim} We’ve been introduced to the \sphinxcode{\sphinxupquote{transAxes}} instance above in {\hyperref[\detokenize{tutorials/advanced/transforms_tutorial:axes-coords}]{\sphinxcrossref{\DUrole{std,std-ref}{Axes coordinates}}}}, which maps the (0, 0), (1, 1) corners of the axes or subplot bounding box to \sphinxcode{\sphinxupquote{display}} space, so let’s look at these other two pieces. \sphinxcode{\sphinxupquote{self.transLimits}} is the transformation that takes you from \sphinxcode{\sphinxupquote{data}} to \sphinxcode{\sphinxupquote{axes}} coordinates; i.e., it maps your view xlim and ylim to the unit space of the axes (and \sphinxcode{\sphinxupquote{transAxes}} then takes that unit space to display space). We can see this in action here \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [80]: }\PYG{n}{ax} \PYG{o}{=} \PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{g+gp}{In [81]: }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{)} \PYG{g+gh}{Out[81]: }\PYG{g+go}{(0, 10)} \PYG{g+gp}{In [82]: }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{g+gh}{Out[82]: }\PYG{g+go}{(\PYGZhy{}1, 1)} \PYG{g+gp}{In [84]: }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transLimits}\PYG{o}{.}\PYG{n}{transform}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{)} \PYG{g+gh}{Out[84]: }\PYG{g+go}{array([ 0., 0.])} \PYG{g+gp}{In [85]: }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transLimits}\PYG{o}{.}\PYG{n}{transform}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{)} \PYG{g+gh}{Out[85]: }\PYG{g+go}{array([ 1., 0.])} \PYG{g+gp}{In [86]: }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transLimits}\PYG{o}{.}\PYG{n}{transform}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{)} \PYG{g+gh}{Out[86]: }\PYG{g+go}{array([ 1., 1.])} \PYG{g+gp}{In [87]: }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transLimits}\PYG{o}{.}\PYG{n}{transform}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{)} \PYG{g+gh}{Out[87]: }\PYG{g+go}{array([ 0.5, 0.5])} \end{sphinxVerbatim} and we can use this same inverted transformation to go from the unit \sphinxcode{\sphinxupquote{axes}} coordinates back to \sphinxcode{\sphinxupquote{data}} coordinates. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [90]: }\PYG{n}{inv}\PYG{o}{.}\PYG{n}{transform}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mf}{0.25}\PYG{p}{,} \PYG{l+m+mf}{0.25}\PYG{p}{)}\PYG{p}{)} \PYG{g+gh}{Out[90]: }\PYG{g+go}{array([ 2.5, \PYGZhy{}0.5])} \end{sphinxVerbatim} The final piece is the \sphinxcode{\sphinxupquote{self.transScale}} attribute, which is responsible for the optional non-linear scaling of the data, e.g., for logarithmic axes. When an Axes is initially setup, this is just set to the identity transform, since the basic Matplotlib axes has linear scale, but when you call a logarithmic scaling function like {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.semilogx:matplotlib.axes.Axes.semilogx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{semilogx()}}}}} or explicitly set the scale to logarithmic with {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xscale:matplotlib.axes.Axes.set_xscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xscale()}}}}}, then the \sphinxcode{\sphinxupquote{ax.transScale}} attribute is set to handle the nonlinear projection. The scales transforms are properties of the respective \sphinxcode{\sphinxupquote{xaxis}} and \sphinxcode{\sphinxupquote{yaxis}} {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} instances. For example, when you call \sphinxcode{\sphinxupquote{ax.set\_xscale('log')}}, the xaxis updates its scale to a {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogScale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogScale}}}}} instance. For non-separable axes the PolarAxes, there is one more piece to consider, the projection transformation. The \sphinxcode{\sphinxupquote{transData}} {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.projections.polar.PolarAxes}}}}} is similar to that for the typical separable matplotlib Axes, with one additional piece \sphinxcode{\sphinxupquote{transProjection}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{transData} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{transScale} \PYG{o}{+} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{transProjection} \PYG{o}{+} \PYGZbs{} \PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{transProjectionAffine} \PYG{o}{+} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \end{sphinxVerbatim} \sphinxcode{\sphinxupquote{transProjection}} handles the projection from the space, e.g., latitude and longitude for map data, or radius and theta for polar data, to a separable Cartesian coordinate system. There are several projection examples in the \sphinxcode{\sphinxupquote{matplotlib.projections}} package, and the best way to learn more is to open the source for those packages and see how to make your own, since Matplotlib supports extensible axes and projections. Michael Droettboom has provided a nice tutorial example of creating a Hammer projection axes; see \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_custom\_projection.py}. \phantomsection\label{\detokenize{tutorials/advanced/transforms_tutorial:sphx-glr-download-tutorials-advanced-transforms-tutorial-py}} \section{Colors} \label{\detokenize{tutorials/index:colors}}\label{\detokenize{tutorials/index:tutorials-colors}} 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. For even more information see the \DUrole{xref,std,std-ref}{examples page}. \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/colors/colors:sphx-glr-download-tutorials-colors-colors-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Specifying Colors} \label{\detokenize{tutorials/colors/colors:specifying-colors}}\label{\detokenize{tutorials/colors/colors:sphx-glr-tutorials-colors-colors-py}}\label{\detokenize{tutorials/colors/colors::doc}} Matplotlib recognizes the following formats to specify a color: \begin{itemize} \item {} an RGB or RGBA tuple of float values in \sphinxcode{\sphinxupquote{{[}0, 1{]}}} (e.g., \sphinxcode{\sphinxupquote{(0.1, 0.2, 0.5)}} or \sphinxcode{\sphinxupquote{(0.1, 0.2, 0.5, 0.3)}}). RGBA is short for Red, Green, Blue, Alpha; \item {} a hex RGB or RGBA string (e.g., \sphinxcode{\sphinxupquote{'\#0F0F0F'}} or \sphinxcode{\sphinxupquote{'\#0F0F0F0F'}}); \item {} a string representation of a float value in \sphinxcode{\sphinxupquote{{[}0, 1{]}}} inclusive for gray level (e.g., \sphinxcode{\sphinxupquote{'0.5'}}); \item {} one of \sphinxcode{\sphinxupquote{\{'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'\}}}; \item {} a X11/CSS4 color name; \item {} a name from the \sphinxhref{https://xkcd.com/color/rgb/}{xkcd color survey}; prefixed with \sphinxcode{\sphinxupquote{'xkcd:'}} (e.g., \sphinxcode{\sphinxupquote{'xkcd:sky blue'}}); \item {} one of \sphinxcode{\sphinxupquote{\{'tab:blue', 'tab:orange', 'tab:green', 'tab:red', 'tab:purple', 'tab:brown', 'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan'\}}} which are the Tableau Colors from the ‘T10’ categorical palette (which is the default color cycle); \item {} a “CN” color spec, i.e. \sphinxcode{\sphinxupquote{'C'}} followed by a single digit, which is an index into the default property cycle (\sphinxcode{\sphinxupquote{matplotlib.rcParams{[}'axes.prop\_cycle'{]}}}); the indexing occurs at artist creation time and defaults to black if the cycle does not include color. \end{itemize} “Red”, “Green” and “Blue”, are the intensities of those colors, the combination of which span the colorspace. How “Alpha” behaves depends on the \sphinxcode{\sphinxupquote{zorder}} of the Artist. Higher \sphinxcode{\sphinxupquote{zorder}} Artists are drawn on top of lower Artists, and “Alpha” determines whether the lower artist is covered by the higher. If the old RGB of a pixel is \sphinxcode{\sphinxupquote{RGBold}} and the RGB of the pixel of the Artist being added is \sphinxcode{\sphinxupquote{RGBnew}} with Alpha \sphinxcode{\sphinxupquote{alpha}}, then the RGB of the pixel is updated to: \sphinxcode{\sphinxupquote{RGB = RGBOld * (1 - Alpha) + RGBnew * Alpha}}. Alpha of 1 means the old color is completely covered by the new Artist, Alpha of 0 means that pixel of the Artist is transparent. All string specifications of color, other than “CN”, are case-insensitive. \subsubsection{“CN” color selection} \label{\detokenize{tutorials/colors/colors:cn-color-selection}} “CN” colors are converted to RGBA as soon as the artist is created. For example, \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{k+kn}{as} \PYG{n+nn}{mpl} \PYG{n}{th} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{,} \PYG{l+m+mi}{128}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{demo}\PYG{p}{(}\PYG{n}{sty}\PYG{p}{)}\PYG{p}{:} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{style}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{n}{sty}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{style: \PYGZob{}!r\PYGZcb{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{.}\PYG{n}{format}\PYG{p}{(}\PYG{n}{sty}\PYG{p}{)}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{C0}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{th}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{cos}\PYG{p}{(}\PYG{n}{th}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{C1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{C1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{th}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{th}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{C2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{C2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{p}{)} \PYG{n}{demo}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{demo}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{seaborn}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \begin{itemize} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colors_001}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colors_002}.png} \end{itemize} will use the first color for the title and then plot using the second and third colors of each style’s \sphinxcode{\sphinxupquote{mpl.rcParams{[}'axes.prop\_cycle'{]}}}. \subsubsection{xkcd v X11/CSS4} \label{\detokenize{tutorials/colors/colors:xkcd-v-x11-css4}} The xkcd colors are derived from a user survey conducted by the webcomic xkcd. \sphinxhref{https://blog.xkcd.com/2010/05/03/color-survey-results/}{Details of the survey are available on the xkcd blog}. Out of 148 colors in the CSS color list, there are 95 name collisions between the X11/CSS4 names and the xkcd names, all but 3 of which have different hex values. For example \sphinxcode{\sphinxupquote{'blue'}} maps to \sphinxcode{\sphinxupquote{'\#0000FF'}} where as \sphinxcode{\sphinxupquote{'xkcd:blue'}} maps to \sphinxcode{\sphinxupquote{'\#0343DF'}}. Due to these name collisions all of the xkcd colors have \sphinxcode{\sphinxupquote{'xkcd:'}} prefixed. As noted in the blog post, while it might be interesting to re-define the X11/CSS4 names based on such a survey, we do not do so unilaterally. The name collisions are shown in the table below; the color names where the hex values agree are shown in bold. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.\PYGZus{}color\PYGZus{}data} \PYG{k+kn}{as} \PYG{n+nn}{mcd} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.patches} \PYG{k+kn}{as} \PYG{n+nn}{mpatch} \PYG{n}{overlap} \PYG{o}{=} \PYG{p}{\PYGZob{}}\PYG{n}{name} \PYG{k}{for} \PYG{n}{name} \PYG{o+ow}{in} \PYG{n}{mcd}\PYG{o}{.}\PYG{n}{CSS4\PYGZus{}COLORS} \PYG{k}{if} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{xkcd:}\PYG{l+s+s2}{\PYGZdq{}} \PYG{o}{+} \PYG{n}{name} \PYG{o+ow}{in} \PYG{n}{mcd}\PYG{o}{.}\PYG{n}{XKCD\PYGZus{}COLORS}\PYG{p}{\PYGZcb{}} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mf}{4.8}\PYG{p}{,} \PYG{l+m+mi}{16}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{k}{for} \PYG{n}{j}\PYG{p}{,} \PYG{n}{n} \PYG{o+ow}{in} \PYG{n+nb}{enumerate}\PYG{p}{(}\PYG{n+nb}{sorted}\PYG{p}{(}\PYG{n}{overlap}\PYG{p}{,} \PYG{n}{reverse}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)}\PYG{p}{)}\PYG{p}{:} \PYG{n}{weight} \PYG{o}{=} \PYG{n+nb+bp}{None} \PYG{n}{cn} \PYG{o}{=} \PYG{n}{mcd}\PYG{o}{.}\PYG{n}{CSS4\PYGZus{}COLORS}\PYG{p}{[}\PYG{n}{n}\PYG{p}{]} \PYG{n}{xkcd} \PYG{o}{=} \PYG{n}{mcd}\PYG{o}{.}\PYG{n}{XKCD\PYGZus{}COLORS}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{xkcd:}\PYG{l+s+s2}{\PYGZdq{}} \PYG{o}{+} \PYG{n}{n}\PYG{p}{]}\PYG{o}{.}\PYG{n}{upper}\PYG{p}{(}\PYG{p}{)} \PYG{k}{if} \PYG{n}{cn} \PYG{o}{==} \PYG{n}{xkcd}\PYG{p}{:} \PYG{n}{weight} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bold}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{r1} \PYG{o}{=} \PYG{n}{mpatch}\PYG{o}{.}\PYG{n}{Rectangle}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{j}\PYG{p}{)}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{n}{cn}\PYG{p}{)} \PYG{n}{r2} \PYG{o}{=} \PYG{n}{mpatch}\PYG{o}{.}\PYG{n}{Rectangle}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{j}\PYG{p}{)}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{n}{xkcd}\PYG{p}{)} \PYG{n}{txt} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{j}\PYG{o}{+}\PYG{o}{.}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ }\PYG{l+s+s1}{\PYGZsq{}} \PYG{o}{+} \PYG{n}{n}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{10}\PYG{p}{,} \PYG{n}{weight}\PYG{o}{=}\PYG{n}{weight}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{add\PYGZus{}patch}\PYG{p}{(}\PYG{n}{r1}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{add\PYGZus{}patch}\PYG{p}{(}\PYG{n}{r2}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axhline}\PYG{p}{(}\PYG{n}{j}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{o}{.}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{n}{j} \PYG{o}{+} \PYG{l+m+mf}{1.5}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{X11}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{1.5}\PYG{p}{,} \PYG{n}{j} \PYG{o}{+} \PYG{l+m+mf}{1.5}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{xkcd}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{j} \PYG{o}{+} \PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{off}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_colors_003}.png} \phantomsection\label{\detokenize{tutorials/colors/colors:sphx-glr-download-tutorials-colors-colors-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/colors/colorbar_only:sphx-glr-download-tutorials-colors-colorbar-only-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Customized Colorbars Tutorial} \label{\detokenize{tutorials/colors/colorbar_only:customized-colorbars-tutorial}}\label{\detokenize{tutorials/colors/colorbar_only:sphx-glr-tutorials-colors-colorbar-only-py}}\label{\detokenize{tutorials/colors/colorbar_only::doc}} This tutorial shows how to build colorbars without an attached plot. \subsubsection{Customized Colorbars} \label{\detokenize{tutorials/colors/colorbar_only:customized-colorbars}} {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ColorbarBase}}}}} derives from {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarMappable}}}}} and puts a colorbar in a specified axes, so it has everything needed for a standalone colorbar. It can be used as is to make a colorbar for a given colormap and does not need a mappable object like an image. In this tutorial we will explore what can be done with standalone colorbar. \paragraph{Basic continuous colorbar} \label{\detokenize{tutorials/colors/colorbar_only:basic-continuous-colorbar}} Set the colormap and norm to correspond to the data for which the colorbar will be used. Then create the colorbar by calling {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ColorbarBase}}}}} and specify axis, colormap, norm and orientation as parameters. Here we create a basic continuous colorbar with ticks and labels. More information on colorbar api can be found \sphinxcode{\sphinxupquote{here}}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{k+kn}{as} \PYG{n+nn}{mpl} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{cmap} \PYG{o}{=} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{cm}\PYG{o}{.}\PYG{n}{cool} \PYG{n}{norm} \PYG{o}{=} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{colors}\PYG{o}{.}\PYG{n}{Normalize}\PYG{p}{(}\PYG{n}{vmin}\PYG{o}{=}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{n}{vmax}\PYG{o}{=}\PYG{l+m+mi}{10}\PYG{p}{)} \PYG{n}{cb1} \PYG{o}{=} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{colorbar}\PYG{o}{.}\PYG{n}{ColorbarBase}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{n}{cmap}\PYG{p}{,} \PYG{n}{norm}\PYG{o}{=}\PYG{n}{norm}\PYG{p}{,} \PYG{n}{orientation}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{horizontal}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{cb1}\PYG{o}{.}\PYG{n}{set\PYGZus{}label}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Some Units}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_colorbar_only_001}.png} \paragraph{Discrete intervals colorbar} \label{\detokenize{tutorials/colors/colorbar_only:discrete-intervals-colorbar}} The second example illustrates the use of a {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.ListedColormap:matplotlib.colors.ListedColormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ListedColormap}}}}} which generates a colormap from a set of listed colors, \sphinxcode{\sphinxupquote{colors.BoundaryNorm()}} which generates a colormap index based on discrete intervals and extended ends to show the “over” and “under” value colors. Over and under are used to display data outside of the normalized {[}0,1{]} range. Here we pass colors as gray shades as a string encoding a float in the 0-1 range. If a {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.ListedColormap:matplotlib.colors.ListedColormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ListedColormap}}}}} is used, the length of the bounds array must be one greater than the length of the color list. The bounds must be monotonically increasing. This time we pass some more arguments in addition to previous arguments to {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ColorbarBase}}}}}. For the out-of-range values to display on the colorbar, we have to use the \sphinxstyleemphasis{extend} keyword argument. To use \sphinxstyleemphasis{extend}, you must specify two extra boundaries. Finally spacing argument ensures that intervals are shown on colorbar proportionally. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{cmap} \PYG{o}{=} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{colors}\PYG{o}{.}\PYG{n}{ListedColormap}\PYG{p}{(}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{green}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{blue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{cyan}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \PYG{n}{cmap}\PYG{o}{.}\PYG{n}{set\PYGZus{}over}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{0.25}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{cmap}\PYG{o}{.}\PYG{n}{set\PYGZus{}under}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{0.75}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{bounds} \PYG{o}{=} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{7}\PYG{p}{,} \PYG{l+m+mi}{8}\PYG{p}{]} \PYG{n}{norm} \PYG{o}{=} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{colors}\PYG{o}{.}\PYG{n}{BoundaryNorm}\PYG{p}{(}\PYG{n}{bounds}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{.}\PYG{n}{N}\PYG{p}{)} \PYG{n}{cb2} \PYG{o}{=} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{colorbar}\PYG{o}{.}\PYG{n}{ColorbarBase}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{n}{cmap}\PYG{p}{,} \PYG{n}{norm}\PYG{o}{=}\PYG{n}{norm}\PYG{p}{,} \PYG{n}{boundaries}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{+} \PYG{n}{bounds} \PYG{o}{+} \PYG{p}{[}\PYG{l+m+mi}{13}\PYG{p}{]}\PYG{p}{,} \PYG{n}{extend}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{both}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ticks}\PYG{o}{=}\PYG{n}{bounds}\PYG{p}{,} \PYG{n}{spacing}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{proportional}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{orientation}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{horizontal}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{cb2}\PYG{o}{.}\PYG{n}{set\PYGZus{}label}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Discrete intervals, some other units}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_colorbar_only_002}.png} \paragraph{Colorbar with custom extension lengths} \label{\detokenize{tutorials/colors/colorbar_only:colorbar-with-custom-extension-lengths}} Here we illustrate the use of custom length colorbar extensions, used on a colorbar with discrete intervals. To make the length of each extension same as the length of the interior colors, use \sphinxcode{\sphinxupquote{extendfrac='auto'}}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{cmap} \PYG{o}{=} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{colors}\PYG{o}{.}\PYG{n}{ListedColormap}\PYG{p}{(}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{royalblue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{cyan}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{yellow}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{orange}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \PYG{n}{cmap}\PYG{o}{.}\PYG{n}{set\PYGZus{}over}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{cmap}\PYG{o}{.}\PYG{n}{set\PYGZus{}under}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{blue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{bounds} \PYG{o}{=} \PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{]} \PYG{n}{norm} \PYG{o}{=} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{colors}\PYG{o}{.}\PYG{n}{BoundaryNorm}\PYG{p}{(}\PYG{n}{bounds}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{.}\PYG{n}{N}\PYG{p}{)} \PYG{n}{cb3} \PYG{o}{=} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{colorbar}\PYG{o}{.}\PYG{n}{ColorbarBase}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{n}{cmap}\PYG{p}{,} \PYG{n}{norm}\PYG{o}{=}\PYG{n}{norm}\PYG{p}{,} \PYG{n}{boundaries}\PYG{o}{=}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{10}\PYG{p}{]} \PYG{o}{+} \PYG{n}{bounds} \PYG{o}{+} \PYG{p}{[}\PYG{l+m+mi}{10}\PYG{p}{]}\PYG{p}{,} \PYG{n}{extend}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{both}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{extendfrac}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{auto}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ticks}\PYG{o}{=}\PYG{n}{bounds}\PYG{p}{,} \PYG{n}{spacing}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{uniform}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{orientation}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{horizontal}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{cb3}\PYG{o}{.}\PYG{n}{set\PYGZus{}label}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Custom extension lengths, some other units}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_colorbar_only_003}.png} \phantomsection\label{\detokenize{tutorials/colors/colorbar_only:sphx-glr-download-tutorials-colors-colorbar-only-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/colors/colormapnorms:sphx-glr-download-tutorials-colors-colormapnorms-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Colormap Normalization} \label{\detokenize{tutorials/colors/colormapnorms:colormap-normalization}}\label{\detokenize{tutorials/colors/colormapnorms:sphx-glr-tutorials-colors-colormapnorms-py}}\label{\detokenize{tutorials/colors/colormapnorms::doc}} Objects that use colormaps by default linearly map the colors in the colormap from data values \sphinxstyleemphasis{vmin} to \sphinxstyleemphasis{vmax}. For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{pcm} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{vmin}\PYG{o}{=}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{1.}\PYG{p}{,} \PYG{n}{vmax}\PYG{o}{=}\PYG{l+m+mf}{1.}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{RdBu\PYGZus{}r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} will map the data in \sphinxstyleemphasis{Z} linearly from -1 to +1, so \sphinxstyleemphasis{Z=0} will give a color at the center of the colormap \sphinxstyleemphasis{RdBu\_r} (white in this case). Matplotlib does this mapping in two steps, with a normalization from {[}0,1{]} occurring first, and then mapping onto the indices in the colormap. Normalizations are classes defined in the {\hyperref[\detokenize{api/colors_api:module-matplotlib.colors}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors()}}}}} module. The default, linear normalization is {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize()}}}}}. Artists that map data to color pass the arguments \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} to construct a {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize()}}}}} instance, then call it: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [1]: }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{k+kn}{as} \PYG{n+nn}{mpl} \PYG{g+gp}{In [2]: }\PYG{n}{norm} \PYG{o}{=} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{colors}\PYG{o}{.}\PYG{n}{Normalize}\PYG{p}{(}\PYG{n}{vmin}\PYG{o}{=}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{1.}\PYG{p}{,}\PYG{n}{vmax}\PYG{o}{=}\PYG{l+m+mf}{1.}\PYG{p}{)} \PYG{g+gp}{In [3]: }\PYG{n}{norm}\PYG{p}{(}\PYG{l+m+mf}{0.}\PYG{p}{)} \PYG{g+gh}{Out[3]: }\PYG{g+go}{0.5} \end{sphinxVerbatim} However, there are sometimes cases where it is useful to map data to colormaps in a non-linear fashion. \subsubsection{Logarithmic} \label{\detokenize{tutorials/colors/colormapnorms:logarithmic}} One of the most common transformations is to plot data by taking its logarithm (to the base-10). This transformation is useful to display changes across disparate scales. Using \sphinxcode{\sphinxupquote{colors.LogNorm()}} normalizes the data via $log_{10}$. In the example below, there are two bumps, one much smaller than the other. Using \sphinxcode{\sphinxupquote{colors.LogNorm()}}, the shape and location of each bump can clearly be seen: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.colors} \PYG{k+kn}{as} \PYG{n+nn}{colors} \PYG{n}{N} \PYG{o}{=} \PYG{l+m+mi}{100} \PYG{n}{X}\PYG{p}{,} \PYG{n}{Y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{mgrid}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{3}\PYG{p}{:}\PYG{l+m+mi}{3}\PYG{p}{:}\PYG{n+nb}{complex}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{N}\PYG{p}{)}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{n+nb}{complex}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{N}\PYG{p}{)}\PYG{p}{]} \PYG{c+c1}{\PYGZsh{} A low hump with a spike coming out of the top right. Needs to have} \PYG{c+c1}{\PYGZsh{} z/colour axis on a log scale so we see both hump and spike. linear} \PYG{c+c1}{\PYGZsh{} scale only shows the spike.} \PYG{n}{Z1} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{exp}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{p}{(}\PYG{n}{X}\PYG{p}{)}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2} \PYG{o}{\PYGZhy{}} \PYG{p}{(}\PYG{n}{Y}\PYG{p}{)}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{Z2} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{exp}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{p}{(}\PYG{n}{X} \PYG{o}{*} \PYG{l+m+mi}{10}\PYG{p}{)}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2} \PYG{o}{\PYGZhy{}} \PYG{p}{(}\PYG{n}{Y} \PYG{o}{*} \PYG{l+m+mi}{10}\PYG{p}{)}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{Z} \PYG{o}{=} \PYG{n}{Z1} \PYG{o}{+} \PYG{l+m+mi}{50} \PYG{o}{*} \PYG{n}{Z2} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{pcm} \PYG{o}{=} \PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{pcolor}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{norm}\PYG{o}{=}\PYG{n}{colors}\PYG{o}{.}\PYG{n}{LogNorm}\PYG{p}{(}\PYG{n}{vmin}\PYG{o}{=}\PYG{n}{Z}\PYG{o}{.}\PYG{n}{min}\PYG{p}{(}\PYG{p}{)}\PYG{p}{,} \PYG{n}{vmax}\PYG{o}{=}\PYG{n}{Z}\PYG{o}{.}\PYG{n}{max}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{PuBu\PYGZus{}r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{pcm}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{extend}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{max}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{pcm} \PYG{o}{=} \PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{pcolor}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{PuBu\PYGZus{}r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{pcm}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{extend}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{max}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_colormapnorms_001}.png} \subsubsection{Symmetric logarithmic} \label{\detokenize{tutorials/colors/colormapnorms:symmetric-logarithmic}} Similarly, it sometimes happens that there is data that is positive and negative, but we would still like a logarithmic scaling applied to both. In this case, the negative numbers are also scaled logarithmically, and mapped to smaller numbers; e.g., if \sphinxcode{\sphinxupquote{vmin=-vmax}}, then they the negative numbers are mapped from 0 to 0.5 and the positive from 0.5 to 1. Since the logarithm of values close to zero tends toward infinity, a small range around zero needs to be mapped linearly. The parameter \sphinxstyleemphasis{linthresh} allows the user to specify the size of this range (-\sphinxstyleemphasis{linthresh}, \sphinxstyleemphasis{linthresh}). The size of this range in the colormap is set by \sphinxstyleemphasis{linscale}. When \sphinxstyleemphasis{linscale} == 1.0 (the default), the space used for the positive and negative halves of the linear range will be equal to one decade in the logarithmic range. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{N} \PYG{o}{=} \PYG{l+m+mi}{100} \PYG{n}{X}\PYG{p}{,} \PYG{n}{Y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{mgrid}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{3}\PYG{p}{:}\PYG{l+m+mi}{3}\PYG{p}{:}\PYG{n+nb}{complex}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{N}\PYG{p}{)}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{n+nb}{complex}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{N}\PYG{p}{)}\PYG{p}{]} \PYG{n}{Z1} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{exp}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{n}{X}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2} \PYG{o}{\PYGZhy{}} \PYG{n}{Y}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{Z2} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{exp}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{p}{(}\PYG{n}{X} \PYG{o}{\PYGZhy{}} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2} \PYG{o}{\PYGZhy{}} \PYG{p}{(}\PYG{n}{Y} \PYG{o}{\PYGZhy{}} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{Z} \PYG{o}{=} \PYG{p}{(}\PYG{n}{Z1} \PYG{o}{\PYGZhy{}} \PYG{n}{Z2}\PYG{p}{)} \PYG{o}{*} \PYG{l+m+mi}{2} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{pcm} \PYG{o}{=} \PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{norm}\PYG{o}{=}\PYG{n}{colors}\PYG{o}{.}\PYG{n}{SymLogNorm}\PYG{p}{(}\PYG{n}{linthresh}\PYG{o}{=}\PYG{l+m+mf}{0.03}\PYG{p}{,} \PYG{n}{linscale}\PYG{o}{=}\PYG{l+m+mf}{0.03}\PYG{p}{,} \PYG{n}{vmin}\PYG{o}{=}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{n}{vmax}\PYG{o}{=}\PYG{l+m+mf}{1.0}\PYG{p}{)}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{RdBu\PYGZus{}r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{pcm}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{extend}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{both}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{pcm} \PYG{o}{=} \PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{RdBu\PYGZus{}r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{vmin}\PYG{o}{=}\PYG{o}{\PYGZhy{}}\PYG{n}{np}\PYG{o}{.}\PYG{n}{max}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{)}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{pcm}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{extend}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{both}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_colormapnorms_002}.png} \subsubsection{Power-law} \label{\detokenize{tutorials/colors/colormapnorms:power-law}} Sometimes it is useful to remap the colors onto a power-law relationship (i.e. $y=x^{\gamma}$, where $\gamma$ is the power). For this we use the \sphinxcode{\sphinxupquote{colors.PowerNorm()}}. It takes as an argument \sphinxstyleemphasis{gamma} (\sphinxstyleemphasis{gamma} == 1.0 will just yield the default linear normalization): \begin{sphinxadmonition}{note}{Note:} There should probably be a good reason for plotting the data using this type of transformation. Technical viewers are used to linear and logarithmic axes and data transformations. Power laws are less common, and viewers should explicitly be made aware that they have been used. \end{sphinxadmonition} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{N} \PYG{o}{=} \PYG{l+m+mi}{100} \PYG{n}{X}\PYG{p}{,} \PYG{n}{Y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{mgrid}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{:}\PYG{l+m+mi}{3}\PYG{p}{:}\PYG{n+nb}{complex}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{N}\PYG{p}{)}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{:}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{n+nb}{complex}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{N}\PYG{p}{)}\PYG{p}{]} \PYG{n}{Z1} \PYG{o}{=} \PYG{p}{(}\PYG{l+m+mi}{1} \PYG{o}{+} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{Y} \PYG{o}{*} \PYG{l+m+mf}{10.}\PYG{p}{)}\PYG{p}{)} \PYG{o}{*} \PYG{n}{X}\PYG{o}{*}\PYG{o}{*}\PYG{p}{(}\PYG{l+m+mf}{2.}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{pcm} \PYG{o}{=} \PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{Z1}\PYG{p}{,} \PYG{n}{norm}\PYG{o}{=}\PYG{n}{colors}\PYG{o}{.}\PYG{n}{PowerNorm}\PYG{p}{(}\PYG{n}{gamma}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{PuBu\PYGZus{}r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{pcm}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{extend}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{max}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{pcm} \PYG{o}{=} \PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{Z1}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{PuBu\PYGZus{}r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{pcm}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{extend}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{max}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_colormapnorms_003}.png} \subsubsection{Discrete bounds} \label{\detokenize{tutorials/colors/colormapnorms:discrete-bounds}} Another normaization that comes with matplolib is \sphinxcode{\sphinxupquote{colors.BoundaryNorm()}}. In addition to \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax}, this takes as arguments boundaries between which data is to be mapped. The colors are then linearly distributed between these “bounds”. For instance: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [4]: }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib.colors} \PYG{k+kn}{as} \PYG{n+nn}{colors} \PYG{g+gp}{In [5]: }\PYG{n}{bounds} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{array}\PYG{p}{(}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.25}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.125}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{g+gp}{In [6]: }\PYG{n}{norm} \PYG{o}{=} \PYG{n}{colors}\PYG{o}{.}\PYG{n}{BoundaryNorm}\PYG{p}{(}\PYG{n}{boundaries}\PYG{o}{=}\PYG{n}{bounds}\PYG{p}{,} \PYG{n}{ncolors}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{)} \PYG{g+gp}{In [7]: }\PYG{k}{print}\PYG{p}{(}\PYG{n}{norm}\PYG{p}{(}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.2}\PYG{p}{,}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.15}\PYG{p}{,}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.02}\PYG{p}{,} \PYG{l+m+mf}{0.3}\PYG{p}{,} \PYG{l+m+mf}{0.8}\PYG{p}{,} \PYG{l+m+mf}{0.99}\PYG{p}{]}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{[0 0 1 2 3 3]} \end{sphinxVerbatim} Note unlike the other norms, this norm returns values from 0 to \sphinxstyleemphasis{ncolors}-1. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{N} \PYG{o}{=} \PYG{l+m+mi}{100} \PYG{n}{X}\PYG{p}{,} \PYG{n}{Y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{mgrid}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{3}\PYG{p}{:}\PYG{l+m+mi}{3}\PYG{p}{:}\PYG{n+nb}{complex}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{N}\PYG{p}{)}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{n+nb}{complex}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{N}\PYG{p}{)}\PYG{p}{]} \PYG{n}{Z1} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{exp}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{n}{X}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2} \PYG{o}{\PYGZhy{}} \PYG{n}{Y}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{Z2} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{exp}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{p}{(}\PYG{n}{X} \PYG{o}{\PYGZhy{}} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2} \PYG{o}{\PYGZhy{}} \PYG{p}{(}\PYG{n}{Y} \PYG{o}{\PYGZhy{}} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{Z} \PYG{o}{=} \PYG{p}{(}\PYG{n}{Z1} \PYG{o}{\PYGZhy{}} \PYG{n}{Z2}\PYG{p}{)} \PYG{o}{*} \PYG{l+m+mi}{2} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{8}\PYG{p}{,} \PYG{l+m+mi}{8}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{flatten}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} even bounds gives a contour\PYGZhy{}like effect} \PYG{n}{bounds} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{)} \PYG{n}{norm} \PYG{o}{=} \PYG{n}{colors}\PYG{o}{.}\PYG{n}{BoundaryNorm}\PYG{p}{(}\PYG{n}{boundaries}\PYG{o}{=}\PYG{n}{bounds}\PYG{p}{,} \PYG{n}{ncolors}\PYG{o}{=}\PYG{l+m+mi}{256}\PYG{p}{)} \PYG{n}{pcm} \PYG{o}{=} \PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{norm}\PYG{o}{=}\PYG{n}{norm}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{RdBu\PYGZus{}r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{pcm}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{extend}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{both}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{orientation}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{vertical}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} uneven bounds changes the colormapping:} \PYG{n}{bounds} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{array}\PYG{p}{(}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.25}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.125}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{norm} \PYG{o}{=} \PYG{n}{colors}\PYG{o}{.}\PYG{n}{BoundaryNorm}\PYG{p}{(}\PYG{n}{boundaries}\PYG{o}{=}\PYG{n}{bounds}\PYG{p}{,} \PYG{n}{ncolors}\PYG{o}{=}\PYG{l+m+mi}{256}\PYG{p}{)} \PYG{n}{pcm} \PYG{o}{=} \PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{norm}\PYG{o}{=}\PYG{n}{norm}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{RdBu\PYGZus{}r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{pcm}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{extend}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{both}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{orientation}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{vertical}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{pcm} \PYG{o}{=} \PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{RdBu\PYGZus{}r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{vmin}\PYG{o}{=}\PYG{o}{\PYGZhy{}}\PYG{n}{np}\PYG{o}{.}\PYG{n}{max}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{)}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{pcm}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{,} \PYG{n}{extend}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{both}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{orientation}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{vertical}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_colormapnorms_004}.png} \subsubsection{Custom normalization: Two linear ranges} \label{\detokenize{tutorials/colors/colormapnorms:custom-normalization-two-linear-ranges}} It is possible to define your own normalization. In the following example, we modify \sphinxcode{\sphinxupquote{colors:SymLogNorm()}} to use different linear maps for the negative data values and the positive. (Note that this example is simple, and does not validate inputs or account for complex cases such as masked data) \begin{sphinxadmonition}{note}{Note:} This may appear soon as \sphinxcode{\sphinxupquote{colors.OffsetNorm()}}. As above, non-symmetric mapping of data to color is non-standard practice for quantitative data, and should only be used advisedly. A practical example is having an ocean/land colormap where the land and ocean data span different ranges. \end{sphinxadmonition} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{N} \PYG{o}{=} \PYG{l+m+mi}{100} \PYG{n}{X}\PYG{p}{,} \PYG{n}{Y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{mgrid}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{3}\PYG{p}{:}\PYG{l+m+mi}{3}\PYG{p}{:}\PYG{n+nb}{complex}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{N}\PYG{p}{)}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{n+nb}{complex}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{N}\PYG{p}{)}\PYG{p}{]} \PYG{n}{Z1} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{exp}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{n}{X}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2} \PYG{o}{\PYGZhy{}} \PYG{n}{Y}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{Z2} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{exp}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{p}{(}\PYG{n}{X} \PYG{o}{\PYGZhy{}} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2} \PYG{o}{\PYGZhy{}} \PYG{p}{(}\PYG{n}{Y} \PYG{o}{\PYGZhy{}} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{Z} \PYG{o}{=} \PYG{p}{(}\PYG{n}{Z1} \PYG{o}{\PYGZhy{}} \PYG{n}{Z2}\PYG{p}{)} \PYG{o}{*} \PYG{l+m+mi}{2} \PYG{k}{class} \PYG{n+nc}{MidpointNormalize}\PYG{p}{(}\PYG{n}{colors}\PYG{o}{.}\PYG{n}{Normalize}\PYG{p}{)}\PYG{p}{:} \PYG{k}{def} \PYG{n+nf+fm}{\PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{vmin}\PYG{o}{=}\PYG{n+nb+bp}{None}\PYG{p}{,} \PYG{n}{vmax}\PYG{o}{=}\PYG{n+nb+bp}{None}\PYG{p}{,} \PYG{n}{midpoint}\PYG{o}{=}\PYG{n+nb+bp}{None}\PYG{p}{,} \PYG{n}{clip}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{midpoint} \PYG{o}{=} \PYG{n}{midpoint} \PYG{n}{colors}\PYG{o}{.}\PYG{n}{Normalize}\PYG{o}{.}\PYG{n+nf+fm}{\PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{vmin}\PYG{p}{,} \PYG{n}{vmax}\PYG{p}{,} \PYG{n}{clip}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf+fm}{\PYGZus{}\PYGZus{}call\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{value}\PYG{p}{,} \PYG{n}{clip}\PYG{o}{=}\PYG{n+nb+bp}{None}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} I\PYGZsq{}m ignoring masked values and all kinds of edge cases to make a} \PYG{c+c1}{\PYGZsh{} simple example...} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y} \PYG{o}{=} \PYG{p}{[}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{vmin}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{midpoint}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{vmax}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]} \PYG{k}{return} \PYG{n}{np}\PYG{o}{.}\PYG{n}{ma}\PYG{o}{.}\PYG{n}{masked\PYGZus{}array}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{interp}\PYG{p}{(}\PYG{n}{value}\PYG{p}{,} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{pcm} \PYG{o}{=} \PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{norm}\PYG{o}{=}\PYG{n}{MidpointNormalize}\PYG{p}{(}\PYG{n}{midpoint}\PYG{o}{=}\PYG{l+m+mf}{0.}\PYG{p}{)}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{RdBu\PYGZus{}r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{pcm}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{extend}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{both}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{pcm} \PYG{o}{=} \PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{RdBu\PYGZus{}r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{vmin}\PYG{o}{=}\PYG{o}{\PYGZhy{}}\PYG{n}{np}\PYG{o}{.}\PYG{n}{max}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{)}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{pcm}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{extend}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{both}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_colormapnorms_005}.png} \phantomsection\label{\detokenize{tutorials/colors/colormapnorms:sphx-glr-download-tutorials-colors-colormapnorms-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/colors/colormaps:sphx-glr-download-tutorials-colors-colormaps-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Colormaps in Matplotlib} \label{\detokenize{tutorials/colors/colormaps:colormaps-in-matplotlib}}\label{\detokenize{tutorials/colors/colormaps:sphx-glr-tutorials-colors-colormaps-py}}\label{\detokenize{tutorials/colors/colormaps::doc}} How (and why) to choose a particular colormap. \subsubsection{Overview} \label{\detokenize{tutorials/colors/colormaps:overview}} The idea behind choosing a good colormap is to find a good representation in 3D colorspace for your data set. The best colormap for any given data set depends on many things including: \begin{itemize} \item {} Whether representing form or metric data (\phantomsection\label{\detokenize{tutorials/colors/colormaps:id1}}{\hyperref[\detokenize{tutorials/colors/colormaps:ware}]{\sphinxcrossref{{[}Ware{]}}}}) \item {} Your knowledge of the data set (\sphinxstyleemphasis{e.g.}, is there a critical value from which the other values deviate?) \item {} If there is an intuitive color scheme for the parameter you are plotting \item {} If there is a standard in the field the audience may be expecting \end{itemize} For many applications, a perceptually uniform colormap is the best choice — one in which equal steps in data are perceived as equal steps in the color space. Researchers have found that the human brain perceives changes in the lightness parameter as changes in the data much better than, for example, changes in hue. Therefore, colormaps which have monotonically increasing lightness through the colormap will be better interpreted by the viewer. A wonderful example of perceptually uniform colormaps is \phantomsection\label{\detokenize{tutorials/colors/colormaps:id2}}{\hyperref[\detokenize{tutorials/colors/colormaps:colorcet}]{\sphinxcrossref{{[}colorcet{]}}}}. Color can be represented in 3D space in various ways. One way to represent color is using CIELAB. In CIELAB, color space is represented by lightness, $L^*$; red-green, $a^*$; and yellow-blue, $b^*$. The lightness parameter $L^*$ can then be used to learn more about how the matplotlib colormaps will be perceived by viewers. An excellent starting resource for learning about human perception of colormaps is from \phantomsection\label{\detokenize{tutorials/colors/colormaps:id3}}{\hyperref[\detokenize{tutorials/colors/colormaps:ibm}]{\sphinxcrossref{{[}IBM{]}}}}. \subsubsection{Classes of colormaps} \label{\detokenize{tutorials/colors/colormaps:classes-of-colormaps}} Colormaps are often split into several categories based on their function (see, \sphinxstyleemphasis{e.g.}, \phantomsection\label{\detokenize{tutorials/colors/colormaps:id4}}{\hyperref[\detokenize{tutorials/colors/colormaps:moreland}]{\sphinxcrossref{{[}Moreland{]}}}}): \begin{enumerate} \item {} Sequential: change in lightness and often saturation of color incrementally, often using a single hue; should be used for representing information that has ordering. \item {} Diverging: change in lightness and possibly saturation of two different colors that meet in the middle at an unsaturated color; should be used when the information being plotted has a critical middle value, such as topography or when the data deviates around zero. \item {} Qualitative: often are miscellaneous colors; should be used to represent information which does not have ordering or relationships. \end{enumerate} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} sphinx\PYGZus{}gallery\PYGZus{}thumbnail\PYGZus{}number = 2} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{k+kn}{as} \PYG{n+nn}{mpl} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib} \PYG{k+kn}{import} \PYG{n}{cm} \PYG{k+kn}{from} \PYG{n+nn}{colorspacious} \PYG{k+kn}{import} \PYG{n}{cspace\PYGZus{}converter} \PYG{k+kn}{from} \PYG{n+nn}{collections} \PYG{k+kn}{import} \PYG{n}{OrderedDict} \PYG{n}{cmaps} \PYG{o}{=} \PYG{n}{OrderedDict}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \paragraph{Sequential} \label{\detokenize{tutorials/colors/colormaps:sequential}} For the Sequential plots, the lightness value increases monotonically through the colormaps. This is good. Some of the $L^*$ values in the colormaps span from 0 to 100 (binary and the other grayscale), and others start around $L^*=20$. Those that have a smaller range of $L^*$ will accordingly have a smaller perceptual range. Note also that the $L^*$ function varies amongst the colormaps: some are approximately linear in $L^*$ and others are more curved. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{cmaps}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Perceptually Uniform Sequential}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{p}{[} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{viridis}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{plasma}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{inferno}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{magma}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{cividis}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{n}{cmaps}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Sequential}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{p}{[} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Greys}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Purples}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Blues}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Greens}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Oranges}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Reds}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{YlOrBr}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{YlOrRd}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{OrRd}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{PuRd}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{RdPu}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{BuPu}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{GnBu}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{PuBu}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{YlGnBu}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{PuBuGn}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{BuGn}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{YlGn}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \end{sphinxVerbatim} \paragraph{Sequential2} \label{\detokenize{tutorials/colors/colormaps:sequential2}} Many of the $L^*$ values from the Sequential2 plots are monotonically increasing, but some (autumn, cool, spring, and winter) plateau or even go both up and down in $L^*$ space. Others (afmhot, copper, gist\_heat, and hot) have kinks in the $L^*$ functions. Data that is being represented in a region of the colormap that is at a plateau or kink will lead to a perception of banding of the data in those values in the colormap (see \phantomsection\label{\detokenize{tutorials/colors/colormaps:id5}}{\hyperref[\detokenize{tutorials/colors/colormaps:mycarta-banding}]{\sphinxcrossref{{[}mycarta-banding{]}}}} for an excellent example of this). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{cmaps}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Sequential (2)}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{p}{[} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{binary}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{gist\PYGZus{}yarg}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{gist\PYGZus{}gray}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{gray}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bone}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{pink}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{spring}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{summer}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{autumn}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{winter}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{cool}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Wistia}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{hot}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{afmhot}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{gist\PYGZus{}heat}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{copper}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \end{sphinxVerbatim} \paragraph{Diverging} \label{\detokenize{tutorials/colors/colormaps:diverging}} For the Diverging maps, we want to have monotonically increasing $L^*$ values up to a maximum, which should be close to $L^*=100$, followed by monotonically decreasing $L^*$ values. We are looking for approximately equal minimum $L^*$ values at opposite ends of the colormap. By these measures, BrBG and RdBu are good options. coolwarm is a good option, but it doesn’t span a wide range of $L^*$ values (see grayscale section below). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{cmaps}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Diverging}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{p}{[} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{PiYG}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{PRGn}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{BrBG}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{PuOr}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{RdGy}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{RdBu}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{RdYlBu}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{RdYlGn}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Spectral}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{coolwarm}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bwr}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{seismic}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \end{sphinxVerbatim} \paragraph{Qualitative} \label{\detokenize{tutorials/colors/colormaps:qualitative}} Qualitative colormaps are not aimed at being perceptual maps, but looking at the lightness parameter can verify that for us. The $L^*$ values move all over the place throughout the colormap, and are clearly not monotonically increasing. These would not be good options for use as perceptual colormaps. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{cmaps}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Qualitative}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Pastel1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Pastel2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Paired}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Accent}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Dark2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Set1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Set2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Set3}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{tab10}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{tab20}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{tab20b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{tab20c}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \end{sphinxVerbatim} \paragraph{Miscellaneous} \label{\detokenize{tutorials/colors/colormaps:miscellaneous}} Some of the miscellaneous colormaps have particular uses for which they have been created. For example, gist\_earth, ocean, and terrain all seem to be created for plotting topography (green/brown) and water depths (blue) together. We would expect to see a divergence in these colormaps, then, but multiple kinks may not be ideal, such as in gist\_earth and terrain. CMRmap was created to convert well to grayscale, though it does appear to have some small kinks in $L^*$. cubehelix was created to vary smoothly in both lightness and hue, but appears to have a small hump in the green hue area. The often-used jet colormap is included in this set of colormaps. We can see that the $L^*$ values vary widely throughout the colormap, making it a poor choice for representing data for viewers to see perceptually. See an extension on this idea at \phantomsection\label{\detokenize{tutorials/colors/colormaps:id6}}{\hyperref[\detokenize{tutorials/colors/colormaps:mycarta-jet}]{\sphinxcrossref{{[}mycarta-jet{]}}}}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{cmaps}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Miscellaneous}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{p}{[} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{flag}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{prism}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ocean}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{gist\PYGZus{}earth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{terrain}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{gist\PYGZus{}stern}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{gnuplot}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{gnuplot2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{CMRmap}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{cubehelix}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{brg}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{hsv}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{gist\PYGZus{}rainbow}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{rainbow}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{jet}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{nipy\PYGZus{}spectral}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{gist\PYGZus{}ncar}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \end{sphinxVerbatim} \phantomsection\label{\detokenize{tutorials/colors/colormaps:color-colormaps-reference}} First, we’ll show the range of each colormap. Note that some seem to change more “quickly” than others. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{nrows} \PYG{o}{=} \PYG{n+nb}{max}\PYG{p}{(}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{cmap\PYGZus{}list}\PYG{p}{)} \PYG{k}{for} \PYG{n}{cmap\PYGZus{}category}\PYG{p}{,} \PYG{n}{cmap\PYGZus{}list} \PYG{o+ow}{in} \PYG{n}{cmaps}\PYG{o}{.}\PYG{n}{items}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{n}{gradient} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{256}\PYG{p}{)} \PYG{n}{gradient} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{vstack}\PYG{p}{(}\PYG{p}{(}\PYG{n}{gradient}\PYG{p}{,} \PYG{n}{gradient}\PYG{p}{)}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{plot\PYGZus{}color\PYGZus{}gradients}\PYG{p}{(}\PYG{n}{cmap\PYGZus{}category}\PYG{p}{,} \PYG{n}{cmap\PYGZus{}list}\PYG{p}{,} \PYG{n}{nrows}\PYG{p}{)}\PYG{p}{:} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axes} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{nrows}\PYG{o}{=}\PYG{n}{nrows}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{subplots\PYGZus{}adjust}\PYG{p}{(}\PYG{n}{top}\PYG{o}{=}\PYG{l+m+mf}{0.95}\PYG{p}{,} \PYG{n}{bottom}\PYG{o}{=}\PYG{l+m+mf}{0.01}\PYG{p}{,} \PYG{n}{left}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{n}{right}\PYG{o}{=}\PYG{l+m+mf}{0.99}\PYG{p}{)} \PYG{n}{axes}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{n}{cmap\PYGZus{}category} \PYG{o}{+} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ colormaps}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{14}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ax}\PYG{p}{,} \PYG{n}{name} \PYG{o+ow}{in} \PYG{n+nb}{zip}\PYG{p}{(}\PYG{n}{axes}\PYG{p}{,} \PYG{n}{cmap\PYGZus{}list}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{gradient}\PYG{p}{,} \PYG{n}{aspect}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{auto}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{n}{plt}\PYG{o}{.}\PYG{n}{get\PYGZus{}cmap}\PYG{p}{(}\PYG{n}{name}\PYG{p}{)}\PYG{p}{)} \PYG{n}{pos} \PYG{o}{=} \PYG{n+nb}{list}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}position}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{bounds}\PYG{p}{)} \PYG{n}{x\PYGZus{}text} \PYG{o}{=} \PYG{n}{pos}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{\PYGZhy{}} \PYG{l+m+mf}{0.01} \PYG{n}{y\PYGZus{}text} \PYG{o}{=} \PYG{n}{pos}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{+} \PYG{n}{pos}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{o}{/}\PYG{l+m+mf}{2.} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{n}{x\PYGZus{}text}\PYG{p}{,} \PYG{n}{y\PYGZus{}text}\PYG{p}{,} \PYG{n}{name}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{10}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Turn off *all* ticks \PYGZam{} spines, not just the ones with colormaps.} \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{axes}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}axis\PYGZus{}off}\PYG{p}{(}\PYG{p}{)} \PYG{k}{for} \PYG{n}{cmap\PYGZus{}category}\PYG{p}{,} \PYG{n}{cmap\PYGZus{}list} \PYG{o+ow}{in} \PYG{n}{cmaps}\PYG{o}{.}\PYG{n}{items}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{plot\PYGZus{}color\PYGZus{}gradients}\PYG{p}{(}\PYG{n}{cmap\PYGZus{}category}\PYG{p}{,} \PYG{n}{cmap\PYGZus{}list}\PYG{p}{,} \PYG{n}{nrows}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \begin{itemize} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_001}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_002}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_003}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_004}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_005}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_006}.png} \end{itemize} \subsubsection{Lightness of matplotlib colormaps} \label{\detokenize{tutorials/colors/colormaps:lightness-of-matplotlib-colormaps}} Here we examine the lightness values of the matplotlib colormaps. Note that some documentation on the colormaps is available (\phantomsection\label{\detokenize{tutorials/colors/colormaps:id7}}{\hyperref[\detokenize{tutorials/colors/colormaps:list-colormaps}]{\sphinxcrossref{{[}list-colormaps{]}}}}). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{o}{.}\PYG{n}{update}\PYG{p}{(}\PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{font.size}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{12}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Number of colormap per subplot for particular cmap categories} \PYG{n}{\PYGZus{}DSUBS} \PYG{o}{=} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Perceptually Uniform Sequential}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Sequential}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{6}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Sequential (2)}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{6}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Diverging}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{6}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Qualitative}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Miscellaneous}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{6}\PYG{p}{\PYGZcb{}} \PYG{c+c1}{\PYGZsh{} Spacing between the colormaps of a subplot} \PYG{n}{\PYGZus{}DC} \PYG{o}{=} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Perceptually Uniform Sequential}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{1.4}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Sequential}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{0.7}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Sequential (2)}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{1.4}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Diverging}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{1.4}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Qualitative}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{1.4}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Miscellaneous}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{1.4}\PYG{p}{\PYGZcb{}} \PYG{c+c1}{\PYGZsh{} Indices to step through colormap} \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Do plot} \PYG{k}{for} \PYG{n}{cmap\PYGZus{}category}\PYG{p}{,} \PYG{n}{cmap\PYGZus{}list} \PYG{o+ow}{in} \PYG{n}{cmaps}\PYG{o}{.}\PYG{n}{items}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} Do subplots so that colormaps have enough space.} \PYG{c+c1}{\PYGZsh{} Default is 6 colormaps per subplot.} \PYG{n}{dsub} \PYG{o}{=} \PYG{n}{\PYGZus{}DSUBS}\PYG{o}{.}\PYG{n}{get}\PYG{p}{(}\PYG{n}{cmap\PYGZus{}category}\PYG{p}{,} \PYG{l+m+mi}{6}\PYG{p}{)} \PYG{n}{nsubplots} \PYG{o}{=} \PYG{n+nb}{int}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{ceil}\PYG{p}{(}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{cmap\PYGZus{}list}\PYG{p}{)} \PYG{o}{/} \PYG{n}{dsub}\PYG{p}{)}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} squeeze=False to handle similarly the case of a single subplot} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axes} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{nrows}\PYG{o}{=}\PYG{n}{nsubplots}\PYG{p}{,} \PYG{n}{squeeze}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{,} \PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{7}\PYG{p}{,} \PYG{l+m+mf}{2.6}\PYG{o}{*}\PYG{n}{nsubplots}\PYG{p}{)}\PYG{p}{)} \PYG{k}{for} \PYG{n}{i}\PYG{p}{,} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n+nb}{enumerate}\PYG{p}{(}\PYG{n}{axes}\PYG{o}{.}\PYG{n}{flat}\PYG{p}{)}\PYG{p}{:} \PYG{n}{locs} \PYG{o}{=} \PYG{p}{[}\PYG{p}{]} \PYG{c+c1}{\PYGZsh{} locations for text labels} \PYG{k}{for} \PYG{n}{j}\PYG{p}{,} \PYG{n}{cmap} \PYG{o+ow}{in} \PYG{n+nb}{enumerate}\PYG{p}{(}\PYG{n}{cmap\PYGZus{}list}\PYG{p}{[}\PYG{n}{i}\PYG{o}{*}\PYG{n}{dsub}\PYG{p}{:}\PYG{p}{(}\PYG{n}{i}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{)}\PYG{o}{*}\PYG{n}{dsub}\PYG{p}{]}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} Get RGB values for colormap and convert the colormap in} \PYG{c+c1}{\PYGZsh{} CAM02\PYGZhy{}UCS colorspace. lab[0, :, 0] is the lightness.} \PYG{n}{rgb} \PYG{o}{=} \PYG{n}{cm}\PYG{o}{.}\PYG{n}{get\PYGZus{}cmap}\PYG{p}{(}\PYG{n}{cmap}\PYG{p}{)}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)}\PYG{p}{[}\PYG{n}{np}\PYG{o}{.}\PYG{n}{newaxis}\PYG{p}{,} \PYG{p}{:}\PYG{p}{,} \PYG{p}{:}\PYG{l+m+mi}{3}\PYG{p}{]} \PYG{n}{lab} \PYG{o}{=} \PYG{n}{cspace\PYGZus{}converter}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{sRGB1}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{CAM02\PYGZhy{}UCS}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}\PYG{p}{(}\PYG{n}{rgb}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Plot colormap L values. Do separately for each category} \PYG{c+c1}{\PYGZsh{} so each plot can be pretty. To make scatter markers change} \PYG{c+c1}{\PYGZsh{} color along plot:} \PYG{c+c1}{\PYGZsh{} http://stackoverflow.com/questions/8202605/matplotlib\PYGZhy{}scatterplot\PYGZhy{}colour\PYGZhy{}as\PYGZhy{}a\PYGZhy{}function\PYGZhy{}of\PYGZhy{}a\PYGZhy{}third\PYGZhy{}variable} \PYG{k}{if} \PYG{n}{cmap\PYGZus{}category} \PYG{o}{==} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Sequential}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} These colormaps all start at high lightness but we want them} \PYG{c+c1}{\PYGZsh{} reversed to look nice in the plot, so reverse the order.} \PYG{n}{y\PYGZus{}} \PYG{o}{=} \PYG{n}{lab}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{p}{:}\PYG{p}{:}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]} \PYG{n}{c\PYGZus{}} \PYG{o}{=} \PYG{n}{x}\PYG{p}{[}\PYG{p}{:}\PYG{p}{:}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{k}{else}\PYG{p}{:} \PYG{n}{y\PYGZus{}} \PYG{o}{=} \PYG{n}{lab}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]} \PYG{n}{c\PYGZus{}} \PYG{o}{=} \PYG{n}{x} \PYG{n}{dc} \PYG{o}{=} \PYG{n}{\PYGZus{}DC}\PYG{o}{.}\PYG{n}{get}\PYG{p}{(}\PYG{n}{cmap\PYGZus{}category}\PYG{p}{,} \PYG{l+m+mf}{1.4}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} cmaps horizontal spacing} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{scatter}\PYG{p}{(}\PYG{n}{x} \PYG{o}{+} \PYG{n}{j}\PYG{o}{*}\PYG{n}{dc}\PYG{p}{,} \PYG{n}{y\PYGZus{}}\PYG{p}{,} \PYG{n}{c}\PYG{o}{=}\PYG{n}{c\PYGZus{}}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{n}{cmap}\PYG{p}{,} \PYG{n}{s}\PYG{o}{=}\PYG{l+m+mi}{300}\PYG{p}{,} \PYG{n}{linewidths}\PYG{o}{=}\PYG{l+m+mf}{0.0}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Store locations for colormap labels} \PYG{k}{if} \PYG{n}{cmap\PYGZus{}category} \PYG{o+ow}{in} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Perceptually Uniform Sequential}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Sequential}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{:} \PYG{n}{locs}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{x}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{+} \PYG{n}{j}\PYG{o}{*}\PYG{n}{dc}\PYG{p}{)} \PYG{k}{elif} \PYG{n}{cmap\PYGZus{}category} \PYG{o+ow}{in} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Diverging}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Qualitative}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Miscellaneous}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Sequential (2)}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{:} \PYG{n}{locs}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{x}\PYG{p}{[}\PYG{n+nb}{int}\PYG{p}{(}\PYG{n}{x}\PYG{o}{.}\PYG{n}{size}\PYG{o}{/}\PYG{l+m+mf}{2.}\PYG{p}{)}\PYG{p}{]} \PYG{o}{+} \PYG{n}{j}\PYG{o}{*}\PYG{n}{dc}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Set up the axis limits:} \PYG{c+c1}{\PYGZsh{} * the 1st subplot is used as a reference for the x\PYGZhy{}axis limits} \PYG{c+c1}{\PYGZsh{} * lightness values goes from 0 to 100 (y\PYGZhy{}axis limits)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{n}{axes}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{get\PYGZus{}xlim}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{100.0}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Set up labels for colormaps} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}ticks\PYGZus{}position}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{top}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ticker} \PYG{o}{=} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{ticker}\PYG{o}{.}\PYG{n}{FixedLocator}\PYG{p}{(}\PYG{n}{locs}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}locator}\PYG{p}{(}\PYG{n}{ticker}\PYG{p}{)} \PYG{n}{formatter} \PYG{o}{=} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{ticker}\PYG{o}{.}\PYG{n}{FixedFormatter}\PYG{p}{(}\PYG{n}{cmap\PYGZus{}list}\PYG{p}{[}\PYG{n}{i}\PYG{o}{*}\PYG{n}{dsub}\PYG{p}{:}\PYG{p}{(}\PYG{n}{i}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{)}\PYG{o}{*}\PYG{n}{dsub}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}formatter}\PYG{p}{(}\PYG{n}{formatter}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}tick\PYGZus{}params}\PYG{p}{(}\PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{50}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{n}{cmap\PYGZus{}category} \PYG{o}{+} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ colormaps}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{14}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{0.55}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Lightness \PYGZdl{}L\PYGZca{}*\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{12}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{fig}\PYG{o}{.}\PYG{n}{transFigure}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{90}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{n}{h\PYGZus{}pad}\PYG{o}{=}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{n}{pad}\PYG{o}{=}\PYG{l+m+mf}{1.5}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \begin{itemize} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_007}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_008}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_009}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_010}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_011}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_012}.png} \end{itemize} \subsubsection{Grayscale conversion} \label{\detokenize{tutorials/colors/colormaps:grayscale-conversion}} It is important to pay attention to conversion to grayscale for color plots, since they may be printed on black and white printers. If not carefully considered, your readers may end up with indecipherable plots because the grayscale changes unpredictably through the colormap. Conversion to grayscale is done in many different ways \phantomsection\label{\detokenize{tutorials/colors/colormaps:id8}}{\hyperref[\detokenize{tutorials/colors/colormaps:bw}]{\sphinxcrossref{{[}bw{]}}}}. Some of the better ones use a linear combination of the rgb values of a pixel, but weighted according to how we perceive color intensity. A nonlinear method of conversion to grayscale is to use the $L^*$ values of the pixels. In general, similar principles apply for this question as they do for presenting one’s information perceptually; that is, if a colormap is chosen that is monotonically increasing in $L^*$ values, it will print in a reasonable manner to grayscale. With this in mind, we see that the Sequential colormaps have reasonable representations in grayscale. Some of the Sequential2 colormaps have decent enough grayscale representations, though some (autumn, spring, summer, winter) have very little grayscale change. If a colormap like this was used in a plot and then the plot was printed to grayscale, a lot of the information may map to the same gray values. The Diverging colormaps mostly vary from darker gray on the outer edges to white in the middle. Some (PuOr and seismic) have noticeably darker gray on one side than the other and therefore are not very symmetric. coolwarm has little range of gray scale and would print to a more uniform plot, losing a lot of detail. Note that overlaid, labeled contours could help differentiate between one side of the colormap vs. the other since color cannot be used once a plot is printed to grayscale. Many of the Qualitative and Miscellaneous colormaps, such as Accent, hsv, and jet, change from darker to lighter and back to darker gray throughout the colormap. This would make it impossible for a viewer to interpret the information in a plot once it is printed in grayscale. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{o}{.}\PYG{n}{update}\PYG{p}{(}\PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{font.size}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{14}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Indices to step through colormap.} \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{)} \PYG{n}{gradient} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{256}\PYG{p}{)} \PYG{n}{gradient} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{vstack}\PYG{p}{(}\PYG{p}{(}\PYG{n}{gradient}\PYG{p}{,} \PYG{n}{gradient}\PYG{p}{)}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{plot\PYGZus{}color\PYGZus{}gradients}\PYG{p}{(}\PYG{n}{cmap\PYGZus{}category}\PYG{p}{,} \PYG{n}{cmap\PYGZus{}list}\PYG{p}{)}\PYG{p}{:} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axes} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{nrows}\PYG{o}{=}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{cmap\PYGZus{}list}\PYG{p}{)}\PYG{p}{,} \PYG{n}{ncols}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{subplots\PYGZus{}adjust}\PYG{p}{(}\PYG{n}{top}\PYG{o}{=}\PYG{l+m+mf}{0.95}\PYG{p}{,} \PYG{n}{bottom}\PYG{o}{=}\PYG{l+m+mf}{0.01}\PYG{p}{,} \PYG{n}{left}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{n}{right}\PYG{o}{=}\PYG{l+m+mf}{0.99}\PYG{p}{,} \PYG{n}{wspace}\PYG{o}{=}\PYG{l+m+mf}{0.05}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{suptitle}\PYG{p}{(}\PYG{n}{cmap\PYGZus{}category} \PYG{o}{+} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ colormaps}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{14}\PYG{p}{,} \PYG{n}{y}\PYG{o}{=}\PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{n}{x}\PYG{o}{=}\PYG{l+m+mf}{0.6}\PYG{p}{)} \PYG{k}{for} \PYG{n}{ax}\PYG{p}{,} \PYG{n}{name} \PYG{o+ow}{in} \PYG{n+nb}{zip}\PYG{p}{(}\PYG{n}{axes}\PYG{p}{,} \PYG{n}{cmap\PYGZus{}list}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} Get RGB values for colormap.} \PYG{n}{rgb} \PYG{o}{=} \PYG{n}{cm}\PYG{o}{.}\PYG{n}{get\PYGZus{}cmap}\PYG{p}{(}\PYG{n}{plt}\PYG{o}{.}\PYG{n}{get\PYGZus{}cmap}\PYG{p}{(}\PYG{n}{name}\PYG{p}{)}\PYG{p}{)}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)}\PYG{p}{[}\PYG{n}{np}\PYG{o}{.}\PYG{n}{newaxis}\PYG{p}{,} \PYG{p}{:}\PYG{p}{,} \PYG{p}{:}\PYG{l+m+mi}{3}\PYG{p}{]} \PYG{c+c1}{\PYGZsh{} Get colormap in CAM02\PYGZhy{}UCS colorspace. We want the lightness.} \PYG{n}{lab} \PYG{o}{=} \PYG{n}{cspace\PYGZus{}converter}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{sRGB1}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{CAM02\PYGZhy{}UCS}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}\PYG{p}{(}\PYG{n}{rgb}\PYG{p}{)} \PYG{n}{L} \PYG{o}{=} \PYG{n}{lab}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]} \PYG{n}{L} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{float32}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{vstack}\PYG{p}{(}\PYG{p}{(}\PYG{n}{L}\PYG{p}{,} \PYG{n}{L}\PYG{p}{,} \PYG{n}{L}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{gradient}\PYG{p}{,} \PYG{n}{aspect}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{auto}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{n}{plt}\PYG{o}{.}\PYG{n}{get\PYGZus{}cmap}\PYG{p}{(}\PYG{n}{name}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{L}\PYG{p}{,} \PYG{n}{aspect}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{auto}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{binary\PYGZus{}r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{vmin}\PYG{o}{=}\PYG{l+m+mf}{0.}\PYG{p}{,} \PYG{n}{vmax}\PYG{o}{=}\PYG{l+m+mf}{100.}\PYG{p}{)} \PYG{n}{pos} \PYG{o}{=} \PYG{n+nb}{list}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{get\PYGZus{}position}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{bounds}\PYG{p}{)} \PYG{n}{x\PYGZus{}text} \PYG{o}{=} \PYG{n}{pos}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{\PYGZhy{}} \PYG{l+m+mf}{0.01} \PYG{n}{y\PYGZus{}text} \PYG{o}{=} \PYG{n}{pos}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{+} \PYG{n}{pos}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{o}{/}\PYG{l+m+mf}{2.} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{n}{x\PYGZus{}text}\PYG{p}{,} \PYG{n}{y\PYGZus{}text}\PYG{p}{,} \PYG{n}{name}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{10}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Turn off *all* ticks \PYGZam{} spines, not just the ones with colormaps.} \PYG{k}{for} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{flat}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}axis\PYGZus{}off}\PYG{p}{(}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \PYG{k}{for} \PYG{n}{cmap\PYGZus{}category}\PYG{p}{,} \PYG{n}{cmap\PYGZus{}list} \PYG{o+ow}{in} \PYG{n}{cmaps}\PYG{o}{.}\PYG{n}{items}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{plot\PYGZus{}color\PYGZus{}gradients}\PYG{p}{(}\PYG{n}{cmap\PYGZus{}category}\PYG{p}{,} \PYG{n}{cmap\PYGZus{}list}\PYG{p}{)} \end{sphinxVerbatim} \begin{itemize} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_013}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_014}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_015}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_016}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_017}.png} \item {} \noindent\sphinxincludegraphics{{sphx_glr_colormaps_018}.png} \end{itemize} \subsubsection{Color vision deficiencies} \label{\detokenize{tutorials/colors/colormaps:color-vision-deficiencies}} There is a lot of information available about color blindness (\sphinxstyleemphasis{e.g.}, \phantomsection\label{\detokenize{tutorials/colors/colormaps:id9}}{\hyperref[\detokenize{tutorials/colors/colormaps:colorblindness}]{\sphinxcrossref{{[}colorblindness{]}}}}). Additionally, there are tools available to convert images to how they look for different types of color vision deficiencies (\sphinxstyleemphasis{e.g.}, \phantomsection\label{\detokenize{tutorials/colors/colormaps:id10}}{\hyperref[\detokenize{tutorials/colors/colormaps:vischeck}]{\sphinxcrossref{{[}vischeck{]}}}}). The most common form of color vision deficiency involves differentiating between red and green. Thus, avoiding colormaps with both red and green will avoid many problems in general. \subsubsection{References} \label{\detokenize{tutorials/colors/colormaps:references}} \sphinxstylestrong{Total running time of the script:} ( 0 minutes 2.459 seconds) \phantomsection\label{\detokenize{tutorials/colors/colormaps:sphx-glr-download-tutorials-colors-colormaps-py}} \section{Text} \label{\detokenize{tutorials/index:text}}\label{\detokenize{tutorials/index:tutorials-text}} 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. \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/text/annotations:sphx-glr-download-tutorials-text-annotations-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Annotations} \label{\detokenize{tutorials/text/annotations:annotations}}\label{\detokenize{tutorials/text/annotations:sphx-glr-tutorials-text-annotations-py}}\label{\detokenize{tutorials/text/annotations::doc}} Annotating text with Matplotlib. \begin{sphinxShadowBox} \sphinxstyletopictitle{Table of Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{tutorials/text/annotations:id23}}{\hyperref[\detokenize{tutorials/text/annotations:annotations}]{\sphinxcrossref{Annotations}}} \item {} \phantomsection\label{\detokenize{tutorials/text/annotations:id24}}{\hyperref[\detokenize{tutorials/text/annotations:basic-annotation}]{\sphinxcrossref{Basic annotation}}} \item {} \phantomsection\label{\detokenize{tutorials/text/annotations:id25}}{\hyperref[\detokenize{tutorials/text/annotations:advanced-annotation}]{\sphinxcrossref{Advanced Annotation}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{tutorials/text/annotations:id26}}{\hyperref[\detokenize{tutorials/text/annotations:annotating-with-text-with-box}]{\sphinxcrossref{Annotating with Text with Box}}} \item {} \phantomsection\label{\detokenize{tutorials/text/annotations:id27}}{\hyperref[\detokenize{tutorials/text/annotations:annotating-with-arrow}]{\sphinxcrossref{Annotating with Arrow}}} \item {} \phantomsection\label{\detokenize{tutorials/text/annotations:id28}}{\hyperref[\detokenize{tutorials/text/annotations:placing-artist-at-the-anchored-location-of-the-axes}]{\sphinxcrossref{Placing Artist at the anchored location of the Axes}}} \item {} \phantomsection\label{\detokenize{tutorials/text/annotations:id29}}{\hyperref[\detokenize{tutorials/text/annotations:using-complex-coordinates-with-annotations}]{\sphinxcrossref{Using Complex Coordinates with Annotations}}} \item {} \phantomsection\label{\detokenize{tutorials/text/annotations:id30}}{\hyperref[\detokenize{tutorials/text/annotations:using-connectionpatch}]{\sphinxcrossref{Using ConnectionPatch}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{tutorials/text/annotations:id31}}{\hyperref[\detokenize{tutorials/text/annotations:advanced-topics}]{\sphinxcrossref{Advanced Topics}}} \end{itemize} \item {} \phantomsection\label{\detokenize{tutorials/text/annotations:id32}}{\hyperref[\detokenize{tutorials/text/annotations:zoom-effect-between-axes}]{\sphinxcrossref{Zoom effect between Axes}}} \item {} \phantomsection\label{\detokenize{tutorials/text/annotations:id33}}{\hyperref[\detokenize{tutorials/text/annotations:define-custom-boxstyle}]{\sphinxcrossref{Define Custom BoxStyle}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \subsection{Basic annotation} \label{\detokenize{tutorials/text/annotations:basic-annotation}}\label{\detokenize{tutorials/text/annotations:annotations-tutorial}} The uses of the basic {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.text:matplotlib.pyplot.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text()}}}}} will place text at an arbitrary position on the Axes. A common use case of text is to annotate some feature of the plot, and the \sphinxcode{\sphinxupquote{annotate()}} method provides helper functionality to make annotations easy. In an annotation, there are two points to consider: the location being annotated represented by the argument \sphinxcode{\sphinxupquote{xy}} and the location of the text \sphinxcode{\sphinxupquote{xytext}}. Both of these arguments are \sphinxcode{\sphinxupquote{(x,y)}} tuples. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/pyplots/annotation\_basic.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_annotation_basic_0011}.png}}\caption{Annotation Basic}\label{\detokenize{tutorials/text/annotations:id1}}\end{figure} In this example, both the \sphinxcode{\sphinxupquote{xy}} (arrow tip) and \sphinxcode{\sphinxupquote{xytext}} locations (text location) are in data coordinates. There are a variety of other coordinate systems one can choose \textendash{} you can specify the coordinate system of \sphinxcode{\sphinxupquote{xy}} and \sphinxcode{\sphinxupquote{xytext}} with one of the following strings for \sphinxcode{\sphinxupquote{xycoords}} and \sphinxcode{\sphinxupquote{textcoords}} (default is ‘data’) \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily argument &\sphinxstyletheadfamily coordinate system \\ \hline ‘figure points’ & points from the lower left corner of the figure \\ \hline ‘figure pixels’ & pixels from the lower left corner of the figure \\ \hline ‘figure fraction’ & 0,0 is lower left of figure and 1,1 is upper right \\ \hline ‘axes points’ & points from lower left corner of axes \\ \hline ‘axes pixels’ & pixels from lower left corner of axes \\ \hline ‘axes fraction’ & 0,0 is lower left of axes and 1,1 is upper right \\ \hline ‘data’ & use the axes data coordinate system \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} For example to place the text coordinates in fractional axes coordinates, one could do: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{local max}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xycoords}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{data}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{xytext}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.8}\PYG{p}{,} \PYG{l+m+mf}{0.95}\PYG{p}{)}\PYG{p}{,} \PYG{n}{textcoords}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes fraction}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{arrowprops}\PYG{o}{=}\PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{black}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{shrink}\PYG{o}{=}\PYG{l+m+mf}{0.05}\PYG{p}{)}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{verticalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{top}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{p}{)} \end{sphinxVerbatim} For physical coordinate systems (points or pixels) the origin is the bottom-left of the figure or axes. Optionally, you can enable drawing of an arrow from the text to the annotated point by giving a dictionary of arrow properties in the optional keyword argument \sphinxcode{\sphinxupquote{arrowprops}}. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily \sphinxcode{\sphinxupquote{arrowprops}} key &\sphinxstyletheadfamily description \\ \hline width & the width of the arrow in points \\ \hline frac & the fraction of the arrow length occupied by the head \\ \hline headwidth & the width of the base of the arrow head in points \\ \hline shrink & move the tip and base some percent away from the annotated point and text \\ \hline **kwargs & any key for {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.Polygon}}}}}, e.g., \sphinxcode{\sphinxupquote{facecolor}} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} In the example below, the \sphinxcode{\sphinxupquote{xy}} point is in native coordinates (\sphinxcode{\sphinxupquote{xycoords}} defaults to ‘data’). For a polar axes, this is in (theta, radius) space. The text in this example is placed in the fractional figure coordinate system. {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}} keyword args like \sphinxcode{\sphinxupquote{horizontalalignment}}, \sphinxcode{\sphinxupquote{verticalalignment}} and \sphinxcode{\sphinxupquote{fontsize}} are passed from \sphinxcode{\sphinxupquote{annotate}} to the \sphinxcode{\sphinxupquote{Text}} instance. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/pyplots/annotation\_polar.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_annotation_polar_0011}.png}}\caption{Annotation Polar}\label{\detokenize{tutorials/text/annotations:id2}}\end{figure} For more on all the wild and wonderful things you can do with annotations, including fancy arrows, see {\hyperref[\detokenize{tutorials/text/annotations:plotting-guide-annotation}]{\sphinxcrossref{\DUrole{std,std-ref}{Advanced Annotation}}}} and \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_annotation\_demo.py}. Do not proceed unless you have already read {\hyperref[\detokenize{tutorials/text/annotations:annotations-tutorial}]{\sphinxcrossref{\DUrole{std,std-ref}{Basic annotation}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.text:matplotlib.pyplot.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.annotate:matplotlib.pyplot.annotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{annotate()}}}}}! \subsection{Advanced Annotation} \label{\detokenize{tutorials/text/annotations:advanced-annotation}}\label{\detokenize{tutorials/text/annotations:plotting-guide-annotation}} \subsubsection{Annotating with Text with Box} \label{\detokenize{tutorials/text/annotations:annotating-with-text-with-box}} Let’s start with a simple example. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/annotate\_text\_arrow.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_annotate_text_arrow_0011}.png}}\caption{Annotate Text Arrow}\label{\detokenize{tutorials/text/annotations:id3}}\end{figure} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.text:matplotlib.pyplot.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text()}}}}} function in the pyplot module (or text method of the Axes class) takes bbox keyword argument, and when given, a box around the text is drawn. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{bbox\PYGZus{}props} \PYG{o}{=} \PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{boxstyle}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{rarrow,pad=0.3}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{fc}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{cyan}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{ec}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{b}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{t} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Direction}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{center}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{center}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{45}\PYG{p}{,} \PYG{n}{size}\PYG{o}{=}\PYG{l+m+mi}{15}\PYG{p}{,} \PYG{n}{bbox}\PYG{o}{=}\PYG{n}{bbox\PYGZus{}props}\PYG{p}{)} \end{sphinxVerbatim} The patch object associated with the text can be accessed by: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{bb} \PYG{o}{=} \PYG{n}{t}\PYG{o}{.}\PYG{n}{get\PYGZus{}bbox\PYGZus{}patch}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} The return value is an instance of FancyBboxPatch and the patch properties like facecolor, edgewidth, etc. can be accessed and modified as usual. To change the shape of the box, use the \sphinxstyleemphasis{set\_boxstyle} method. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{bb}\PYG{o}{.}\PYG{n}{set\PYGZus{}boxstyle}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{rarrow}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{pad}\PYG{o}{=}\PYG{l+m+mf}{0.6}\PYG{p}{)} \end{sphinxVerbatim} The arguments are the name of the box style with its attributes as keyword arguments. Currently, following box styles are implemented. \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily Class &\sphinxstyletheadfamily Name &\sphinxstyletheadfamily Attrs \\ \hline Circle & \sphinxcode{\sphinxupquote{circle}} & pad=0.3 \\ \hline DArrow & \sphinxcode{\sphinxupquote{darrow}} & pad=0.3 \\ \hline LArrow & \sphinxcode{\sphinxupquote{larrow}} & pad=0.3 \\ \hline RArrow & \sphinxcode{\sphinxupquote{rarrow}} & pad=0.3 \\ \hline Round & \sphinxcode{\sphinxupquote{round}} & pad=0.3,rounding\_size=None \\ \hline Round4 & \sphinxcode{\sphinxupquote{round4}} & pad=0.3,rounding\_size=None \\ \hline Roundtooth & \sphinxcode{\sphinxupquote{roundtooth}} & pad=0.3,tooth\_size=None \\ \hline Sawtooth & \sphinxcode{\sphinxupquote{sawtooth}} & pad=0.3,tooth\_size=None \\ \hline Square & \sphinxcode{\sphinxupquote{square}} & pad=0.3 \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/shapes\_and\_collections/fancybox\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_fancybox_demo_0011}.png}}\caption{Fancybox Demo}\label{\detokenize{tutorials/text/annotations:id4}}\end{figure} Note that the attribute arguments can be specified within the style name with separating comma (this form can be used as “boxstyle” value of bbox argument when initializing the text instance) \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{bb}\PYG{o}{.}\PYG{n}{set\PYGZus{}boxstyle}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{rarrow,pad=0.6}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} \subsubsection{Annotating with Arrow} \label{\detokenize{tutorials/text/annotations:annotating-with-arrow}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.annotate:matplotlib.pyplot.annotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{annotate()}}}}} function in the pyplot module (or annotate method of the Axes class) is used to draw an arrow connecting two points on the plot. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Annotation}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xycoords}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{data}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{xytext}\PYG{o}{=}\PYG{p}{(}\PYG{n}{x2}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{)}\PYG{p}{,} \PYG{n}{textcoords}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{offset points}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{p}{)} \end{sphinxVerbatim} This annotates a point at \sphinxcode{\sphinxupquote{xy}} in the given coordinate (\sphinxcode{\sphinxupquote{xycoords}}) with the text at \sphinxcode{\sphinxupquote{xytext}} given in \sphinxcode{\sphinxupquote{textcoords}}. Often, the annotated point is specified in the \sphinxstyleemphasis{data} coordinate and the annotating text in \sphinxstyleemphasis{offset points}. See {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.annotate:matplotlib.pyplot.annotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{annotate()}}}}} for available coordinate systems. An arrow connecting two points (xy \& xytext) can be optionally drawn by specifying the \sphinxcode{\sphinxupquote{arrowprops}} argument. To draw only an arrow, use empty string as the first argument. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{l+m+mf}{0.2}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xycoords}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{data}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{xytext}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.8}\PYG{p}{,} \PYG{l+m+mf}{0.8}\PYG{p}{)}\PYG{p}{,} \PYG{n}{textcoords}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{data}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{arrowprops}\PYG{o}{=}\PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{arrowstyle}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZhy{}\PYGZgt{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{connectionstyle}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{arc3}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}\PYG{p}{,} \PYG{p}{)} \end{sphinxVerbatim} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/annotate\_simple01.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_annotate_simple01_0011}.png}}\caption{Annotate Simple01}\label{\detokenize{tutorials/text/annotations:id5}}\end{figure} The arrow drawing takes a few steps. \begin{enumerate} \item {} a connecting path between two points are created. This is controlled by \sphinxcode{\sphinxupquote{connectionstyle}} key value. \item {} If patch object is given (\sphinxstyleemphasis{patchA} \& \sphinxstyleemphasis{patchB}), the path is clipped to avoid the patch. \item {} The path is further shrunk by given amount of pixels (\sphinxstyleemphasis{shrinkA} \& \sphinxstyleemphasis{shrinkB}) \item {} The path is transmuted to arrow patch, which is controlled by the \sphinxcode{\sphinxupquote{arrowstyle}} key value. \end{enumerate} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/annotate\_explain.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_annotate_explain_0011}.png}}\caption{Annotate Explain}\label{\detokenize{tutorials/text/annotations:id6}}\end{figure} The creation of the connecting path between two points is controlled by \sphinxcode{\sphinxupquote{connectionstyle}} key and the following styles are available. \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Name &\sphinxstyletheadfamily Attrs \\ \hline \sphinxcode{\sphinxupquote{angle}} & angleA=90,angleB=0,rad=0.0 \\ \hline \sphinxcode{\sphinxupquote{angle3}} & angleA=90,angleB=0 \\ \hline \sphinxcode{\sphinxupquote{arc}} & angleA=0,angleB=0,armA=None,armB=None,rad=0.0 \\ \hline \sphinxcode{\sphinxupquote{arc3}} & rad=0.0 \\ \hline \sphinxcode{\sphinxupquote{bar}} & armA=0.0,armB=0.0,fraction=0.3,angle=None \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} Note that “3” in \sphinxcode{\sphinxupquote{angle3}} and \sphinxcode{\sphinxupquote{arc3}} is meant to indicate that the resulting path is a quadratic spline segment (three control points). As will be discussed below, some arrow style options can only be used when the connecting path is a quadratic spline. The behavior of each connection style is (limitedly) demonstrated in the example below. (Warning : The behavior of the \sphinxcode{\sphinxupquote{bar}} style is currently not well defined, it may be changed in the future). \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/connectionstyle\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_connectionstyle_demo_0011}.png}}\caption{Connectionstyle Demo}\label{\detokenize{tutorials/text/annotations:id7}}\end{figure} The connecting path (after clipping and shrinking) is then mutated to an arrow patch, according to the given \sphinxcode{\sphinxupquote{arrowstyle}}. \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Name &\sphinxstyletheadfamily Attrs \\ \hline \sphinxcode{\sphinxupquote{-}} & None \\ \hline \sphinxcode{\sphinxupquote{-\textgreater{}}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{-{[}}} & widthB=1.0,lengthB=0.2,angleB=None \\ \hline \sphinxcode{\sphinxupquote{\textbar{}-\textbar{}}} & widthA=1.0,widthB=1.0 \\ \hline \sphinxcode{\sphinxupquote{-\textbar{}\textgreater{}}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{\textless{}-}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{\textless{}-\textgreater{}}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{\textless{}\textbar{}-}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{\textless{}\textbar{}-\textbar{}\textgreater{}}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{fancy}} & head\_length=0.4,head\_width=0.4,tail\_width=0.4 \\ \hline \sphinxcode{\sphinxupquote{simple}} & head\_length=0.5,head\_width=0.5,tail\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{wedge}} & tail\_width=0.3,shrink\_factor=0.5 \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/text\_labels\_and\_annotations/fancyarrow\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_fancyarrow_demo_0011}.png}}\caption{Fancyarrow Demo}\label{\detokenize{tutorials/text/annotations:id8}}\end{figure} Some arrowstyles only work with connection styles that generate a quadratic-spline segment. They are \sphinxcode{\sphinxupquote{fancy}}, \sphinxcode{\sphinxupquote{simple}}, and \sphinxcode{\sphinxupquote{wedge}}. For these arrow styles, you must use the “angle3” or “arc3” connection style. If the annotation string is given, the patchA is set to the bbox patch of the text by default. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/annotate\_simple02.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_annotate_simple02_0011}.png}}\caption{Annotate Simple02}\label{\detokenize{tutorials/text/annotations:id9}}\end{figure} As in the text command, a box around the text can be drawn using the \sphinxcode{\sphinxupquote{bbox}} argument. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/annotate\_simple03.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_annotate_simple03_0011}.png}}\caption{Annotate Simple03}\label{\detokenize{tutorials/text/annotations:id10}}\end{figure} By default, the starting point is set to the center of the text extent. This can be adjusted with \sphinxcode{\sphinxupquote{relpos}} key value. The values are normalized to the extent of the text. For example, (0,0) means lower-left corner and (1,1) means top-right. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/annotate\_simple04.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_annotate_simple04_0011}.png}}\caption{Annotate Simple04}\label{\detokenize{tutorials/text/annotations:id11}}\end{figure} \subsubsection{Placing Artist at the anchored location of the Axes} \label{\detokenize{tutorials/text/annotations:placing-artist-at-the-anchored-location-of-the-axes}} There are classes of artists that can be placed at an anchored location in the Axes. A common example is the legend. This type of artist can be created by using the OffsetBox class. A few predefined classes are available in \sphinxcode{\sphinxupquote{mpl\_toolkits.axes\_grid1.anchored\_artists}} others in \sphinxcode{\sphinxupquote{matplotlib.offsetbox}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{offsetbox} \PYG{k}{import} \PYG{n}{AnchoredText} \PYG{n}{at} \PYG{o}{=} \PYG{n}{AnchoredText}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Figure 1a}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{prop}\PYG{o}{=}\PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{size}\PYG{o}{=}\PYG{l+m+mi}{8}\PYG{p}{)}\PYG{p}{,} \PYG{n}{frameon}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{,} \PYG{n}{loc}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{p}{)} \PYG{n}{at}\PYG{o}{.}\PYG{n}{patch}\PYG{o}{.}\PYG{n}{set\PYGZus{}boxstyle}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{round,pad=0.,rounding\PYGZus{}size=0.2}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{add\PYGZus{}artist}\PYG{p}{(}\PYG{n}{at}\PYG{p}{)} \end{sphinxVerbatim} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/anchored\_box01.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_anchored_box01_0011}.png}}\caption{Anchored Box01}\label{\detokenize{tutorials/text/annotations:id12}}\end{figure} The \sphinxstyleemphasis{loc} keyword has same meaning as in the legend command. A simple application is when the size of the artist (or collection of artists) is known in pixel size during the time of creation. For example, If you want to draw a circle with fixed size of 20 pixel x 20 pixel (radius = 10 pixel), you can utilize \sphinxcode{\sphinxupquote{AnchoredDrawingArea}}. The instance is created with a size of the drawing area (in pixels), and arbitrary artists can added to the drawing area. Note that the extents of the artists that are added to the drawing area are not related to the placement of the drawing area itself. Only the initial size matters. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{mpl\PYGZus{}toolkits}\PYG{n+nn}{.}\PYG{n+nn}{axes\PYGZus{}grid1}\PYG{n+nn}{.}\PYG{n+nn}{anchored\PYGZus{}artists} \PYG{k}{import} \PYG{n}{AnchoredDrawingArea} \PYG{n}{ada} \PYG{o}{=} \PYG{n}{AnchoredDrawingArea}\PYG{p}{(}\PYG{l+m+mi}{20}\PYG{p}{,} \PYG{l+m+mi}{20}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{loc}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{pad}\PYG{o}{=}\PYG{l+m+mf}{0.}\PYG{p}{,} \PYG{n}{frameon}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{)} \PYG{n}{p1} \PYG{o}{=} \PYG{n}{Circle}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{)} \PYG{n}{ada}\PYG{o}{.}\PYG{n}{drawing\PYGZus{}area}\PYG{o}{.}\PYG{n}{add\PYGZus{}artist}\PYG{p}{(}\PYG{n}{p1}\PYG{p}{)} \PYG{n}{p2} \PYG{o}{=} \PYG{n}{Circle}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{30}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{n}{fc}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{ada}\PYG{o}{.}\PYG{n}{drawing\PYGZus{}area}\PYG{o}{.}\PYG{n}{add\PYGZus{}artist}\PYG{p}{(}\PYG{n}{p2}\PYG{p}{)} \end{sphinxVerbatim} The artists that are added to the drawing area should not have a transform set (it will be overridden) and the dimensions of those artists are interpreted as a pixel coordinate, i.e., the radius of the circles in above example are 10 pixels and 5 pixels, respectively. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/anchored\_box02.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_anchored_box02_0011}.png}}\caption{Anchored Box02}\label{\detokenize{tutorials/text/annotations:id13}}\end{figure} Sometimes, you want your artists to scale with the data coordinate (or coordinates other than canvas pixels). You can use \sphinxcode{\sphinxupquote{AnchoredAuxTransformBox}} class. This is similar to \sphinxcode{\sphinxupquote{AnchoredDrawingArea}} except that the extent of the artist is determined during the drawing time respecting the specified transform. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{mpl\PYGZus{}toolkits}\PYG{n+nn}{.}\PYG{n+nn}{axes\PYGZus{}grid1}\PYG{n+nn}{.}\PYG{n+nn}{anchored\PYGZus{}artists} \PYG{k}{import} \PYG{n}{AnchoredAuxTransformBox} \PYG{n}{box} \PYG{o}{=} \PYG{n}{AnchoredAuxTransformBox}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{p}{,} \PYG{n}{loc}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{el} \PYG{o}{=} \PYG{n}{Ellipse}\PYG{p}{(}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{,} \PYG{n}{width}\PYG{o}{=}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{n}{height}\PYG{o}{=}\PYG{l+m+mf}{0.4}\PYG{p}{,} \PYG{n}{angle}\PYG{o}{=}\PYG{l+m+mi}{30}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} in data coordinates!} \PYG{n}{box}\PYG{o}{.}\PYG{n}{drawing\PYGZus{}area}\PYG{o}{.}\PYG{n}{add\PYGZus{}artist}\PYG{p}{(}\PYG{n}{el}\PYG{p}{)} \end{sphinxVerbatim} The ellipse in the above example will have width and height corresponding to 0.1 and 0.4 in data coordinateing and will be automatically scaled when the view limits of the axes change. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/anchored\_box03.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_anchored_box03_0011}.png}}\caption{Anchored Box03}\label{\detokenize{tutorials/text/annotations:id14}}\end{figure} As in the legend, the bbox\_to\_anchor argument can be set. Using the HPacker and VPacker, you can have an arrangement(?) of artist as in the legend (as a matter of fact, this is how the legend is created). \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/anchored\_box04.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_anchored_box04_0011}.png}}\caption{Anchored Box04}\label{\detokenize{tutorials/text/annotations:id15}}\end{figure} Note that unlike the legend, the \sphinxcode{\sphinxupquote{bbox\_transform}} is set to IdentityTransform by default. \subsubsection{Using Complex Coordinates with Annotations} \label{\detokenize{tutorials/text/annotations:using-complex-coordinates-with-annotations}} The Annotation in matplotlib supports several types of coordinates as described in {\hyperref[\detokenize{tutorials/text/annotations:annotations-tutorial}]{\sphinxcrossref{\DUrole{std,std-ref}{Basic annotation}}}}. For an advanced user who wants more control, it supports a few other options. \begin{enumerate} \item {} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance. For example, \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xycoords}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \end{sphinxVerbatim} is identical to \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xycoords}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{axes fraction}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} With this, you can annotate a point in other axes. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax1}\PYG{p}{,} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{121}\PYG{p}{)}\PYG{p}{,} \PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{122}\PYG{p}{)} \PYG{n}{ax2}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xycoords}\PYG{o}{=}\PYG{n}{ax1}\PYG{o}{.}\PYG{n}{transData}\PYG{p}{,} \PYG{n}{xytext}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{textcoords}\PYG{o}{=}\PYG{n}{ax2}\PYG{o}{.}\PYG{n}{transData}\PYG{p}{,} \PYG{n}{arrowprops}\PYG{o}{=}\PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{arrowstyle}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZhy{}\PYGZgt{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \item {} {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instance. The xy value (or xytext) is interpreted as a fractional coordinate of the bbox (return value of \sphinxstyleemphasis{get\_window\_extent}) of the artist. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{an1} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test 1}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xycoords}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{data}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{center}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{center}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{bbox}\PYG{o}{=}\PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{boxstyle}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{round}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{fc}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{w}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}\PYG{p}{)} \PYG{n}{an2} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test 2}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xycoords}\PYG{o}{=}\PYG{n}{an1}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} (1,0.5) of the an1\PYGZsq{}s bbox} \PYG{n}{xytext}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{30}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{,} \PYG{n}{textcoords}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{offset points}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{center}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{left}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{bbox}\PYG{o}{=}\PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{boxstyle}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{round}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{fc}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{w}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}\PYG{p}{,} \PYG{n}{arrowprops}\PYG{o}{=}\PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{arrowstyle}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZhy{}\PYGZgt{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/annotate\_simple\_coord01.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_annotate_simple_coord01_0011}.png}}\caption{Annotation with Simple Coordinates}\label{\detokenize{tutorials/text/annotations:id16}}\end{figure} Note that it is your responsibility that the extent of the coordinate artist (\sphinxstyleemphasis{an1} in above example) is determined before \sphinxstyleemphasis{an2} gets drawn. In most cases, it means that \sphinxstyleemphasis{an2} needs to be drawn later than \sphinxstyleemphasis{an1}. \item {} A callable object that returns an instance of either {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BboxBase}}}}} or {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}. If a transform is returned, it is the same as 1 and if a bbox is returned, it is the same as 2. The callable object should take a single argument of the renderer instance. For example, the following two commands give identical results \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{an2} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test 2}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xycoords}\PYG{o}{=}\PYG{n}{an1}\PYG{p}{,} \PYG{n}{xytext}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{30}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{,} \PYG{n}{textcoords}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{offset points}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{an2} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test 2}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xycoords}\PYG{o}{=}\PYG{n}{an1}\PYG{o}{.}\PYG{n}{get\PYGZus{}window\PYGZus{}extent}\PYG{p}{,} \PYG{n}{xytext}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{30}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{,} \PYG{n}{textcoords}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{offset points}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} \item {} A tuple of two coordinate specifications. The first item is for the x-coordinate and the second is for the y-coordinate. For example, \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Test}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xycoords}\PYG{o}{=}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{data}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{axes fraction}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} 0.5 is in data coordinates, and 1 is in normalized axes coordinates. You may use an artist or transform as with a tuple. For example, \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/annotate\_simple\_coord02.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_annotate_simple_coord02_0011}.png}}\caption{Annotation with Simple Coordinates 2}\label{\detokenize{tutorials/text/annotations:id17}}\end{figure} \item {} Sometimes, you want your annotation with some “offset points”, not from the annotated point but from some other point. {\hyperref[\detokenize{api/text_api:matplotlib.text.OffsetFrom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{OffsetFrom}}}}} is a helper class for such cases. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/annotate\_simple\_coord03.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_annotate_simple_coord03_0011}.png}}\caption{Annotation with Simple Coordinates 3}\label{\detokenize{tutorials/text/annotations:id18}}\end{figure} You may take a look at this example \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_annotation\_demo.py}. \end{enumerate} \subsubsection{Using ConnectionPatch} \label{\detokenize{tutorials/text/annotations:using-connectionpatch}} The ConnectionPatch is like an annotation without text. While the annotate function is recommended in most situations, the ConnectionPatch is useful when you want to connect points in different axes. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{patches} \PYG{k}{import} \PYG{n}{ConnectionPatch} \PYG{n}{xy} \PYG{o}{=} \PYG{p}{(}\PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{l+m+mf}{0.2}\PYG{p}{)} \PYG{n}{con} \PYG{o}{=} \PYG{n}{ConnectionPatch}\PYG{p}{(}\PYG{n}{xyA}\PYG{o}{=}\PYG{n}{xy}\PYG{p}{,} \PYG{n}{xyB}\PYG{o}{=}\PYG{n}{xy}\PYG{p}{,} \PYG{n}{coordsA}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{data}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{coordsB}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{data}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{axesA}\PYG{o}{=}\PYG{n}{ax1}\PYG{p}{,} \PYG{n}{axesB}\PYG{o}{=}\PYG{n}{ax2}\PYG{p}{)} \PYG{n}{ax2}\PYG{o}{.}\PYG{n}{add\PYGZus{}artist}\PYG{p}{(}\PYG{n}{con}\PYG{p}{)} \end{sphinxVerbatim} The above code connects point xy in the data coordinates of \sphinxcode{\sphinxupquote{ax1}} to point xy in the data coordinates of \sphinxcode{\sphinxupquote{ax2}}. Here is a simple example. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/connect\_simple01.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_connect_simple01_0011}.png}}\caption{Connect Simple01}\label{\detokenize{tutorials/text/annotations:id19}}\end{figure} While the ConnectionPatch instance can be added to any axes, you may want to add it to the axes that is latest in drawing order to prevent overlap by other axes. \paragraph{Advanced Topics} \label{\detokenize{tutorials/text/annotations:advanced-topics}} \subsubsection{Zoom effect between Axes} \label{\detokenize{tutorials/text/annotations:zoom-effect-between-axes}} \sphinxcode{\sphinxupquote{mpl\_toolkits.axes\_grid1.inset\_locator}} defines some patch classes useful for interconnecting two axes. Understanding the code requires some knowledge of how mpl’s transform works. But, utilizing it will be straight forward. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/subplots\_axes\_and\_figures/axes\_zoom\_effect.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_axes_zoom_effect_0011}.png}}\caption{Axes Zoom Effect}\label{\detokenize{tutorials/text/annotations:id20}}\end{figure} \subsubsection{Define Custom BoxStyle} \label{\detokenize{tutorials/text/annotations:define-custom-boxstyle}} You can use a custom box style. The value for the \sphinxcode{\sphinxupquote{boxstyle}} can be a callable object in the following forms.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{\PYGZus{}\PYGZus{}call\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{x0}\PYG{p}{,} \PYG{n}{y0}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{n}{mutation\PYGZus{}size}\PYG{p}{,} \PYG{n}{aspect\PYGZus{}ratio}\PYG{o}{=}\PYG{l+m+mf}{1.}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZsq{}\PYGZsq{}\PYGZsq{}} \PYG{l+s+sd}{ Given the location and size of the box, return the path of} \PYG{l+s+sd}{ the box around it.} \PYG{l+s+sd}{ \PYGZhy{} *x0*, *y0*, *width*, *height* : location and size of the box} \PYG{l+s+sd}{ \PYGZhy{} *mutation\PYGZus{}size* : a reference scale for the mutation.} \PYG{l+s+sd}{ \PYGZhy{} *aspect\PYGZus{}ratio* : aspect\PYGZhy{}ratio for the mutation.} \PYG{l+s+sd}{ \PYGZsq{}\PYGZsq{}\PYGZsq{}} \PYG{n}{path} \PYG{o}{=} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.} \PYG{k}{return} \PYG{n}{path} \end{sphinxVerbatim} Here is a complete example. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/custom\_boxstyle01.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_custom_boxstyle01_0011}.png}}\caption{Custom Boxstyle01}\label{\detokenize{tutorials/text/annotations:id21}}\end{figure} However, it is recommended that you derive from the matplotlib.patches.BoxStyle.\_Base as demonstrated below. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/custom\_boxstyle02.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_custom_boxstyle02_0011}.png}}\caption{Custom Boxstyle02}\label{\detokenize{tutorials/text/annotations:id22}}\end{figure} Similarly, you can define a custom ConnectionStyle and a custom ArrowStyle. See the source code of \sphinxcode{\sphinxupquote{lib/matplotlib/patches.py}} and check how each style class is defined. \phantomsection\label{\detokenize{tutorials/text/annotations:sphx-glr-download-tutorials-text-annotations-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/text/usetex:sphx-glr-download-tutorials-text-usetex-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Text rendering With LaTeX} \label{\detokenize{tutorials/text/usetex:text-rendering-with-latex}}\label{\detokenize{tutorials/text/usetex:sphx-glr-tutorials-text-usetex-py}}\label{\detokenize{tutorials/text/usetex::doc}} Rendering text with LaTeX in Matplotlib. Matplotlib has the option to use LaTeX to manage all text layout. This option is available with the following backends: \begin{itemize} \item {} Agg \item {} PS \item {} PDF \end{itemize} The LaTeX option is activated by setting \sphinxcode{\sphinxupquote{text.usetex : True}} in your rc settings. Text handling with matplotlib’s LaTeX support is slower than matplotlib’s very capable {\hyperref[\detokenize{tutorials/text/mathtext:sphx-glr-tutorials-text-mathtext-py}]{\sphinxcrossref{\DUrole{std,std-ref}{mathtext}}}}, but is more flexible, since different LaTeX packages (font packages, math packages, etc.) can be used. The results can be striking, especially when you take care to use the same fonts in your figures as in the main document. Matplotlib’s LaTeX support requires a working \sphinxhref{http://www.tug.org}{LaTeX} installation, \sphinxhref{http://www.nongnu.org/dvipng/}{dvipng} (which may be included with your LaTeX installation), and \sphinxhref{https://ghostscript.com/}{Ghostscript} (GPL Ghostscript 8.60 or later is recommended). The executables for these external dependencies must all be located on your \index{PATH}\index{environment variable!PATH}{\hyperref[\detokenize{faq/environment_variables_faq:envvar-PATH}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PATH}}}}}. There are a couple of options to mention, which can be changed using {\hyperref[\detokenize{tutorials/introductory/customizing:sphx-glr-tutorials-introductory-customizing-py}]{\sphinxcrossref{\DUrole{std,std-ref}{rc settings}}}}. Here is an example matplotlibrc file: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{font}\PYG{o}{.}\PYG{n}{family} \PYG{p}{:} \PYG{n}{serif} \PYG{n}{font}\PYG{o}{.}\PYG{n}{serif} \PYG{p}{:} \PYG{n}{Times}\PYG{p}{,} \PYG{n}{Palatino}\PYG{p}{,} \PYG{n}{New} \PYG{n}{Century} \PYG{n}{Schoolbook}\PYG{p}{,} \PYG{n}{Bookman}\PYG{p}{,} \PYG{n}{Computer} \PYG{n}{Modern} \PYG{n}{Roman} \PYG{n}{font}\PYG{o}{.}\PYG{n}{sans}\PYG{o}{\PYGZhy{}}\PYG{n}{serif} \PYG{p}{:} \PYG{n}{Helvetica}\PYG{p}{,} \PYG{n}{Avant} \PYG{n}{Garde}\PYG{p}{,} \PYG{n}{Computer} \PYG{n}{Modern} \PYG{n}{Sans} \PYG{n}{serif} \PYG{n}{font}\PYG{o}{.}\PYG{n}{cursive} \PYG{p}{:} \PYG{n}{Zapf} \PYG{n}{Chancery} \PYG{n}{font}\PYG{o}{.}\PYG{n}{monospace} \PYG{p}{:} \PYG{n}{Courier}\PYG{p}{,} \PYG{n}{Computer} \PYG{n}{Modern} \PYG{n}{Typewriter} \PYG{n}{text}\PYG{o}{.}\PYG{n}{usetex} \PYG{p}{:} \PYG{n}{true} \end{sphinxVerbatim} The first valid font in each family is the one that will be loaded. If the fonts are not specified, the Computer Modern fonts are used by default. All of the other fonts are Adobe fonts. Times and Palatino each have their own accompanying math fonts, while the other Adobe serif fonts make use of the Computer Modern math fonts. See the \sphinxhref{http://www.ctan.org/tex-archive/macros/latex/required/psnfss/psnfss2e.pdf}{PSNFSS} documentation for more details. To use LaTeX and select Helvetica as the default font, without editing matplotlibrc use: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib} \PYG{k}{import} \PYG{n}{rc} \PYG{n}{rc}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{font}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,}\PYG{o}{*}\PYG{o}{*}\PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{family}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{sans\PYGZhy{}serif}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{sans\PYGZhy{}serif}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Helvetica}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{}\PYGZsh{} for Palatino and other serif fonts use:} \PYG{c+c1}{\PYGZsh{}rc(\PYGZsq{}font\PYGZsq{},**\PYGZob{}\PYGZsq{}family\PYGZsq{}:\PYGZsq{}serif\PYGZsq{},\PYGZsq{}serif\PYGZsq{}:[\PYGZsq{}Palatino\PYGZsq{}]\PYGZcb{})} \PYG{n}{rc}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{text}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{usetex}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)} \end{sphinxVerbatim} Here is the standard example, \sphinxcode{\sphinxupquote{tex\_demo.py}}: \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/text\_labels\_and\_annotations/tex\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_tex_demo_0012}.png}}\caption{TeX Demo}\label{\detokenize{tutorials/text/usetex:id1}}\end{figure} Note that display math mode (\sphinxcode{\sphinxupquote{\$\$ e=mc\textasciicircum{}2 \$\$}}) is not supported, but adding the command \sphinxcode{\sphinxupquote{\textbackslash{}displaystyle}}, as in \sphinxcode{\sphinxupquote{tex\_demo.py}}, will produce the same results. \begin{sphinxadmonition}{note}{Note:} Certain characters require special escaping in TeX, such as: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} \PYGZdl{} \PYGZpc{} \PYGZam{} \PYGZti{} \PYGZus{} \PYGZca{} \PYGZbs{} \PYGZob{} \PYGZcb{} \PYGZbs{}( \PYGZbs{}) \PYGZbs{}[ \PYGZbs{}]} \end{sphinxVerbatim} Therefore, these characters will behave differently depending on the rcParam \sphinxcode{\sphinxupquote{text.usetex}} flag. \end{sphinxadmonition} \subsubsection{usetex with unicode} \label{\detokenize{tutorials/text/usetex:usetex-with-unicode}}\label{\detokenize{tutorials/text/usetex:usetex-unicode}} It is also possible to use unicode strings with the LaTeX text manager, here is an example taken from \sphinxcode{\sphinxupquote{tex\_demo.py}}. The axis labels include Unicode text: \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/text\_labels\_and\_annotations/tex\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_tex_demo_0012}.png}}\caption{TeX Unicode Demo}\label{\detokenize{tutorials/text/usetex:id2}}\end{figure} \subsubsection{Postscript options} \label{\detokenize{tutorials/text/usetex:postscript-options}}\label{\detokenize{tutorials/text/usetex:usetex-postscript}} In order to produce encapsulated postscript files that can be embedded in a new LaTeX document, the default behavior of matplotlib is to distill the output, which removes some postscript operators used by LaTeX that are illegal in an eps file. This step produces results which may be unacceptable to some users, because the text is coarsely rasterized and converted to bitmaps, which are not scalable like standard postscript, and the text is not searchable. One workaround is to set \sphinxcode{\sphinxupquote{ps.distiller.res}} to a higher value (perhaps 6000) in your rc settings, which will produce larger files but may look better and scale reasonably. A better workaround, which requires \sphinxhref{https://poppler.freedesktop.org/}{Poppler} or \sphinxhref{http://www.xpdfreader.com/}{Xpdf}, can be activated by changing the \sphinxcode{\sphinxupquote{ps.usedistiller}} rc setting to \sphinxcode{\sphinxupquote{xpdf}}. This alternative produces postscript without rasterizing text, so it scales properly, can be edited in Adobe Illustrator, and searched text in pdf documents. \subsubsection{Possible hangups} \label{\detokenize{tutorials/text/usetex:possible-hangups}}\label{\detokenize{tutorials/text/usetex:usetex-hangups}}\begin{itemize} \item {} On Windows, the \index{PATH}\index{environment variable!PATH}{\hyperref[\detokenize{faq/environment_variables_faq:envvar-PATH}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PATH}}}}} environment variable may need to be modified to include the directories containing the latex, dvipng and ghostscript executables. See {\hyperref[\detokenize{faq/environment_variables_faq:environment-variables}]{\sphinxcrossref{\DUrole{std,std-ref}{Environment Variables}}}} and {\hyperref[\detokenize{faq/environment_variables_faq:setting-windows-environment-variables}]{\sphinxcrossref{\DUrole{std,std-ref}{Setting environment variables in windows}}}} for details. \item {} Using MiKTeX with Computer Modern fonts, if you get odd *Agg and PNG results, go to MiKTeX/Options and update your format files \item {} On Ubuntu and Gentoo, the base texlive install does not ship with the type1cm package. You may need to install some of the extra packages to get all the goodies that come bundled with other latex distributions. \item {} Some progress has been made so matplotlib uses the dvi files directly for text layout. This allows latex to be used for text layout with the pdf and svg backends, as well as the *Agg and PS backends. In the future, a latex installation may be the only external dependency. \end{itemize} \subsubsection{Troubleshooting} \label{\detokenize{tutorials/text/usetex:troubleshooting}}\label{\detokenize{tutorials/text/usetex:usetex-troubleshooting}}\begin{itemize} \item {} Try deleting your \sphinxcode{\sphinxupquote{.matplotlib/tex.cache}} directory. If you don’t know where to find \sphinxcode{\sphinxupquote{.matplotlib}}, see {\hyperref[\detokenize{faq/troubleshooting_faq:locating-matplotlib-config-dir}]{\sphinxcrossref{\DUrole{std,std-ref}{matplotlib configuration and cache directory locations}}}}. \item {} Make sure LaTeX, dvipng and ghostscript are each working and on your \index{PATH}\index{environment variable!PATH}{\hyperref[\detokenize{faq/environment_variables_faq:envvar-PATH}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PATH}}}}}. \item {} Make sure what you are trying to do is possible in a LaTeX document, that your LaTeX syntax is valid and that you are using raw strings if necessary to avoid unintended escape sequences. \item {} Most problems reported on the mailing list have been cleared up by upgrading \sphinxhref{https://ghostscript.com/}{Ghostscript}. If possible, please try upgrading to the latest release before reporting problems to the list. \item {} The \sphinxcode{\sphinxupquote{text.latex.preamble}} rc setting is not officially supported. This option provides lots of flexibility, and lots of ways to cause problems. Please disable this option before reporting problems to the mailing list. \item {} If you still need help, please see {\hyperref[\detokenize{faq/troubleshooting_faq:reporting-problems}]{\sphinxcrossref{\DUrole{std,std-ref}{Getting help}}}} \end{itemize} \phantomsection\label{\detokenize{tutorials/text/usetex:sphx-glr-download-tutorials-text-usetex-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/text/pgf:sphx-glr-download-tutorials-text-pgf-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Typesetting With XeLaTeX/LuaLaTeX} \label{\detokenize{tutorials/text/pgf:typesetting-with-xelatex-lualatex}}\label{\detokenize{tutorials/text/pgf:sphx-glr-tutorials-text-pgf-py}}\label{\detokenize{tutorials/text/pgf::doc}} How to typeset text with the \sphinxcode{\sphinxupquote{pgf}} backend in Matplotlib. Using the \sphinxcode{\sphinxupquote{pgf}} backend, matplotlib can export figures as pgf drawing commands that can be processed with pdflatex, xelatex or lualatex. XeLaTeX and LuaLaTeX have full unicode support and can use any font that is installed in the operating system, making use of advanced typographic features of OpenType, AAT and Graphite. Pgf pictures created by \sphinxcode{\sphinxupquote{plt.savefig('figure.pgf')}} can be embedded as raw commands in LaTeX documents. Figures can also be directly compiled and saved to PDF with \sphinxcode{\sphinxupquote{plt.savefig('figure.pdf')}} by either switching to the backend \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{pgf}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} or registering it for handling pdf output \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib.backends.backend\PYGZus{}pgf} \PYG{k+kn}{import} \PYG{n}{FigureCanvasPgf} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backend\PYGZus{}bases}\PYG{o}{.}\PYG{n}{register\PYGZus{}backend}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{pdf}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{FigureCanvasPgf}\PYG{p}{)} \end{sphinxVerbatim} The second method allows you to keep using regular interactive backends and to save xelatex, lualatex or pdflatex compiled PDF files from the graphical user interface. Matplotlib’s pgf support requires a recent \sphinxhref{http://www.tug.org}{LaTeX} installation that includes the TikZ/PGF packages (such as \sphinxhref{http://www.tug.org/texlive/}{TeXLive}), preferably with XeLaTeX or LuaLaTeX installed. If either pdftocairo or ghostscript is present on your system, figures can optionally be saved to PNG images as well. The executables for all applications must be located on your \index{PATH}\index{environment variable!PATH}{\hyperref[\detokenize{faq/environment_variables_faq:envvar-PATH}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PATH}}}}}. Rc parameters that control the behavior of the pgf backend: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Parameter &\sphinxstyletheadfamily Documentation \\ \hline pgf.preamble & Lines to be included in the LaTeX preamble \\ \hline pgf.rcfonts & Setup fonts from rc params using the fontspec package \\ \hline pgf.texsystem & Either “xelatex” (default), “lualatex” or “pdflatex” \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \begin{sphinxadmonition}{note}{Note:} TeX defines a set of special characters, such as: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} \PYGZdl{} \PYGZpc{} \PYGZam{} \PYGZti{} \PYGZus{} \PYGZca{} \PYGZbs{} \PYGZob{} \PYGZcb{}} \end{sphinxVerbatim} Generally, these characters must be escaped correctly. For convenience, some characters (\_,\textasciicircum{},\%) are automatically escaped outside of math environments. \end{sphinxadmonition} \subsubsection{Font specification} \label{\detokenize{tutorials/text/pgf:font-specification}}\label{\detokenize{tutorials/text/pgf:pgf-rcfonts}} The fonts used for obtaining the size of text elements or when compiling figures to PDF are usually defined in the matplotlib rc parameters. You can also use the LaTeX default Computer Modern fonts by clearing the lists for \sphinxcode{\sphinxupquote{font.serif}}, \sphinxcode{\sphinxupquote{font.sans-serif}} or \sphinxcode{\sphinxupquote{font.monospace}}. Please note that the glyph coverage of these fonts is very limited. If you want to keep the Computer Modern font face but require extended unicode support, consider installing the \sphinxhref{https://sourceforge.net/projects/cm-unicode/}{Computer Modern Unicode} fonts \sphinxstyleemphasis{CMU Serif}, \sphinxstyleemphasis{CMU Sans Serif}, etc. When saving to \sphinxcode{\sphinxupquote{.pgf}}, the font configuration matplotlib used for the layout of the figure is included in the header of the text file. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{=========} \PYG{l+s+sd}{Pgf Fonts} \PYG{l+s+sd}{=========} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{c+c1}{\PYGZsh{} \PYGZhy{}*\PYGZhy{} coding: utf\PYGZhy{}8 \PYGZhy{}*\PYGZhy{}} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{k}{as} \PYG{n+nn}{mpl} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{pgf}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{pgf\PYGZus{}with\PYGZus{}rc\PYGZus{}fonts} \PYG{o}{=} \PYG{p}{\PYGZob{}} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{font.family}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{serif}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{font.serif}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} use latex default serif font} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{font.sans\PYGZhy{}serif}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{DejaVu Sans}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} use a specific sans\PYGZhy{}serif font} \PYG{p}{\PYGZcb{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{o}{.}\PYG{n}{update}\PYG{p}{(}\PYG{n}{pgf\PYGZus{}with\PYGZus{}rc\PYGZus{}fonts}\PYG{p}{)} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{4.5}\PYG{p}{,} \PYG{l+m+mf}{2.5}\PYG{p}{)}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{)}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{3.}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{serif}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{2.}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{monospace}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{family}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{monospace}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{2.5}\PYG{p}{,} \PYG{l+m+mf}{2.}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{sans\PYGZhy{}serif}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{family}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{sans\PYGZhy{}serif}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{2.5}\PYG{p}{,} \PYG{l+m+mf}{1.}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{comic sans}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{family}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Comic Sans MS}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{xlabel}\PYG{p}{(}\PYG{l+s+sa}{u}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{µ is not \PYGZdl{}}\PYG{l+s+se}{\PYGZbs{}\PYGZbs{}}\PYG{l+s+s2}{mu\PYGZdl{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{o}{.}\PYG{l+m+mi}{5}\PYG{p}{)} \end{sphinxVerbatim} \subsubsection{Custom preamble} \label{\detokenize{tutorials/text/pgf:custom-preamble}}\label{\detokenize{tutorials/text/pgf:pgf-preamble}} Full customization is possible by adding your own commands to the preamble. Use the \sphinxcode{\sphinxupquote{pgf.preamble}} parameter if you want to configure the math fonts, using \sphinxcode{\sphinxupquote{unicode-math}} for example, or for loading additional packages. Also, if you want to do the font configuration yourself instead of using the fonts specified in the rc parameters, make sure to disable \sphinxcode{\sphinxupquote{pgf.rcfonts}}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{============} \PYG{l+s+sd}{Pgf Preamble} \PYG{l+s+sd}{============} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{c+c1}{\PYGZsh{} \PYGZhy{}*\PYGZhy{} coding: utf\PYGZhy{}8 \PYGZhy{}*\PYGZhy{}} \PYG{k+kn}{from} \PYG{n+nn}{\PYGZus{}\PYGZus{}future\PYGZus{}\PYGZus{}} \PYG{k}{import} \PYG{p}{(}\PYG{n}{absolute\PYGZus{}import}\PYG{p}{,} \PYG{n}{division}\PYG{p}{,} \PYG{n}{print\PYGZus{}function}\PYG{p}{,} \PYG{n}{unicode\PYGZus{}literals}\PYG{p}{)} \PYG{k+kn}{import} \PYG{n+nn}{six} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{k}{as} \PYG{n+nn}{mpl} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{pgf}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{pgf\PYGZus{}with\PYGZus{}custom\PYGZus{}preamble} \PYG{o}{=} \PYG{p}{\PYGZob{}} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{font.family}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{serif}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} use serif/main font for text elements} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{text.usetex}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{k+kc}{True}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} use inline math for ticks} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{pgf.rcfonts}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{k+kc}{False}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} don\PYGZsq{}t setup fonts from rc parameters} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{pgf.preamble}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{p}{[} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+se}{\PYGZbs{}\PYGZbs{}}\PYG{l+s+s2}{usepackage}\PYG{l+s+si}{\PYGZob{}units\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} load additional packages} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+se}{\PYGZbs{}\PYGZbs{}}\PYG{l+s+s2}{usepackage}\PYG{l+s+si}{\PYGZob{}metalogo\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+se}{\PYGZbs{}\PYGZbs{}}\PYG{l+s+s2}{usepackage}\PYG{l+s+s2}{\PYGZob{}}\PYG{l+s+s2}{unicode\PYGZhy{}math\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} unicode math setup} \PYG{l+s+sa}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{setmathfont}\PYG{l+s+s2}{\PYGZob{}}\PYG{l+s+s2}{xits\PYGZhy{}math.otf\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+sa}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{setmainfont}\PYG{l+s+s2}{\PYGZob{}}\PYG{l+s+s2}{DejaVu Serif\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} serif font via preamble} \PYG{p}{]} \PYG{p}{\PYGZcb{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{o}{.}\PYG{n}{update}\PYG{p}{(}\PYG{n}{pgf\PYGZus{}with\PYGZus{}custom\PYGZus{}preamble}\PYG{p}{)} \end{sphinxVerbatim} \subsubsection{Choosing the TeX system} \label{\detokenize{tutorials/text/pgf:choosing-the-tex-system}}\label{\detokenize{tutorials/text/pgf:pgf-texsystem}} The TeX system to be used by matplotlib is chosen by the \sphinxcode{\sphinxupquote{pgf.texsystem}} parameter. Possible values are \sphinxcode{\sphinxupquote{'xelatex'}} (default), \sphinxcode{\sphinxupquote{'lualatex'}} and \sphinxcode{\sphinxupquote{'pdflatex'}}. Please note that when selecting pdflatex the fonts and unicode handling must be configured in the preamble. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{=============} \PYG{l+s+sd}{Pgf Texsystem} \PYG{l+s+sd}{=============} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{c+c1}{\PYGZsh{} \PYGZhy{}*\PYGZhy{} coding: utf\PYGZhy{}8 \PYGZhy{}*\PYGZhy{}} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{k}{as} \PYG{n+nn}{mpl} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{pgf}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{pgf\PYGZus{}with\PYGZus{}pdflatex} \PYG{o}{=} \PYG{p}{\PYGZob{}} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{pgf.texsystem}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{pdflatex}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{pgf.preamble}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{p}{[} \PYG{l+s+sa}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{usepackage[utf8x]}\PYG{l+s+si}{\PYGZob{}inputenc\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+sa}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{usepackage[T1]}\PYG{l+s+si}{\PYGZob{}fontenc\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+sa}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{usepackage}\PYG{l+s+si}{\PYGZob{}cmbright\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{p}{]} \PYG{p}{\PYGZcb{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{o}{.}\PYG{n}{update}\PYG{p}{(}\PYG{n}{pgf\PYGZus{}with\PYGZus{}pdflatex}\PYG{p}{)} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{4.5}\PYG{p}{,} \PYG{l+m+mf}{2.5}\PYG{p}{)}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{)}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{3.}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{serif}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{family}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{serif}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{2.}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{monospace}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{family}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{monospace}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{2.5}\PYG{p}{,} \PYG{l+m+mf}{2.}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{sans\PYGZhy{}serif}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{family}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{sans\PYGZhy{}serif}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{xlabel}\PYG{p}{(}\PYG{l+s+sa}{u}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{µ is not \PYGZdl{}}\PYG{l+s+se}{\PYGZbs{}\PYGZbs{}}\PYG{l+s+s2}{mu\PYGZdl{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{o}{.}\PYG{l+m+mi}{5}\PYG{p}{)} \end{sphinxVerbatim} \subsubsection{Troubleshooting} \label{\detokenize{tutorials/text/pgf:troubleshooting}}\label{\detokenize{tutorials/text/pgf:pgf-troubleshooting}}\begin{itemize} \item {} Please note that the TeX packages found in some Linux distributions and MiKTeX installations are dramatically outdated. Make sure to update your package catalog and upgrade or install a recent TeX distribution. \item {} On Windows, the \index{PATH}\index{environment variable!PATH}{\hyperref[\detokenize{faq/environment_variables_faq:envvar-PATH}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PATH}}}}} environment variable may need to be modified to include the directories containing the latex, dvipng and ghostscript executables. See {\hyperref[\detokenize{faq/environment_variables_faq:environment-variables}]{\sphinxcrossref{\DUrole{std,std-ref}{Environment Variables}}}} and {\hyperref[\detokenize{faq/environment_variables_faq:setting-windows-environment-variables}]{\sphinxcrossref{\DUrole{std,std-ref}{Setting environment variables in windows}}}} for details. \item {} A limitation on Windows causes the backend to keep file handles that have been opened by your application open. As a result, it may not be possible to delete the corresponding files until the application closes (see \sphinxhref{https://github.com/matplotlib/matplotlib/issues/1324}{\#1324}). \item {} Sometimes the font rendering in figures that are saved to png images is very bad. This happens when the pdftocairo tool is not available and ghostscript is used for the pdf to png conversion. \item {} Make sure what you are trying to do is possible in a LaTeX document, that your LaTeX syntax is valid and that you are using raw strings if necessary to avoid unintended escape sequences. \item {} The \sphinxcode{\sphinxupquote{pgf.preamble}} rc setting provides lots of flexibility, and lots of ways to cause problems. When experiencing problems, try to minimalize or disable the custom preamble. \item {} Configuring an \sphinxcode{\sphinxupquote{unicode-math}} environment can be a bit tricky. The TeXLive distribution for example provides a set of math fonts which are usually not installed system-wide. XeTeX, unlike LuaLatex, cannot find these fonts by their name, which is why you might have to specify \sphinxcode{\sphinxupquote{\textbackslash{}setmathfont\{xits-math.otf\}}} instead of \sphinxcode{\sphinxupquote{\textbackslash{}setmathfont\{XITS Math\}}} or alternatively make the fonts available to your OS. See this \sphinxhref{http://tex.stackexchange.com/questions/43642}{tex.stackexchange.com question} for more details. \item {} If the font configuration used by matplotlib differs from the font setting in yout LaTeX document, the alignment of text elements in imported figures may be off. Check the header of your \sphinxcode{\sphinxupquote{.pgf}} file if you are unsure about the fonts matplotlib used for the layout. \item {} Vector images and hence \sphinxcode{\sphinxupquote{.pgf}} files can become bloated if there are a lot of objects in the graph. This can be the case for image processing or very big scatter graphs. In an extreme case this can cause TeX to run out of memory: “TeX capacity exceeded, sorry” You can configure latex to increase the amount of memory available to generate the \sphinxcode{\sphinxupquote{.pdf}} image as discussed on \sphinxhref{http://tex.stackexchange.com/questions/7953}{tex.stackexchange.com}. Another way would be to “rasterize” parts of the graph causing problems using either the \sphinxcode{\sphinxupquote{rasterized=True}} keyword, or \sphinxcode{\sphinxupquote{.set\_rasterized(True)}} as per \sphinxhref{http://matplotlib.org/examples/misc/rasterization\_demo.html}{this example}. \item {} If you still need help, please see {\hyperref[\detokenize{faq/troubleshooting_faq:reporting-problems}]{\sphinxcrossref{\DUrole{std,std-ref}{Getting help}}}} \end{itemize} \phantomsection\label{\detokenize{tutorials/text/pgf:sphx-glr-download-tutorials-text-pgf-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/text/mathtext:sphx-glr-download-tutorials-text-mathtext-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Writing mathematical expressions} \label{\detokenize{tutorials/text/mathtext:writing-mathematical-expressions}}\label{\detokenize{tutorials/text/mathtext:sphx-glr-tutorials-text-mathtext-py}}\label{\detokenize{tutorials/text/mathtext::doc}} An introduction to writing mathematical expressions in Matplotlib. You can use a subset TeX markup in any matplotlib text string by placing it inside a pair of dollar signs (\$). Note that you do not need to have TeX installed, since matplotlib ships its own TeX expression parser, layout engine and fonts. The layout engine is a fairly direct adaptation of the layout algorithms in Donald Knuth’s TeX, so the quality is quite good (matplotlib also provides a \sphinxcode{\sphinxupquote{usetex}} option for those who do want to call out to TeX to generate their text (see {\hyperref[\detokenize{tutorials/text/usetex:sphx-glr-tutorials-text-usetex-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Text rendering With LaTeX}}}}). Any text element can use math text. You should use raw strings (precede the quotes with an \sphinxcode{\sphinxupquote{'r'}}), and surround the math text with dollar signs (\$), as in TeX. Regular text and mathtext can be interleaved within the same string. Mathtext can use DejaVu Sans (default), DejaVu Serif, the Computer Modern fonts (from (La)TeX), \sphinxhref{http://www.stixfonts.org/}{STIX} fonts (with are designed to blend well with Times), or a Unicode font that you provide. The mathtext font can be selected with the customization variable \sphinxcode{\sphinxupquote{mathtext.fontset}} (see {\hyperref[\detokenize{tutorials/introductory/customizing:sphx-glr-tutorials-introductory-customizing-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Matplotlib with style sheets and rcParams}}}}) \begin{sphinxadmonition}{note}{Note:} On \sphinxhref{http://wordaligned.org/articles/narrow-python}{“narrow”} builds of Python, if you use the STIX fonts you should also set \sphinxcode{\sphinxupquote{ps.fonttype}} and \sphinxcode{\sphinxupquote{pdf.fonttype}} to 3 (the default), not 42. Otherwise \sphinxhref{http://thread.gmane.org/gmane.comp.python.matplotlib.general/19963/focus=19978}{some characters will not be visible}. \end{sphinxadmonition} Here is a simple example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} plain text} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{alpha \PYGZgt{} beta}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} produces “alpha \textgreater{} beta”. Whereas this: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} math text} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{title}\PYG{p}{(}\PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{alpha \PYGZgt{} }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{beta\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} produces “$\alpha > \beta$”. \begin{sphinxadmonition}{note}{Note:} Mathtext should be placed between a pair of dollar signs (\$). To make it easy to display monetary values, e.g., “\$100.00”, if a single dollar sign is present in the entire string, it will be displayed verbatim as a dollar sign. This is a small change from regular TeX, where the dollar sign in non-math text would have to be escaped (‘\textbackslash{}\$’). \end{sphinxadmonition} \begin{sphinxadmonition}{note}{Note:} While the syntax inside the pair of dollar signs (\$) aims to be TeX-like, the text outside does not. In particular, characters such as: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} \PYGZdl{} \PYGZpc{} \PYGZam{} \PYGZti{} \PYGZus{} \PYGZca{} \PYGZbs{} \PYGZob{} \PYGZcb{} \PYGZbs{}( \PYGZbs{}) \PYGZbs{}[ \PYGZbs{}]} \end{sphinxVerbatim} have special meaning outside of math mode in TeX. Therefore, these characters will behave differently depending on the rcParam \sphinxcode{\sphinxupquote{text.usetex}} flag. See the {\hyperref[\detokenize{tutorials/text/usetex:sphx-glr-tutorials-text-usetex-py}]{\sphinxcrossref{\DUrole{std,std-ref}{usetex tutorial}}}} for more information. \end{sphinxadmonition} \subsubsection{Subscripts and superscripts} \label{\detokenize{tutorials/text/mathtext:subscripts-and-superscripts}} To make subscripts and superscripts, use the \sphinxcode{\sphinxupquote{'\_'}} and \sphinxcode{\sphinxupquote{'\textasciicircum{}'}} symbols: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{alpha\PYGZus{}i \PYGZgt{} }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{beta\PYGZus{}i\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} \begin{equation}\alpha_i > \beta_i\end{equation} Some symbols automatically put their sub/superscripts under and over the operator. For example, to write the sum of $x_i$ from $0$ to $\infty$, you could do: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{sum\PYGZus{}}\PYG{l+s+s1}{\PYGZob{}}\PYG{l+s+s1}{i=0\PYGZcb{}\PYGZca{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{infty x\PYGZus{}i\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} \begin{equation}\sum_{i=0}^\infty x_i\end{equation} \subsubsection{Fractions, binomials and stacked numbers} \label{\detokenize{tutorials/text/mathtext:fractions-binomials-and-stacked-numbers}} Fractions, binomials and stacked numbers can be created with the \sphinxcode{\sphinxupquote{\textbackslash{}frac\{\}\{\}}}, \sphinxcode{\sphinxupquote{\textbackslash{}binom\{\}\{\}}} and \sphinxcode{\sphinxupquote{\textbackslash{}stackrel\{\}\{\}}} commands, respectively: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{frac}\PYG{l+s+si}{\PYGZob{}3\PYGZcb{}}\PYG{l+s+si}{\PYGZob{}4\PYGZcb{}}\PYG{l+s+s1}{ }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{binom}\PYG{l+s+si}{\PYGZob{}3\PYGZcb{}}\PYG{l+s+si}{\PYGZob{}4\PYGZcb{}}\PYG{l+s+s1}{ }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{stackrel}\PYG{l+s+si}{\PYGZob{}3\PYGZcb{}}\PYG{l+s+si}{\PYGZob{}4\PYGZcb{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} produces \begin{equation}\frac{3}{4} \binom{3}{4} \stackrel{3}{4}\end{equation} Fractions can be arbitrarily nested: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{frac}\PYG{l+s+s1}{\PYGZob{}}\PYG{l+s+s1}{5 \PYGZhy{} }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{frac}\PYG{l+s+si}{\PYGZob{}1\PYGZcb{}}\PYG{l+s+si}{\PYGZob{}x\PYGZcb{}}\PYG{l+s+s1}{\PYGZcb{}}\PYG{l+s+si}{\PYGZob{}4\PYGZcb{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} produces \begin{equation}\frac{5 - \frac{1}{x}}{4}\end{equation} Note that special care needs to be taken to place parentheses and brackets around fractions. Doing things the obvious way produces brackets that are too small: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}(}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{frac}\PYG{l+s+s1}{\PYGZob{}}\PYG{l+s+s1}{5 \PYGZhy{} }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{frac}\PYG{l+s+si}{\PYGZob{}1\PYGZcb{}}\PYG{l+s+si}{\PYGZob{}x\PYGZcb{}}\PYG{l+s+s1}{\PYGZcb{}}\PYG{l+s+si}{\PYGZob{}4\PYGZcb{}}\PYG{l+s+s1}{)\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} \begin{equation}(\frac{5 - \frac{1}{x}}{4})\end{equation} The solution is to precede the bracket with \sphinxcode{\sphinxupquote{\textbackslash{}left}} and \sphinxcode{\sphinxupquote{\textbackslash{}right}} to inform the parser that those brackets encompass the entire object.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{left(}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{frac}\PYG{l+s+s1}{\PYGZob{}}\PYG{l+s+s1}{5 \PYGZhy{} }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{frac}\PYG{l+s+si}{\PYGZob{}1\PYGZcb{}}\PYG{l+s+si}{\PYGZob{}x\PYGZcb{}}\PYG{l+s+s1}{\PYGZcb{}}\PYG{l+s+si}{\PYGZob{}4\PYGZcb{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{right)\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} \begin{equation}\left(\frac{5 - \frac{1}{x}}{4}\right)\end{equation} \subsubsection{Radicals} \label{\detokenize{tutorials/text/mathtext:radicals}} Radicals can be produced with the \sphinxcode{\sphinxupquote{\textbackslash{}sqrt{[}{]}\{\}}} command. For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{sqrt}\PYG{l+s+si}{\PYGZob{}2\PYGZcb{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} \begin{equation}\sqrt{2}\end{equation} Any base can (optionally) be provided inside square brackets. Note that the base must be a simple expression, and can not contain layout commands such as fractions or sub/superscripts: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{sqrt[3]}\PYG{l+s+si}{\PYGZob{}x\PYGZcb{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} \begin{equation}\sqrt[3]{x}\end{equation} \subsubsection{Fonts} \label{\detokenize{tutorials/text/mathtext:fonts}}\label{\detokenize{tutorials/text/mathtext:mathtext-fonts}} The default font is \sphinxstyleemphasis{italics} for mathematical symbols. \begin{sphinxadmonition}{note}{Note:} This default can be changed using the \sphinxcode{\sphinxupquote{mathtext.default}} rcParam. This is useful, for example, to use the same font as regular non-math text for math text, by setting it to \sphinxcode{\sphinxupquote{regular}}. \end{sphinxadmonition} To change fonts, e.g., to write “sin” in a Roman font, enclose the text in a font command: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}s(t) = }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{mathcal}\PYG{l+s+si}{\PYGZob{}A\PYGZcb{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{mathrm}\PYG{l+s+si}{\PYGZob{}sin\PYGZcb{}}\PYG{l+s+s1}{(2 }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{omega t)\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} \begin{equation}s(t) = \mathcal{A}\mathrm{sin}(2 \omega t)\end{equation} More conveniently, many commonly used function names that are typeset in a Roman font have shortcuts. So the expression above could be written as follows: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}s(t) = }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{mathcal}\PYG{l+s+si}{\PYGZob{}A\PYGZcb{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{sin(2 }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{omega t)\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} \begin{equation}s(t) = \mathcal{A}\sin(2 \omega t)\end{equation} Here “s” and “t” are variable in italics font (default), “sin” is in Roman font, and the amplitude “A” is in calligraphy font. Note in the example above the calligraphy \sphinxcode{\sphinxupquote{A}} is squished into the \sphinxcode{\sphinxupquote{sin}}. You can use a spacing command to add a little whitespace between them: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{s}\PYG{p}{(}\PYG{n}{t}\PYG{p}{)} \PYG{o}{=} \PYGZbs{}\PYG{n}{mathcal}\PYG{p}{\PYGZob{}}\PYG{n}{A}\PYG{p}{\PYGZcb{}}\PYGZbs{}\PYG{o}{/}\PYGZbs{}\PYG{n}{sin}\PYG{p}{(}\PYG{l+m+mi}{2} \PYGZbs{}\PYG{n}{omega} \PYG{n}{t}\PYG{p}{)} \end{sphinxVerbatim} \begin{equation}s(t) = \mathcal{A}\/\sin(2 \omega t)\end{equation} The choices available with all fonts are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Command &\sphinxstyletheadfamily Result \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}mathrm\{Roman\}}} & $\mathrm{Roman}$ \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}mathit\{Italic\}}} & $\mathit{Italic}$ \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}mathtt\{Typewriter\}}} & $\mathtt{Typewriter}$ \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}mathcal\{CALLIGRAPHY\}}} & $\mathcal{CALLIGRAPHY}$ \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} When using the \sphinxhref{http://www.stixfonts.org/}{STIX} fonts, you also have the choice of: \begin{quote} \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Command &\sphinxstyletheadfamily Result \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}mathbb\{blackboard\}}} & $\mathbb{blackboard}$ \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}mathrm\{\textbackslash{}mathbb\{blackboard\}\}}} & $\mathrm{\mathbb{blackboard}}$ \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}mathfrak\{Fraktur\}}} & $\mathfrak{Fraktur}$ \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}mathsf\{sansserif\}}} & $\mathsf{sansserif}$ \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}mathrm\{\textbackslash{}mathsf\{sansserif\}\}}} & $\mathrm{\mathsf{sansserif}}$ \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \end{quote} There are also three global “font sets” to choose from, which are selected using the \sphinxcode{\sphinxupquote{mathtext.fontset}} parameter in {\hyperref[\detokenize{tutorials/introductory/customizing:matplotlibrc-sample}]{\sphinxcrossref{\DUrole{std,std-ref}{matplotlibrc}}}}. \sphinxcode{\sphinxupquote{cm}}: \sphinxstylestrong{Computer Modern (TeX)} \noindent\sphinxincludegraphics{{cm_fontset}.png} \sphinxcode{\sphinxupquote{stix}}: \sphinxstylestrong{STIX} (designed to blend well with Times) \noindent\sphinxincludegraphics{{stix_fontset}.png} \sphinxcode{\sphinxupquote{stixsans}}: \sphinxstylestrong{STIX sans-serif} \noindent\sphinxincludegraphics{{stixsans_fontset}.png} Additionally, you can use \sphinxcode{\sphinxupquote{\textbackslash{}mathdefault\{...\}}} or its alias \sphinxcode{\sphinxupquote{\textbackslash{}mathregular\{...\}}} to use the font used for regular text outside of mathtext. There are a number of limitations to this approach, most notably that far fewer symbols will be available, but it can be useful to make math expressions blend well with other text in the plot. \paragraph{Custom fonts} \label{\detokenize{tutorials/text/mathtext:custom-fonts}} mathtext also provides a way to use custom fonts for math. This method is fairly tricky to use, and should be considered an experimental feature for patient users only. By setting the rcParam \sphinxcode{\sphinxupquote{mathtext.fontset}} to \sphinxcode{\sphinxupquote{custom}}, you can then set the following parameters, which control which font file to use for a particular set of math characters. \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Parameter &\sphinxstyletheadfamily Corresponds to \\ \hline \sphinxcode{\sphinxupquote{mathtext.it}} & \sphinxcode{\sphinxupquote{\textbackslash{}mathit\{\}}} or default italic \\ \hline \sphinxcode{\sphinxupquote{mathtext.rm}} & \sphinxcode{\sphinxupquote{\textbackslash{}mathrm\{\}}} Roman (upright) \\ \hline \sphinxcode{\sphinxupquote{mathtext.tt}} & \sphinxcode{\sphinxupquote{\textbackslash{}mathtt\{\}}} Typewriter (monospace) \\ \hline \sphinxcode{\sphinxupquote{mathtext.bf}} & \sphinxcode{\sphinxupquote{\textbackslash{}mathbf\{\}}} bold italic \\ \hline \sphinxcode{\sphinxupquote{mathtext.cal}} & \sphinxcode{\sphinxupquote{\textbackslash{}mathcal\{\}}} calligraphic \\ \hline \sphinxcode{\sphinxupquote{mathtext.sf}} & \sphinxcode{\sphinxupquote{\textbackslash{}mathsf\{\}}} sans-serif \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} Each parameter should be set to a fontconfig font descriptor (as defined in the yet-to-be-written font chapter). The fonts used should have a Unicode mapping in order to find any non-Latin characters, such as Greek. If you want to use a math symbol that is not contained in your custom fonts, you can set the rcParam \sphinxcode{\sphinxupquote{mathtext.fallback\_to\_cm}} to \sphinxcode{\sphinxupquote{True}} which will cause the mathtext system to use characters from the default Computer Modern fonts whenever a particular character can not be found in the custom font. Note that the math glyphs specified in Unicode have evolved over time, and many fonts may not have glyphs in the correct place for mathtext. \subsubsection{Accents} \label{\detokenize{tutorials/text/mathtext:accents}} An accent command may precede any symbol to add an accent above it. There are long and short forms for some of them. \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Command &\sphinxstyletheadfamily Result \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}acute a}} or \sphinxcode{\sphinxupquote{\textbackslash{}'a}} & $\acute a$ \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}bar a}} & $\bar a$ \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}breve a}} & $\breve a$ \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}ddot a}} or \sphinxcode{\sphinxupquote{\textbackslash{}'{'}a}} & $\ddot a$ \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}dot a}} or \sphinxcode{\sphinxupquote{\textbackslash{}.a}} & $\dot a$ \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}grave a}} or \sphinxcode{\sphinxupquote{\textbackslash{}{}`a}} & $\grave a$ \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}hat a}} or \sphinxcode{\sphinxupquote{\textbackslash{}\textasciicircum{}a}} & $\hat a$ \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}tilde a}} or \sphinxcode{\sphinxupquote{\textbackslash{}\textasciitilde{}a}} & $\tilde a$ \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}vec a}} & $\vec a$ \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}overline\{abc\}}} & $\overline{abc}$ \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} In addition, there are two special accents that automatically adjust to the width of the symbols below: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Command &\sphinxstyletheadfamily Result \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}widehat\{xyz\}}} & $\widehat{xyz}$ \\ \hline \sphinxcode{\sphinxupquote{\textbackslash{}widetilde\{xyz\}}} & $\widetilde{xyz}$ \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} Care should be taken when putting accents on lower-case i’s and j’s. Note that in the following \sphinxcode{\sphinxupquote{\textbackslash{}imath}} is used to avoid the extra dot over the i: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sa}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdl{}}\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{hat i}\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{ }\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{ }\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{hat }\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{imath\PYGZdl{}}\PYG{l+s+s2}{\PYGZdq{}} \end{sphinxVerbatim} \begin{equation}\hat i\ \ \hat \imath\end{equation} \subsubsection{Symbols} \label{\detokenize{tutorials/text/mathtext:symbols}} You can also use a large number of the TeX symbols, as in \sphinxcode{\sphinxupquote{\textbackslash{}infty}}, \sphinxcode{\sphinxupquote{\textbackslash{}leftarrow}}, \sphinxcode{\sphinxupquote{\textbackslash{}sum}}, \sphinxcode{\sphinxupquote{\textbackslash{}int}}. \sphinxstylestrong{Lower-case Greek} \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|T|T|T|} \hline $\alpha$ \sphinxcode{\sphinxupquote{\textbackslash{}alpha}} & $\beta$ \sphinxcode{\sphinxupquote{\textbackslash{}beta}} & $\chi$ \sphinxcode{\sphinxupquote{\textbackslash{}chi}} & $\delta$ \sphinxcode{\sphinxupquote{\textbackslash{}delta}} & $\digamma$ \sphinxcode{\sphinxupquote{\textbackslash{}digamma}} & $\epsilon$ \sphinxcode{\sphinxupquote{\textbackslash{}epsilon}} \\ \hline $\eta$ \sphinxcode{\sphinxupquote{\textbackslash{}eta}} & $\gamma$ \sphinxcode{\sphinxupquote{\textbackslash{}gamma}} & $\iota$ \sphinxcode{\sphinxupquote{\textbackslash{}iota}} & $\kappa$ \sphinxcode{\sphinxupquote{\textbackslash{}kappa}} & $\lambda$ \sphinxcode{\sphinxupquote{\textbackslash{}lambda}} & $\mu$ \sphinxcode{\sphinxupquote{\textbackslash{}mu}} \\ \hline $\nu$ \sphinxcode{\sphinxupquote{\textbackslash{}nu}} & $\omega$ \sphinxcode{\sphinxupquote{\textbackslash{}omega}} & $\phi$ \sphinxcode{\sphinxupquote{\textbackslash{}phi}} & $\pi$ \sphinxcode{\sphinxupquote{\textbackslash{}pi}} & $\psi$ \sphinxcode{\sphinxupquote{\textbackslash{}psi}} & $\rho$ \sphinxcode{\sphinxupquote{\textbackslash{}rho}} \\ \hline $\sigma$ \sphinxcode{\sphinxupquote{\textbackslash{}sigma}} & $\tau$ \sphinxcode{\sphinxupquote{\textbackslash{}tau}} & $\theta$ \sphinxcode{\sphinxupquote{\textbackslash{}theta}} & $\upsilon$ \sphinxcode{\sphinxupquote{\textbackslash{}upsilon}} & $\varepsilon$ \sphinxcode{\sphinxupquote{\textbackslash{}varepsilon}} & $\varkappa$ \sphinxcode{\sphinxupquote{\textbackslash{}varkappa}} \\ \hline $\varphi$ \sphinxcode{\sphinxupquote{\textbackslash{}varphi}} & $\varpi$ \sphinxcode{\sphinxupquote{\textbackslash{}varpi}} & $\varrho$ \sphinxcode{\sphinxupquote{\textbackslash{}varrho}} & $\varsigma$ \sphinxcode{\sphinxupquote{\textbackslash{}varsigma}} & $\vartheta$ \sphinxcode{\sphinxupquote{\textbackslash{}vartheta}} & $\xi$ \sphinxcode{\sphinxupquote{\textbackslash{}xi}} \\ \hline $\zeta$ \sphinxcode{\sphinxupquote{\textbackslash{}zeta}} &&&&&\\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \sphinxstylestrong{Upper-case Greek} \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|T|T|T|T|T|} \hline $\Delta$ \sphinxcode{\sphinxupquote{\textbackslash{}Delta}} & $\Gamma$ \sphinxcode{\sphinxupquote{\textbackslash{}Gamma}} & $\Lambda$ \sphinxcode{\sphinxupquote{\textbackslash{}Lambda}} & $\Omega$ \sphinxcode{\sphinxupquote{\textbackslash{}Omega}} & $\Phi$ \sphinxcode{\sphinxupquote{\textbackslash{}Phi}} & $\Pi$ \sphinxcode{\sphinxupquote{\textbackslash{}Pi}} & $\Psi$ \sphinxcode{\sphinxupquote{\textbackslash{}Psi}} & $\Sigma$ \sphinxcode{\sphinxupquote{\textbackslash{}Sigma}} \\ \hline $\Theta$ \sphinxcode{\sphinxupquote{\textbackslash{}Theta}} & $\Upsilon$ \sphinxcode{\sphinxupquote{\textbackslash{}Upsilon}} & $\Xi$ \sphinxcode{\sphinxupquote{\textbackslash{}Xi}} & $\mho$ \sphinxcode{\sphinxupquote{\textbackslash{}mho}} & $\nabla$ \sphinxcode{\sphinxupquote{\textbackslash{}nabla}} &&&\\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \sphinxstylestrong{Hebrew} \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|T|T|T|} \hline $\aleph$ \sphinxcode{\sphinxupquote{\textbackslash{}aleph}} & $\beth$ \sphinxcode{\sphinxupquote{\textbackslash{}beth}} & $\daleth$ \sphinxcode{\sphinxupquote{\textbackslash{}daleth}} & $\gimel$ \sphinxcode{\sphinxupquote{\textbackslash{}gimel}} &&\\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \sphinxstylestrong{Delimiters} \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|T|T|T|} \hline $/$ \sphinxcode{\sphinxupquote{/}} & $[$ \sphinxcode{\sphinxupquote{{[}}} & $\Downarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}Downarrow}} & $\Uparrow$ \sphinxcode{\sphinxupquote{\textbackslash{}Uparrow}} & $\Vert$ \sphinxcode{\sphinxupquote{\textbackslash{}Vert}} & $\backslash$ \sphinxcode{\sphinxupquote{\textbackslash{}backslash}} \\ \hline $\downarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}downarrow}} & $\langle$ \sphinxcode{\sphinxupquote{\textbackslash{}langle}} & $\lceil$ \sphinxcode{\sphinxupquote{\textbackslash{}lceil}} & $\lfloor$ \sphinxcode{\sphinxupquote{\textbackslash{}lfloor}} & $\llcorner$ \sphinxcode{\sphinxupquote{\textbackslash{}llcorner}} & $\lrcorner$ \sphinxcode{\sphinxupquote{\textbackslash{}lrcorner}} \\ \hline $\rangle$ \sphinxcode{\sphinxupquote{\textbackslash{}rangle}} & $\rceil$ \sphinxcode{\sphinxupquote{\textbackslash{}rceil}} & $\rfloor$ \sphinxcode{\sphinxupquote{\textbackslash{}rfloor}} & $\ulcorner$ \sphinxcode{\sphinxupquote{\textbackslash{}ulcorner}} & $\uparrow$ \sphinxcode{\sphinxupquote{\textbackslash{}uparrow}} & $\urcorner$ \sphinxcode{\sphinxupquote{\textbackslash{}urcorner}} \\ \hline $\vert$ \sphinxcode{\sphinxupquote{\textbackslash{}vert}} & $\{$ \sphinxcode{\sphinxupquote{\textbackslash{}\{}} & $\|$ \sphinxcode{\sphinxupquote{\textbackslash{}\textbar{}}} & $\}$ \sphinxcode{\sphinxupquote{\textbackslash{}\}}} & $]$ \sphinxcode{\sphinxupquote{{]}}} & $|$ \sphinxcode{\sphinxupquote{\textbar{}}} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \sphinxstylestrong{Big symbols} \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|T|T|T|} \hline $\bigcap$ \sphinxcode{\sphinxupquote{\textbackslash{}bigcap}} & $\bigcup$ \sphinxcode{\sphinxupquote{\textbackslash{}bigcup}} & $\bigodot$ \sphinxcode{\sphinxupquote{\textbackslash{}bigodot}} & $\bigoplus$ \sphinxcode{\sphinxupquote{\textbackslash{}bigoplus}} & $\bigotimes$ \sphinxcode{\sphinxupquote{\textbackslash{}bigotimes}} & $\biguplus$ \sphinxcode{\sphinxupquote{\textbackslash{}biguplus}} \\ \hline $\bigvee$ \sphinxcode{\sphinxupquote{\textbackslash{}bigvee}} & $\bigwedge$ \sphinxcode{\sphinxupquote{\textbackslash{}bigwedge}} & $\coprod$ \sphinxcode{\sphinxupquote{\textbackslash{}coprod}} & $\int$ \sphinxcode{\sphinxupquote{\textbackslash{}int}} & $\oint$ \sphinxcode{\sphinxupquote{\textbackslash{}oint}} & $\prod$ \sphinxcode{\sphinxupquote{\textbackslash{}prod}} \\ \hline $\sum$ \sphinxcode{\sphinxupquote{\textbackslash{}sum}} &&&&&\\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \sphinxstylestrong{Standard function names} \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|T|T|T|} \hline $\Pr$ \sphinxcode{\sphinxupquote{\textbackslash{}Pr}} & $\arccos$ \sphinxcode{\sphinxupquote{\textbackslash{}arccos}} & $\arcsin$ \sphinxcode{\sphinxupquote{\textbackslash{}arcsin}} & $\arctan$ \sphinxcode{\sphinxupquote{\textbackslash{}arctan}} & $\arg$ \sphinxcode{\sphinxupquote{\textbackslash{}arg}} & $\cos$ \sphinxcode{\sphinxupquote{\textbackslash{}cos}} \\ \hline $\cosh$ \sphinxcode{\sphinxupquote{\textbackslash{}cosh}} & $\cot$ \sphinxcode{\sphinxupquote{\textbackslash{}cot}} & $\coth$ \sphinxcode{\sphinxupquote{\textbackslash{}coth}} & $\csc$ \sphinxcode{\sphinxupquote{\textbackslash{}csc}} & $\deg$ \sphinxcode{\sphinxupquote{\textbackslash{}deg}} & $\det$ \sphinxcode{\sphinxupquote{\textbackslash{}det}} \\ \hline $\dim$ \sphinxcode{\sphinxupquote{\textbackslash{}dim}} & $\exp$ \sphinxcode{\sphinxupquote{\textbackslash{}exp}} & $\gcd$ \sphinxcode{\sphinxupquote{\textbackslash{}gcd}} & $\hom$ \sphinxcode{\sphinxupquote{\textbackslash{}hom}} & $\inf$ \sphinxcode{\sphinxupquote{\textbackslash{}inf}} & $\ker$ \sphinxcode{\sphinxupquote{\textbackslash{}ker}} \\ \hline $\lg$ \sphinxcode{\sphinxupquote{\textbackslash{}lg}} & $\lim$ \sphinxcode{\sphinxupquote{\textbackslash{}lim}} & $\liminf$ \sphinxcode{\sphinxupquote{\textbackslash{}liminf}} & $\limsup$ \sphinxcode{\sphinxupquote{\textbackslash{}limsup}} & $\ln$ \sphinxcode{\sphinxupquote{\textbackslash{}ln}} & $\log$ \sphinxcode{\sphinxupquote{\textbackslash{}log}} \\ \hline $\max$ \sphinxcode{\sphinxupquote{\textbackslash{}max}} & $\min$ \sphinxcode{\sphinxupquote{\textbackslash{}min}} & $\sec$ \sphinxcode{\sphinxupquote{\textbackslash{}sec}} & $\sin$ \sphinxcode{\sphinxupquote{\textbackslash{}sin}} & $\sinh$ \sphinxcode{\sphinxupquote{\textbackslash{}sinh}} & $\sup$ \sphinxcode{\sphinxupquote{\textbackslash{}sup}} \\ \hline $\tan$ \sphinxcode{\sphinxupquote{\textbackslash{}tan}} & $\tanh$ \sphinxcode{\sphinxupquote{\textbackslash{}tanh}} &&&&\\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \sphinxstylestrong{Binary operation and relation symbols} \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|l|l|} \hline \endfirsthead \multicolumn{4}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{4}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot $\Bumpeq$ \sphinxcode{\sphinxupquote{\textbackslash{}Bumpeq}} & $\Cap$ \sphinxcode{\sphinxupquote{\textbackslash{}Cap}} & $\Cup$ \sphinxcode{\sphinxupquote{\textbackslash{}Cup}} & $\Doteq$ \sphinxcode{\sphinxupquote{\textbackslash{}Doteq}} \\ \hline $\Join$ \sphinxcode{\sphinxupquote{\textbackslash{}Join}} & $\Subset$ \sphinxcode{\sphinxupquote{\textbackslash{}Subset}} & $\Supset$ \sphinxcode{\sphinxupquote{\textbackslash{}Supset}} & $\Vdash$ \sphinxcode{\sphinxupquote{\textbackslash{}Vdash}} \\ \hline $\Vvdash$ \sphinxcode{\sphinxupquote{\textbackslash{}Vvdash}} & $\approx$ \sphinxcode{\sphinxupquote{\textbackslash{}approx}} & $\approxeq$ \sphinxcode{\sphinxupquote{\textbackslash{}approxeq}} & $\ast$ \sphinxcode{\sphinxupquote{\textbackslash{}ast}} \\ \hline $\asymp$ \sphinxcode{\sphinxupquote{\textbackslash{}asymp}} & $\backepsilon$ \sphinxcode{\sphinxupquote{\textbackslash{}backepsilon}} & $\backsim$ \sphinxcode{\sphinxupquote{\textbackslash{}backsim}} & $\backsimeq$ \sphinxcode{\sphinxupquote{\textbackslash{}backsimeq}} \\ \hline $\barwedge$ \sphinxcode{\sphinxupquote{\textbackslash{}barwedge}} & $\because$ \sphinxcode{\sphinxupquote{\textbackslash{}because}} & $\between$ \sphinxcode{\sphinxupquote{\textbackslash{}between}} & $\bigcirc$ \sphinxcode{\sphinxupquote{\textbackslash{}bigcirc}} \\ \hline $\bigtriangledown$ \sphinxcode{\sphinxupquote{\textbackslash{}bigtriangledown}} & $\bigtriangleup$ \sphinxcode{\sphinxupquote{\textbackslash{}bigtriangleup}} & $\blacktriangleleft$ \sphinxcode{\sphinxupquote{\textbackslash{}blacktriangleleft}} & $\blacktriangleright$ \sphinxcode{\sphinxupquote{\textbackslash{}blacktriangleright}} \\ \hline $\bot$ \sphinxcode{\sphinxupquote{\textbackslash{}bot}} & $\bowtie$ \sphinxcode{\sphinxupquote{\textbackslash{}bowtie}} & $\boxdot$ \sphinxcode{\sphinxupquote{\textbackslash{}boxdot}} & $\boxminus$ \sphinxcode{\sphinxupquote{\textbackslash{}boxminus}} \\ \hline $\boxplus$ \sphinxcode{\sphinxupquote{\textbackslash{}boxplus}} & $\boxtimes$ \sphinxcode{\sphinxupquote{\textbackslash{}boxtimes}} & $\bullet$ \sphinxcode{\sphinxupquote{\textbackslash{}bullet}} & $\bumpeq$ \sphinxcode{\sphinxupquote{\textbackslash{}bumpeq}} \\ \hline $\cap$ \sphinxcode{\sphinxupquote{\textbackslash{}cap}} & $\cdot$ \sphinxcode{\sphinxupquote{\textbackslash{}cdot}} & $\circ$ \sphinxcode{\sphinxupquote{\textbackslash{}circ}} & $\circeq$ \sphinxcode{\sphinxupquote{\textbackslash{}circeq}} \\ \hline $\coloneq$ \sphinxcode{\sphinxupquote{\textbackslash{}coloneq}} & $\cong$ \sphinxcode{\sphinxupquote{\textbackslash{}cong}} & $\cup$ \sphinxcode{\sphinxupquote{\textbackslash{}cup}} & $\curlyeqprec$ \sphinxcode{\sphinxupquote{\textbackslash{}curlyeqprec}} \\ \hline $\curlyeqsucc$ \sphinxcode{\sphinxupquote{\textbackslash{}curlyeqsucc}} & $\curlyvee$ \sphinxcode{\sphinxupquote{\textbackslash{}curlyvee}} & $\curlywedge$ \sphinxcode{\sphinxupquote{\textbackslash{}curlywedge}} & $\dag$ \sphinxcode{\sphinxupquote{\textbackslash{}dag}} \\ \hline $\dashv$ \sphinxcode{\sphinxupquote{\textbackslash{}dashv}} & $\ddag$ \sphinxcode{\sphinxupquote{\textbackslash{}ddag}} & $\diamond$ \sphinxcode{\sphinxupquote{\textbackslash{}diamond}} & $\div$ \sphinxcode{\sphinxupquote{\textbackslash{}div}} \\ \hline $\divideontimes$ \sphinxcode{\sphinxupquote{\textbackslash{}divideontimes}} & $\doteq$ \sphinxcode{\sphinxupquote{\textbackslash{}doteq}} & $\doteqdot$ \sphinxcode{\sphinxupquote{\textbackslash{}doteqdot}} & $\dotplus$ \sphinxcode{\sphinxupquote{\textbackslash{}dotplus}} \\ \hline $\doublebarwedge$ \sphinxcode{\sphinxupquote{\textbackslash{}doublebarwedge}} & $\eqcirc$ \sphinxcode{\sphinxupquote{\textbackslash{}eqcirc}} & $\eqcolon$ \sphinxcode{\sphinxupquote{\textbackslash{}eqcolon}} & $\eqsim$ \sphinxcode{\sphinxupquote{\textbackslash{}eqsim}} \\ \hline $\eqslantgtr$ \sphinxcode{\sphinxupquote{\textbackslash{}eqslantgtr}} & $\eqslantless$ \sphinxcode{\sphinxupquote{\textbackslash{}eqslantless}} & $\equiv$ \sphinxcode{\sphinxupquote{\textbackslash{}equiv}} & $\fallingdotseq$ \sphinxcode{\sphinxupquote{\textbackslash{}fallingdotseq}} \\ \hline $\frown$ \sphinxcode{\sphinxupquote{\textbackslash{}frown}} & $\geq$ \sphinxcode{\sphinxupquote{\textbackslash{}geq}} & $\geqq$ \sphinxcode{\sphinxupquote{\textbackslash{}geqq}} & $\geqslant$ \sphinxcode{\sphinxupquote{\textbackslash{}geqslant}} \\ \hline $\gg$ \sphinxcode{\sphinxupquote{\textbackslash{}gg}} & $\ggg$ \sphinxcode{\sphinxupquote{\textbackslash{}ggg}} & $\gnapprox$ \sphinxcode{\sphinxupquote{\textbackslash{}gnapprox}} & $\gneqq$ \sphinxcode{\sphinxupquote{\textbackslash{}gneqq}} \\ \hline $\gnsim$ \sphinxcode{\sphinxupquote{\textbackslash{}gnsim}} & $\gtrapprox$ \sphinxcode{\sphinxupquote{\textbackslash{}gtrapprox}} & $\gtrdot$ \sphinxcode{\sphinxupquote{\textbackslash{}gtrdot}} & $\gtreqless$ \sphinxcode{\sphinxupquote{\textbackslash{}gtreqless}} \\ \hline $\gtreqqless$ \sphinxcode{\sphinxupquote{\textbackslash{}gtreqqless}} & $\gtrless$ \sphinxcode{\sphinxupquote{\textbackslash{}gtrless}} & $\gtrsim$ \sphinxcode{\sphinxupquote{\textbackslash{}gtrsim}} & $\in$ \sphinxcode{\sphinxupquote{\textbackslash{}in}} \\ \hline $\intercal$ \sphinxcode{\sphinxupquote{\textbackslash{}intercal}} & $\leftthreetimes$ \sphinxcode{\sphinxupquote{\textbackslash{}leftthreetimes}} & $\leq$ \sphinxcode{\sphinxupquote{\textbackslash{}leq}} & $\leqq$ \sphinxcode{\sphinxupquote{\textbackslash{}leqq}} \\ \hline $\leqslant$ \sphinxcode{\sphinxupquote{\textbackslash{}leqslant}} & $\lessapprox$ \sphinxcode{\sphinxupquote{\textbackslash{}lessapprox}} & $\lessdot$ \sphinxcode{\sphinxupquote{\textbackslash{}lessdot}} & $\lesseqgtr$ \sphinxcode{\sphinxupquote{\textbackslash{}lesseqgtr}} \\ \hline $\lesseqqgtr$ \sphinxcode{\sphinxupquote{\textbackslash{}lesseqqgtr}} & $\lessgtr$ \sphinxcode{\sphinxupquote{\textbackslash{}lessgtr}} & $\lesssim$ \sphinxcode{\sphinxupquote{\textbackslash{}lesssim}} & $\ll$ \sphinxcode{\sphinxupquote{\textbackslash{}ll}} \\ \hline $\lll$ \sphinxcode{\sphinxupquote{\textbackslash{}lll}} & $\lnapprox$ \sphinxcode{\sphinxupquote{\textbackslash{}lnapprox}} & $\lneqq$ \sphinxcode{\sphinxupquote{\textbackslash{}lneqq}} & $\lnsim$ \sphinxcode{\sphinxupquote{\textbackslash{}lnsim}} \\ \hline $\ltimes$ \sphinxcode{\sphinxupquote{\textbackslash{}ltimes}} & $\mid$ \sphinxcode{\sphinxupquote{\textbackslash{}mid}} & $\models$ \sphinxcode{\sphinxupquote{\textbackslash{}models}} & $\mp$ \sphinxcode{\sphinxupquote{\textbackslash{}mp}} \\ \hline $\nVDash$ \sphinxcode{\sphinxupquote{\textbackslash{}nVDash}} & $\nVdash$ \sphinxcode{\sphinxupquote{\textbackslash{}nVdash}} & $\napprox$ \sphinxcode{\sphinxupquote{\textbackslash{}napprox}} & $\ncong$ \sphinxcode{\sphinxupquote{\textbackslash{}ncong}} \\ \hline $\ne$ \sphinxcode{\sphinxupquote{\textbackslash{}ne}} & $\neq$ \sphinxcode{\sphinxupquote{\textbackslash{}neq}} & $\neq$ \sphinxcode{\sphinxupquote{\textbackslash{}neq}} & $\nequiv$ \sphinxcode{\sphinxupquote{\textbackslash{}nequiv}} \\ \hline $\ngeq$ \sphinxcode{\sphinxupquote{\textbackslash{}ngeq}} & $\ngtr$ \sphinxcode{\sphinxupquote{\textbackslash{}ngtr}} & $\ni$ \sphinxcode{\sphinxupquote{\textbackslash{}ni}} & $\nleq$ \sphinxcode{\sphinxupquote{\textbackslash{}nleq}} \\ \hline $\nless$ \sphinxcode{\sphinxupquote{\textbackslash{}nless}} & $\nmid$ \sphinxcode{\sphinxupquote{\textbackslash{}nmid}} & $\notin$ \sphinxcode{\sphinxupquote{\textbackslash{}notin}} & $\nparallel$ \sphinxcode{\sphinxupquote{\textbackslash{}nparallel}} \\ \hline $\nprec$ \sphinxcode{\sphinxupquote{\textbackslash{}nprec}} & $\nsim$ \sphinxcode{\sphinxupquote{\textbackslash{}nsim}} & $\nsubset$ \sphinxcode{\sphinxupquote{\textbackslash{}nsubset}} & $\nsubseteq$ \sphinxcode{\sphinxupquote{\textbackslash{}nsubseteq}} \\ \hline $\nsucc$ \sphinxcode{\sphinxupquote{\textbackslash{}nsucc}} & $\nsupset$ \sphinxcode{\sphinxupquote{\textbackslash{}nsupset}} & $\nsupseteq$ \sphinxcode{\sphinxupquote{\textbackslash{}nsupseteq}} & $\ntriangleleft$ \sphinxcode{\sphinxupquote{\textbackslash{}ntriangleleft}} \\ \hline $\ntrianglelefteq$ \sphinxcode{\sphinxupquote{\textbackslash{}ntrianglelefteq}} & $\ntriangleright$ \sphinxcode{\sphinxupquote{\textbackslash{}ntriangleright}} & $\ntrianglerighteq$ \sphinxcode{\sphinxupquote{\textbackslash{}ntrianglerighteq}} & $\nvDash$ \sphinxcode{\sphinxupquote{\textbackslash{}nvDash}} \\ \hline $\nvdash$ \sphinxcode{\sphinxupquote{\textbackslash{}nvdash}} & $\odot$ \sphinxcode{\sphinxupquote{\textbackslash{}odot}} & $\ominus$ \sphinxcode{\sphinxupquote{\textbackslash{}ominus}} & $\oplus$ \sphinxcode{\sphinxupquote{\textbackslash{}oplus}} \\ \hline $\oslash$ \sphinxcode{\sphinxupquote{\textbackslash{}oslash}} & $\otimes$ \sphinxcode{\sphinxupquote{\textbackslash{}otimes}} & $\parallel$ \sphinxcode{\sphinxupquote{\textbackslash{}parallel}} & $\perp$ \sphinxcode{\sphinxupquote{\textbackslash{}perp}} \\ \hline $\pitchfork$ \sphinxcode{\sphinxupquote{\textbackslash{}pitchfork}} & $\pm$ \sphinxcode{\sphinxupquote{\textbackslash{}pm}} & $\prec$ \sphinxcode{\sphinxupquote{\textbackslash{}prec}} & $\precapprox$ \sphinxcode{\sphinxupquote{\textbackslash{}precapprox}} \\ \hline $\preccurlyeq$ \sphinxcode{\sphinxupquote{\textbackslash{}preccurlyeq}} & $\preceq$ \sphinxcode{\sphinxupquote{\textbackslash{}preceq}} & $\precnapprox$ \sphinxcode{\sphinxupquote{\textbackslash{}precnapprox}} & $\precnsim$ \sphinxcode{\sphinxupquote{\textbackslash{}precnsim}} \\ \hline $\precsim$ \sphinxcode{\sphinxupquote{\textbackslash{}precsim}} & $\propto$ \sphinxcode{\sphinxupquote{\textbackslash{}propto}} & $\rightthreetimes$ \sphinxcode{\sphinxupquote{\textbackslash{}rightthreetimes}} & $\risingdotseq$ \sphinxcode{\sphinxupquote{\textbackslash{}risingdotseq}} \\ \hline $\rtimes$ \sphinxcode{\sphinxupquote{\textbackslash{}rtimes}} & $\sim$ \sphinxcode{\sphinxupquote{\textbackslash{}sim}} & $\simeq$ \sphinxcode{\sphinxupquote{\textbackslash{}simeq}} & $\slash$ \sphinxcode{\sphinxupquote{\textbackslash{}slash}} \\ \hline $\smile$ \sphinxcode{\sphinxupquote{\textbackslash{}smile}} & $\sqcap$ \sphinxcode{\sphinxupquote{\textbackslash{}sqcap}} & $\sqcup$ \sphinxcode{\sphinxupquote{\textbackslash{}sqcup}} & $\sqsubset$ \sphinxcode{\sphinxupquote{\textbackslash{}sqsubset}} \\ \hline $\sqsubset$ \sphinxcode{\sphinxupquote{\textbackslash{}sqsubset}} & $\sqsubseteq$ \sphinxcode{\sphinxupquote{\textbackslash{}sqsubseteq}} & $\sqsupset$ \sphinxcode{\sphinxupquote{\textbackslash{}sqsupset}} & $\sqsupset$ \sphinxcode{\sphinxupquote{\textbackslash{}sqsupset}} \\ \hline $\sqsupseteq$ \sphinxcode{\sphinxupquote{\textbackslash{}sqsupseteq}} & $\star$ \sphinxcode{\sphinxupquote{\textbackslash{}star}} & $\subset$ \sphinxcode{\sphinxupquote{\textbackslash{}subset}} & $\subseteq$ \sphinxcode{\sphinxupquote{\textbackslash{}subseteq}} \\ \hline $\subseteqq$ \sphinxcode{\sphinxupquote{\textbackslash{}subseteqq}} & $\subsetneq$ \sphinxcode{\sphinxupquote{\textbackslash{}subsetneq}} & $\subsetneqq$ \sphinxcode{\sphinxupquote{\textbackslash{}subsetneqq}} & $\succ$ \sphinxcode{\sphinxupquote{\textbackslash{}succ}} \\ \hline $\succapprox$ \sphinxcode{\sphinxupquote{\textbackslash{}succapprox}} & $\succcurlyeq$ \sphinxcode{\sphinxupquote{\textbackslash{}succcurlyeq}} & $\succeq$ \sphinxcode{\sphinxupquote{\textbackslash{}succeq}} & $\succnapprox$ \sphinxcode{\sphinxupquote{\textbackslash{}succnapprox}} \\ \hline $\succnsim$ \sphinxcode{\sphinxupquote{\textbackslash{}succnsim}} & $\succsim$ \sphinxcode{\sphinxupquote{\textbackslash{}succsim}} & $\supset$ \sphinxcode{\sphinxupquote{\textbackslash{}supset}} & $\supseteq$ \sphinxcode{\sphinxupquote{\textbackslash{}supseteq}} \\ \hline $\supseteqq$ \sphinxcode{\sphinxupquote{\textbackslash{}supseteqq}} & $\supsetneq$ \sphinxcode{\sphinxupquote{\textbackslash{}supsetneq}} & $\supsetneqq$ \sphinxcode{\sphinxupquote{\textbackslash{}supsetneqq}} & $\therefore$ \sphinxcode{\sphinxupquote{\textbackslash{}therefore}} \\ \hline $\times$ \sphinxcode{\sphinxupquote{\textbackslash{}times}} & $\top$ \sphinxcode{\sphinxupquote{\textbackslash{}top}} & $\triangleleft$ \sphinxcode{\sphinxupquote{\textbackslash{}triangleleft}} & $\trianglelefteq$ \sphinxcode{\sphinxupquote{\textbackslash{}trianglelefteq}} \\ \hline $\triangleq$ \sphinxcode{\sphinxupquote{\textbackslash{}triangleq}} & $\triangleright$ \sphinxcode{\sphinxupquote{\textbackslash{}triangleright}} & $\trianglerighteq$ \sphinxcode{\sphinxupquote{\textbackslash{}trianglerighteq}} & $\uplus$ \sphinxcode{\sphinxupquote{\textbackslash{}uplus}} \\ \hline $\vDash$ \sphinxcode{\sphinxupquote{\textbackslash{}vDash}} & $\varpropto$ \sphinxcode{\sphinxupquote{\textbackslash{}varpropto}} & $\vartriangleleft$ \sphinxcode{\sphinxupquote{\textbackslash{}vartriangleleft}} & $\vartriangleright$ \sphinxcode{\sphinxupquote{\textbackslash{}vartriangleright}} \\ \hline $\vdash$ \sphinxcode{\sphinxupquote{\textbackslash{}vdash}} & $\vee$ \sphinxcode{\sphinxupquote{\textbackslash{}vee}} & $\veebar$ \sphinxcode{\sphinxupquote{\textbackslash{}veebar}} & $\wedge$ \sphinxcode{\sphinxupquote{\textbackslash{}wedge}} \\ \hline $\wr$ \sphinxcode{\sphinxupquote{\textbackslash{}wr}} &&&\\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} \sphinxstylestrong{Arrow symbols} \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|T|} \hline $\Downarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}Downarrow}} & $\Leftarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}Leftarrow}} & $\Leftrightarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}Leftrightarrow}} & $\Lleftarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}Lleftarrow}} \\ \hline $\Longleftarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}Longleftarrow}} & $\Longleftrightarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}Longleftrightarrow}} & $\Longrightarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}Longrightarrow}} & $\Lsh$ \sphinxcode{\sphinxupquote{\textbackslash{}Lsh}} \\ \hline $\Nearrow$ \sphinxcode{\sphinxupquote{\textbackslash{}Nearrow}} & $\Nwarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}Nwarrow}} & $\Rightarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}Rightarrow}} & $\Rrightarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}Rrightarrow}} \\ \hline $\Rsh$ \sphinxcode{\sphinxupquote{\textbackslash{}Rsh}} & $\Searrow$ \sphinxcode{\sphinxupquote{\textbackslash{}Searrow}} & $\Swarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}Swarrow}} & $\Uparrow$ \sphinxcode{\sphinxupquote{\textbackslash{}Uparrow}} \\ \hline $\Updownarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}Updownarrow}} & $\circlearrowleft$ \sphinxcode{\sphinxupquote{\textbackslash{}circlearrowleft}} & $\circlearrowright$ \sphinxcode{\sphinxupquote{\textbackslash{}circlearrowright}} & $\curvearrowleft$ \sphinxcode{\sphinxupquote{\textbackslash{}curvearrowleft}} \\ \hline $\curvearrowright$ \sphinxcode{\sphinxupquote{\textbackslash{}curvearrowright}} & $\dashleftarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}dashleftarrow}} & $\dashrightarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}dashrightarrow}} & $\downarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}downarrow}} \\ \hline $\downdownarrows$ \sphinxcode{\sphinxupquote{\textbackslash{}downdownarrows}} & $\downharpoonleft$ \sphinxcode{\sphinxupquote{\textbackslash{}downharpoonleft}} & $\downharpoonright$ \sphinxcode{\sphinxupquote{\textbackslash{}downharpoonright}} & $\hookleftarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}hookleftarrow}} \\ \hline $\hookrightarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}hookrightarrow}} & $\leadsto$ \sphinxcode{\sphinxupquote{\textbackslash{}leadsto}} & $\leftarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}leftarrow}} & $\leftarrowtail$ \sphinxcode{\sphinxupquote{\textbackslash{}leftarrowtail}} \\ \hline $\leftharpoondown$ \sphinxcode{\sphinxupquote{\textbackslash{}leftharpoondown}} & $\leftharpoonup$ \sphinxcode{\sphinxupquote{\textbackslash{}leftharpoonup}} & $\leftleftarrows$ \sphinxcode{\sphinxupquote{\textbackslash{}leftleftarrows}} & $\leftrightarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}leftrightarrow}} \\ \hline $\leftrightarrows$ \sphinxcode{\sphinxupquote{\textbackslash{}leftrightarrows}} & $\leftrightharpoons$ \sphinxcode{\sphinxupquote{\textbackslash{}leftrightharpoons}} & $\leftrightsquigarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}leftrightsquigarrow}} & $\leftsquigarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}leftsquigarrow}} \\ \hline $\longleftarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}longleftarrow}} & $\longleftrightarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}longleftrightarrow}} & $\longmapsto$ \sphinxcode{\sphinxupquote{\textbackslash{}longmapsto}} & $\longrightarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}longrightarrow}} \\ \hline $\looparrowleft$ \sphinxcode{\sphinxupquote{\textbackslash{}looparrowleft}} & $\looparrowright$ \sphinxcode{\sphinxupquote{\textbackslash{}looparrowright}} & $\mapsto$ \sphinxcode{\sphinxupquote{\textbackslash{}mapsto}} & $\multimap$ \sphinxcode{\sphinxupquote{\textbackslash{}multimap}} \\ \hline $\nLeftarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}nLeftarrow}} & $\nLeftrightarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}nLeftrightarrow}} & $\nRightarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}nRightarrow}} & $\nearrow$ \sphinxcode{\sphinxupquote{\textbackslash{}nearrow}} \\ \hline $\nleftarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}nleftarrow}} & $\nleftrightarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}nleftrightarrow}} & $\nrightarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}nrightarrow}} & $\nwarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}nwarrow}} \\ \hline $\rightarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}rightarrow}} & $\rightarrowtail$ \sphinxcode{\sphinxupquote{\textbackslash{}rightarrowtail}} & $\rightharpoondown$ \sphinxcode{\sphinxupquote{\textbackslash{}rightharpoondown}} & $\rightharpoonup$ \sphinxcode{\sphinxupquote{\textbackslash{}rightharpoonup}} \\ \hline $\rightleftarrows$ \sphinxcode{\sphinxupquote{\textbackslash{}rightleftarrows}} & $\rightleftarrows$ \sphinxcode{\sphinxupquote{\textbackslash{}rightleftarrows}} & $\rightleftharpoons$ \sphinxcode{\sphinxupquote{\textbackslash{}rightleftharpoons}} & $\rightleftharpoons$ \sphinxcode{\sphinxupquote{\textbackslash{}rightleftharpoons}} \\ \hline $\rightrightarrows$ \sphinxcode{\sphinxupquote{\textbackslash{}rightrightarrows}} & $\rightrightarrows$ \sphinxcode{\sphinxupquote{\textbackslash{}rightrightarrows}} & $\rightsquigarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}rightsquigarrow}} & $\searrow$ \sphinxcode{\sphinxupquote{\textbackslash{}searrow}} \\ \hline $\swarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}swarrow}} & $\to$ \sphinxcode{\sphinxupquote{\textbackslash{}to}} & $\twoheadleftarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}twoheadleftarrow}} & $\twoheadrightarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}twoheadrightarrow}} \\ \hline $\uparrow$ \sphinxcode{\sphinxupquote{\textbackslash{}uparrow}} & $\updownarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}updownarrow}} & $\updownarrow$ \sphinxcode{\sphinxupquote{\textbackslash{}updownarrow}} & $\upharpoonleft$ \sphinxcode{\sphinxupquote{\textbackslash{}upharpoonleft}} \\ \hline $\upharpoonright$ \sphinxcode{\sphinxupquote{\textbackslash{}upharpoonright}} & $\upuparrows$ \sphinxcode{\sphinxupquote{\textbackslash{}upuparrows}} &&\\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \sphinxstylestrong{Miscellaneous symbols} \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|T|} \hline $\$$ \sphinxcode{\sphinxupquote{\textbackslash{}\$}} & $\AA$ \sphinxcode{\sphinxupquote{\textbackslash{}AA}} & $\Finv$ \sphinxcode{\sphinxupquote{\textbackslash{}Finv}} & $\Game$ \sphinxcode{\sphinxupquote{\textbackslash{}Game}} \\ \hline $\Im$ \sphinxcode{\sphinxupquote{\textbackslash{}Im}} & $\P$ \sphinxcode{\sphinxupquote{\textbackslash{}P}} & $\Re$ \sphinxcode{\sphinxupquote{\textbackslash{}Re}} & $\S$ \sphinxcode{\sphinxupquote{\textbackslash{}S}} \\ \hline $\angle$ \sphinxcode{\sphinxupquote{\textbackslash{}angle}} & $\backprime$ \sphinxcode{\sphinxupquote{\textbackslash{}backprime}} & $\bigstar$ \sphinxcode{\sphinxupquote{\textbackslash{}bigstar}} & $\blacksquare$ \sphinxcode{\sphinxupquote{\textbackslash{}blacksquare}} \\ \hline $\blacktriangle$ \sphinxcode{\sphinxupquote{\textbackslash{}blacktriangle}} & $\blacktriangledown$ \sphinxcode{\sphinxupquote{\textbackslash{}blacktriangledown}} & $\cdots$ \sphinxcode{\sphinxupquote{\textbackslash{}cdots}} & $\checkmark$ \sphinxcode{\sphinxupquote{\textbackslash{}checkmark}} \\ \hline $\circledR$ \sphinxcode{\sphinxupquote{\textbackslash{}circledR}} & $\circledS$ \sphinxcode{\sphinxupquote{\textbackslash{}circledS}} & $\clubsuit$ \sphinxcode{\sphinxupquote{\textbackslash{}clubsuit}} & $\complement$ \sphinxcode{\sphinxupquote{\textbackslash{}complement}} \\ \hline $\copyright$ \sphinxcode{\sphinxupquote{\textbackslash{}copyright}} & $\ddots$ \sphinxcode{\sphinxupquote{\textbackslash{}ddots}} & $\diamondsuit$ \sphinxcode{\sphinxupquote{\textbackslash{}diamondsuit}} & $\ell$ \sphinxcode{\sphinxupquote{\textbackslash{}ell}} \\ \hline $\emptyset$ \sphinxcode{\sphinxupquote{\textbackslash{}emptyset}} & $\eth$ \sphinxcode{\sphinxupquote{\textbackslash{}eth}} & $\exists$ \sphinxcode{\sphinxupquote{\textbackslash{}exists}} & $\flat$ \sphinxcode{\sphinxupquote{\textbackslash{}flat}} \\ \hline $\forall$ \sphinxcode{\sphinxupquote{\textbackslash{}forall}} & $\hbar$ \sphinxcode{\sphinxupquote{\textbackslash{}hbar}} & $\heartsuit$ \sphinxcode{\sphinxupquote{\textbackslash{}heartsuit}} & $\hslash$ \sphinxcode{\sphinxupquote{\textbackslash{}hslash}} \\ \hline $\iiint$ \sphinxcode{\sphinxupquote{\textbackslash{}iiint}} & $\iint$ \sphinxcode{\sphinxupquote{\textbackslash{}iint}} & $\iint$ \sphinxcode{\sphinxupquote{\textbackslash{}iint}} & $\imath$ \sphinxcode{\sphinxupquote{\textbackslash{}imath}} \\ \hline $\infty$ \sphinxcode{\sphinxupquote{\textbackslash{}infty}} & $\jmath$ \sphinxcode{\sphinxupquote{\textbackslash{}jmath}} & $\ldots$ \sphinxcode{\sphinxupquote{\textbackslash{}ldots}} & $\measuredangle$ \sphinxcode{\sphinxupquote{\textbackslash{}measuredangle}} \\ \hline $\natural$ \sphinxcode{\sphinxupquote{\textbackslash{}natural}} & $\neg$ \sphinxcode{\sphinxupquote{\textbackslash{}neg}} & $\nexists$ \sphinxcode{\sphinxupquote{\textbackslash{}nexists}} & $\oiiint$ \sphinxcode{\sphinxupquote{\textbackslash{}oiiint}} \\ \hline $\partial$ \sphinxcode{\sphinxupquote{\textbackslash{}partial}} & $\prime$ \sphinxcode{\sphinxupquote{\textbackslash{}prime}} & $\sharp$ \sphinxcode{\sphinxupquote{\textbackslash{}sharp}} & $\spadesuit$ \sphinxcode{\sphinxupquote{\textbackslash{}spadesuit}} \\ \hline $\sphericalangle$ \sphinxcode{\sphinxupquote{\textbackslash{}sphericalangle}} & $\ss$ \sphinxcode{\sphinxupquote{\textbackslash{}ss}} & $\triangledown$ \sphinxcode{\sphinxupquote{\textbackslash{}triangledown}} & $\varnothing$ \sphinxcode{\sphinxupquote{\textbackslash{}varnothing}} \\ \hline $\vartriangle$ \sphinxcode{\sphinxupquote{\textbackslash{}vartriangle}} & $\vdots$ \sphinxcode{\sphinxupquote{\textbackslash{}vdots}} & $\wp$ \sphinxcode{\sphinxupquote{\textbackslash{}wp}} & $\yen$ \sphinxcode{\sphinxupquote{\textbackslash{}yen}} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} If a particular symbol does not have a name (as is true of many of the more obscure symbols in the STIX fonts), Unicode characters can also be used: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sa}{ur}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{u23ce\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} \subsubsection{Example} \label{\detokenize{tutorials/text/mathtext:example}} Here is an example illustrating many of these features in context. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/pyplots/pyplot\_mathtext.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_pyplot_mathtext_0011}.png}}\caption{Pyplot Mathtext}\label{\detokenize{tutorials/text/mathtext:id2}}\end{figure} \phantomsection\label{\detokenize{tutorials/text/mathtext:sphx-glr-download-tutorials-text-mathtext-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/text/text_props:sphx-glr-download-tutorials-text-text-props-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Text properties and layout} \label{\detokenize{tutorials/text/text_props:text-properties-and-layout}}\label{\detokenize{tutorials/text/text_props:sphx-glr-tutorials-text-text-props-py}}\label{\detokenize{tutorials/text/text_props::doc}} Controlling properties of text and its layout with Matplotlib. The {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}} instances have a variety of properties which can be configured via keyword arguments to the text commands (e.g., {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.title:matplotlib.pyplot.title}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{title()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xlabel:matplotlib.pyplot.xlabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xlabel()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.text:matplotlib.pyplot.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text()}}}}}). \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Value Type \\ \hline alpha & \sphinxhref{https://docs.python.org/3/library/functions.html\#float}{\sphinxcode{\sphinxupquote{float}}} \\ \hline backgroundcolor & any matplotlib {\hyperref[\detokenize{tutorials/colors/colors:sphx-glr-tutorials-colors-colors-py}]{\sphinxcrossref{\DUrole{std,std-ref}{color}}}} \\ \hline bbox & {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}} prop dict plus key \sphinxcode{\sphinxupquote{'pad'}} which is a pad in points \\ \hline clip\_box & a matplotlib.transform.Bbox instance \\ \hline clip\_on & bool \\ \hline clip\_path & a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance and a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \\ \hline color & any matplotlib {\hyperref[\detokenize{tutorials/colors/colors:sphx-glr-tutorials-colors-colors-py}]{\sphinxcrossref{\DUrole{std,std-ref}{color}}}} \\ \hline family & {[} \sphinxcode{\sphinxupquote{'serif'}} \textbar{} \sphinxcode{\sphinxupquote{'sans-serif'}} \textbar{} \sphinxcode{\sphinxupquote{'cursive'}} \textbar{} \sphinxcode{\sphinxupquote{'fantasy'}} \textbar{} \sphinxcode{\sphinxupquote{'monospace'}} {]} \\ \hline fontproperties & a {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FontProperties}}}}} instance \\ \hline horizontalalignment or ha & {[} \sphinxcode{\sphinxupquote{'center'}} \textbar{} \sphinxcode{\sphinxupquote{'right'}} \textbar{} \sphinxcode{\sphinxupquote{'left'}} {]} \\ \hline label & any string \\ \hline linespacing & \sphinxhref{https://docs.python.org/3/library/functions.html\#float}{\sphinxcode{\sphinxupquote{float}}} \\ \hline multialignment & {[}\sphinxcode{\sphinxupquote{'left'}} \textbar{} \sphinxcode{\sphinxupquote{'right'}} \textbar{} \sphinxcode{\sphinxupquote{'center'}} {]} \\ \hline name or fontname & string e.g., {[}\sphinxcode{\sphinxupquote{'Sans'}} \textbar{} \sphinxcode{\sphinxupquote{'Courier'}} \textbar{} \sphinxcode{\sphinxupquote{'Helvetica'}} …{]} \\ \hline picker & {[}None\textbar{}float\textbar{}boolean\textbar{}callable{]} \\ \hline position & (x, y) \\ \hline rotation & {[} angle in degrees \textbar{} \sphinxcode{\sphinxupquote{'vertical'}} \textbar{} \sphinxcode{\sphinxupquote{'horizontal'}} {]} \\ \hline size or fontsize & {[} size in points \textbar{} relative size, e.g., \sphinxcode{\sphinxupquote{'smaller'}}, \sphinxcode{\sphinxupquote{'x-large'}} {]} \\ \hline style or fontstyle & {[} \sphinxcode{\sphinxupquote{'normal'}} \textbar{} \sphinxcode{\sphinxupquote{'italic'}} \textbar{} \sphinxcode{\sphinxupquote{'oblique'}} {]} \\ \hline text & string or anything printable with ‘\%s’ conversion \\ \hline transform & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance \\ \hline variant & {[} \sphinxcode{\sphinxupquote{'normal'}} \textbar{} \sphinxcode{\sphinxupquote{'small-caps'}} {]} \\ \hline verticalalignment or va & {[} \sphinxcode{\sphinxupquote{'center'}} \textbar{} \sphinxcode{\sphinxupquote{'top'}} \textbar{} \sphinxcode{\sphinxupquote{'bottom'}} \textbar{} \sphinxcode{\sphinxupquote{'baseline'}} {]} \\ \hline visible & bool \\ \hline weight or fontweight & {[} \sphinxcode{\sphinxupquote{'normal'}} \textbar{} \sphinxcode{\sphinxupquote{'bold'}} \textbar{} \sphinxcode{\sphinxupquote{'heavy'}} \textbar{} \sphinxcode{\sphinxupquote{'light'}} \textbar{} \sphinxcode{\sphinxupquote{'ultrabold'}} \textbar{} \sphinxcode{\sphinxupquote{'ultralight'}}{]} \\ \hline x & \sphinxhref{https://docs.python.org/3/library/functions.html\#float}{\sphinxcode{\sphinxupquote{float}}} \\ \hline y & \sphinxhref{https://docs.python.org/3/library/functions.html\#float}{\sphinxcode{\sphinxupquote{float}}} \\ \hline zorder & any number \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} You can lay out text with the alignment arguments \sphinxcode{\sphinxupquote{horizontalalignment}}, \sphinxcode{\sphinxupquote{verticalalignment}}, and \sphinxcode{\sphinxupquote{multialignment}}. \sphinxcode{\sphinxupquote{horizontalalignment}} controls whether the x positional argument for the text indicates the left, center or right side of the text bounding box. \sphinxcode{\sphinxupquote{verticalalignment}} controls whether the y positional argument for the text indicates the bottom, center or top side of the text bounding box. \sphinxcode{\sphinxupquote{multialignment}}, for newline separated strings only, controls whether the different lines are left, center or right justified. Here is an example which uses the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.text:matplotlib.pyplot.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text()}}}}} command to show the various alignment possibilities. The use of \sphinxcode{\sphinxupquote{transform=ax.transAxes}} throughout the code indicates that the coordinates are given relative to the axes bounding box, with 0,0 being the lower left of the axes and 1,1 the upper right. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.patches} \PYG{k+kn}{as} \PYG{n+nn}{patches} \PYG{c+c1}{\PYGZsh{} build a rectangle in axes coords} \PYG{n}{left}\PYG{p}{,} \PYG{n}{width} \PYG{o}{=} \PYG{o}{.}\PYG{l+m+mi}{25}\PYG{p}{,} \PYG{o}{.}\PYG{l+m+mi}{5} \PYG{n}{bottom}\PYG{p}{,} \PYG{n}{height} \PYG{o}{=} \PYG{o}{.}\PYG{l+m+mi}{25}\PYG{p}{,} \PYG{o}{.}\PYG{l+m+mi}{5} \PYG{n}{right} \PYG{o}{=} \PYG{n}{left} \PYG{o}{+} \PYG{n}{width} \PYG{n}{top} \PYG{o}{=} \PYG{n}{bottom} \PYG{o}{+} \PYG{n}{height} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} axes coordinates are 0,0 is bottom left and 1,1 is upper right} \PYG{n}{p} \PYG{o}{=} \PYG{n}{patches}\PYG{o}{.}\PYG{n}{Rectangle}\PYG{p}{(} \PYG{p}{(}\PYG{n}{left}\PYG{p}{,} \PYG{n}{bottom}\PYG{p}{)}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{n}{fill}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{,} \PYG{n}{clip\PYGZus{}on}\PYG{o}{=}\PYG{n+nb+bp}{False} \PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{add\PYGZus{}patch}\PYG{p}{(}\PYG{n}{p}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{n}{left}\PYG{p}{,} \PYG{n}{bottom}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{left top}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{left}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{verticalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{top}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{n}{left}\PYG{p}{,} \PYG{n}{bottom}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{left bottom}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{left}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{verticalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bottom}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{n}{right}\PYG{p}{,} \PYG{n}{top}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right bottom}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{verticalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bottom}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{n}{right}\PYG{p}{,} \PYG{n}{top}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right top}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{verticalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{top}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{n}{right}\PYG{p}{,} \PYG{n}{bottom}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center top}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{verticalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{top}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{n}{left}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{o}{*}\PYG{p}{(}\PYG{n}{bottom}\PYG{o}{+}\PYG{n}{top}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{verticalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{vertical}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{n}{left}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{o}{*}\PYG{p}{(}\PYG{n}{bottom}\PYG{o}{+}\PYG{n}{top}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{left center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{left}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{verticalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{vertical}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{o}{*}\PYG{p}{(}\PYG{n}{left}\PYG{o}{+}\PYG{n}{right}\PYG{p}{)}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{o}{*}\PYG{p}{(}\PYG{n}{bottom}\PYG{o}{+}\PYG{n}{top}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{middle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{verticalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{20}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{n}{right}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{o}{*}\PYG{p}{(}\PYG{n}{bottom}\PYG{o}{+}\PYG{n}{top}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{centered}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{verticalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{vertical}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{n}{left}\PYG{p}{,} \PYG{n}{top}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{rotated}\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s1}{with newlines}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{verticalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{45}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}axis\PYGZus{}off}\PYG{p}{(}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_props_001}.png} \subsection{Default Font} \label{\detokenize{tutorials/text/text_props:default-font}} The base default font is controlled by a set of rcParams. To set the font for mathematical expressions, use the rcParams beginning with \sphinxcode{\sphinxupquote{mathtext}} (see {\hyperref[\detokenize{tutorials/text/mathtext:mathtext-fonts}]{\sphinxcrossref{\DUrole{std,std-ref}{mathtext}}}}). \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily rcParam &\sphinxstyletheadfamily usage \\ \hline \sphinxcode{\sphinxupquote{'font.family'}} & List of either names of font or \sphinxcode{\sphinxupquote{\{'cursive', 'fantasy', 'monospace', 'sans', 'sans serif', 'sans-serif', 'serif'\}}}. \\ \hline \sphinxcode{\sphinxupquote{'font.style'}} & The default style, ex \sphinxcode{\sphinxupquote{'normal'}}, \sphinxcode{\sphinxupquote{'italic'}}. \\ \hline \sphinxcode{\sphinxupquote{'font.variant'}} & Default variant, ex \sphinxcode{\sphinxupquote{'normal'}}, \sphinxcode{\sphinxupquote{'small-caps'}} (untested) \\ \hline \sphinxcode{\sphinxupquote{'font.stretch'}} & Default stretch, ex \sphinxcode{\sphinxupquote{'normal'}}, \sphinxcode{\sphinxupquote{'condensed'}} (incomplete) \\ \hline \sphinxcode{\sphinxupquote{'font.weight'}} & Default weight. Either string or integer \\ \hline \sphinxcode{\sphinxupquote{'font.size'}} & Default font size in points. Relative font sizes (\sphinxcode{\sphinxupquote{'large'}}, \sphinxcode{\sphinxupquote{'x-small'}}) are computed against this size. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} The mapping between the family aliases (\sphinxcode{\sphinxupquote{\{'cursive', 'fantasy', 'monospace', 'sans', 'sans serif', 'sans-serif', 'serif'\}}}) and actual font names is controlled by the following rcParams: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily family alias &\sphinxstyletheadfamily rcParam with mappings \\ \hline \sphinxcode{\sphinxupquote{'serif'}} & \sphinxcode{\sphinxupquote{'font.serif'}} \\ \hline \sphinxcode{\sphinxupquote{'monospace'}} & \sphinxcode{\sphinxupquote{'font.monospace'}} \\ \hline \sphinxcode{\sphinxupquote{'fantasy'}} & \sphinxcode{\sphinxupquote{'font.fantasy'}} \\ \hline \sphinxcode{\sphinxupquote{'cursive'}} & \sphinxcode{\sphinxupquote{'font.cursive'}} \\ \hline \sphinxcode{\sphinxupquote{\{'sans', 'sans serif', 'sans-serif'\}}} & \sphinxcode{\sphinxupquote{'font.sans-serif'}} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} which are lists of font names. \subsubsection{Text with non-latin glyphs} \label{\detokenize{tutorials/text/text_props:text-with-non-latin-glyphs}} As of v2.0 the {\hyperref[\detokenize{users/dflt_style_changes:default-changes-font}]{\sphinxcrossref{\DUrole{std,std-ref}{default font}}}} contains glyphs for many western alphabets, but still does not cover all of the glyphs that may be required by mpl users. For example, DejaVu has no coverage of Chinese, Korean, or Japanese. To set the default font to be one that supports the code points you need, prepend the font name to \sphinxcode{\sphinxupquote{'font.family'}} or the desired alias lists \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{font.sans\PYGZhy{}serif}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Source Han Sans TW}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{sans\PYGZhy{}serif}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \end{sphinxVerbatim} or set it in your \sphinxcode{\sphinxupquote{.matplotlibrc}} file: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{font}\PYG{o}{.}\PYG{n}{sans}\PYG{o}{\PYGZhy{}}\PYG{n}{serif}\PYG{p}{:} \PYG{n}{Source} \PYG{n}{Han} \PYG{n}{Sans} \PYG{n}{TW}\PYG{p}{,} \PYG{n}{Arial}\PYG{p}{,} \PYG{n}{sans}\PYG{o}{\PYGZhy{}}\PYG{n}{serif} \end{sphinxVerbatim} To control the font used on per-artist basis use the \sphinxcode{\sphinxupquote{'name'}}, \sphinxcode{\sphinxupquote{'fontname'}} or \sphinxcode{\sphinxupquote{'fontproperties'}} kwargs documented {\hyperref[\detokenize{tutorials/text/text_props:sphx-glr-tutorials-text-text-props-py}]{\sphinxcrossref{\DUrole{std,std-ref}{above}}}}. On linux, \sphinxhref{https://linux.die.net/man/1/fc-list}{fc-list} can be a useful tool to discover the font name; for example \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYGZdl{} fc\PYGZhy{}list :lang=zh family Noto to Sans Mono CJK TC,Noto Sans Mono CJK TC Bold Noto Sans CJK TC,Noto Sans CJK TC Medium Noto Sans CJK TC,Noto Sans CJK TC DemiLight Noto Sans CJK KR,Noto Sans CJK KR Black Noto Sans CJK TC,Noto Sans CJK TC Black Noto Sans Mono CJK TC,Noto Sans Mono CJK TC Regular Noto Sans CJK SC,Noto Sans CJK SC Light \end{sphinxVerbatim} lists all of the fonts that support Chinese. \phantomsection\label{\detokenize{tutorials/text/text_props:sphx-glr-download-tutorials-text-text-props-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/text/text_intro:sphx-glr-download-tutorials-text-text-intro-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Text in Matplotlib Plots} \label{\detokenize{tutorials/text/text_intro:text-in-matplotlib-plots}}\label{\detokenize{tutorials/text/text_intro:sphx-glr-tutorials-text-text-intro-py}}\label{\detokenize{tutorials/text/text_intro::doc}} Introduction to plotting and working with text in Matplotlib. 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. Because it embeds fonts directly in output documents, e.g., for postscript or PDF, what you see on the screen is what you get in the hardcopy. \sphinxhref{https://www.freetype.org/}{FreeType} support produces very nice, antialiased fonts, that look good even at small raster sizes. matplotlib includes its own {\hyperref[\detokenize{api/font_manager_api:module-matplotlib.font_manager}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager}}}}} (thanks to Paul Barrett), which implements a cross platform, \sphinxcode{\sphinxupquote{W3C}} compliant font finding algorithm. The user has a great deal of control over text properties (font size, font weight, text location and color, etc.) with sensible defaults set in the \sphinxcode{\sphinxupquote{rc file}}. And significantly, for those interested in mathematical or scientific figures, matplotlib implements a large number of TeX math symbols and commands, supporting {\hyperref[\detokenize{tutorials/text/mathtext:sphx-glr-tutorials-text-mathtext-py}]{\sphinxcrossref{\DUrole{std,std-ref}{mathematical expressions}}}} anywhere in your figure. \subsubsection{Basic text commands} \label{\detokenize{tutorials/text/text_intro:basic-text-commands}} The following commands are used to create text in the pyplot interface and the object-oriented API: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pyplot}}}}} API &\sphinxstyletheadfamily OO API &\sphinxstyletheadfamily description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.text:matplotlib.pyplot.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.text:matplotlib.axes.Axes.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text}}}}} & Add text at an arbitrary location of the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.annotate:matplotlib.pyplot.annotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{annotate}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.annotate:matplotlib.axes.Axes.annotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{annotate}}}}} & Add an annotation, with an optional arrow, at an arbitrary location of the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xlabel:matplotlib.pyplot.xlabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xlabel}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlabel:matplotlib.axes.Axes.set_xlabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xlabel}}}}} & Add a label to the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}’s x-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ylabel:matplotlib.pyplot.ylabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ylabel}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylabel:matplotlib.axes.Axes.set_ylabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_ylabel}}}}} & Add a label to the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}’s y-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.title:matplotlib.pyplot.title}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{title}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_title:matplotlib.axes.Axes.set_title}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_title}}}}} & Add a title to the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figtext:matplotlib.pyplot.figtext}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figtext}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text}}}}} & Add text at an arbitrary location of the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.suptitle:matplotlib.pyplot.suptitle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{suptitle}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.suptitle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{suptitle}}}}} & Add a title to the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} All of these functions create and return a {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instance, which can be configured with a variety of font and other properties. The example below shows all of these commands in action, and more detail is provided in the sections that follow. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{suptitle}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bold figure suptitle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{14}\PYG{p}{,} \PYG{n}{fontweight}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bold}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{subplots\PYGZus{}adjust}\PYG{p}{(}\PYG{n}{top}\PYG{o}{=}\PYG{l+m+mf}{0.85}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes title}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{xlabel}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ylabel}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{8}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxed italics text in data coords}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{style}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{italic}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{bbox}\PYG{o}{=}\PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{facecolor}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{alpha}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{pad}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{10}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{6}\PYG{p}{,} \PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{an equation: \PYGZdl{}E=mc\PYGZca{}2\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{15}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+s+sa}{u}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{unicode: Institut für Festkörperphysik}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.95}\PYG{p}{,} \PYG{l+m+mf}{0.01}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{colored text in axes coords}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{verticalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bottom}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{green}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{15}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{o}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{annotate}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xytext}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{,} \PYG{n}{arrowprops}\PYG{o}{=}\PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{black}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{shrink}\PYG{o}{=}\PYG{l+m+mf}{0.05}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{]}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_001}.png} \subsubsection{Labels for x- and y-axis} \label{\detokenize{tutorials/text/text_intro:labels-for-x-and-y-axis}} Specifying the labels for the x- and y-axis is strightforward, via the {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlabel:matplotlib.axes.Axes.set_xlabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xlabel}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylabel:matplotlib.axes.Axes.set_ylabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_ylabel}}}}} methods. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{n}{x1} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{5.0}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{)} \PYG{n}{y1} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{cos}\PYG{p}{(}\PYG{l+m+mi}{2} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{pi} \PYG{o}{*} \PYG{n}{x1}\PYG{p}{)} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{exp}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{n}{x1}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{subplots\PYGZus{}adjust}\PYG{p}{(}\PYG{n}{bottom}\PYG{o}{=}\PYG{l+m+mf}{0.15}\PYG{p}{,} \PYG{n}{left}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{time [s]}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Damped oscillation [V]}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_002}.png} The x- and y-labels are automatically placed so that they clear the x- and y-ticklabels. Compare the plot below with that above, and note the y-label is to the left of the one above. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{subplots\PYGZus{}adjust}\PYG{p}{(}\PYG{n}{bottom}\PYG{o}{=}\PYG{l+m+mf}{0.15}\PYG{p}{,} \PYG{n}{left}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{o}{*}\PYG{l+m+mi}{10000}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{time [s]}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Damped oscillation [V]}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_003}.png} If you want to move the labels, you can specify the \sphinxstyleemphasis{labelpad} kyeword argument, where the value is points (1/72”, the same unit used to specify fontsizes). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{subplots\PYGZus{}adjust}\PYG{p}{(}\PYG{n}{bottom}\PYG{o}{=}\PYG{l+m+mf}{0.15}\PYG{p}{,} \PYG{n}{left}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{o}{*}\PYG{l+m+mi}{10000}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{time [s]}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Damped oscillation [V]}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{labelpad}\PYG{o}{=}\PYG{l+m+mi}{18}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_004}.png} Or, the labels accept all the {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} keyword arguments, including \sphinxstyleemphasis{position}, via which we can manually specify the label positions. Here we put the xlabel to the far left of the axis. Note, that the y-coordinate of this position has no effect - to adjust the y-position we need to use the \sphinxstyleemphasis{labelpad} kwarg. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{subplots\PYGZus{}adjust}\PYG{p}{(}\PYG{n}{bottom}\PYG{o}{=}\PYG{l+m+mf}{0.15}\PYG{p}{,} \PYG{n}{left}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{time [s]}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{position}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.}\PYG{p}{,} \PYG{l+m+mf}{1e6}\PYG{p}{)}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{left}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Damped oscillation [V]}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_005}.png} All the labelling in this tutorial can be changed by manipulating the {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}} method, or by named kwargs to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlabel:matplotlib.axes.Axes.set_xlabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xlabel}}}}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib.font\PYGZus{}manager} \PYG{k+kn}{import} \PYG{n}{FontProperties} \PYG{n}{font} \PYG{o}{=} \PYG{n}{FontProperties}\PYG{p}{(}\PYG{p}{)} \PYG{n}{font}\PYG{o}{.}\PYG{n}{set\PYGZus{}family}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{serif}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{font}\PYG{o}{.}\PYG{n}{set\PYGZus{}name}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Times New Roman}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{font}\PYG{o}{.}\PYG{n}{set\PYGZus{}style}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{italic}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{subplots\PYGZus{}adjust}\PYG{p}{(}\PYG{n}{bottom}\PYG{o}{=}\PYG{l+m+mf}{0.15}\PYG{p}{,} \PYG{n}{left}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{time [s]}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{large}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontweight}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bold}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Damped oscillation [V]}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontproperties}\PYG{o}{=}\PYG{n}{font}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_006}.png} Finally, we can use native TeX rendering in all text objects and have multiple lines: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{subplots\PYGZus{}adjust}\PYG{p}{(}\PYG{n}{bottom}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{n}{left}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{cumsum}\PYG{p}{(}\PYG{n}{y1}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{time [s] }\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s1}{ This was a long experiment}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylabel}\PYG{p}{(}\PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{int}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{ Y\PYGZca{}2}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{ dt}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{ }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{ [V\PYGZca{}2 s]\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_007}.png} \subsubsection{Titles} \label{\detokenize{tutorials/text/text_intro:titles}} Subplot titles are set in much the same way as labels, but there is the \sphinxstyleemphasis{loc} keyword arguments that can change the position and justification from the default value of \sphinxcode{\sphinxupquote{loc=center}}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{6}\PYG{p}{)}\PYG{p}{,} \PYG{n}{tight\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{locs} \PYG{o}{=} \PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{left}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{k}{for} \PYG{n}{ax}\PYG{p}{,} \PYG{n}{loc} \PYG{o+ow}{in} \PYG{n+nb}{zip}\PYG{p}{(}\PYG{n}{axs}\PYG{p}{,} \PYG{n}{locs}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Title with loc at }\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{+}\PYG{n}{loc}\PYG{p}{,} \PYG{n}{loc}\PYG{o}{=}\PYG{n}{loc}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_008}.png} Vertical spacing for titles is controlled via \sphinxcode{\sphinxupquote{rcParams{[}axes.titlepad{]}}}, which defaults to 5 points. Setting to a different value moves the title. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{subplots\PYGZus{}adjust}\PYG{p}{(}\PYG{n}{top}\PYG{o}{=}\PYG{l+m+mf}{0.8}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Vertically offset title}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{pad}\PYG{o}{=}\PYG{l+m+mi}{30}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_009}.png} \subsubsection{Ticks and ticklabels} \label{\detokenize{tutorials/text/text_intro:ticks-and-ticklabels}} Placing ticks and ticklabels is a very tricky aspect of making a figure. Matplotlib does the best it can automatically, but it also offers a very flexible framework for determining the choices for tick locations, and how they are labelled. \paragraph{Terminology} \label{\detokenize{tutorials/text/text_intro:terminology}} \sphinxstyleemphasis{Axes} have an {\hyperref[\detokenize{api/axis_api:module-matplotlib.axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axis}}}}} object for the \sphinxcode{\sphinxupquote{ax.xaxis}} and \sphinxcode{\sphinxupquote{ax.yaxis}} that contain the information about how the labels in the axis are laid out. The axis API is explained in detail in the documentation to {\hyperref[\detokenize{api/axis_api:module-matplotlib.axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axis}}}}}. An Axis object has major and minor ticks. The Axis has a \sphinxcode{\sphinxupquote{matplotlib.xaxis.set\_major\_locator}} and \sphinxcode{\sphinxupquote{matplotlib.xaxis.set\_minor\_locator}} methods that use the data being plotted to determine the location of major and minor ticks. There are also \sphinxcode{\sphinxupquote{matplotlib.xaxis.set\_major\_formatter}} and \sphinxcode{\sphinxupquote{matplotlib.xaxis.set\_minor\_formatters}} methods that format the tick labels. \paragraph{Simple ticks} \label{\detokenize{tutorials/text/text_intro:simple-ticks}} It often is convenient to simply define the tick values, and sometimes the tick labels, overriding the default locators and formatters. This is discouraged because it breaks itneractive navigation of the plot. It also can reset the axis limits: note that the second plot has the ticks we asked for, including ones that are well outside the automatic view limits. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{n}{tight\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}ticks}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mf}{0.}\PYG{p}{,} \PYG{l+m+mf}{8.1}\PYG{p}{,} \PYG{l+m+mf}{2.}\PYG{p}{)}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_010}.png} We can of course fix this after the fact, but it does highlight a weakness of hard-coding the ticks. This example also changes the format of the ticks: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{n}{tight\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{ticks} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mf}{0.}\PYG{p}{,} \PYG{l+m+mf}{8.1}\PYG{p}{,} \PYG{l+m+mf}{2.}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} list comprehension to get all tick labels...} \PYG{n}{tickla} \PYG{o}{=} \PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+si}{\PYGZpc{}1.2f}\PYG{l+s+s1}{\PYGZsq{}} \PYG{o}{\PYGZpc{}} \PYG{n}{tick} \PYG{k}{for} \PYG{n}{tick} \PYG{o+ow}{in} \PYG{n}{ticks}\PYG{p}{]} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}ticks}\PYG{p}{(}\PYG{n}{ticks}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}ticklabels}\PYG{p}{(}\PYG{n}{tickla}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{get\PYGZus{}xlim}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_011}.png} \paragraph{Tick Locators and Formatters} \label{\detokenize{tutorials/text/text_intro:tick-locators-and-formatters}} Instead of making a list of all the tickalbels, we could have used a {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.FormatStrFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.FormatStrFormatter}}}}} and passed it to the \sphinxcode{\sphinxupquote{ax.xaxis}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{n}{tight\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{ticks} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mf}{0.}\PYG{p}{,} \PYG{l+m+mf}{8.1}\PYG{p}{,} \PYG{l+m+mf}{2.}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} list comprehension to get all tick labels...} \PYG{n}{formatter} \PYG{o}{=} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{ticker}\PYG{o}{.}\PYG{n}{StrMethodFormatter}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZob{}x:1.1f\PYGZcb{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}ticks}\PYG{p}{(}\PYG{n}{ticks}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}formatter}\PYG{p}{(}\PYG{n}{formatter}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{get\PYGZus{}xlim}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_012}.png} And of course we could have used a non-default locator to set the tick locations. Note we still pass in the tick values, but the x-limit fix used above is \sphinxstyleemphasis{not} needed. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{n}{tight\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{formatter} \PYG{o}{=} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{ticker}\PYG{o}{.}\PYG{n}{FormatStrFormatter}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+si}{\PYGZpc{}1.1f}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{locator} \PYG{o}{=} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{ticker}\PYG{o}{.}\PYG{n}{FixedLocator}\PYG{p}{(}\PYG{n}{ticks}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}locator}\PYG{p}{(}\PYG{n}{locator}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}formatter}\PYG{p}{(}\PYG{n}{formatter}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_013}.png} The default formatter is the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.MaxNLocator}}}}} called as \sphinxcode{\sphinxupquote{ticker.MaxNLocator(self, nbins='auto', steps={[}1, 2, 2.5, 5, 10{]})}} The \sphinxstyleemphasis{steps} keyword contains a list of multiples that can be used for tick values. i.e. in this case, 2, 4, 6 would be acceptable ticks, as would 20, 40, 60 or 0.2, 0.4, 0.6. However, 3, 6, 9 would not be acceptable because 3 doesn’t appear in the list of steps. \sphinxcode{\sphinxupquote{nbins=auto}} uses an algorithm to determine how many ticks will be acceptable based on how long the axis is. The fontsize of the ticklabel is taken into account, but the length of the tick string is not (because its not yet known.) In the bottom row, the ticklabels are quite large, so we set \sphinxcode{\sphinxupquote{nbins=4}} to make the labels fit in the right-hand plot. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{8}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{tight\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{axs}\PYG{o}{.}\PYG{n}{flatten}\PYG{p}{(}\PYG{p}{)} \PYG{k}{for} \PYG{n}{n}\PYG{p}{,} \PYG{n}{ax} \PYG{o+ow}{in} \PYG{n+nb}{enumerate}\PYG{p}{(}\PYG{n}{axs}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{o}{*}\PYG{l+m+mf}{10.}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{formatter} \PYG{o}{=} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{ticker}\PYG{o}{.}\PYG{n}{FormatStrFormatter}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+si}{\PYGZpc{}1.1f}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{locator} \PYG{o}{=} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{ticker}\PYG{o}{.}\PYG{n}{MaxNLocator}\PYG{p}{(}\PYG{n}{nbins}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{auto}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{steps}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{]}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}locator}\PYG{p}{(}\PYG{n}{locator}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}formatter}\PYG{p}{(}\PYG{n}{formatter}\PYG{p}{)} \PYG{n}{formatter} \PYG{o}{=} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{ticker}\PYG{o}{.}\PYG{n}{FormatStrFormatter}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+si}{\PYGZpc{}1.5f}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{locator} \PYG{o}{=} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{ticker}\PYG{o}{.}\PYG{n}{AutoLocator}\PYG{p}{(}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}formatter}\PYG{p}{(}\PYG{n}{formatter}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}locator}\PYG{p}{(}\PYG{n}{locator}\PYG{p}{)} \PYG{n}{formatter} \PYG{o}{=} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{ticker}\PYG{o}{.}\PYG{n}{FormatStrFormatter}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+si}{\PYGZpc{}1.5f}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{locator} \PYG{o}{=} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{ticker}\PYG{o}{.}\PYG{n}{MaxNLocator}\PYG{p}{(}\PYG{n}{nbins}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}formatter}\PYG{p}{(}\PYG{n}{formatter}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}locator}\PYG{p}{(}\PYG{n}{locator}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_014}.png} Finally, we can specify functions for the formatter using {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.FuncFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.FuncFormatter}}}}}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{formatoddticks}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{pos}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}Format odd tick positions} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{k}{if} \PYG{n}{x} \PYG{o}{\PYGZpc{}} \PYG{l+m+mi}{2}\PYG{p}{:} \PYG{k}{return} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+si}{\PYGZpc{}1.2f}\PYG{l+s+s1}{\PYGZsq{}} \PYG{o}{\PYGZpc{}} \PYG{n}{x} \PYG{k}{else}\PYG{p}{:} \PYG{k}{return} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{n}{tight\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{formatter} \PYG{o}{=} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{ticker}\PYG{o}{.}\PYG{n}{FuncFormatter}\PYG{p}{(}\PYG{n}{formatoddticks}\PYG{p}{)} \PYG{n}{locator} \PYG{o}{=} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{ticker}\PYG{o}{.}\PYG{n}{MaxNLocator}\PYG{p}{(}\PYG{n}{nbins}\PYG{o}{=}\PYG{l+m+mi}{6}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}formatter}\PYG{p}{(}\PYG{n}{formatter}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}locator}\PYG{p}{(}\PYG{n}{locator}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_015}.png} \paragraph{Dateticks} \label{\detokenize{tutorials/text/text_intro:dateticks}} Matplotlib can accept \sphinxhref{https://docs.python.org/3/library/datetime.html\#datetime.datetime}{\sphinxcode{\sphinxupquote{datetime.datetime}}} and \sphinxcode{\sphinxupquote{numpy.datetime64}} objects as plotting arguments. Dates and times require special formatting, which can often benefit from manual intervention. In order to help, dates have spectial Locators and Formatters, defined in the {\hyperref[\detokenize{api/dates_api:module-matplotlib.dates}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates}}}}} module. A simple example is as follows. Note how we have to rotate the tick labels so that they don’t over-run each other. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{datetime} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{n}{tight\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{base} \PYG{o}{=} \PYG{n}{datetime}\PYG{o}{.}\PYG{n}{datetime}\PYG{p}{(}\PYG{l+m+mi}{2017}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{time} \PYG{o}{=} \PYG{p}{[}\PYG{n}{base} \PYG{o}{+} \PYG{n}{datetime}\PYG{o}{.}\PYG{n}{timedelta}\PYG{p}{(}\PYG{n}{days}\PYG{o}{=}\PYG{n}{x}\PYG{p}{)} \PYG{k}{for} \PYG{n}{x} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{y1}\PYG{p}{)}\PYG{p}{)}\PYG{p}{]} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{time}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{tick\PYGZus{}params}\PYG{p}{(}\PYG{n}{axis}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{x}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{70}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_016}.png} Maybe the format of the labels above is acceptable, but the choices is rather idiosyncratic. We can make the ticks fall on the start of the month by modifying {\hyperref[\detokenize{api/dates_api:matplotlib.dates.AutoDateLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.AutoDateLocator}}}}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.dates} \PYG{k+kn}{as} \PYG{n+nn}{mdates} \PYG{n}{locator} \PYG{o}{=} \PYG{n}{mdates}\PYG{o}{.}\PYG{n}{AutoDateLocator}\PYG{p}{(}\PYG{n}{interval\PYGZus{}multiples}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{n}{tight\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}locator}\PYG{p}{(}\PYG{n}{locator}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{time}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{tick\PYGZus{}params}\PYG{p}{(}\PYG{n}{axis}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{x}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{70}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_017}.png} However, this changes the tick labels. The easiest fix is to pass a format to {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.DateFormatter}}}}}. Also note that the 29th and the next month are very close together. We can fix this by using the \sphinxcode{\sphinxupquote{dates.DayLocator}} class, which allows us to specify a list of days of the month to use. Similar formatters are listed in the {\hyperref[\detokenize{api/dates_api:module-matplotlib.dates}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates}}}}} module. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{locator} \PYG{o}{=} \PYG{n}{mdates}\PYG{o}{.}\PYG{n}{DayLocator}\PYG{p}{(}\PYG{n}{bymonthday}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{15}\PYG{p}{]}\PYG{p}{)} \PYG{n}{formatter} \PYG{o}{=} \PYG{n}{mdates}\PYG{o}{.}\PYG{n}{DateFormatter}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{b }\PYG{l+s+si}{\PYGZpc{}d}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{n}{tight\PYGZus{}layout}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}locator}\PYG{p}{(}\PYG{n}{locator}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}formatter}\PYG{p}{(}\PYG{n}{formatter}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{time}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{tick\PYGZus{}params}\PYG{p}{(}\PYG{n}{axis}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{x}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{70}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_text_intro_018}.png} \subsubsection{Legends and Annotations} \label{\detokenize{tutorials/text/text_intro:legends-and-annotations}}\begin{itemize} \item {} Legends: {\hyperref[\detokenize{tutorials/intermediate/legend_guide::doc}]{\sphinxcrossref{\DUrole{doc}{Legend guide}}}} \item {} Annotations: {\hyperref[\detokenize{tutorials/text/annotations::doc}]{\sphinxcrossref{\DUrole{doc}{Annotations}}}} \end{itemize} \phantomsection\label{\detokenize{tutorials/text/text_intro:sphx-glr-download-tutorials-text-text-intro-py}} \section{Toolkits} \label{\detokenize{tutorials/index:toolkits}}\label{\detokenize{tutorials/index:tutorials-toolkits}} These tutorials cover toolkits designed to extend the functionality of Matplotlib in order to accomplish specific goals. \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/toolkits/mplot3d:sphx-glr-download-tutorials-toolkits-mplot3d-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{The mplot3d Toolkit} \label{\detokenize{tutorials/toolkits/mplot3d:the-mplot3d-toolkit}}\label{\detokenize{tutorials/toolkits/mplot3d:sphx-glr-tutorials-toolkits-mplot3d-py}}\label{\detokenize{tutorials/toolkits/mplot3d::doc}} Generating 3D plots using the mplot3d toolkit. \begin{sphinxShadowBox} \sphinxstyletopictitle{Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:id14}}{\hyperref[\detokenize{tutorials/toolkits/mplot3d:the-mplot3d-toolkit}]{\sphinxcrossref{The mplot3d Toolkit}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:id15}}{\hyperref[\detokenize{tutorials/toolkits/mplot3d:getting-started}]{\sphinxcrossref{Getting started}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:id16}}{\hyperref[\detokenize{tutorials/toolkits/mplot3d:line-plots}]{\sphinxcrossref{Line plots}}} \item {} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:id17}}{\hyperref[\detokenize{tutorials/toolkits/mplot3d:scatter-plots}]{\sphinxcrossref{Scatter plots}}} \item {} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:id18}}{\hyperref[\detokenize{tutorials/toolkits/mplot3d:wireframe-plots}]{\sphinxcrossref{Wireframe plots}}} \item {} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:id19}}{\hyperref[\detokenize{tutorials/toolkits/mplot3d:surface-plots}]{\sphinxcrossref{Surface plots}}} \item {} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:id20}}{\hyperref[\detokenize{tutorials/toolkits/mplot3d:tri-surface-plots}]{\sphinxcrossref{Tri-Surface plots}}} \item {} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:id21}}{\hyperref[\detokenize{tutorials/toolkits/mplot3d:contour-plots}]{\sphinxcrossref{Contour plots}}} \item {} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:id22}}{\hyperref[\detokenize{tutorials/toolkits/mplot3d:filled-contour-plots}]{\sphinxcrossref{Filled contour plots}}} \item {} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:id23}}{\hyperref[\detokenize{tutorials/toolkits/mplot3d:polygon-plots}]{\sphinxcrossref{Polygon plots}}} \item {} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:id24}}{\hyperref[\detokenize{tutorials/toolkits/mplot3d:bar-plots}]{\sphinxcrossref{Bar plots}}} \item {} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:id25}}{\hyperref[\detokenize{tutorials/toolkits/mplot3d:quiver}]{\sphinxcrossref{Quiver}}} \item {} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:id26}}{\hyperref[\detokenize{tutorials/toolkits/mplot3d:d-plots-in-3d}]{\sphinxcrossref{2D plots in 3D}}} \item {} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:id27}}{\hyperref[\detokenize{tutorials/toolkits/mplot3d:text}]{\sphinxcrossref{Text}}} \item {} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:id28}}{\hyperref[\detokenize{tutorials/toolkits/mplot3d:subplotting}]{\sphinxcrossref{Subplotting}}} \end{itemize} \end{itemize} \end{itemize} \end{sphinxShadowBox} \subsubsection{Getting started} \label{\detokenize{tutorials/toolkits/mplot3d:getting-started}}\label{\detokenize{tutorials/toolkits/mplot3d:toolkit-mplot3d-tutorial}} An Axes3D object is created just like any other axes using the projection=‘3d’ keyword. Create a new {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure}}}}} and add a new axes to it of type \sphinxcode{\sphinxupquote{Axes3D}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{k+kn}{from} \PYG{n+nn}{mpl\PYGZus{}toolkits}\PYG{n+nn}{.}\PYG{n+nn}{mplot3d} \PYG{k}{import} \PYG{n}{Axes3D} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{,} \PYG{n}{projection}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{3d}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \DUrole{versionmodified}{New in version 1.0.0: }This approach is the preferred method of creating a 3D axes. \begin{sphinxadmonition}{note}{Note:} Prior to version 1.0.0, the method of creating a 3D axes was different. For those using older versions of matplotlib, change \sphinxcode{\sphinxupquote{ax = fig.add\_subplot(111, projection='3d')}} to \sphinxcode{\sphinxupquote{ax = Axes3D(fig)}}. \end{sphinxadmonition} See the {\hyperref[\detokenize{mpl_toolkits/mplot3d/faq:toolkit-mplot3d-faq}]{\sphinxcrossref{\DUrole{std,std-ref}{mplot3d FAQ}}}} for more information about the mplot3d toolkit. \paragraph{Line plots} \label{\detokenize{tutorials/toolkits/mplot3d:line-plots}}\label{\detokenize{tutorials/toolkits/mplot3d:plot3d}}\index{plot() (mpl\_toolkits.mplot3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:mpl_toolkits.mplot3d.Axes3D.plot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes3D.}}\sphinxbfcode{\sphinxupquote{plot}}}{\emph{xs}, \emph{ys}, \emph{*args}, \emph{**kwargs}}{} Plot 2D or 3D data. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{xs}, \sphinxstyleemphasis{ys} & x, y coordinates of vertices \\ \hline \sphinxstyleemphasis{zs} & z value(s), either one for all points or one for each point. \\ \hline \sphinxstyleemphasis{zdir} & Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Other arguments are passed on to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot()}}}}} \end{fulllineitems} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/lines3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_lines3d_0011}.png}}\caption{Lines3d}\label{\detokenize{tutorials/toolkits/mplot3d:id1}}\end{figure} \paragraph{Scatter plots} \label{\detokenize{tutorials/toolkits/mplot3d:scatter-plots}}\label{\detokenize{tutorials/toolkits/mplot3d:scatter3d}}\index{scatter() (mpl\_toolkits.mplot3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:mpl_toolkits.mplot3d.Axes3D.scatter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes3D.}}\sphinxbfcode{\sphinxupquote{scatter}}}{\emph{xs}, \emph{ys}, \emph{zs=0}, \emph{zdir='z'}, \emph{s=20}, \emph{c=None}, \emph{depthshade=True}, \emph{*args}, \emph{**kwargs}}{} Create a scatter plot. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{xs}, \sphinxstyleemphasis{ys} & Positions of data points. \\ \hline \sphinxstyleemphasis{zs} & Either an array of the same length as \sphinxstyleemphasis{xs} and \sphinxstyleemphasis{ys} or a single value to place all points in the same plane. Default is 0. \\ \hline \sphinxstyleemphasis{zdir} & Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. \\ \hline \sphinxstyleemphasis{s} & Size in points\textasciicircum{}2. It is a scalar or an array of the same length as \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. \\ \hline \sphinxstyleemphasis{c} & A color. \sphinxstyleemphasis{c} can be a single color format string, or a sequence of color specifications of length \sphinxstyleemphasis{N}, or a sequence of \sphinxstyleemphasis{N} numbers to be mapped to colors using the \sphinxstyleemphasis{cmap} and \sphinxstyleemphasis{norm} specified via kwargs (see below). Note that \sphinxstyleemphasis{c} should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. \sphinxstyleemphasis{c} can be a 2-D array in which the rows are RGB or RGBA, however, including the case of a single row to specify the same color for all points. \\ \hline \sphinxstyleemphasis{depthshade} & Whether or not to shade the scatter markers to give the appearance of depth. Default is \sphinxstyleemphasis{True}. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Keyword arguments are passed on to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.scatter:matplotlib.axes.Axes.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter()}}}}}. Returns a {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3DCollection:mpl_toolkits.mplot3d.art3d.Patch3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch3DCollection}}}}} \end{fulllineitems} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/scatter3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_scatter3d_0011}.png}}\caption{Scatter3d}\label{\detokenize{tutorials/toolkits/mplot3d:id2}}\end{figure} \paragraph{Wireframe plots} \label{\detokenize{tutorials/toolkits/mplot3d:wireframe-plots}}\label{\detokenize{tutorials/toolkits/mplot3d:wireframe}}\index{plot\_wireframe() (mpl\_toolkits.mplot3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:mpl_toolkits.mplot3d.Axes3D.plot_wireframe}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes3D.}}\sphinxbfcode{\sphinxupquote{plot\_wireframe}}}{\emph{X}, \emph{Y}, \emph{Z}, \emph{*args}, \emph{**kwargs}}{} Plot a 3D wireframe. \begin{sphinxadmonition}{note}{Note:} The \sphinxstyleemphasis{rcount} and \sphinxstyleemphasis{ccount} kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. \end{sphinxadmonition} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{X, Y, Z}}] \leavevmode{[}2d arrays{]} Data values. \item[{\sphinxstylestrong{rcount, ccount}}] \leavevmode{[}int{]} Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Setting a count to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot. Defaults to 50. \DUrole{versionmodified}{New in version 2.0.} \item[{\sphinxstylestrong{rstride, cstride}}] \leavevmode{[}int{]} Downsampling stride in each direction. These arguments are mutually exclusive with \sphinxstyleemphasis{rcount} and \sphinxstyleemphasis{ccount}. If only one of \sphinxstyleemphasis{rstride} or \sphinxstyleemphasis{cstride} is set, the other defaults to 1. Setting a stride to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot. ‘classic’ mode uses a default of \sphinxcode{\sphinxupquote{rstride = cstride = 1}} instead of the new default of \sphinxcode{\sphinxupquote{rcount = ccount = 50}}. \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Other arguments are forwarded to {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Line3DCollection:mpl_toolkits.mplot3d.art3d.Line3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line3DCollection}}}}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/wire3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_wire3d_0011}.png}}\caption{Wire3d}\label{\detokenize{tutorials/toolkits/mplot3d:id3}}\end{figure} \paragraph{Surface plots} \label{\detokenize{tutorials/toolkits/mplot3d:surface-plots}}\label{\detokenize{tutorials/toolkits/mplot3d:surface}}\index{plot\_surface() (mpl\_toolkits.mplot3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:mpl_toolkits.mplot3d.Axes3D.plot_surface}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes3D.}}\sphinxbfcode{\sphinxupquote{plot\_surface}}}{\emph{X}, \emph{Y}, \emph{Z}, \emph{*args}, \emph{**kwargs}}{} Create a surface plot. By default it will be colored in shades of a solid color, but it also supports color mapping by supplying the \sphinxstyleemphasis{cmap} argument. \begin{sphinxadmonition}{note}{Note:} The \sphinxstyleemphasis{rcount} and \sphinxstyleemphasis{ccount} kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. \end{sphinxadmonition} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{X, Y, Z}}] \leavevmode{[}2d arrays{]} Data values. \item[{\sphinxstylestrong{rcount, ccount}}] \leavevmode{[}int{]} Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Defaults to 50. \DUrole{versionmodified}{New in version 2.0.} \item[{\sphinxstylestrong{rstride, cstride}}] \leavevmode{[}int{]} Downsampling stride in each direction. These arguments are mutually exclusive with \sphinxstyleemphasis{rcount} and \sphinxstyleemphasis{ccount}. If only one of \sphinxstyleemphasis{rstride} or \sphinxstyleemphasis{cstride} is set, the other defaults to 10. ‘classic’ mode uses a default of \sphinxcode{\sphinxupquote{rstride = cstride = 10}} instead of the new default of \sphinxcode{\sphinxupquote{rcount = ccount = 50}}. \item[{\sphinxstylestrong{color}}] \leavevmode{[}color-like{]} Color of the surface patches. \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}Colormap{]} Colormap of the surface patches. \item[{\sphinxstylestrong{facecolors}}] \leavevmode{[}array-like of colors.{]} Colors of each individual patch. \item[{\sphinxstylestrong{norm}}] \leavevmode{[}Normalize{]} Normalization for the colormap. \item[{\sphinxstylestrong{vmin, vmax}}] \leavevmode{[}float{]} Bounds for the normalization. \item[{\sphinxstylestrong{shade}}] \leavevmode{[}bool{]} Whether to shade the face colors. \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Other arguments are forwarded to {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Poly3DCollection}}}}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/surface3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_surface3d_0012}.png}}\caption{Surface3d} \begin{sphinxlegend} Surface3d 2 Surface3d 3 \end{sphinxlegend} \label{\detokenize{tutorials/toolkits/mplot3d:id4}}\end{figure} \paragraph{Tri-Surface plots} \label{\detokenize{tutorials/toolkits/mplot3d:tri-surface-plots}}\label{\detokenize{tutorials/toolkits/mplot3d:trisurface}}\index{plot\_trisurf() (mpl\_toolkits.mplot3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:mpl_toolkits.mplot3d.Axes3D.plot_trisurf}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes3D.}}\sphinxbfcode{\sphinxupquote{plot\_trisurf}}}{\emph{*args}, \emph{**kwargs}}{}~ \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}, \sphinxstyleemphasis{Z} & Data values as 1D arrays \\ \hline \sphinxstyleemphasis{color} & Color of the surface patches \\ \hline \sphinxstyleemphasis{cmap} & A colormap for the surface patches. \\ \hline \sphinxstyleemphasis{norm} & An instance of Normalize to map values to colors \\ \hline \sphinxstyleemphasis{vmin} & Minimum value to map \\ \hline \sphinxstyleemphasis{vmax} & Maximum value to map \\ \hline \sphinxstyleemphasis{shade} & Whether to shade the facecolors \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} The (optional) triangulation can be specified in one of two ways; either: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plot\PYGZus{}trisurf}\PYG{p}{(}\PYG{n}{triangulation}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} where triangulation is a {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} object, or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plot\PYGZus{}trisurf}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{plot\PYGZus{}trisurf}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{plot\PYGZus{}trisurf}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{triangles}\PYG{o}{=}\PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} in which case a Triangulation object will be created. See {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} for a explanation of these possibilities. The remaining arguments are: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plot\PYGZus{}trisurf}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxstyleemphasis{Z} is the array of values to contour, one per point in the triangulation. Other arguments are passed on to {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Poly3DCollection}}}}} \sphinxstylestrong{Examples:} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{trisurf3d1}.pdf} \end{figure} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{trisurf3d_21}.pdf} \end{figure} \DUrole{versionmodified}{New in version 1.2.0: }This plotting function was added for the v1.2.0 release. \end{fulllineitems} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/trisurf3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_trisurf3d_0011}.png}}\caption{Trisurf3d}\label{\detokenize{tutorials/toolkits/mplot3d:id5}}\end{figure} \paragraph{Contour plots} \label{\detokenize{tutorials/toolkits/mplot3d:contour-plots}}\label{\detokenize{tutorials/toolkits/mplot3d:contour3d}}\index{contour() (mpl\_toolkits.mplot3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:mpl_toolkits.mplot3d.Axes3D.contour}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes3D.}}\sphinxbfcode{\sphinxupquote{contour}}}{\emph{X}, \emph{Y}, \emph{Z}, \emph{*args}, \emph{**kwargs}}{} Create a 3D contour plot. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}, & Data values as numpy.arrays \\ \hline \sphinxstyleemphasis{Z} &\\ \hline \sphinxstyleemphasis{extend3d} & Whether to extend contour in 3D (default: False) \\ \hline \sphinxstyleemphasis{stride} & Stride (step size) for extending contour \\ \hline \sphinxstyleemphasis{zdir} & The direction to use: x, y or z (default) \\ \hline \sphinxstyleemphasis{offset} & If specified plot a projection of the contour lines on this position in plane normal to zdir \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} The positional and other keyword arguments are passed on to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contour:matplotlib.axes.Axes.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}} Returns a {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contour:matplotlib.axes.Axes.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour}}}}} \end{fulllineitems} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/contour3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_contour3d_0011}.png}}\caption{Contour3d} \begin{sphinxlegend} Contour3d 2 Contour3d 3 \end{sphinxlegend} \label{\detokenize{tutorials/toolkits/mplot3d:id6}}\end{figure} \paragraph{Filled contour plots} \label{\detokenize{tutorials/toolkits/mplot3d:filled-contour-plots}}\label{\detokenize{tutorials/toolkits/mplot3d:contourf3d}}\index{contourf() (mpl\_toolkits.mplot3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:mpl_toolkits.mplot3d.Axes3D.contourf}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes3D.}}\sphinxbfcode{\sphinxupquote{contourf}}}{\emph{X}, \emph{Y}, \emph{Z}, \emph{*args}, \emph{**kwargs}}{} Create a 3D contourf plot. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}, & Data values as numpy.arrays \\ \hline \sphinxstyleemphasis{Z} &\\ \hline \sphinxstyleemphasis{zdir} & The direction to use: x, y or z (default) \\ \hline \sphinxstyleemphasis{offset} & If specified plot a projection of the filled contour on this position in plane normal to zdir \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} The positional and keyword arguments are passed on to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contourf:matplotlib.axes.Axes.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}} Returns a {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contourf:matplotlib.axes.Axes.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf}}}}} \DUrole{versionmodified}{Changed in version 1.1.0: }The \sphinxstyleemphasis{zdir} and \sphinxstyleemphasis{offset} kwargs were added. \end{fulllineitems} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/contourf3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_contourf3d_0011}.png}}\caption{Contourf3d} \begin{sphinxlegend} Contourf3d 2 \end{sphinxlegend} \label{\detokenize{tutorials/toolkits/mplot3d:id7}}\end{figure} \DUrole{versionmodified}{New in version 1.1.0: }The feature demoed in the second contourf3d example was enabled as a result of a bugfix for version 1.1.0. \paragraph{Polygon plots} \label{\detokenize{tutorials/toolkits/mplot3d:polygon-plots}}\label{\detokenize{tutorials/toolkits/mplot3d:polygon3d}}\index{add\_collection3d() (mpl\_toolkits.mplot3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:mpl_toolkits.mplot3d.Axes3D.add_collection3d}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes3D.}}\sphinxbfcode{\sphinxupquote{add\_collection3d}}}{\emph{col}, \emph{zs=0}, \emph{zdir='z'}}{} Add a 3D collection object to the plot. 2D collection types are converted to a 3D version by modifying the object and adding z coordinate information. \begin{description} \item[{Supported are:}] \leavevmode\begin{itemize} \item {} PolyCollection \item {} LineCollection \item {} PatchCollection \end{itemize} \end{description} \end{fulllineitems} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/polys3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_polys3d_0011}.png}}\caption{Polys3d}\label{\detokenize{tutorials/toolkits/mplot3d:id8}}\end{figure} \paragraph{Bar plots} \label{\detokenize{tutorials/toolkits/mplot3d:bar-plots}}\label{\detokenize{tutorials/toolkits/mplot3d:bar3d}}\index{bar() (mpl\_toolkits.mplot3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:mpl_toolkits.mplot3d.Axes3D.bar}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes3D.}}\sphinxbfcode{\sphinxupquote{bar}}}{\emph{left}, \emph{height}, \emph{zs=0}, \emph{zdir='z'}, \emph{*args}, \emph{**kwargs}}{} Add 2D bar(s). \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{left} & The x coordinates of the left sides of the bars. \\ \hline \sphinxstyleemphasis{height} & The height of the bars. \\ \hline \sphinxstyleemphasis{zs} & Z coordinate of bars, if one value is specified they will all be placed at the same z. \\ \hline \sphinxstyleemphasis{zdir} & Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Keyword arguments are passed onto {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.bar:matplotlib.axes.Axes.bar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bar()}}}}}. Returns a {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3DCollection:mpl_toolkits.mplot3d.art3d.Patch3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch3DCollection}}}}} \end{fulllineitems} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/bars3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_bars3d_0011}.png}}\caption{Bars3d}\label{\detokenize{tutorials/toolkits/mplot3d:id9}}\end{figure} \paragraph{Quiver} \label{\detokenize{tutorials/toolkits/mplot3d:quiver}}\label{\detokenize{tutorials/toolkits/mplot3d:quiver3d}}\index{quiver() (mpl\_toolkits.mplot3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:mpl_toolkits.mplot3d.Axes3D.quiver}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes3D.}}\sphinxbfcode{\sphinxupquote{quiver}}}{\emph{*args}, \emph{**kwargs}}{} Plot a 3D field of arrows. call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{quiver}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{n}{W}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}, \sphinxstyleemphasis{Z}:}] \leavevmode The x, y and z coordinates of the arrow locations (default is tail of arrow; see \sphinxstyleemphasis{pivot} kwarg) \item[{\sphinxstyleemphasis{U}, \sphinxstyleemphasis{V}, \sphinxstyleemphasis{W}:}] \leavevmode The x, y and z components of the arrow vectors \end{description} \end{quote} The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted. Keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{length}: {[}1.0 \textbar{} float{]}}] \leavevmode The length of each quiver, default to 1.0, the unit is the same with the axes \item[{\sphinxstyleemphasis{arrow\_length\_ratio}: {[}0.3 \textbar{} float{]}}] \leavevmode The ratio of the arrow head with respect to the quiver, default to 0.3 \item[{\sphinxstyleemphasis{pivot}: {[} ‘tail’ \textbar{} ‘middle’ \textbar{} ‘tip’ {]}}] \leavevmode The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name \sphinxstyleemphasis{pivot}. Default is ‘tail’ \item[{\sphinxstyleemphasis{normalize}: bool}] \leavevmode When True, all of the arrows will be the same length. This defaults to False, where the arrows will be different lengths depending on the values of u,v,w. \end{description} \end{quote} Any additional keyword arguments are delegated to {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} \end{fulllineitems} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/quiver3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_quiver3d_0011}.png}}\caption{Quiver3d}\label{\detokenize{tutorials/toolkits/mplot3d:id10}}\end{figure} \paragraph{2D plots in 3D} \label{\detokenize{tutorials/toolkits/mplot3d:d-plots-in-3d}}\label{\detokenize{tutorials/toolkits/mplot3d:dcollections3d}} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/2dcollections3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_2dcollections3d_0011}.png}}\caption{2dcollections3d}\label{\detokenize{tutorials/toolkits/mplot3d:id11}}\end{figure} \paragraph{Text} \label{\detokenize{tutorials/toolkits/mplot3d:text}}\label{\detokenize{tutorials/toolkits/mplot3d:text3d}}\index{text() (mpl\_toolkits.mplot3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:mpl_toolkits.mplot3d.Axes3D.text}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes3D.}}\sphinxbfcode{\sphinxupquote{text}}}{\emph{x}, \emph{y}, \emph{z}, \emph{s}, \emph{zdir=None}, \emph{**kwargs}}{} Add text to the plot. kwargs will be passed on to Axes.text, except for the \sphinxcode{\sphinxupquote{zdir}} keyword, which sets the direction to be used as the z direction. \end{fulllineitems} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/text3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_text3d_0011}.png}}\caption{Text3d}\label{\detokenize{tutorials/toolkits/mplot3d:id12}}\end{figure} \paragraph{Subplotting} \label{\detokenize{tutorials/toolkits/mplot3d:subplotting}}\label{\detokenize{tutorials/toolkits/mplot3d:dsubplots}} Having multiple 3D plots in a single figure is the same as it is for 2D plots. Also, you can have both 2D and 3D plots in the same figure. \DUrole{versionmodified}{New in version 1.0.0: }Subplotting 3D plots was added in v1.0.0. Earlier version can not do this. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/subplot3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_subplot3d_0011}.png}}\caption{Subplot3d} \begin{sphinxlegend} Mixed Subplots \end{sphinxlegend} \label{\detokenize{tutorials/toolkits/mplot3d:id13}}\end{figure} \phantomsection\label{\detokenize{tutorials/toolkits/mplot3d:sphx-glr-download-tutorials-toolkits-mplot3d-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/toolkits/axisartist:sphx-glr-download-tutorials-toolkits-axisartist-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Overview of axisartist toolkit} \label{\detokenize{tutorials/toolkits/axisartist:overview-of-axisartist-toolkit}}\label{\detokenize{tutorials/toolkits/axisartist:sphx-glr-tutorials-toolkits-axisartist-py}}\label{\detokenize{tutorials/toolkits/axisartist::doc}} The axisartist toolkit tutorial. \begin{sphinxadmonition}{warning}{Warning:} \sphinxstyleemphasis{axisartist} uses a custom Axes class (derived from the mpl’s original Axes class). As a side effect, some commands (mostly tick-related) do not work. \end{sphinxadmonition} The \sphinxstyleemphasis{axisartist} contains a custom Axes class that is meant to support curvilinear grids (e.g., the world coordinate system in astronomy). Unlike mpl’s original Axes class which uses Axes.xaxis and Axes.yaxis to draw ticks, ticklines, etc., axisartist uses a special artist (AxisArtist) that can handle ticks, ticklines, etc. for curved coordinate systems. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axisartist/demo\_floating\_axis.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_demo_floating_axis_0011}.png}}\caption{Demo Floating Axis}\label{\detokenize{tutorials/toolkits/axisartist:id2}}\end{figure} Since it uses special artists, some Matplotlib commands that work on Axes.xaxis and Axes.yaxis may not work. \subsubsection{axisartist} \label{\detokenize{tutorials/toolkits/axisartist:axisartist}}\label{\detokenize{tutorials/toolkits/axisartist:axisartist-users-guide-index}} The \sphinxstyleemphasis{axisartist} module provides a custom (and very experimental) Axes class, where each axis (left, right, top, and bottom) have a separate associated artist which is responsible for drawing the axis-line, ticks, ticklabels, and labels. You can also create your own axis, which can pass through a fixed position in the axes coordinate, or a fixed position in the data coordinate (i.e., the axis floats around when viewlimit changes). The axes class, by default, has its xaxis and yaxis invisible, and has 4 additional artists which are responsible for drawing the 4 axis spines in “left”, “right”, “bottom”, and “top”. They are accessed as ax.axis{[}“left”{]}, ax.axis{[}“right”{]}, and so on, i.e., ax.axis is a dictionary that contains artists (note that ax.axis is still a callable method and it behaves as an original Axes.axis method in Matplotlib). To create an axes, \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{mpl\PYGZus{}toolkits}\PYG{n+nn}{.}\PYG{n+nn}{axisartist} \PYG{k}{as} \PYG{n+nn}{AA} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{AA}\PYG{o}{.}\PYG{n}{Axes}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.8}\PYG{p}{,} \PYG{l+m+mf}{0.8}\PYG{p}{]}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \end{sphinxVerbatim} or to create a subplot \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax} \PYG{o}{=} \PYG{n}{AA}\PYG{o}{.}\PYG{n}{Subplot}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \end{sphinxVerbatim} For example, you can hide the right and top spines using: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{right}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}visible}\PYG{p}{(}\PYG{k+kc}{False}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{top}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}visible}\PYG{p}{(}\PYG{k+kc}{False}\PYG{p}{)} \end{sphinxVerbatim} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axisartist/simple\_axisline3.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_simple_axisline3_0011}.png}}\caption{Simple Axisline3}\label{\detokenize{tutorials/toolkits/axisartist:id3}}\end{figure} It is also possible to add a horizontal axis. For example, you may have an horizontal axis at y=0 (in data coordinate). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{y=0}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{new\PYGZus{}floating\PYGZus{}axis}\PYG{p}{(}\PYG{n}{nth\PYGZus{}coord}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{value}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{)} \end{sphinxVerbatim} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axisartist/simple\_axisartist1.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_simple_axisartist1_0011}.png}}\caption{Simple Axisartist1}\label{\detokenize{tutorials/toolkits/axisartist:id4}}\end{figure} Or a fixed axis with some offset \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} make new (right\PYGZhy{}side) yaxis, but with some offset} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{right2}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{new\PYGZus{}fixed\PYGZus{}axis}\PYG{p}{(}\PYG{n}{loc}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{right}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{offset}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{20}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \paragraph{axisartist with ParasiteAxes} \label{\detokenize{tutorials/toolkits/axisartist:axisartist-with-parasiteaxes}} Most commands in the axes\_grid1 toolkit can take an axes\_class keyword argument, and the commands create an axes of the given class. For example, to create a host subplot with axisartist.Axes, \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{mpl\PYGZus{}toolkits}\PYG{n+nn}{.}\PYG{n+nn}{axisartist} \PYG{k}{as} \PYG{n+nn}{AA} \PYG{k+kn}{from} \PYG{n+nn}{mpl\PYGZus{}toolkits}\PYG{n+nn}{.}\PYG{n+nn}{axes\PYGZus{}grid1} \PYG{k}{import} \PYG{n}{host\PYGZus{}subplot} \PYG{n}{host} \PYG{o}{=} \PYG{n}{host\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{,} \PYG{n}{axes\PYGZus{}class}\PYG{o}{=}\PYG{n}{AA}\PYG{o}{.}\PYG{n}{Axes}\PYG{p}{)} \end{sphinxVerbatim} Here is an example that uses ParasiteAxes. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axisartist/demo\_parasite\_axes2.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_demo_parasite_axes2_0011}.png}}\caption{Demo Parasite Axes2}\label{\detokenize{tutorials/toolkits/axisartist:id5}}\end{figure} \paragraph{Curvilinear Grid} \label{\detokenize{tutorials/toolkits/axisartist:curvilinear-grid}} The motivation behind the AxisArtist module is to support a curvilinear grid and ticks. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axisartist/demo\_curvelinear\_grid.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_demo_curvelinear_grid_0011}.png}}\caption{Demo Curvelinear Grid}\label{\detokenize{tutorials/toolkits/axisartist:id6}}\end{figure} \paragraph{Floating Axes} \label{\detokenize{tutorials/toolkits/axisartist:floating-axes}} AxisArtist also supports a Floating Axes whose outer axes are defined as floating axis. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axisartist/demo\_floating\_axes.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_demo_floating_axes_0011}.png}}\caption{Demo Floating Axes}\label{\detokenize{tutorials/toolkits/axisartist:id7}}\end{figure} \subsubsection{axisartist namespace} \label{\detokenize{tutorials/toolkits/axisartist:axisartist-namespace}} The \sphinxstyleemphasis{axisartist} namespace includes a derived Axes implementation. The biggest difference is that the artists responsible to draw axis line, ticks, ticklabel and axis labels are separated out from the mpl’s Axis class, which are much more than artists in the original mpl. This change was strongly motivated to support curvilinear grid. Here are a few things that mpl\_tootlkits.axisartist.Axes is different from original Axes from mpl. \begin{itemize} \item {} Axis elements (axis line(spine), ticks, ticklabel and axis labels) are drawn by a AxisArtist instance. Unlike Axis, left, right, top and bottom axis are drawn by separate artists. And each of them may have different tick location and different tick labels. \item {} gridlines are drawn by a Gridlines instance. The change was motivated that in curvilinear coordinate, a gridline may not cross axis-lines (i.e., no associated ticks). In the original Axes class, gridlines are tied to ticks. \item {} ticklines can be rotated if necessary (i.e, along the gridlines) \end{itemize} In summary, all these changes was to support \begin{itemize} \item {} a curvilinear grid. \item {} a floating axis \end{itemize} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axisartist/demo\_floating\_axis.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_demo_floating_axis_0011}.png}}\caption{Demo Floating Axis}\label{\detokenize{tutorials/toolkits/axisartist:id8}}\end{figure} \sphinxstyleemphasis{mpl\_toolkits.axisartist.Axes} class defines a \sphinxstyleemphasis{axis} attribute, which is a dictionary of AxisArtist instances. By default, the dictionary has 4 AxisArtist instances, responsible for drawing of left, right, bottom and top axis. xaxis and yaxis attributes are still available, however they are set to not visible. As separate artists are used for rendering axis, some axis-related method in mpl may have no effect. In addition to AxisArtist instances, the mpl\_toolkits.axisartist.Axes will have \sphinxstyleemphasis{gridlines} attribute (Gridlines), which obviously draws grid lines. In both AxisArtist and Gridlines, the calculation of tick and grid location is delegated to an instance of GridHelper class. mpl\_toolkits.axisartist.Axes class uses GridHelperRectlinear as a grid helper. The GridHelperRectlinear class is a wrapper around the \sphinxstyleemphasis{xaxis} and \sphinxstyleemphasis{yaxis} of mpl’s original Axes, and it was meant to work as the way how mpl’s original axes works. For example, tick location changes using set\_ticks method and etc. should work as expected. But change in artist properties (e.g., color) will not work in general, although some effort has been made so that some often-change attributes (color, etc.) are respected. \subsubsection{AxisArtist} \label{\detokenize{tutorials/toolkits/axisartist:id1}} AxisArtist can be considered as a container artist with following attributes which will draw ticks, labels, etc. \begin{itemize} \item {} line \item {} major\_ticks, major\_ticklabels \item {} minor\_ticks, minor\_ticklabels \item {} offsetText \item {} label \end{itemize} \paragraph{line} \label{\detokenize{tutorials/toolkits/axisartist:line}} Derived from Line2d class. Responsible for drawing a spinal(?) line. \paragraph{major\_ticks, minor\_ticks} \label{\detokenize{tutorials/toolkits/axisartist:major-ticks-minor-ticks}} Derived from Line2d class. Note that ticks are markers. \paragraph{major\_ticklabels, minor\_ticklabels} \label{\detokenize{tutorials/toolkits/axisartist:major-ticklabels-minor-ticklabels}} Derived from Text. Note that it is not a list of Text artist, but a single artist (similar to a collection). \paragraph{axislabel} \label{\detokenize{tutorials/toolkits/axisartist:axislabel}} Derived from Text. \subsubsection{Default AxisArtists} \label{\detokenize{tutorials/toolkits/axisartist:default-axisartists}} By default, following for axis artists are defined.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{left}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{bottom}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{right}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{top}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]} \end{sphinxVerbatim} The ticklabels and axislabel of the top and the right axis are set to not visible. For example, if you want to change the color attributes of major\_ticklabels of the bottom x-axis \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{bottom}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{major\PYGZus{}ticklabels}\PYG{o}{.}\PYG{n}{set\PYGZus{}color}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{b}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} Similarly, to make ticklabels invisible \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{bottom}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{major\PYGZus{}ticklabels}\PYG{o}{.}\PYG{n}{set\PYGZus{}visible}\PYG{p}{(}\PYG{k+kc}{False}\PYG{p}{)} \end{sphinxVerbatim} AxisAritst provides a helper method to control the visibility of ticks, ticklabels, and label. To make ticklabel invisible, \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{bottom}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{toggle}\PYG{p}{(}\PYG{n}{ticklabels}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{)} \end{sphinxVerbatim} To make all of ticks, ticklabels, and (axis) label invisible \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{bottom}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{toggle}\PYG{p}{(}\PYG{n+nb}{all}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{)} \end{sphinxVerbatim} To turn all off but ticks on \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{bottom}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{toggle}\PYG{p}{(}\PYG{n+nb}{all}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{,} \PYG{n}{ticks}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)} \end{sphinxVerbatim} To turn all on but (axis) label off \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{bottom}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{toggle}\PYG{p}{(}\PYG{n+nb}{all}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} ax.axis’s \_\_getitem\_\_ method can take multiple axis names. For example, to turn ticklabels of “top” and “right” axis on, \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{top}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{right}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{toggle}\PYG{p}{(}\PYG{n}{ticklabels}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} Note that ‘ax.axis{[}“top”,”right”{]}’ returns a simple proxy object that translate above code to something like below. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{for} \PYG{n}{n} \PYG{o+ow}{in} \PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{top}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{right}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{n}{n}\PYG{p}{]}\PYG{o}{.}\PYG{n}{toggle}\PYG{p}{(}\PYG{n}{ticklabels}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} So, any return values in the for loop are ignored. And you should not use it anything more than a simple method. Like the list indexing “:” means all items, i.e., \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]}\PYG{o}{.}\PYG{n}{major\PYGZus{}ticks}\PYG{o}{.}\PYG{n}{set\PYGZus{}color}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} changes tick color in all axis. \subsubsection{HowTo} \label{\detokenize{tutorials/toolkits/axisartist:howto}}\begin{enumerate} \item {} Changing tick locations and label. \end{enumerate} \begin{quote} Same as the original mpl’s axes.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xticks}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \end{quote} \begin{enumerate} \setcounter{enumi}{1} \item {} Changing axis properties like color, etc. \end{enumerate} \begin{quote} Change the properties of appropriate artists. For example, to change the color of the ticklabels: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{left}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{major\PYGZus{}ticklabels}\PYG{o}{.}\PYG{n}{set\PYGZus{}color}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} \end{quote} \begin{enumerate} \setcounter{enumi}{2} \item {} To change the attributes of multiple axis: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{left}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{bottom}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{major\PYGZus{}ticklabels}\PYG{o}{.}\PYG{n}{set\PYGZus{}color}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} or to change the attributes of all axis: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]}\PYG{o}{.}\PYG{n}{major\PYGZus{}ticklabels}\PYG{o}{.}\PYG{n}{set\PYGZus{}color}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} \item {} \begin{description} \item[{To change the tick size (length), you need to use}] \leavevmode axis.major\_ticks.set\_ticksize method. To change the direction of the ticks (ticks are in opposite direction of ticklabels by default), use axis.major\_ticks.set\_tick\_out method. To change the pad between ticks and ticklabels, use axis.major\_ticklabels.set\_pad method. To change the pad between ticklabels and axis label, axis.label.set\_pad method. \end{description} \end{enumerate} \subsubsection{Rotation and Alignment of TickLabels} \label{\detokenize{tutorials/toolkits/axisartist:rotation-and-alignment-of-ticklabels}} This is also quite different from the original mpl and can be confusing. When you want to rotate the ticklabels, first consider using “set\_axis\_direction” method. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{left}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{major\PYGZus{}ticklabels}\PYG{o}{.}\PYG{n}{set\PYGZus{}axis\PYGZus{}direction}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{top}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{right}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{label}\PYG{o}{.}\PYG{n}{set\PYGZus{}axis\PYGZus{}direction}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{left}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axisartist/simple\_axis\_direction01.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_simple_axis_direction01_0011}.png}}\caption{Simple Axis Direction01}\label{\detokenize{tutorials/toolkits/axisartist:id9}}\end{figure} The parameter for set\_axis\_direction is one of {[}“left”, “right”, “bottom”, “top”{]}. You must understand some underlying concept of directions. \begin{quote} \begin{enumerate} \item {} There is a reference direction which is defined as the direction of the axis line with increasing coordinate. For example, the reference direction of the left x-axis is from bottom to top. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axisartist/axis\_direction\_demo\_step01.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_axis_direction_demo_step01_0011}.png}}\caption{Axis Direction Demo - Step 01}\label{\detokenize{tutorials/toolkits/axisartist:id10}}\end{figure} \end{enumerate} \begin{quote} The direction, text angle, and alignments of the ticks, ticklabels and axis-label is determined with respect to the reference direction \end{quote} \begin{enumerate} \setcounter{enumi}{1} \item {} \sphinxstyleemphasis{ticklabel\_direction} is either the right-hand side (+) of the reference direction or the left-hand side (-). \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axisartist/axis\_direction\_demo\_step02.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_axis_direction_demo_step02_0011}.png}}\caption{Axis Direction Demo - Step 02}\label{\detokenize{tutorials/toolkits/axisartist:id11}}\end{figure} \item {} same for the \sphinxstyleemphasis{label\_direction} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axisartist/axis\_direction\_demo\_step03.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_axis_direction_demo_step03_0011}.png}}\caption{Axis Direction Demo - Step 03}\label{\detokenize{tutorials/toolkits/axisartist:id12}}\end{figure} \item {} ticks are by default drawn toward the opposite direction of the ticklabels. \item {} text rotation of ticklabels and label is determined in reference to the \sphinxstyleemphasis{ticklabel\_direction} or \sphinxstyleemphasis{label\_direction}, respectively. The rotation of ticklabels and label is anchored. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axisartist/axis\_direction\_demo\_step04.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_axis_direction_demo_step04_0011}.png}}\caption{Axis Direction Demo - Step 04}\label{\detokenize{tutorials/toolkits/axisartist:id13}}\end{figure} \end{enumerate} \end{quote} On the other hand, there is a concept of “axis\_direction”. This is a default setting of above properties for each, “bottom”, “left”, “top”, and “right” axis. \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|T|T|T|} \hline ? & ? & left & bottom & right & top \\ \hline axislabel & direction & ‘-‘ & ‘+’ & ‘+’ & ‘-‘ \\ \hline axislabel & rotation & 180 & 0 & 0 & 180 \\ \hline axislabel & va & center & top & center & bottom \\ \hline axislabel & ha & right & center & right & center \\ \hline ticklabel & direction & ‘-‘ & ‘+’ & ‘+’ & ‘-‘ \\ \hline ticklabels & rotation & 90 & 0 & -90 & 180 \\ \hline ticklabel & ha & right & center & right & center \\ \hline ticklabel & va & center & baseline & center & baseline \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} And, ‘set\_axis\_direction(“top”)’ means to adjust the text rotation etc, for settings suitable for “top” axis. The concept of axis direction can be more clear with curved axis. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axisartist/demo\_axis\_direction.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_demo_axis_direction_0011}.png}}\caption{Demo Axis Direction}\label{\detokenize{tutorials/toolkits/axisartist:id14}}\end{figure} The axis\_direction can be adjusted in the AxisArtist level, or in the level of its child arists, i.e., ticks, ticklabels, and axis-label. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{left}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}axis\PYGZus{}direction}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{top}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} changes axis\_direction of all the associated artist with the “left” axis, while \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{left}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{major\PYGZus{}ticklabels}\PYG{o}{.}\PYG{n}{set\PYGZus{}axis\PYGZus{}direction}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{top}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} changes the axis\_direction of only the major\_ticklabels. Note that set\_axis\_direction in the AxisArtist level changes the ticklabel\_direction and label\_direction, while changing the axis\_direction of ticks, ticklabels, and axis-label does not affect them. If you want to make ticks outward and ticklabels inside the axes, use invert\_ticklabel\_direction method. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]}\PYG{o}{.}\PYG{n}{invert\PYGZus{}ticklabel\PYGZus{}direction}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} A related method is “set\_tick\_out”. It makes ticks outward (as a matter of fact, it makes ticks toward the opposite direction of the default direction). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]}\PYG{o}{.}\PYG{n}{major\PYGZus{}ticks}\PYG{o}{.}\PYG{n}{set\PYGZus{}tick\PYGZus{}out}\PYG{p}{(}\PYG{k+kc}{True}\PYG{p}{)} \end{sphinxVerbatim} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axisartist/simple\_axis\_direction03.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_simple_axis_direction03_0011}.png}}\caption{Simple Axis Direction03}\label{\detokenize{tutorials/toolkits/axisartist:id15}}\end{figure} So, in summary, \begin{itemize} \item {} \begin{description} \item[{AxisArtist’s methods}] \leavevmode\begin{itemize} \item {} set\_axis\_direction : “left”, “right”, “bottom”, or “top” \item {} set\_ticklabel\_direction : “+” or “-“ \item {} set\_axislabel\_direction : “+” or “-“ \item {} invert\_ticklabel\_direction \end{itemize} \end{description} \item {} \begin{description} \item[{Ticks’ methods (major\_ticks and minor\_ticks)}] \leavevmode\begin{itemize} \item {} set\_tick\_out : True or False \item {} set\_ticksize : size in points \end{itemize} \end{description} \item {} \begin{description} \item[{TickLabels’ methods (major\_ticklabels and minor\_ticklabels)}] \leavevmode\begin{itemize} \item {} set\_axis\_direction : “left”, “right”, “bottom”, or “top” \item {} set\_rotation : angle with respect to the reference direction \item {} set\_ha and set\_va : see below \end{itemize} \end{description} \item {} \begin{description} \item[{AxisLabels’ methods (label)}] \leavevmode\begin{itemize} \item {} set\_axis\_direction : “left”, “right”, “bottom”, or “top” \item {} set\_rotation : angle with respect to the reference direction \item {} set\_ha and set\_va \end{itemize} \end{description} \end{itemize} \paragraph{Adjusting ticklabels alignment} \label{\detokenize{tutorials/toolkits/axisartist:adjusting-ticklabels-alignment}} Alignment of TickLabels are treated specially. See below \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axisartist/demo\_ticklabel\_alignment.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_demo_ticklabel_alignment_0011}.png}}\caption{Demo Ticklabel Alignment}\label{\detokenize{tutorials/toolkits/axisartist:id16}}\end{figure} \paragraph{Adjusting pad} \label{\detokenize{tutorials/toolkits/axisartist:adjusting-pad}} To change the pad between ticks and ticklabels \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{left}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{major\PYGZus{}ticklabels}\PYG{o}{.}\PYG{n}{set\PYGZus{}pad}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)} \end{sphinxVerbatim} Or ticklabels and axis-label \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{left}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{label}\PYG{o}{.}\PYG{n}{set\PYGZus{}pad}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)} \end{sphinxVerbatim} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axisartist/simple\_axis\_pad.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_simple_axis_pad_0011}.png}}\caption{Simple Axis Pad}\label{\detokenize{tutorials/toolkits/axisartist:id17}}\end{figure} \subsubsection{GridHelper} \label{\detokenize{tutorials/toolkits/axisartist:gridhelper}} To actually define a curvilinear coordinate, you have to use your own grid helper. A generalised version of grid helper class is supplied and this class should suffice in most of cases. A user may provide two functions which defines a transformation (and its inverse pair) from the curved coordinate to (rectilinear) image coordinate. Note that while ticks and grids are drawn for curved coordinate, the data transform of the axes itself (ax.transData) is still rectilinear (image) coordinate. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{mpl\PYGZus{}toolkits}\PYG{n+nn}{.}\PYG{n+nn}{axisartist}\PYG{n+nn}{.}\PYG{n+nn}{grid\PYGZus{}helper\PYGZus{}curvelinear} \PYG{k}{import} \PYG{n}{GridHelperCurveLinear} \PYG{k+kn}{from} \PYG{n+nn}{mpl\PYGZus{}toolkits}\PYG{n+nn}{.}\PYG{n+nn}{axisartist} \PYG{k}{import} \PYG{n}{Subplot} \PYG{c+c1}{\PYGZsh{} from curved coordinate to rectlinear coordinate.} \PYG{k}{def} \PYG{n+nf}{tr}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)}\PYG{p}{:} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{asarray}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{asarray}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)} \PYG{k}{return} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{o}{\PYGZhy{}}\PYG{n}{x} \PYG{c+c1}{\PYGZsh{} from rectlinear coordinate to curved coordinate.} \PYG{k}{def} \PYG{n+nf}{inv\PYGZus{}tr}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,}\PYG{n}{y}\PYG{p}{)}\PYG{p}{:} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{asarray}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{asarray}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)} \PYG{k}{return} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{o}{+}\PYG{n}{x} \PYG{n}{grid\PYGZus{}helper} \PYG{o}{=} \PYG{n}{GridHelperCurveLinear}\PYG{p}{(}\PYG{p}{(}\PYG{n}{tr}\PYG{p}{,} \PYG{n}{inv\PYGZus{}tr}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{Subplot}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{grid\PYGZus{}helper}\PYG{o}{=}\PYG{n}{grid\PYGZus{}helper}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{)} \end{sphinxVerbatim} You may use matplotlib’s Transform instance instead (but a inverse transformation must be defined). Often, coordinate range in a curved coordinate system may have a limited range, or may have cycles. In those cases, a more customized version of grid helper is required. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{mpl\PYGZus{}toolkits}\PYG{n+nn}{.}\PYG{n+nn}{axisartist}\PYG{n+nn}{.}\PYG{n+nn}{angle\PYGZus{}helper} \PYG{k}{as} \PYG{n+nn}{angle\PYGZus{}helper} \PYG{c+c1}{\PYGZsh{} PolarAxes.PolarTransform takes radian. However, we want our coordinate} \PYG{c+c1}{\PYGZsh{} system in degree} \PYG{n}{tr} \PYG{o}{=} \PYG{n}{Affine2D}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{scale}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{o}{/}\PYG{l+m+mf}{180.}\PYG{p}{,} \PYG{l+m+mf}{1.}\PYG{p}{)} \PYG{o}{+} \PYG{n}{PolarAxes}\PYG{o}{.}\PYG{n}{PolarTransform}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} extreme finder : find a range of coordinate.} \PYG{c+c1}{\PYGZsh{} 20, 20 : number of sampling points along x, y direction} \PYG{c+c1}{\PYGZsh{} The first coordinate (longitude, but theta in polar)} \PYG{c+c1}{\PYGZsh{} has a cycle of 360 degree.} \PYG{c+c1}{\PYGZsh{} The second coordinate (latitude, but radius in polar) has a minimum of 0} \PYG{n}{extreme\PYGZus{}finder} \PYG{o}{=} \PYG{n}{angle\PYGZus{}helper}\PYG{o}{.}\PYG{n}{ExtremeFinderCycle}\PYG{p}{(}\PYG{l+m+mi}{20}\PYG{p}{,} \PYG{l+m+mi}{20}\PYG{p}{,} \PYG{n}{lon\PYGZus{}cycle} \PYG{o}{=} \PYG{l+m+mi}{360}\PYG{p}{,} \PYG{n}{lat\PYGZus{}cycle} \PYG{o}{=} \PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{lon\PYGZus{}minmax} \PYG{o}{=} \PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{lat\PYGZus{}minmax} \PYG{o}{=} \PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{inf}\PYG{p}{)}\PYG{p}{,} \PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Find a grid values appropriate for the coordinate (degree,} \PYG{c+c1}{\PYGZsh{} minute, second). The argument is a approximate number of grids.} \PYG{n}{grid\PYGZus{}locator1} \PYG{o}{=} \PYG{n}{angle\PYGZus{}helper}\PYG{o}{.}\PYG{n}{LocatorDMS}\PYG{p}{(}\PYG{l+m+mi}{12}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} And also uses an appropriate formatter. Note that,the} \PYG{c+c1}{\PYGZsh{} acceptable Locator and Formatter class is a bit different than} \PYG{c+c1}{\PYGZsh{} that of mpl\PYGZsq{}s, and you cannot directly use mpl\PYGZsq{}s Locator and} \PYG{c+c1}{\PYGZsh{} Formatter here (but may be possible in the future).} \PYG{n}{tick\PYGZus{}formatter1} \PYG{o}{=} \PYG{n}{angle\PYGZus{}helper}\PYG{o}{.}\PYG{n}{FormatterDMS}\PYG{p}{(}\PYG{p}{)} \PYG{n}{grid\PYGZus{}helper} \PYG{o}{=} \PYG{n}{GridHelperCurveLinear}\PYG{p}{(}\PYG{n}{tr}\PYG{p}{,} \PYG{n}{extreme\PYGZus{}finder}\PYG{o}{=}\PYG{n}{extreme\PYGZus{}finder}\PYG{p}{,} \PYG{n}{grid\PYGZus{}locator1}\PYG{o}{=}\PYG{n}{grid\PYGZus{}locator1}\PYG{p}{,} \PYG{n}{tick\PYGZus{}formatter1}\PYG{o}{=}\PYG{n}{tick\PYGZus{}formatter1} \PYG{p}{)} \end{sphinxVerbatim} Again, the \sphinxstyleemphasis{transData} of the axes is still a rectilinear coordinate (image coordinate). You may manually do conversion between two coordinates, or you may use Parasite Axes for convenience.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{SubplotHost}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{grid\PYGZus{}helper}\PYG{o}{=}\PYG{n}{grid\PYGZus{}helper}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} A parasite axes with given transform} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{ParasiteAxesAuxTrans}\PYG{p}{(}\PYG{n}{ax1}\PYG{p}{,} \PYG{n}{tr}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{equal}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} note that ax2.transData == tr + ax1.transData} \PYG{c+c1}{\PYGZsh{} Anthing you draw in ax2 will match the ticks and grids of ax1.} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{parasites}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{ax2}\PYG{p}{)} \end{sphinxVerbatim} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axisartist/demo\_curvelinear\_grid.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_demo_curvelinear_grid_0011}.png}}\caption{Demo Curvelinear Grid}\label{\detokenize{tutorials/toolkits/axisartist:id18}}\end{figure} \subsubsection{FloatingAxis} \label{\detokenize{tutorials/toolkits/axisartist:floatingaxis}} A floating axis is an axis one of whose data coordinate is fixed, i.e, its location is not fixed in Axes coordinate but changes as axes data limits changes. A floating axis can be created using \sphinxstyleemphasis{new\_floating\_axis} method. However, it is your responsibility that the resulting AxisArtist is properly added to the axes. A recommended way is to add it as an item of Axes’s axis attribute.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} floating axis whose first (index starts from 0) coordinate} \PYG{c+c1}{\PYGZsh{} (theta) is fixed at 60} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{axis}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{lat}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]} \PYG{o}{=} \PYG{n}{axis} \PYG{o}{=} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{new\PYGZus{}floating\PYGZus{}axis}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{60}\PYG{p}{)} \PYG{n}{axis}\PYG{o}{.}\PYG{n}{label}\PYG{o}{.}\PYG{n}{set\PYGZus{}text}\PYG{p}{(}\PYG{l+s+sa}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdl{} heta = 60\PYGZca{}}\PYG{l+s+s2}{\PYGZob{}}\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{circ\PYGZcb{}\PYGZdl{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{axis}\PYG{o}{.}\PYG{n}{label}\PYG{o}{.}\PYG{n}{set\PYGZus{}visible}\PYG{p}{(}\PYG{k+kc}{True}\PYG{p}{)} \end{sphinxVerbatim} See the first example of this page. \subsubsection{Current Limitations and TODO’s} \label{\detokenize{tutorials/toolkits/axisartist:current-limitations-and-todo-s}} The code need more refinement. Here is a incomplete list of issues and TODO’s \begin{itemize} \item {} No easy way to support a user customized tick location (for curvilinear grid). A new Locator class needs to be created. \item {} FloatingAxis may have coordinate limits, e.g., a floating axis of x = 0, but y only spans from 0 to 1. \item {} The location of axislabel of FloatingAxis needs to be optionally given as a coordinate value. ex, a floating axis of x=0 with label at y=1 \end{itemize} \phantomsection\label{\detokenize{tutorials/toolkits/axisartist:sphx-glr-download-tutorials-toolkits-axisartist-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{tutorials/toolkits/axes_grid:sphx-glr-download-tutorials-toolkits-axes-grid-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsection{Overview of axes\_grid1 toolkit} \label{\detokenize{tutorials/toolkits/axes_grid:overview-of-axes-grid1-toolkit}}\label{\detokenize{tutorials/toolkits/axes_grid:sphx-glr-tutorials-toolkits-axes-grid-py}}\label{\detokenize{tutorials/toolkits/axes_grid::doc}} Controlling the layout of plots with the axes\_grid toolkit. \subsubsection{What is axes\_grid1 toolkit?} \label{\detokenize{tutorials/toolkits/axes_grid:what-is-axes-grid1-toolkit}}\label{\detokenize{tutorials/toolkits/axes_grid:axes-grid1-users-guide-index}} \sphinxstyleemphasis{axes\_grid1} is a collection of helper classes to ease displaying (multiple) images with matplotlib. In matplotlib, the axes location (and size) is specified in the normalized figure coordinates, which may not be ideal for displaying images that needs to have a given aspect ratio. For example, it helps if you have a colorbar whose height always matches that of the image. {\hyperref[\detokenize{tutorials/toolkits/axes_grid:imagegrid}]{\sphinxcrossref{ImageGrid}}}, {\hyperref[\detokenize{tutorials/toolkits/axes_grid:rgb-axes}]{\sphinxcrossref{RGB Axes}}} and {\hyperref[\detokenize{tutorials/toolkits/axes_grid:axesdivider}]{\sphinxcrossref{AxesDivider}}} are helper classes that deals with adjusting the location of (multiple) Axes. They provides a framework to adjust the position of multiple axes at the drawing time. {\hyperref[\detokenize{tutorials/toolkits/axes_grid:parasiteaxes}]{\sphinxcrossref{ParasiteAxes}}} provides twinx(or twiny)-like features so that you can plot different data (e.g., different y-scale) in a same Axes. {\hyperref[\detokenize{tutorials/toolkits/axes_grid:anchoredartists}]{\sphinxcrossref{AnchoredArtists}}} includes custom artists which are placed at some anchored position, like the legend. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axes\_grid1/demo\_axes\_grid.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_demo_axes_grid_0011}.png}}\caption{Demo Axes Grid}\label{\detokenize{tutorials/toolkits/axes_grid:id1}}\end{figure} \subsubsection{axes\_grid1} \label{\detokenize{tutorials/toolkits/axes_grid:axes-grid1}} \paragraph{ImageGrid} \label{\detokenize{tutorials/toolkits/axes_grid:imagegrid}} A class that creates a grid of Axes. In matplotlib, the axes location (and size) is specified in the normalized figure coordinates. This may not be ideal for images that needs to be displayed with a given aspect ratio. For example, displaying images of a same size with some fixed padding between them cannot be easily done in matplotlib. ImageGrid is used in such case. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axes\_grid1/simple\_axesgrid.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_simple_axesgrid_0011}.png}}\caption{Simple Axesgrid}\label{\detokenize{tutorials/toolkits/axes_grid:id2}}\end{figure} \begin{itemize} \item {} The position of each axes is determined at the drawing time (see {\hyperref[\detokenize{tutorials/toolkits/axes_grid:axesdivider}]{\sphinxcrossref{AxesDivider}}}), so that the size of the entire grid fits in the given rectangle (like the aspect of axes). Note that in this example, the paddings between axes are fixed even if you changes the figure size. \item {} axes in the same column has a same axes width (in figure coordinate), and similarly, axes in the same row has a same height. The widths (height) of the axes in the same row (column) are scaled according to their view limits (xlim or ylim). \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axes\_grid1/simple\_axesgrid2.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_simple_axesgrid2_0011}.png}}\caption{Simple Axes Grid}\label{\detokenize{tutorials/toolkits/axes_grid:id3}}\end{figure} \item {} xaxis are shared among axes in a same column. Similarly, yaxis are shared among axes in a same row. Therefore, changing axis properties (view limits, tick location, etc. either by plot commands or using your mouse in interactive backends) of one axes will affect all other shared axes. \end{itemize} When initialized, ImageGrid creates given number (\sphinxstyleemphasis{ngrids} or \sphinxstyleemphasis{ncols} * \sphinxstyleemphasis{nrows} if \sphinxstyleemphasis{ngrids} is None) of Axes instances. A sequence-like interface is provided to access the individual Axes instances (e.g., grid{[}0{]} is the first Axes in the grid. See below for the order of axes). ImageGrid takes following arguments, \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily Name &\sphinxstyletheadfamily Default &\sphinxstyletheadfamily Description \\ \hline fig &&\\ \hline rect &&\\ \hline nrows\_ncols && number of rows and cols. e.g., (2,2) \\ \hline ngrids & None & number of grids. nrows x ncols if None \\ \hline direction & “row” & increasing direction of axes number. {[}row\textbar{}column{]} \\ \hline axes\_pad & 0.02 & pad between axes in inches \\ \hline add\_all & True & Add axes to figures if True \\ \hline share\_all & False & xaxis \& yaxis of all axes are shared if True \\ \hline aspect & True & aspect of axes \\ \hline label\_mode & “L” & location of tick labels thaw will be displayed. “1” (only the lower left axes), “L” (left most and bottom most axes), or “all”. \\ \hline cbar\_mode & None & {[}None\textbar{}single\textbar{}each{]} \\ \hline cbar\_location & “right” & {[}right\textbar{}top{]} \\ \hline cbar\_pad & None & pad between image axes and colorbar axes \\ \hline cbar\_size & “5\%” & size of the colorbar \\ \hline axes\_class & None &\\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \begin{description} \item[{\sphinxstyleemphasis{rect}}] \leavevmode specifies the location of the grid. You can either specify coordinates of the rectangle to be used (e.g., (0.1, 0.1, 0.8, 0.8) as in the Axes), or the subplot-like position (e.g., “121”). \item[{\sphinxstyleemphasis{direction}}] \leavevmode means the increasing direction of the axes number. \item[{\sphinxstyleemphasis{aspect}}] \leavevmode By default (False), widths and heights of axes in the grid are scaled independently. If True, they are scaled according to their data limits (similar to aspect parameter in mpl). \item[{\sphinxstyleemphasis{share\_all}}] \leavevmode if True, xaxis and yaxis of all axes are shared. \item[{\sphinxstyleemphasis{direction}}] \leavevmode direction of increasing axes number. For “row”, \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline grid{[}0{]} & grid{[}1{]} \\ \hline grid{[}2{]} & grid{[}3{]} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} For “column”, \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline grid{[}0{]} & grid{[}2{]} \\ \hline grid{[}1{]} & grid{[}3{]} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \end{description} \end{quote} You can also create a colorbar (or colorbars). You can have colorbar for each axes (cbar\_mode=”each”), or you can have a single colorbar for the grid (cbar\_mode=”single”). The colorbar can be placed on your right, or top. The axes for each colorbar is stored as a \sphinxstyleemphasis{cbar\_axes} attribute. The examples below show what you can do with ImageGrid. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axes\_grid1/demo\_axes\_grid.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_demo_axes_grid_0011}.png}}\caption{Demo Axes Grid}\label{\detokenize{tutorials/toolkits/axes_grid:id4}}\end{figure} \paragraph{AxesDivider Class} \label{\detokenize{tutorials/toolkits/axes_grid:axesdivider-class}} Behind the scene, the ImageGrid class and the RGBAxes class utilize the AxesDivider class, whose role is to calculate the location of the axes at drawing time. While a more about the AxesDivider is (will be) explained in (yet to be written) AxesDividerGuide, direct use of the AxesDivider class will not be necessary for most users. The axes\_divider module provides a helper function make\_axes\_locatable, which can be useful. It takes a existing axes instance and create a divider for it. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax} \PYG{o}{=} \PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{divider} \PYG{o}{=} \PYG{n}{make\PYGZus{}axes\PYGZus{}locatable}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \end{sphinxVerbatim} \sphinxstyleemphasis{make\_axes\_locatable} returns an instance of the AxesLocator class, derived from the Locator. It provides \sphinxstyleemphasis{append\_axes} method that creates a new axes on the given side of (“top”, “right”, “bottom” and “left”) of the original axes. \paragraph{colorbar whose height (or width) in sync with the master axes} \label{\detokenize{tutorials/toolkits/axes_grid:colorbar-whose-height-or-width-in-sync-with-the-master-axes}} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axes\_grid1/simple\_colorbar.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_simple_colorbar_0011}.png}}\caption{Simple Colorbar}\label{\detokenize{tutorials/toolkits/axes_grid:id5}}\end{figure} \subparagraph{scatter\_hist.py with AxesDivider} \label{\detokenize{tutorials/toolkits/axes_grid:scatter-hist-py-with-axesdivider}} The “scatter\_hist.py” example in mpl can be rewritten using \sphinxstyleemphasis{make\_axes\_locatable}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{axScatter} \PYG{o}{=} \PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{axScatter}\PYG{o}{.}\PYG{n}{scatter}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{n}{axScatter}\PYG{o}{.}\PYG{n}{set\PYGZus{}aspect}\PYG{p}{(}\PYG{l+m+mf}{1.}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} create new axes on the right and on the top of the current axes.} \PYG{n}{divider} \PYG{o}{=} \PYG{n}{make\PYGZus{}axes\PYGZus{}locatable}\PYG{p}{(}\PYG{n}{axScatter}\PYG{p}{)} \PYG{n}{axHistx} \PYG{o}{=} \PYG{n}{divider}\PYG{o}{.}\PYG{n}{append\PYGZus{}axes}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{top}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{size}\PYG{o}{=}\PYG{l+m+mf}{1.2}\PYG{p}{,} \PYG{n}{pad}\PYG{o}{=}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{n}{sharex}\PYG{o}{=}\PYG{n}{axScatter}\PYG{p}{)} \PYG{n}{axHisty} \PYG{o}{=} \PYG{n}{divider}\PYG{o}{.}\PYG{n}{append\PYGZus{}axes}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{right}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{size}\PYG{o}{=}\PYG{l+m+mf}{1.2}\PYG{p}{,} \PYG{n}{pad}\PYG{o}{=}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{n}{sharey}\PYG{o}{=}\PYG{n}{axScatter}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} the scatter plot:} \PYG{c+c1}{\PYGZsh{} histograms} \PYG{n}{bins} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{n}{lim}\PYG{p}{,} \PYG{n}{lim} \PYG{o}{+} \PYG{n}{binwidth}\PYG{p}{,} \PYG{n}{binwidth}\PYG{p}{)} \PYG{n}{axHistx}\PYG{o}{.}\PYG{n}{hist}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{bins}\PYG{o}{=}\PYG{n}{bins}\PYG{p}{)} \PYG{n}{axHisty}\PYG{o}{.}\PYG{n}{hist}\PYG{p}{(}\PYG{n}{y}\PYG{p}{,} \PYG{n}{bins}\PYG{o}{=}\PYG{n}{bins}\PYG{p}{,} \PYG{n}{orientation}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{horizontal}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} See the full source code below. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axes\_grid1/scatter\_hist\_locatable\_axes.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_scatter_hist_locatable_axes_0011}.png}}\caption{Scatter Hist}\label{\detokenize{tutorials/toolkits/axes_grid:id6}}\end{figure} The scatter\_hist using the AxesDivider has some advantage over the original scatter\_hist.py in mpl. For example, you can set the aspect ratio of the scatter plot, even with the x-axis or y-axis is shared accordingly. \paragraph{ParasiteAxes} \label{\detokenize{tutorials/toolkits/axes_grid:parasiteaxes}} The ParasiteAxes is an axes whose location is identical to its host axes. The location is adjusted in the drawing time, thus it works even if the host change its location (e.g., images). In most cases, you first create a host axes, which provides a few method that can be used to create parasite axes. They are \sphinxstyleemphasis{twinx}, \sphinxstyleemphasis{twiny} (which are similar to twinx and twiny in the matplotlib) and \sphinxstyleemphasis{twin}. \sphinxstyleemphasis{twin} takes an arbitrary transformation that maps between the data coordinates of the host axes and the parasite axes. \sphinxstyleemphasis{draw} method of the parasite axes are never called. Instead, host axes collects artists in parasite axes and draw them as if they belong to the host axes, i.e., artists in parasite axes are merged to those of the host axes and then drawn according to their zorder. The host and parasite axes modifies some of the axes behavior. For example, color cycle for plot lines are shared between host and parasites. Also, the legend command in host, creates a legend that includes lines in the parasite axes. To create a host axes, you may use \sphinxstyleemphasis{host\_suplot} or \sphinxstyleemphasis{host\_axes} command. \subparagraph{Example 1. twinx} \label{\detokenize{tutorials/toolkits/axes_grid:example-1-twinx}} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axes\_grid1/parasite\_simple.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_parasite_simple_0011}.png}}\caption{Parasite Simple}\label{\detokenize{tutorials/toolkits/axes_grid:id7}}\end{figure} \subparagraph{Example 2. twin} \label{\detokenize{tutorials/toolkits/axes_grid:example-2-twin}} \sphinxstyleemphasis{twin} without a transform argument assumes that the parasite axes has the same data transform as the host. This can be useful when you want the top(or right)-axis to have different tick-locations, tick-labels, or tick-formatter for bottom(or left)-axis. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{twin}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} now, ax2 is responsible for \PYGZdq{}top\PYGZdq{} axis and \PYGZdq{}right\PYGZdq{} axis} \PYG{n}{ax2}\PYG{o}{.}\PYG{n}{set\PYGZus{}xticks}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mf}{0.}\PYG{p}{,} \PYG{o}{.}\PYG{l+m+mi}{5}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{,} \PYG{l+m+mf}{1.5}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax2}\PYG{o}{.}\PYG{n}{set\PYGZus{}xticklabels}\PYG{p}{(}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{0}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+sa}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdl{} rac}\PYG{l+s+si}{\PYGZob{}1\PYGZcb{}}\PYG{l+s+si}{\PYGZob{}2\PYGZcb{}}\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{pi\PYGZdl{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+sa}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdl{}}\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{pi\PYGZdl{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+sa}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdl{} rac}\PYG{l+s+si}{\PYGZob{}3\PYGZcb{}}\PYG{l+s+si}{\PYGZob{}2\PYGZcb{}}\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{pi\PYGZdl{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+sa}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdl{}2}\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{pi\PYGZdl{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axes\_grid1/simple\_axisline4.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_simple_axisline4_0011}.png}}\caption{Simple Axisline4}\label{\detokenize{tutorials/toolkits/axes_grid:id8}}\end{figure} A more sophisticated example using twin. Note that if you change the x-limit in the host axes, the x-limit of the parasite axes will change accordingly. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axes\_grid1/parasite\_simple2.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_parasite_simple2_0011}.png}}\caption{Parasite Simple2}\label{\detokenize{tutorials/toolkits/axes_grid:id9}}\end{figure} \paragraph{AnchoredArtists} \label{\detokenize{tutorials/toolkits/axes_grid:anchoredartists}} It’s a collection of artists whose location is anchored to the (axes) bbox, like the legend. It is derived from \sphinxstyleemphasis{OffsetBox} in mpl, and artist need to be drawn in the canvas coordinate. But, there is a limited support for an arbitrary transform. For example, the ellipse in the example below will have width and height in the data coordinate. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axes\_grid1/simple\_anchored\_artists.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_simple_anchored_artists_0011}.png}}\caption{Simple Anchored Artists}\label{\detokenize{tutorials/toolkits/axes_grid:id10}}\end{figure} \paragraph{InsetLocator} \label{\detokenize{tutorials/toolkits/axes_grid:insetlocator}} \sphinxcode{\sphinxupquote{mpl\_toolkits.axes\_grid1.inset\_locator}} provides helper classes and functions to place your (inset) axes at the anchored position of the parent axes, similarly to AnchoredArtist. Using \sphinxcode{\sphinxupquote{mpl\_toolkits.axes\_grid1.inset\_locator.inset\_axes()}}, you can have inset axes whose size is either fixed, or a fixed proportion of the parent axes. For example,: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{inset\PYGZus{}axes} \PYG{o}{=} \PYG{n}{inset\PYGZus{}axes}\PYG{p}{(}\PYG{n}{parent\PYGZus{}axes}\PYG{p}{,} \PYG{n}{width}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{30}\PYG{l+s+s2}{\PYGZpc{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} width = 30\PYGZpc{} of parent\PYGZus{}bbox} \PYG{n}{height}\PYG{o}{=}\PYG{l+m+mf}{1.}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} height : 1 inch} \PYG{n}{loc}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{)} \end{sphinxVerbatim} creates an inset axes whose width is 30\% of the parent axes and whose height is fixed at 1 inch. You may creates your inset whose size is determined so that the data scale of the inset axes to be that of the parent axes multiplied by some factor. For example, \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{inset\PYGZus{}axes} \PYG{o}{=} \PYG{n}{zoomed\PYGZus{}inset\PYGZus{}axes}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} zoom = 0.5} \PYG{n}{loc}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{)} \end{sphinxVerbatim} creates an inset axes whose data scale is half of the parent axes. Here is complete examples. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axes\_grid1/inset\_locator\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_inset_locator_demo_0011}.png}}\caption{Inset Locator Demo}\label{\detokenize{tutorials/toolkits/axes_grid:id11}}\end{figure} For example, \sphinxcode{\sphinxupquote{zoomed\_inset\_axes()}} can be used when you want the inset represents the zoom-up of the small portion in the parent axes. And \sphinxcode{\sphinxupquote{mpl\_toolkits/axes\_grid/inset\_locator}} provides a helper function \sphinxcode{\sphinxupquote{mark\_inset()}} to mark the location of the area represented by the inset axes. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axes\_grid1/inset\_locator\_demo2.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_inset_locator_demo2_0011}.png}}\caption{Inset Locator Demo2}\label{\detokenize{tutorials/toolkits/axes_grid:id12}}\end{figure} \subparagraph{RGB Axes} \label{\detokenize{tutorials/toolkits/axes_grid:rgb-axes}} RGBAxes is a helper class to conveniently show RGB composite images. Like ImageGrid, the location of axes are adjusted so that the area occupied by them fits in a given rectangle. Also, the xaxis and yaxis of each axes are shared. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{mpl\PYGZus{}toolkits}\PYG{n+nn}{.}\PYG{n+nn}{axes\PYGZus{}grid1}\PYG{n+nn}{.}\PYG{n+nn}{axes\PYGZus{}rgb} \PYG{k}{import} \PYG{n}{RGBAxes} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{RGBAxes}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.8}\PYG{p}{,} \PYG{l+m+mf}{0.8}\PYG{p}{]}\PYG{p}{)} \PYG{n}{r}\PYG{p}{,} \PYG{n}{g}\PYG{p}{,} \PYG{n}{b} \PYG{o}{=} \PYG{n}{get\PYGZus{}rgb}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} r,g,b are 2\PYGZhy{}d images} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{imshow\PYGZus{}rgb}\PYG{p}{(}\PYG{n}{r}\PYG{p}{,} \PYG{n}{g}\PYG{p}{,} \PYG{n}{b}\PYG{p}{,} \PYG{n}{origin}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{lower}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{interpolation}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{nearest}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axes\_grid1/simple\_rgb.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_simple_rgb_0011}.png}}\caption{Simple Rgb}\label{\detokenize{tutorials/toolkits/axes_grid:id13}}\end{figure} \subsubsection{AxesDivider} \label{\detokenize{tutorials/toolkits/axes_grid:axesdivider}} The axes\_divider module provides helper classes to adjust the axes positions of a set of images at drawing time. \begin{itemize} \item {} \sphinxcode{\sphinxupquote{axes\_size}} provides a class of units that are used to determine the size of each axes. For example, you can specify a fixed size. \item {} \sphinxcode{\sphinxupquote{Divider}} is the class that calculates the axes position. It divides the given rectangular area into several areas. The divider is initialized by setting the lists of horizontal and vertical sizes on which the division will be based. Then use \sphinxcode{\sphinxupquote{new\_locator()}}, which returns a callable object that can be used to set the axes\_locator of the axes. \end{itemize} First, initialize the divider by specifying its grids, i.e., horizontal and vertical. for example,: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{rect} \PYG{o}{=} \PYG{p}{[}\PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{l+m+mf}{0.6}\PYG{p}{,} \PYG{l+m+mf}{0.6}\PYG{p}{]} \PYG{n}{horiz}\PYG{o}{=}\PYG{p}{[}\PYG{n}{h0}\PYG{p}{,} \PYG{n}{h1}\PYG{p}{,} \PYG{n}{h2}\PYG{p}{,} \PYG{n}{h3}\PYG{p}{]} \PYG{n}{vert}\PYG{o}{=}\PYG{p}{[}\PYG{n}{v0}\PYG{p}{,} \PYG{n}{v1}\PYG{p}{,} \PYG{n}{v2}\PYG{p}{]} \PYG{n}{divider} \PYG{o}{=} \PYG{n}{Divider}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{rect}\PYG{p}{,} \PYG{n}{horiz}\PYG{p}{,} \PYG{n}{vert}\PYG{p}{)} \end{sphinxVerbatim} where, rect is a bounds of the box that will be divided and h0,..h3, v0,..v2 need to be an instance of classes in the \sphinxcode{\sphinxupquote{axes\_size}}. They have \sphinxstyleemphasis{get\_size} method that returns a tuple of two floats. The first float is the relative size, and the second float is the absolute size. Consider a following grid. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|T|} \hline v0 &&&\\ \hline v1 &&&\\ \hline h0,v2 & h1 & h2 & h3 \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \begin{itemize} \item {} v0 =\textgreater{} 0, 2 \item {} v1 =\textgreater{} 2, 0 \item {} v2 =\textgreater{} 3, 0 \end{itemize} The height of the bottom row is always 2 (axes\_divider internally assumes that the unit is inches). The first and the second rows have a height ratio of 2:3. For example, if the total height of the grid is 6, then the first and second row will each occupy 2/(2+3) and 3/(2+3) of (6-1) inches. The widths of the horizontal columns will be similarly determined. When the aspect ratio is set, the total height (or width) will be adjusted accordingly. The \sphinxcode{\sphinxupquote{mpl\_toolkits.axes\_grid1.axes\_size}} contains several classes that can be used to set the horizontal and vertical configurations. For example, for vertical configuration one could use: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{mpl\PYGZus{}toolkits}\PYG{n+nn}{.}\PYG{n+nn}{axes\PYGZus{}grid1}\PYG{n+nn}{.}\PYG{n+nn}{axes\PYGZus{}size} \PYG{k}{import} \PYG{n}{Fixed}\PYG{p}{,} \PYG{n}{Scaled} \PYG{n}{vert} \PYG{o}{=} \PYG{p}{[}\PYG{n}{Fixed}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{,} \PYG{n}{Scaled}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{,} \PYG{n}{Scaled}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{]} \end{sphinxVerbatim} After you set up the divider object, then you create a locator instance that will be given to the axes object.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{locator} \PYG{o}{=} \PYG{n}{divider}\PYG{o}{.}\PYG{n}{new\PYGZus{}locator}\PYG{p}{(}\PYG{n}{nx}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{ny}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}axes\PYGZus{}locator}\PYG{p}{(}\PYG{n}{locator}\PYG{p}{)} \end{sphinxVerbatim} The return value of the new\_locator method is an instance of the AxesLocator class. It is a callable object that returns the location and size of the cell at the first column and the second row. You may create a locator that spans over multiple cells.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{locator} \PYG{o}{=} \PYG{n}{divider}\PYG{o}{.}\PYG{n}{new\PYGZus{}locator}\PYG{p}{(}\PYG{n}{nx}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{nx}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{ny}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{)} \end{sphinxVerbatim} The above locator, when called, will return the position and size of the cells spanning the first and second column and the first row. In this example, it will return {[}0:2, 1{]}. See the example, \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axes\_grid1/simple\_axes\_divider2.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_simple_axes_divider2_0011}.png}}\caption{Simple Axes Divider2}\label{\detokenize{tutorials/toolkits/axes_grid:id14}}\end{figure} You can adjust the size of each axes according to its x or y data limits (AxesX and AxesY). \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/axes\_grid1/simple\_axes\_divider3.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_simple_axes_divider3_0011}.png}}\caption{Simple Axes Divider3}\label{\detokenize{tutorials/toolkits/axes_grid:id15}}\end{figure} \phantomsection\label{\detokenize{tutorials/toolkits/axes_grid:sphx-glr-download-tutorials-toolkits-axes-grid-py}} \chapter{Interactive plots} \label{\detokenize{users/interactive:interactive-plots}}\label{\detokenize{users/interactive:dump-index}}\label{\detokenize{users/interactive::doc}} \section{Interactive navigation} \label{\detokenize{users/navigation_toolbar:interactive-navigation}}\label{\detokenize{users/navigation_toolbar:navigation-toolbar}}\label{\detokenize{users/navigation_toolbar::doc}} \noindent\sphinxincludegraphics{{toolbar}.png} All figure windows come with a navigation toolbar, which can be used to navigate through the data set. Here is a description of each of the buttons at the bottom of the toolbar \noindent\sphinxincludegraphics{{home_large}.png} \noindent\sphinxincludegraphics{{back_large}.png} \noindent\sphinxincludegraphics{{forward_large}.png} \begin{description} \item[{The \sphinxcode{\sphinxupquote{Home}}, \sphinxcode{\sphinxupquote{Forward}} and \sphinxcode{\sphinxupquote{Back}} buttons}] \leavevmode These are akin to a web browser’s home, forward and back controls. \sphinxcode{\sphinxupquote{Forward}} and \sphinxcode{\sphinxupquote{Back}} are used to navigate back and forth between previously defined views. They have no meaning unless you have already navigated somewhere else using the pan and zoom buttons. This is analogous to trying to click \sphinxcode{\sphinxupquote{Back}} on your web browser before visiting a new page or \sphinxcode{\sphinxupquote{Forward}} before you have gone back to a page \textendash{} nothing happens. \sphinxcode{\sphinxupquote{Home}} always takes you to the first, default view of your data. Again, all of these buttons should feel very familiar to any user of a web browser. \end{description} \noindent\sphinxincludegraphics{{move_large}.png} \begin{description} \item[{The \sphinxcode{\sphinxupquote{Pan/Zoom}} button}] \leavevmode This button has two modes: pan and zoom. Click the toolbar button to activate panning and zooming, then put your mouse somewhere over an axes. Press the left mouse button and hold it to pan the figure, dragging it to a new position. When you release it, the data under the point where you pressed will be moved to the point where you released. If you press ‘x’ or ‘y’ while panning the motion will be constrained to the x or y axis, respectively. Press the right mouse button to zoom, dragging it to a new position. The x axis will be zoomed in proportionately to the rightward movement and zoomed out proportionately to the leftward movement. The same is true for the y axis and up/down motions. The point under your mouse when you begin the zoom remains stationary, allowing you to zoom in or out around that point as much as you wish. You can use the modifier keys ‘x’, ‘y’ or ‘CONTROL’ to constrain the zoom to the x axis, the y axis, or aspect ratio preserve, respectively. With polar plots, the pan and zoom functionality behaves differently. The radius axis labels can be dragged using the left mouse button. The radius scale can be zoomed in and out using the right mouse button. \end{description} \noindent\sphinxincludegraphics{{zoom_to_rect_large}.png} \begin{description} \item[{The \sphinxcode{\sphinxupquote{Zoom-to-rectangle}} button}] \leavevmode Click this toolbar button to activate this mode. Put your mouse somewhere over an axes and press a mouse button. Define a rectangular region by dragging the mouse while holding the button to a new location. When using the left mouse button, the axes view limits will be zoomed to the defined region. When using the right mouse button, the axes view limits will be zoomed out, placing the original axes in the defined region. \end{description} \noindent\sphinxincludegraphics{{subplots_large}.png} \begin{description} \item[{The \sphinxcode{\sphinxupquote{Subplot-configuration}} button}] \leavevmode Use this tool to configure the appearance of the subplot: you can stretch or compress the left, right, top, or bottom side of the subplot, or the space between the rows or space between the columns. \end{description} \noindent\sphinxincludegraphics{{filesave_large}.png} \begin{description} \item[{The \sphinxcode{\sphinxupquote{Save}} button}] \leavevmode Click this button to launch a file save dialog. You can save files with the following extensions: \sphinxcode{\sphinxupquote{png}}, \sphinxcode{\sphinxupquote{ps}}, \sphinxcode{\sphinxupquote{eps}}, \sphinxcode{\sphinxupquote{svg}} and \sphinxcode{\sphinxupquote{pdf}}. \end{description} \subsection{Navigation Keyboard Shortcuts} \label{\detokenize{users/navigation_toolbar:navigation-keyboard-shortcuts}}\label{\detokenize{users/navigation_toolbar:key-event-handling}} The following table holds all the default keys, which can be overwritten by use of your matplotlibrc (\#keymap.*). \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Command &\sphinxstyletheadfamily Keyboard Shortcut(s) \\ \hline Home/Reset & \sphinxstylestrong{h} or \sphinxstylestrong{r} or \sphinxstylestrong{home} \\ \hline Back & \sphinxstylestrong{c} or \sphinxstylestrong{left arrow} or \sphinxstylestrong{backspace} \\ \hline Forward & \sphinxstylestrong{v} or \sphinxstylestrong{right arrow} \\ \hline Pan/Zoom & \sphinxstylestrong{p} \\ \hline Zoom-to-rect & \sphinxstylestrong{o} \\ \hline Save & \sphinxstylestrong{ctrl} + \sphinxstylestrong{s} \\ \hline Toggle fullscreen & \sphinxstylestrong{f} or \sphinxstylestrong{ctrl} + \sphinxstylestrong{f} \\ \hline Close plot & \sphinxstylestrong{ctrl} + \sphinxstylestrong{w} \\ \hline Close all plots & \sphinxstylestrong{shift} + \sphinxstylestrong{w} \\ \hline Constrain pan/zoom to x axis & hold \sphinxstylestrong{x} when panning/zooming with mouse \\ \hline Constrain pan/zoom to y axis & hold \sphinxstylestrong{y} when panning/zooming with mouse \\ \hline Preserve aspect ratio & hold \sphinxstylestrong{CONTROL} when panning/zooming with mouse \\ \hline Toggle major grids & \sphinxstylestrong{g} when mouse is over an axes \\ \hline Toggle minor grids & \sphinxstylestrong{G} when mouse is over an axes \\ \hline Toggle x axis scale (log/linear) & \sphinxstylestrong{L} or \sphinxstylestrong{k} when mouse is over an axes \\ \hline Toggle y axis scale (log/linear) & \sphinxstylestrong{l} when mouse is over an axes \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} If you are using {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot}}}}} the toolbar will be created automatically for every figure. If you are writing your own user interface code, you can add the toolbar as a widget. The exact syntax depends on your UI, but we have examples for every supported UI in the \sphinxcode{\sphinxupquote{matplotlib/examples/user\_interfaces}} directory. Here is some example code for GTK: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{gtk} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{figure} \PYG{k}{import} \PYG{n}{Figure} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{backends}\PYG{n+nn}{.}\PYG{n+nn}{backend\PYGZus{}gtkagg} \PYG{k}{import} \PYG{n}{FigureCanvasGTKAgg} \PYG{k}{as} \PYG{n}{FigureCanvas} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{backends}\PYG{n+nn}{.}\PYG{n+nn}{backend\PYGZus{}gtkagg} \PYG{k}{import} \PYG{n}{NavigationToolbar2GTKAgg} \PYG{k}{as} \PYG{n}{NavigationToolbar} \PYG{n}{win} \PYG{o}{=} \PYG{n}{gtk}\PYG{o}{.}\PYG{n}{Window}\PYG{p}{(}\PYG{p}{)} \PYG{n}{win}\PYG{o}{.}\PYG{n}{connect}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{destroy}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{k}{lambda} \PYG{n}{x}\PYG{p}{:} \PYG{n}{gtk}\PYG{o}{.}\PYG{n}{main\PYGZus{}quit}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{n}{win}\PYG{o}{.}\PYG{n}{set\PYGZus{}default\PYGZus{}size}\PYG{p}{(}\PYG{l+m+mi}{400}\PYG{p}{,}\PYG{l+m+mi}{300}\PYG{p}{)} \PYG{n}{win}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Embedding in GTK}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{vbox} \PYG{o}{=} \PYG{n}{gtk}\PYG{o}{.}\PYG{n}{VBox}\PYG{p}{(}\PYG{p}{)} \PYG{n}{win}\PYG{o}{.}\PYG{n}{add}\PYG{p}{(}\PYG{n}{vbox}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{Figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{,} \PYG{n}{dpi}\PYG{o}{=}\PYG{l+m+mi}{100}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \PYG{n}{canvas} \PYG{o}{=} \PYG{n}{FigureCanvas}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} a gtk.DrawingArea} \PYG{n}{vbox}\PYG{o}{.}\PYG{n}{pack\PYGZus{}start}\PYG{p}{(}\PYG{n}{canvas}\PYG{p}{)} \PYG{n}{toolbar} \PYG{o}{=} \PYG{n}{NavigationToolbar}\PYG{p}{(}\PYG{n}{canvas}\PYG{p}{,} \PYG{n}{win}\PYG{p}{)} \PYG{n}{vbox}\PYG{o}{.}\PYG{n}{pack\PYGZus{}start}\PYG{p}{(}\PYG{n}{toolbar}\PYG{p}{,} \PYG{k+kc}{False}\PYG{p}{,} \PYG{k+kc}{False}\PYG{p}{)} \PYG{n}{win}\PYG{o}{.}\PYG{n}{show\PYGZus{}all}\PYG{p}{(}\PYG{p}{)} \PYG{n}{gtk}\PYG{o}{.}\PYG{n}{main}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \section{Using matplotlib in a python shell} \label{\detokenize{users/shell:using-matplotlib-in-a-python-shell}}\label{\detokenize{users/shell:mpl-shell}}\label{\detokenize{users/shell::doc}} \begin{sphinxadmonition}{warning}{Warning:} This page is significantly out of date \end{sphinxadmonition} By default, matplotlib defers drawing until the end of the script because drawing can be an expensive operation, and you may not want to update the plot every time a single property is changed, only once after all the properties have changed. But when working from the python shell, you usually do want to update the plot with every command, e.g., after changing the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xlabel:matplotlib.pyplot.xlabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xlabel()}}}}}, or the marker style of a line. While this is simple in concept, in practice it can be tricky, because matplotlib is a graphical user interface application under the hood, and there are some tricks to make the applications work right in a python shell. \subsection{IPython to the rescue} \label{\detokenize{users/shell:ipython-to-the-rescue}}\label{\detokenize{users/shell:ipython-pylab}} \begin{sphinxadmonition}{note}{Note:} The mode described here still exists for historical reasons, but it is highly advised not to use. It pollutes namespaces with functions that will shadow python built-in and can lead to hard to track bugs. To get IPython integration without imports the use of the \sphinxcode{\sphinxupquote{\%matplotlib}} magic is preferred. See \sphinxhref{https://ipython.readthedocs.io/en/stable/interactive/reference.html\#plotting-with-matplotlib}{ipython documentation} . \end{sphinxadmonition} Fortunately, \sphinxhref{http://ipython.org/}{ipython}, an enhanced interactive python shell, has figured out all of these tricks, and is matplotlib aware, so when you start ipython in the \sphinxstyleemphasis{pylab} mode. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+go}{johnh@flag:\PYGZti{}\PYGZgt{} ipython} \PYG{g+go}{Python 2.4.5 (\PYGZsh{}4, Apr 12 2008, 09:09:16)} \PYG{g+go}{IPython 0.9.0 \PYGZhy{}\PYGZhy{} An enhanced Interactive Python.} \PYG{g+gp}{In [1]: }\PYG{o}{\PYGZpc{}}\PYG{k}{pylab} \PYG{g+go}{ Welcome to pylab, a matplotlib\PYGZhy{}based Python environment.} \PYG{g+go}{ For more information, type \PYGZsq{}help(pylab)\PYGZsq{}.} \PYG{g+gp}{In [2]: }\PYG{n}{x} \PYG{o}{=} \PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{10000}\PYG{p}{)} \PYG{g+gp}{In [3]: }\PYG{n}{hist}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{)} \end{sphinxVerbatim} it sets everything up for you so interactive plotting works as you would expect it to. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figure:matplotlib.pyplot.figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure()}}}}} and a figure window pops up, call {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot()}}}}} and your data appears in the figure window. Note in the example above that we did not import any matplotlib names because in pylab mode, ipython will import them automatically. ipython also turns on \sphinxstyleemphasis{interactive} mode for you, which causes every pyplot command to trigger a figure update, and also provides a matplotlib aware \sphinxcode{\sphinxupquote{run}} command to run matplotlib scripts efficiently. ipython will turn off interactive mode during a \sphinxcode{\sphinxupquote{run}} command, and then restore the interactive state at the end of the run so you can continue tweaking the figure manually. There has been a lot of recent work to embed ipython, with pylab support, into various GUI applications, so check on the ipython mailing \sphinxhref{https://mail.scipy.org/mailman/listinfo/ipython-user}{list} for the latest status. \subsection{Other python interpreters} \label{\detokenize{users/shell:other-python-interpreters}}\label{\detokenize{users/shell:other-shells}} If you can’t use ipython, and still want to use matplotlib/pylab from an interactive python shell, e.g., the plain-ole standard python interactive interpreter, you are going to need to understand what a matplotlib backend is {\hyperref[\detokenize{tutorials/introductory/usage:what-is-a-backend}]{\sphinxcrossref{\DUrole{std,std-ref}{What is a backend?}}}}. With the TkAgg backend, which uses the Tkinter user interface toolkit, you can use matplotlib from an arbitrary non-gui python shell. Just set your \sphinxcode{\sphinxupquote{backend : TkAgg}} and \sphinxcode{\sphinxupquote{interactive : True}} in your \sphinxcode{\sphinxupquote{matplotlibrc}} file (see {\hyperref[\detokenize{tutorials/introductory/customizing:sphx-glr-tutorials-introductory-customizing-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Matplotlib with style sheets and rcParams}}}}) and fire up python. Then: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{pylab} \PYG{k}{import} \PYG{o}{*} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{hi mom}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} should work out of the box. This is also likely to work with recent versions of the qt4agg and gtkagg backends, and with the macosx backend on the Macintosh. Note, in batch mode, i.e. when making figures from scripts, interactive mode can be slow since it redraws the figure with each command. So you may want to think carefully before making this the default behavior via the \sphinxcode{\sphinxupquote{matplotlibrc}} file instead of using the functions listed in the next section. Gui shells are at best problematic, because they have to run a mainloop, but interactive plotting also involves a mainloop. Ipython has sorted all this out for the primary matplotlib backends. There may be other shells and IDEs that also work with matplotlib in interactive mode, but one obvious candidate does not: the python IDLE IDE is a Tkinter gui app that does not support pylab interactive mode, regardless of backend. \subsection{Controlling interactive updating} \label{\detokenize{users/shell:controlling-interactive-updating}}\label{\detokenize{users/shell:controlling-interactive}} The \sphinxstyleemphasis{interactive} property of the pyplot interface controls whether a figure canvas is drawn on every pyplot command. If \sphinxstyleemphasis{interactive} is \sphinxstyleemphasis{False}, then the figure state is updated on every plot command, but will only be drawn on explicit calls to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.draw:matplotlib.pyplot.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw()}}}}}. When \sphinxstyleemphasis{interactive} is \sphinxstyleemphasis{True}, then every pyplot command triggers a draw. The pyplot interface provides 4 commands that are useful for interactive control. \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.isinteractive:matplotlib.pyplot.isinteractive}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{isinteractive()}}}}}}] \leavevmode returns the interactive setting \sphinxstyleemphasis{True\textbar{}False} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ion:matplotlib.pyplot.ion}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ion()}}}}}}] \leavevmode turns interactive mode on \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ioff:matplotlib.pyplot.ioff}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ioff()}}}}}}] \leavevmode turns interactive mode off \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.draw:matplotlib.pyplot.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw()}}}}}}] \leavevmode forces a figure redraw \end{description} When working with a big figure in which drawing is expensive, you may want to turn matplotlib’s interactive setting off temporarily to avoid the performance hit: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{c+c1}{\PYGZsh{}create big\PYGZhy{}expensive\PYGZhy{}figure} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{ioff}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} turn updates off} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{now how much would you pay?}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{xticklabels}\PYG{p}{(}\PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{20}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{green}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} force a draw} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{savefig}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{alldone}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{dpi}\PYG{o}{=}\PYG{l+m+mi}{300}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{close}\PYG{p}{(}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{ion}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} turn updating back on} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{20}\PYG{p}{)}\PYG{p}{,} \PYG{n}{mfc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{mec}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ms}\PYG{o}{=}\PYG{l+m+mi}{40}\PYG{p}{,} \PYG{n}{mew}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{n}{ls}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{)} \end{sphinxVerbatim} \section{Event handling and picking} \label{\detokenize{users/event_handling:event-handling-and-picking}}\label{\detokenize{users/event_handling:event-handling-tutorial}}\label{\detokenize{users/event_handling::doc}} matplotlib works with a number of user interface toolkits (wxpython, tkinter, qt4, gtk, and macosx) and in order to support features like interactive panning and zooming of figures, it is helpful to the developers to have an API for interacting with the figure via key presses and mouse movements that is “GUI neutral” so we don’t have to repeat a lot of code across the different user interfaces. Although the event handling API is GUI neutral, it is based on the GTK model, which was the first user interface matplotlib supported. The events that are triggered are also a bit richer vis-a-vis matplotlib than standard GUI events, including information like which {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} the event occurred in. The events also understand the matplotlib coordinate system, and report event locations in both pixel and data coordinates. \subsection{Event connections} \label{\detokenize{users/event_handling:event-connections}}\label{\detokenize{users/event_handling:id1}} To receive events, you need to write a callback function and then connect your function to the event manager, which is part of the {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FigureCanvasBase}}}}}. Here is a simple example that prints the location of the mouse click and which button was pressed: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{onclick}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+si}{\PYGZpc{}s}\PYG{l+s+s1}{ click: button=}\PYG{l+s+si}{\PYGZpc{}d}\PYG{l+s+s1}{, x=}\PYG{l+s+si}{\PYGZpc{}d}\PYG{l+s+s1}{, y=}\PYG{l+s+si}{\PYGZpc{}d}\PYG{l+s+s1}{, xdata=}\PYG{l+s+si}{\PYGZpc{}f}\PYG{l+s+s1}{, ydata=}\PYG{l+s+si}{\PYGZpc{}f}\PYG{l+s+s1}{\PYGZsq{}} \PYG{o}{\PYGZpc{}} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{double}\PYG{l+s+s1}{\PYGZsq{}} \PYG{k}{if} \PYG{n}{event}\PYG{o}{.}\PYG{n}{dblclick} \PYG{k}{else} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{single}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{button}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{x}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{y}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{xdata}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{ydata}\PYG{p}{)}\PYG{p}{)} \PYG{n}{cid} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{button\PYGZus{}press\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{onclick}\PYG{p}{)} \end{sphinxVerbatim} The \sphinxcode{\sphinxupquote{FigureCanvas}} method {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.mpl_connect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mpl\_connect()}}}}} returns a connection id which is simply an integer. When you want to disconnect the callback, just call: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}disconnect}\PYG{p}{(}\PYG{n}{cid}\PYG{p}{)} \end{sphinxVerbatim} \begin{sphinxadmonition}{note}{Note:} The canvas retains only weak references to the callbacks. Therefore if a callback is a method of a class instance, you need to retain a reference to that instance. Otherwise the instance will be garbage-collected and the callback will vanish. \end{sphinxadmonition} Here are the events that you can connect to, the class instances that are sent back to you when the event occurs, and the event descriptions \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Event name &\sphinxstyletheadfamily Class and description \\ \hline ‘button\_press\_event’ & {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MouseEvent}}}}} - mouse button is pressed \\ \hline ‘button\_release\_event’ & {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MouseEvent}}}}} - mouse button is released \\ \hline ‘draw\_event’ & {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.DrawEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{DrawEvent}}}}} - canvas draw (but before screen update) \\ \hline ‘key\_press\_event’ & {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.KeyEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{KeyEvent}}}}} - key is pressed \\ \hline ‘key\_release\_event’ & {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.KeyEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{KeyEvent}}}}} - key is released \\ \hline ‘motion\_notify\_event’ & {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MouseEvent}}}}} - mouse motion \\ \hline ‘pick\_event’ & {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.PickEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PickEvent}}}}} - an object in the canvas is selected \\ \hline ‘resize\_event’ & {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.ResizeEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ResizeEvent}}}}} - figure canvas is resized \\ \hline ‘scroll\_event’ & {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MouseEvent}}}}} - mouse scroll wheel is rolled \\ \hline ‘figure\_enter\_event’ & {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.LocationEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LocationEvent}}}}} - mouse enters a new figure \\ \hline ‘figure\_leave\_event’ & {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.LocationEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LocationEvent}}}}} - mouse leaves a figure \\ \hline ‘axes\_enter\_event’ & {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.LocationEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LocationEvent}}}}} - mouse enters a new axes \\ \hline ‘axes\_leave\_event’ & {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.LocationEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LocationEvent}}}}} - mouse leaves an axes \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \subsection{Event attributes} \label{\detokenize{users/event_handling:event-attributes}}\label{\detokenize{users/event_handling:id2}} All matplotlib events inherit from the base class {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.Event}}}}}, which store the attributes: \begin{quote} \begin{description} \item[{\sphinxcode{\sphinxupquote{name}}}] \leavevmode the event name \item[{\sphinxcode{\sphinxupquote{canvas}}}] \leavevmode the FigureCanvas instance generating the event \item[{\sphinxcode{\sphinxupquote{guiEvent}}}] \leavevmode the GUI event that triggered the matplotlib event \end{description} \end{quote} The most common events that are the bread and butter of event handling are key press/release events and mouse press/release and movement events. The {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.KeyEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{KeyEvent}}}}} and {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MouseEvent}}}}} classes that handle these events are both derived from the LocationEvent, which has the following attributes \begin{quote} \begin{description} \item[{\sphinxcode{\sphinxupquote{x}}}] \leavevmode x position - pixels from left of canvas \item[{\sphinxcode{\sphinxupquote{y}}}] \leavevmode y position - pixels from bottom of canvas \item[{\sphinxcode{\sphinxupquote{inaxes}}}] \leavevmode the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance if mouse is over axes \item[{\sphinxcode{\sphinxupquote{xdata}}}] \leavevmode x coord of mouse in data coords \item[{\sphinxcode{\sphinxupquote{ydata}}}] \leavevmode y coord of mouse in data coords \end{description} \end{quote} Let’s look a simple example of a canvas, where a simple line segment is created every time a mouse is pressed: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib} \PYG{k}{import} \PYG{n}{pyplot} \PYG{k}{as} \PYG{n}{plt} \PYG{k}{class} \PYG{n+nc}{LineBuilder}\PYG{p}{:} \PYG{k}{def} \PYG{n+nf}{\PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{line}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{line} \PYG{o}{=} \PYG{n}{line} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{xs} \PYG{o}{=} \PYG{n+nb}{list}\PYG{p}{(}\PYG{n}{line}\PYG{o}{.}\PYG{n}{get\PYGZus{}xdata}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ys} \PYG{o}{=} \PYG{n+nb}{list}\PYG{p}{(}\PYG{n}{line}\PYG{o}{.}\PYG{n}{get\PYGZus{}ydata}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{cid} \PYG{o}{=} \PYG{n}{line}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{button\PYGZus{}press\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{\PYGZus{}\PYGZus{}call\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{click}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{event}\PYG{p}{)} \PYG{k}{if} \PYG{n}{event}\PYG{o}{.}\PYG{n}{inaxes}\PYG{o}{!=}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{line}\PYG{o}{.}\PYG{n}{axes}\PYG{p}{:} \PYG{k}{return} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{xs}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{event}\PYG{o}{.}\PYG{n}{xdata}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ys}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{event}\PYG{o}{.}\PYG{n}{ydata}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}data}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{xs}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ys}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{line}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{click to build line segments}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} empty line} \PYG{n}{linebuilder} \PYG{o}{=} \PYG{n}{LineBuilder}\PYG{p}{(}\PYG{n}{line}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} The {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MouseEvent}}}}} that we just used is a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.LocationEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LocationEvent}}}}}, so we have access to the data and pixel coordinates in event.x and event.xdata. In addition to the \sphinxcode{\sphinxupquote{LocationEvent}} attributes, it has \begin{quote} \begin{description} \item[{\sphinxcode{\sphinxupquote{button}}}] \leavevmode button pressed None, 1, 2, 3, ‘up’, ‘down’ (up and down are used for scroll events) \item[{\sphinxcode{\sphinxupquote{key}}}] \leavevmode the key pressed: None, any character, ‘shift’, ‘win’, or ‘control’ \end{description} \end{quote} \subsubsection{Draggable rectangle exercise} \label{\detokenize{users/event_handling:draggable-rectangle-exercise}} Write draggable rectangle class that is initialized with a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}} instance but will move its x,y location when dragged. Hint: you will need to store the original \sphinxcode{\sphinxupquote{xy}} location of the rectangle which is stored as rect.xy and connect to the press, motion and release mouse events. When the mouse is pressed, check to see if the click occurs over your rectangle (see \sphinxcode{\sphinxupquote{matplotlib.patches.Rectangle.contains()}}) and if it does, store the rectangle xy and the location of the mouse click in data coords. In the motion event callback, compute the deltax and deltay of the mouse movement, and add those deltas to the origin of the rectangle you stored. The redraw the figure. On the button release event, just reset all the button press data you stored as None. Here is the solution: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{k}{class} \PYG{n+nc}{DraggableRectangle}\PYG{p}{:} \PYG{k}{def} \PYG{n+nf}{\PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{rect}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect} \PYG{o}{=} \PYG{n}{rect} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{press} \PYG{o}{=} \PYG{k+kc}{None} \PYG{k}{def} \PYG{n+nf}{connect}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{connect to all the events we need}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{cidpress} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{button\PYGZus{}press\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{on\PYGZus{}press}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{cidrelease} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{button\PYGZus{}release\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{on\PYGZus{}release}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{cidmotion} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{motion\PYGZus{}notify\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{on\PYGZus{}motion}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{on\PYGZus{}press}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{on button press we will see if the mouse is over us and store some data}\PYG{l+s+s1}{\PYGZsq{}} \PYG{k}{if} \PYG{n}{event}\PYG{o}{.}\PYG{n}{inaxes} \PYG{o}{!=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{axes}\PYG{p}{:} \PYG{k}{return} \PYG{n}{contains}\PYG{p}{,} \PYG{n}{attrd} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{contains}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)} \PYG{k}{if} \PYG{o+ow}{not} \PYG{n}{contains}\PYG{p}{:} \PYG{k}{return} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{event contains}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{xy}\PYG{p}{)} \PYG{n}{x0}\PYG{p}{,} \PYG{n}{y0} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{xy} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{press} \PYG{o}{=} \PYG{n}{x0}\PYG{p}{,} \PYG{n}{y0}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{xdata}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{ydata} \PYG{k}{def} \PYG{n+nf}{on\PYGZus{}motion}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{on motion we will move the rect if the mouse is over us}\PYG{l+s+s1}{\PYGZsq{}} \PYG{k}{if} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{press} \PYG{o+ow}{is} \PYG{k+kc}{None}\PYG{p}{:} \PYG{k}{return} \PYG{k}{if} \PYG{n}{event}\PYG{o}{.}\PYG{n}{inaxes} \PYG{o}{!=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{axes}\PYG{p}{:} \PYG{k}{return} \PYG{n}{x0}\PYG{p}{,} \PYG{n}{y0}\PYG{p}{,} \PYG{n}{xpress}\PYG{p}{,} \PYG{n}{ypress} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{press} \PYG{n}{dx} \PYG{o}{=} \PYG{n}{event}\PYG{o}{.}\PYG{n}{xdata} \PYG{o}{\PYGZhy{}} \PYG{n}{xpress} \PYG{n}{dy} \PYG{o}{=} \PYG{n}{event}\PYG{o}{.}\PYG{n}{ydata} \PYG{o}{\PYGZhy{}} \PYG{n}{ypress} \PYG{c+c1}{\PYGZsh{}print(\PYGZsq{}x0=\PYGZpc{}f, xpress=\PYGZpc{}f, event.xdata=\PYGZpc{}f, dx=\PYGZpc{}f, x0+dx=\PYGZpc{}f\PYGZsq{} \PYGZpc{}} \PYG{c+c1}{\PYGZsh{} (x0, xpress, event.xdata, dx, x0+dx))} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{set\PYGZus{}x}\PYG{p}{(}\PYG{n}{x0}\PYG{o}{+}\PYG{n}{dx}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{set\PYGZus{}y}\PYG{p}{(}\PYG{n}{y0}\PYG{o}{+}\PYG{n}{dy}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{on\PYGZus{}release}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{on release we reset the press data}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{press} \PYG{o}{=} \PYG{k+kc}{None} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{disconnect}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{disconnect all the stored connection ids}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}disconnect}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{cidpress}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}disconnect}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{cidrelease}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}disconnect}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{cidmotion}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{rects} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{bar}\PYG{p}{(}\PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{,} \PYG{l+m+mi}{20}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{)} \PYG{n}{drs} \PYG{o}{=} \PYG{p}{[}\PYG{p}{]} \PYG{k}{for} \PYG{n}{rect} \PYG{o+ow}{in} \PYG{n}{rects}\PYG{p}{:} \PYG{n}{dr} \PYG{o}{=} \PYG{n}{DraggableRectangle}\PYG{p}{(}\PYG{n}{rect}\PYG{p}{)} \PYG{n}{dr}\PYG{o}{.}\PYG{n}{connect}\PYG{p}{(}\PYG{p}{)} \PYG{n}{drs}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{dr}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \sphinxstylestrong{Extra credit}: use the animation blit techniques discussed in the \sphinxhref{https://scipy-cookbook.readthedocs.io/items/Matplotlib\_Animations.html}{animations recipe} to make the animated drawing faster and smoother. Extra credit solution: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} draggable rectangle with the animation blit techniques; see} \PYG{c+c1}{\PYGZsh{} http://www.scipy.org/Cookbook/Matplotlib/Animations} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{k}{class} \PYG{n+nc}{DraggableRectangle}\PYG{p}{:} \PYG{n}{lock} \PYG{o}{=} \PYG{k+kc}{None} \PYG{c+c1}{\PYGZsh{} only one can be animated at a time} \PYG{k}{def} \PYG{n+nf}{\PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{rect}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect} \PYG{o}{=} \PYG{n}{rect} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{press} \PYG{o}{=} \PYG{k+kc}{None} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{background} \PYG{o}{=} \PYG{k+kc}{None} \PYG{k}{def} \PYG{n+nf}{connect}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{connect to all the events we need}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{cidpress} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{button\PYGZus{}press\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{on\PYGZus{}press}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{cidrelease} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{button\PYGZus{}release\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{on\PYGZus{}release}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{cidmotion} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{motion\PYGZus{}notify\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{on\PYGZus{}motion}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{on\PYGZus{}press}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{on button press we will see if the mouse is over us and store some data}\PYG{l+s+s1}{\PYGZsq{}} \PYG{k}{if} \PYG{n}{event}\PYG{o}{.}\PYG{n}{inaxes} \PYG{o}{!=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{axes}\PYG{p}{:} \PYG{k}{return} \PYG{k}{if} \PYG{n}{DraggableRectangle}\PYG{o}{.}\PYG{n}{lock} \PYG{o+ow}{is} \PYG{o+ow}{not} \PYG{k+kc}{None}\PYG{p}{:} \PYG{k}{return} \PYG{n}{contains}\PYG{p}{,} \PYG{n}{attrd} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{contains}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)} \PYG{k}{if} \PYG{o+ow}{not} \PYG{n}{contains}\PYG{p}{:} \PYG{k}{return} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{event contains}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{xy}\PYG{p}{)} \PYG{n}{x0}\PYG{p}{,} \PYG{n}{y0} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{xy} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{press} \PYG{o}{=} \PYG{n}{x0}\PYG{p}{,} \PYG{n}{y0}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{xdata}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{ydata} \PYG{n}{DraggableRectangle}\PYG{o}{.}\PYG{n}{lock} \PYG{o}{=} \PYG{n+nb+bp}{self} \PYG{c+c1}{\PYGZsh{} draw everything but the selected rectangle and store the pixel buffer} \PYG{n}{canvas} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas} \PYG{n}{axes} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{axes} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{set\PYGZus{}animated}\PYG{p}{(}\PYG{k+kc}{True}\PYG{p}{)} \PYG{n}{canvas}\PYG{o}{.}\PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{background} \PYG{o}{=} \PYG{n}{canvas}\PYG{o}{.}\PYG{n}{copy\PYGZus{}from\PYGZus{}bbox}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{axes}\PYG{o}{.}\PYG{n}{bbox}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} now redraw just the rectangle} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{draw\PYGZus{}artist}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} and blit just the redrawn area} \PYG{n}{canvas}\PYG{o}{.}\PYG{n}{blit}\PYG{p}{(}\PYG{n}{axes}\PYG{o}{.}\PYG{n}{bbox}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{on\PYGZus{}motion}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{on motion we will move the rect if the mouse is over us}\PYG{l+s+s1}{\PYGZsq{}} \PYG{k}{if} \PYG{n}{DraggableRectangle}\PYG{o}{.}\PYG{n}{lock} \PYG{o+ow}{is} \PYG{o+ow}{not} \PYG{n+nb+bp}{self}\PYG{p}{:} \PYG{k}{return} \PYG{k}{if} \PYG{n}{event}\PYG{o}{.}\PYG{n}{inaxes} \PYG{o}{!=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{axes}\PYG{p}{:} \PYG{k}{return} \PYG{n}{x0}\PYG{p}{,} \PYG{n}{y0}\PYG{p}{,} \PYG{n}{xpress}\PYG{p}{,} \PYG{n}{ypress} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{press} \PYG{n}{dx} \PYG{o}{=} \PYG{n}{event}\PYG{o}{.}\PYG{n}{xdata} \PYG{o}{\PYGZhy{}} \PYG{n}{xpress} \PYG{n}{dy} \PYG{o}{=} \PYG{n}{event}\PYG{o}{.}\PYG{n}{ydata} \PYG{o}{\PYGZhy{}} \PYG{n}{ypress} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{set\PYGZus{}x}\PYG{p}{(}\PYG{n}{x0}\PYG{o}{+}\PYG{n}{dx}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{set\PYGZus{}y}\PYG{p}{(}\PYG{n}{y0}\PYG{o}{+}\PYG{n}{dy}\PYG{p}{)} \PYG{n}{canvas} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas} \PYG{n}{axes} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{axes} \PYG{c+c1}{\PYGZsh{} restore the background region} \PYG{n}{canvas}\PYG{o}{.}\PYG{n}{restore\PYGZus{}region}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{background}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} redraw just the current rectangle} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{draw\PYGZus{}artist}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} blit just the redrawn area} \PYG{n}{canvas}\PYG{o}{.}\PYG{n}{blit}\PYG{p}{(}\PYG{n}{axes}\PYG{o}{.}\PYG{n}{bbox}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{on\PYGZus{}release}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{on release we reset the press data}\PYG{l+s+s1}{\PYGZsq{}} \PYG{k}{if} \PYG{n}{DraggableRectangle}\PYG{o}{.}\PYG{n}{lock} \PYG{o+ow}{is} \PYG{o+ow}{not} \PYG{n+nb+bp}{self}\PYG{p}{:} \PYG{k}{return} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{press} \PYG{o}{=} \PYG{k+kc}{None} \PYG{n}{DraggableRectangle}\PYG{o}{.}\PYG{n}{lock} \PYG{o}{=} \PYG{k+kc}{None} \PYG{c+c1}{\PYGZsh{} turn off the rect animation property and reset the background} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{set\PYGZus{}animated}\PYG{p}{(}\PYG{k+kc}{False}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{background} \PYG{o}{=} \PYG{k+kc}{None} \PYG{c+c1}{\PYGZsh{} redraw the full figure} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{disconnect}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{disconnect all the stored connection ids}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}disconnect}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{cidpress}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}disconnect}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{cidrelease}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rect}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}disconnect}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{cidmotion}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{rects} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{bar}\PYG{p}{(}\PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{,} \PYG{l+m+mi}{20}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{)} \PYG{n}{drs} \PYG{o}{=} \PYG{p}{[}\PYG{p}{]} \PYG{k}{for} \PYG{n}{rect} \PYG{o+ow}{in} \PYG{n}{rects}\PYG{p}{:} \PYG{n}{dr} \PYG{o}{=} \PYG{n}{DraggableRectangle}\PYG{p}{(}\PYG{n}{rect}\PYG{p}{)} \PYG{n}{dr}\PYG{o}{.}\PYG{n}{connect}\PYG{p}{(}\PYG{p}{)} \PYG{n}{drs}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{dr}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Mouse enter and leave} \label{\detokenize{users/event_handling:mouse-enter-and-leave}}\label{\detokenize{users/event_handling:enter-leave-events}} If you want to be notified when the mouse enters or leaves a figure or axes, you can connect to the figure/axes enter/leave events. Here is a simple example that changes the colors of the axes and figure background that the mouse is over: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{Illustrate the figure and axes enter and leave events by changing the} \PYG{l+s+sd}{frame colors on enter and leave} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{k}{def} \PYG{n+nf}{enter\PYGZus{}axes}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{enter\PYGZus{}axes}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{inaxes}\PYG{p}{)} \PYG{n}{event}\PYG{o}{.}\PYG{n}{inaxes}\PYG{o}{.}\PYG{n}{patch}\PYG{o}{.}\PYG{n}{set\PYGZus{}facecolor}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{yellow}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{event}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{leave\PYGZus{}axes}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{leave\PYGZus{}axes}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{inaxes}\PYG{p}{)} \PYG{n}{event}\PYG{o}{.}\PYG{n}{inaxes}\PYG{o}{.}\PYG{n}{patch}\PYG{o}{.}\PYG{n}{set\PYGZus{}facecolor}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{white}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{event}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{enter\PYGZus{}figure}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{enter\PYGZus{}figure}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{)} \PYG{n}{event}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{patch}\PYG{o}{.}\PYG{n}{set\PYGZus{}facecolor}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{event}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{leave\PYGZus{}figure}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{leave\PYGZus{}figure}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{)} \PYG{n}{event}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{patch}\PYG{o}{.}\PYG{n}{set\PYGZus{}facecolor}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{grey}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{event}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \PYG{n}{fig1} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{fig1}\PYG{o}{.}\PYG{n}{suptitle}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{mouse hover over figure or axes to trigger events}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig1}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{211}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig1}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{212}\PYG{p}{)} \PYG{n}{fig1}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{figure\PYGZus{}enter\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{enter\PYGZus{}figure}\PYG{p}{)} \PYG{n}{fig1}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{figure\PYGZus{}leave\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{leave\PYGZus{}figure}\PYG{p}{)} \PYG{n}{fig1}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes\PYGZus{}enter\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{enter\PYGZus{}axes}\PYG{p}{)} \PYG{n}{fig1}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes\PYGZus{}leave\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{leave\PYGZus{}axes}\PYG{p}{)} \PYG{n}{fig2} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{fig2}\PYG{o}{.}\PYG{n}{suptitle}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{mouse hover over figure or axes to trigger events}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig2}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{211}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig2}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{212}\PYG{p}{)} \PYG{n}{fig2}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{figure\PYGZus{}enter\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{enter\PYGZus{}figure}\PYG{p}{)} \PYG{n}{fig2}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{figure\PYGZus{}leave\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{leave\PYGZus{}figure}\PYG{p}{)} \PYG{n}{fig2}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes\PYGZus{}enter\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{enter\PYGZus{}axes}\PYG{p}{)} \PYG{n}{fig2}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes\PYGZus{}leave\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{leave\PYGZus{}axes}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Object picking} \label{\detokenize{users/event_handling:object-picking}}\label{\detokenize{users/event_handling:id3}} You can enable picking by setting the \sphinxcode{\sphinxupquote{picker}} property of an {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} (e.g., a matplotlib {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}}, {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Polygon}}}}}, \sphinxcode{\sphinxupquote{AxesImage}}, etc…) There are a variety of meanings of the \sphinxcode{\sphinxupquote{picker}} property: \begin{quote} \begin{description} \item[{\sphinxcode{\sphinxupquote{None}}}] \leavevmode picking is disabled for this artist (default) \item[{\sphinxcode{\sphinxupquote{boolean}}}] \leavevmode if True then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item[{\sphinxcode{\sphinxupquote{float}}}] \leavevmode if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event. \item[{\sphinxcode{\sphinxupquote{function}}}] \leavevmode if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event. The signature is \sphinxcode{\sphinxupquote{hit, props = picker(artist, mouseevent)}} to determine the hit test. If the mouse event is over the artist, return \sphinxcode{\sphinxupquote{hit=True}} and props is a dictionary of properties you want added to the {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.PickEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PickEvent}}}}} attributes \end{description} \end{quote} After you have enabled an artist for picking by setting the \sphinxcode{\sphinxupquote{picker}} property, you need to connect to the figure canvas pick\_event to get pick callbacks on mouse press events. e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{pick\PYGZus{}handler}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{n}{mouseevent} \PYG{o}{=} \PYG{n}{event}\PYG{o}{.}\PYG{n}{mouseevent} \PYG{n}{artist} \PYG{o}{=} \PYG{n}{event}\PYG{o}{.}\PYG{n}{artist} \PYG{c+c1}{\PYGZsh{} now do something with this...} \end{sphinxVerbatim} The {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.PickEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PickEvent}}}}} which is passed to your callback is always fired with two attributes: \begin{quote} \begin{description} \item[{\sphinxcode{\sphinxupquote{mouseevent}} the mouse event that generate the pick event. The}] \leavevmode mouse event in turn has attributes like \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} (the coords in display space, e.g., pixels from left, bottom) and xdata, ydata (the coords in data space). Additionally, you can get information about which buttons were pressed, which keys were pressed, which {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} the mouse is over, etc. See {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.MouseEvent}}}}} for details. \item[{\sphinxcode{\sphinxupquote{artist}}}] \leavevmode the {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} that generated the pick event. \end{description} \end{quote} Additionally, certain artists like {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} and {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PatchCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PatchCollection}}}}} may attach additional meta data like the indices into the data that meet the picker criteria (e.g., all the points in the line that are within the specified epsilon tolerance) \subsubsection{Simple picking example} \label{\detokenize{users/event_handling:simple-picking-example}} In the example below, we set the line picker property to a scalar, so it represents a tolerance in points (72 points per inch). The onpick callback function will be called when the pick event it within the tolerance distance from the line, and has the indices of the data vertices that are within the pick distance tolerance. Our onpick callback function simply prints the data that are under the pick location. Different matplotlib Artists can attach different data to the PickEvent. For example, \sphinxcode{\sphinxupquote{Line2D}} attaches the ind property, which are the indices into the line data under the pick point. See \sphinxcode{\sphinxupquote{pick()}} for details on the \sphinxcode{\sphinxupquote{PickEvent}} properties of the line. Here is the code: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{click on points}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{o}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{picker}\PYG{o}{=}\PYG{l+m+mi}{5}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} 5 points tolerance} \PYG{k}{def} \PYG{n+nf}{onpick}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{n}{thisline} \PYG{o}{=} \PYG{n}{event}\PYG{o}{.}\PYG{n}{artist} \PYG{n}{xdata} \PYG{o}{=} \PYG{n}{thisline}\PYG{o}{.}\PYG{n}{get\PYGZus{}xdata}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ydata} \PYG{o}{=} \PYG{n}{thisline}\PYG{o}{.}\PYG{n}{get\PYGZus{}ydata}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ind} \PYG{o}{=} \PYG{n}{event}\PYG{o}{.}\PYG{n}{ind} \PYG{n}{points} \PYG{o}{=} \PYG{n+nb}{tuple}\PYG{p}{(}\PYG{n+nb}{zip}\PYG{p}{(}\PYG{n}{xdata}\PYG{p}{[}\PYG{n}{ind}\PYG{p}{]}\PYG{p}{,} \PYG{n}{ydata}\PYG{p}{[}\PYG{n}{ind}\PYG{p}{]}\PYG{p}{)}\PYG{p}{)} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{onpick points:}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{points}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{pick\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{onpick}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \subsubsection{Picking exercise} \label{\detokenize{users/event_handling:picking-exercise}} Create a data set of 100 arrays of 1000 Gaussian random numbers and compute the sample mean and standard deviation of each of them (hint: numpy arrays have a mean and std method) and make a xy marker plot of the 100 means vs the 100 standard deviations. Connect the line created by the plot command to the pick event, and plot the original time series of the data that generated the clicked on points. If more than one point is within the tolerance of the clicked on point, you can use multiple subplots to plot the multiple time series. Exercise solution: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{compute the mean and stddev of 100 data sets and plot mean vs stddev.} \PYG{l+s+sd}{When you click on one of the mu, sigma points, plot the raw data from} \PYG{l+s+sd}{the dataset that generated the mean and stddev} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{X} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{,} \PYG{l+m+mi}{1000}\PYG{p}{)} \PYG{n}{xs} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{mean}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{axis}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{ys} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{std}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{axis}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{click on point to plot time series}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{xs}\PYG{p}{,} \PYG{n}{ys}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{o}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{picker}\PYG{o}{=}\PYG{l+m+mi}{5}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} 5 points tolerance} \PYG{k}{def} \PYG{n+nf}{onpick}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{k}{if} \PYG{n}{event}\PYG{o}{.}\PYG{n}{artist}\PYG{o}{!=}\PYG{n}{line}\PYG{p}{:} \PYG{k}{return} \PYG{k+kc}{True} \PYG{n}{N} \PYG{o}{=} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{event}\PYG{o}{.}\PYG{n}{ind}\PYG{p}{)} \PYG{k}{if} \PYG{o+ow}{not} \PYG{n}{N}\PYG{p}{:} \PYG{k}{return} \PYG{k+kc}{True} \PYG{n}{figi} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{k}{for} \PYG{n}{subplotnum}\PYG{p}{,} \PYG{n}{dataind} \PYG{o+ow}{in} \PYG{n+nb}{enumerate}\PYG{p}{(}\PYG{n}{event}\PYG{o}{.}\PYG{n}{ind}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{figi}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{N}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{n}{subplotnum}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{X}\PYG{p}{[}\PYG{n}{dataind}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.05}\PYG{p}{,} \PYG{l+m+mf}{0.9}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{mu=}\PYG{l+s+si}{\PYGZpc{}1.3f}\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s1}{sigma=}\PYG{l+s+si}{\PYGZpc{}1.3f}\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{\PYGZpc{}}\PYG{p}{(}\PYG{n}{xs}\PYG{p}{[}\PYG{n}{dataind}\PYG{p}{]}\PYG{p}{,} \PYG{n}{ys}\PYG{p}{[}\PYG{n}{dataind}\PYG{p}{]}\PYG{p}{)}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{top}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{1.5}\PYG{p}{)} \PYG{n}{figi}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \PYG{k}{return} \PYG{k+kc}{True} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{pick\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{onpick}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \chapter{What’s new in Matplotlib} \label{\detokenize{users/whats_new:what-s-new-in-matplotlib}}\label{\detokenize{users/whats_new:whats-new}}\label{\detokenize{users/whats_new::doc}} For a list of all of the issues and pull requests since the last revision, see the {\hyperref[\detokenize{users/github_stats:github-stats}]{\sphinxcrossref{\DUrole{std,std-ref}{GitHub Stats}}}}. \begin{sphinxShadowBox} \sphinxstyletopictitle{Table of Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/whats_new:id1}}{\hyperref[\detokenize{users/whats_new:what-s-new-in-matplotlib}]{\sphinxcrossref{What’s new in Matplotlib}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/whats_new:id2}}{\hyperref[\detokenize{users/whats_new:new-in-matplotlib-2-2}]{\sphinxcrossref{New in Matplotlib 2.2}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/whats_new:id3}}{\hyperref[\detokenize{users/whats_new:constrained-layout-manager}]{\sphinxcrossref{Constrained Layout Manager}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/whats_new:id4}}{\hyperref[\detokenize{users/whats_new:new-plt-figure-and-plt-subplots-kwarg-constrained-layout}]{\sphinxcrossref{New \sphinxcode{\sphinxupquote{plt.figure}} and \sphinxcode{\sphinxupquote{plt.subplots}} kwarg: \sphinxcode{\sphinxupquote{constrained\_layout}}}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id5}}{\hyperref[\detokenize{users/whats_new:new-ax-set-position-behaviour}]{\sphinxcrossref{New \sphinxcode{\sphinxupquote{ax.set\_position}} behaviour}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id6}}{\hyperref[\detokenize{users/whats_new:new-figure-kwarg-for-gridspec}]{\sphinxcrossref{New \sphinxcode{\sphinxupquote{figure}} kwarg for \sphinxcode{\sphinxupquote{GridSpec}}}}} \end{itemize} \item {} \phantomsection\label{\detokenize{users/whats_new:id7}}{\hyperref[\detokenize{users/whats_new:xlabels-and-ylabels-can-now-be-automatically-aligned}]{\sphinxcrossref{xlabels and ylabels can now be automatically aligned}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id8}}{\hyperref[\detokenize{users/whats_new:axes-legends-now-included-in-tight-bbox}]{\sphinxcrossref{Axes legends now included in tight\_bbox}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id9}}{\hyperref[\detokenize{users/whats_new:cividis-colormap}]{\sphinxcrossref{Cividis colormap}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id10}}{\hyperref[\detokenize{users/whats_new:new-style-colorblind-friendly-color-cycle}]{\sphinxcrossref{New style colorblind-friendly color cycle}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id11}}{\hyperref[\detokenize{users/whats_new:support-for-numpy-datetime64}]{\sphinxcrossref{Support for numpy.datetime64}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id12}}{\hyperref[\detokenize{users/whats_new:writing-animations-with-pillow}]{\sphinxcrossref{Writing animations with Pillow}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id13}}{\hyperref[\detokenize{users/whats_new:slider-ui-widget-can-snap-to-discrete-values}]{\sphinxcrossref{Slider UI widget can snap to discrete values}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id14}}{\hyperref[\detokenize{users/whats_new:capstyle-and-joinstyle-attributes-added-to-collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}} and \sphinxcode{\sphinxupquote{joinstyle}} attributes added to \sphinxcode{\sphinxupquote{Collection}}}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id15}}{\hyperref[\detokenize{users/whats_new:pad-kwarg-added-to-ax-set-title}]{\sphinxcrossref{\sphinxstyleemphasis{pad} kwarg added to ax.set\_title}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id16}}{\hyperref[\detokenize{users/whats_new:comparison-of-2-colors-in-matplotlib}]{\sphinxcrossref{Comparison of 2 colors in Matplotlib}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id17}}{\hyperref[\detokenize{users/whats_new:autoscaling-a-polar-plot-snaps-to-the-origin}]{\sphinxcrossref{Autoscaling a polar plot snaps to the origin}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id18}}{\hyperref[\detokenize{users/whats_new:pathlike-support}]{\sphinxcrossref{PathLike support}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id19}}{\hyperref[\detokenize{users/whats_new:axes-tick-params-can-set-gridline-properties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.tick\_params}} can set gridline properties}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id20}}{\hyperref[\detokenize{users/whats_new:axes-imshow-clips-rgb-values-to-the-valid-range}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.imshow}} clips RGB values to the valid range}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id21}}{\hyperref[\detokenize{users/whats_new:properties-in-matplotlibrc-to-place-xaxis-and-yaxis-tick-labels}]{\sphinxcrossref{Properties in \sphinxcode{\sphinxupquote{matplotlibrc}} to place xaxis and yaxis tick labels}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id22}}{\hyperref[\detokenize{users/whats_new:pgi-bindings-for-gtk3}]{\sphinxcrossref{PGI bindings for gtk3}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id23}}{\hyperref[\detokenize{users/whats_new:cairo-rendering-for-qt-wx-and-tk-canvases}]{\sphinxcrossref{Cairo rendering for Qt, WX, and Tk canvases}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id24}}{\hyperref[\detokenize{users/whats_new:added-support-for-qt-in-new-toolmanager}]{\sphinxcrossref{Added support for QT in new ToolManager}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id25}}{\hyperref[\detokenize{users/whats_new:tkagg-backend-reworked-to-support-pypy}]{\sphinxcrossref{TkAgg backend reworked to support PyPy}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id26}}{\hyperref[\detokenize{users/whats_new:python-logging-library-used-for-debug-output}]{\sphinxcrossref{Python logging library used for debug output}}} \item {} \phantomsection\label{\detokenize{users/whats_new:id27}}{\hyperref[\detokenize{users/whats_new:improved-repr-for-transforms}]{\sphinxcrossref{Improved \sphinxhref{https://docs.python.org/3/library/functions.html\#repr}{\sphinxcode{\sphinxupquote{repr}}} for \sphinxcode{\sphinxupquote{Transform}}s}}} \end{itemize} \item {} \phantomsection\label{\detokenize{users/whats_new:id28}}{\hyperref[\detokenize{users/whats_new:previous-whats-new}]{\sphinxcrossref{Previous Whats New}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \section{New in Matplotlib 2.2} \label{\detokenize{users/whats_new:new-in-matplotlib-2-2}} \subsection{Constrained Layout Manager} \label{\detokenize{users/whats_new:constrained-layout-manager}} \begin{sphinxadmonition}{warning}{Warning:} Constrained Layout is \sphinxstylestrong{experimental}. The behaviour and API are subject to change, or the whole functionality may be removed without a deprecation period. \end{sphinxadmonition} A new method to automatically decide spacing between subplots and their organizing \sphinxcode{\sphinxupquote{GridSpec}} instances has been added. It is meant to replace the venerable \sphinxcode{\sphinxupquote{tight\_layout}} method. It is invoked via a new \sphinxcode{\sphinxupquote{constrained\_layout=True}} kwarg to {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} or \sphinxcode{\sphinxupquote{subplots}}. There are new \sphinxcode{\sphinxupquote{rcParams}} for this package, and spacing can be more finely tuned with the new {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.set_constrained_layout_pads}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_constrained\_layout\_pads}}}}}. Features include: \begin{quote} \begin{itemize} \item {} Automatic spacing for subplots with a fixed-size padding in inches around subplots and all their decorators, and space between as a fraction of subplot size between subplots. \item {} Spacing for \sphinxcode{\sphinxupquote{suptitle}}, and colorbars that are attached to more than one axes. \item {} Nested {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpec}}}}} layouts using {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecFromSubplotSpec:matplotlib.gridspec.GridSpecFromSubplotSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpecFromSubplotSpec}}}}}. \end{itemize} For more details and capabilities please see the new tutorial: {\hyperref[\detokenize{tutorials/intermediate/constrainedlayout_guide::doc}]{\sphinxcrossref{\DUrole{doc}{Constrained Layout Guide}}}} \end{quote} Note the new API to access this: \subsubsection{New \sphinxstyleliteralintitle{\sphinxupquote{plt.figure}} and \sphinxstyleliteralintitle{\sphinxupquote{plt.subplots}} kwarg: \sphinxstyleliteralintitle{\sphinxupquote{constrained\_layout}}} \label{\detokenize{users/whats_new:new-plt-figure-and-plt-subplots-kwarg-constrained-layout}} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figure:matplotlib.pyplot.figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots:matplotlib.pyplot.subplots}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots()}}}}} can now be called with \sphinxcode{\sphinxupquote{constrained\_layout=True}} kwarg to enable constrained\_layout. \subsubsection{New \sphinxstyleliteralintitle{\sphinxupquote{ax.set\_position}} behaviour} \label{\detokenize{users/whats_new:new-ax-set-position-behaviour}} \sphinxcode{\sphinxupquote{set\_position()}} now makes the specified axis no longer responsive to \sphinxcode{\sphinxupquote{constrained\_layout}}, consistent with the idea that the user wants to place an axis manually. Internally, this means that old \sphinxcode{\sphinxupquote{ax.set\_position}} calls \sphinxstyleemphasis{inside} the library are changed to private \sphinxcode{\sphinxupquote{ax.\_set\_position}} calls so that \sphinxcode{\sphinxupquote{constrained\_layout}} will still work with these axes. \subsubsection{New \sphinxstyleliteralintitle{\sphinxupquote{figure}} kwarg for \sphinxstyleliteralintitle{\sphinxupquote{GridSpec}}} \label{\detokenize{users/whats_new:new-figure-kwarg-for-gridspec}} In order to facilitate \sphinxcode{\sphinxupquote{constrained\_layout}}, \sphinxcode{\sphinxupquote{GridSpec}} now accepts a \sphinxcode{\sphinxupquote{figure}} keyword. This is backwards compatible, in that not supplying this will simply cause \sphinxcode{\sphinxupquote{constrained\_layout}} to not operate on the subplots orgainzed by this \sphinxcode{\sphinxupquote{GridSpec}} instance. Routines that use \sphinxcode{\sphinxupquote{GridSpec}} (e.g. \sphinxcode{\sphinxupquote{fig.subplots}}) have been modified to pass the figure to \sphinxcode{\sphinxupquote{GridSpec}}. \subsection{xlabels and ylabels can now be automatically aligned} \label{\detokenize{users/whats_new:xlabels-and-ylabels-can-now-be-automatically-aligned}} Subplot axes \sphinxcode{\sphinxupquote{ylabels}} can be misaligned horizontally if the tick labels are very different widths. The same can happen to \sphinxcode{\sphinxupquote{xlabels}} if the ticklabels are rotated on one subplot (for instance). The new methods on the \sphinxcode{\sphinxupquote{Figure}} class: \sphinxcode{\sphinxupquote{Figure.align\_xlabels}} and \sphinxcode{\sphinxupquote{Figure.align\_ylabels}} will now align these labels horizontally or vertically. If the user only wants to align some axes, a list of axes can be passed. If no list is passed, the algorithm looks at all the labels on the figure. Only labels that have the same subplot locations are aligned. i.e. the ylabels are aligned only if the subplots are in the same column of the subplot layout. Alignemnt is persistent and automatic after these are called. A convenience wrapper \sphinxcode{\sphinxupquote{Figure.align\_labels}} calls both functions at once. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{whats_new-1}.pdf} \end{figure} \subsection{Axes legends now included in tight\_bbox} \label{\detokenize{users/whats_new:axes-legends-now-included-in-tight-bbox}} Legends created via \sphinxcode{\sphinxupquote{ax.legend}} can sometimes overspill the limits of the axis. Tools like \sphinxcode{\sphinxupquote{fig.tight\_layout()}} and \sphinxcode{\sphinxupquote{fig.savefig(bbox\_inches='tight')}} would clip these legends. A change was made to include them in the \sphinxcode{\sphinxupquote{tight}} calculations. \subsection{Cividis colormap} \label{\detokenize{users/whats_new:cividis-colormap}} A new dark blue/yellow colormap named ‘cividis’ was added. Like viridis, cividis is perceptually uniform and colorblind friendly. However, cividis also goes a step further: not only is it usable by colorblind users, it should actually look effectively identical to colorblind and non-colorblind users. For more details, see Nunez J, Anderton C, and Renslow R. (submitted). Optimizing colormaps with consideration for color vision deficiency to enable accurate interpretation of scientific data.” \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{whats_new-2}.pdf} \end{figure} \subsection{New style colorblind-friendly color cycle} \label{\detokenize{users/whats_new:new-style-colorblind-friendly-color-cycle}} A new style defining a color cycle has been added, tableau-colorblind10, to provide another option for colorblind-friendly plots. A demonstration of this new style can be found in the \sphinxhref{https://matplotlib.org/gallery/style\_sheets/style\_sheets\_reference.html}{reference} of style sheets. To load this color cycle in place of the default one: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{style}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{tableau\PYGZhy{}colorblind10}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Support for numpy.datetime64} \label{\detokenize{users/whats_new:support-for-numpy-datetime64}} Matplotlib has supported \sphinxhref{https://docs.python.org/3/library/datetime.html\#datetime.datetime}{\sphinxcode{\sphinxupquote{datetime.datetime}}} dates for a long time in {\hyperref[\detokenize{api/dates_api:module-matplotlib.dates}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates}}}}}. We now support \sphinxcode{\sphinxupquote{numpy.datetime64}} dates as well. Anywhere that \sphinxcode{\sphinxupquote{dateime.datetime}} could be used, \sphinxcode{\sphinxupquote{numpy.datetime64}} can be used. eg: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{time} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{2005\PYGZhy{}02\PYGZhy{}01}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{2005\PYGZhy{}02\PYGZhy{}02}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{dtype}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{datetime64[h]}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{time}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Writing animations with Pillow} \label{\detokenize{users/whats_new:writing-animations-with-pillow}} It is now possible to use Pillow as an animation writer. Supported output formats are currently gif (Pillow\textgreater{}=3.4) and webp (Pillow\textgreater{}=5.0). Use e.g. as \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{\PYGZus{}\PYGZus{}future\PYGZus{}\PYGZus{}} \PYG{k}{import} \PYG{n}{division} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib} \PYG{k}{import} \PYG{n}{pyplot} \PYG{k}{as} \PYG{n}{plt} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{animation} \PYG{k}{import} \PYG{n}{FuncAnimation}\PYG{p}{,} \PYG{n}{PillowWriter} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{animate}\PYG{p}{(}\PYG{n}{i}\PYG{p}{)}\PYG{p}{:} \PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}ydata}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{i} \PYG{o}{/} \PYG{l+m+mi}{20}\PYG{p}{]}\PYG{p}{)} \PYG{k}{return} \PYG{p}{[}\PYG{n}{line}\PYG{p}{]} \PYG{n}{anim} \PYG{o}{=} \PYG{n}{FuncAnimation}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{animate}\PYG{p}{,} \PYG{l+m+mi}{20}\PYG{p}{,} \PYG{n}{blit}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)} \PYG{n}{anim}\PYG{o}{.}\PYG{n}{save}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{movie.gif}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{writer}\PYG{o}{=}\PYG{n}{PillowWriter}\PYG{p}{(}\PYG{n}{fps}\PYG{o}{=}\PYG{l+m+mi}{24}\PYG{p}{)}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Slider UI widget can snap to discrete values} \label{\detokenize{users/whats_new:slider-ui-widget-can-snap-to-discrete-values}} The slider UI widget can take the optional argument \sphinxstyleemphasis{valstep}. Doing so forces the slider to take on only discrete values, starting from \sphinxstyleemphasis{valmin} and counting up to \sphinxstyleemphasis{valmax} with steps of size \sphinxstyleemphasis{valstep}. If \sphinxstyleemphasis{closedmax==True}, then the slider will snap to \sphinxstyleemphasis{valmax} as well. \subsection{\sphinxstyleliteralintitle{\sphinxupquote{capstyle}} and \sphinxstyleliteralintitle{\sphinxupquote{joinstyle}} attributes added to \sphinxstyleliteralintitle{\sphinxupquote{Collection}}} \label{\detokenize{users/whats_new:capstyle-and-joinstyle-attributes-added-to-collection}} The \sphinxcode{\sphinxupquote{Collection}} class now has customizable \sphinxcode{\sphinxupquote{capstyle}} and \sphinxcode{\sphinxupquote{joinstyle}} attributes. This allows the user for example to set the \sphinxcode{\sphinxupquote{capstyle}} of errorbars. \subsection{\sphinxstyleemphasis{pad} kwarg added to ax.set\_title} \label{\detokenize{users/whats_new:pad-kwarg-added-to-ax-set-title}} The method \sphinxcode{\sphinxupquote{axes.set\_title}} now has a \sphinxstyleemphasis{pad} kwarg, that specifies the distance from the top of an axes to where the title is drawn. The units of \sphinxstyleemphasis{pad} is points, and the default is the value of the (already-existing) \sphinxcode{\sphinxupquote{rcParams{[}'axes.titlepad'{]}}}. \subsection{Comparison of 2 colors in Matplotlib} \label{\detokenize{users/whats_new:comparison-of-2-colors-in-matplotlib}} As the colors in Matplotlib can be specified with a wide variety of ways, the \sphinxcode{\sphinxupquote{matplotlib.colors.same\_color}} method has been added which checks if two {\hyperref[\detokenize{api/colors_api:module-matplotlib.colors}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colors}}}}} are the same. \subsection{Autoscaling a polar plot snaps to the origin} \label{\detokenize{users/whats_new:autoscaling-a-polar-plot-snaps-to-the-origin}} Setting the limits automatically in a polar plot now snaps the radial limit to zero if the automatic limit is nearby. This means plotting from zero doesn’t automatically scale to include small negative values on the radial axis. The limits can still be set manually in the usual way using \sphinxcode{\sphinxupquote{set\_ylim}}. \subsection{PathLike support} \label{\detokenize{users/whats_new:pathlike-support}} On Python 3.6+, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.savefig:matplotlib.pyplot.savefig}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{savefig}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imsave:matplotlib.pyplot.imsave}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imsave}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imread:matplotlib.pyplot.imread}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imread}}}}}, and animation writers now accept \sphinxhref{https://docs.python.org/3/library/os.html\#os.PathLike}{\sphinxcode{\sphinxupquote{os.PathLike}}}s as input. \subsection{\sphinxstyleliteralintitle{\sphinxupquote{Axes.tick\_params}} can set gridline properties} \label{\detokenize{users/whats_new:axes-tick-params-can-set-gridline-properties}} \sphinxcode{\sphinxupquote{Tick}} objects hold gridlines as well as the tick mark and its label. \sphinxcode{\sphinxupquote{Axis.set\_tick\_params}}, \sphinxcode{\sphinxupquote{Axes.tick\_params}} and \sphinxcode{\sphinxupquote{pyplot.tick\_params}} now have keyword arguments ‘grid\_color’, ‘grid\_alpha’, ‘grid\_linewidth’, and ‘grid\_linestyle’ for overriding the defaults in \sphinxcode{\sphinxupquote{rcParams}}: ‘grid.color’, etc. \subsection{\sphinxstyleliteralintitle{\sphinxupquote{Axes.imshow}} clips RGB values to the valid range} \label{\detokenize{users/whats_new:axes-imshow-clips-rgb-values-to-the-valid-range}} When \sphinxcode{\sphinxupquote{Axes.imshow}} is passed an RGB or RGBA value with out-of-range values, it now logs a warning and clips them to the valid range. The old behaviour, wrapping back in to the range, often hid outliers and made interpreting RGB images unreliable. \subsection{Properties in \sphinxstyleliteralintitle{\sphinxupquote{matplotlibrc}} to place xaxis and yaxis tick labels} \label{\detokenize{users/whats_new:properties-in-matplotlibrc-to-place-xaxis-and-yaxis-tick-labels}} Introducing four new boolean properties in \sphinxcode{\sphinxupquote{matplotlibrc}} for default positions of xaxis and yaxis tick labels, namely, \sphinxcode{\sphinxupquote{xtick.labeltop}}, \sphinxcode{\sphinxupquote{xtick.labelbottom}}, \sphinxcode{\sphinxupquote{ytick.labelright}} and \sphinxcode{\sphinxupquote{ytick.labelleft}}. These can also be changed in rcParams. \subsection{PGI bindings for gtk3} \label{\detokenize{users/whats_new:pgi-bindings-for-gtk3}} The GTK3 backends can now use \sphinxhref{https://pgi.readthedocs.io/en/latest/}{PGI} instead of \sphinxhref{http://pygobject.readthedocs.io/en/latest/\#}{PyGObject}. PGI is a fairly incomplete binding for GObject, thus its use is not recommended; its main benefit is its availability on Travis (thus allowing CI testing for the gtk3agg and gtk3cairo backends). The binding selection rules are as follows: - if \sphinxcode{\sphinxupquote{gi}} has already been imported, use it; else - if \sphinxcode{\sphinxupquote{pgi}} has already been imported, use it; else - if \sphinxcode{\sphinxupquote{gi}} can be imported, use it; else - if \sphinxcode{\sphinxupquote{pgi}} can be imported, use it; else - error out. Thus, to force usage of PGI when both bindings are installed, import it first. \subsection{Cairo rendering for Qt, WX, and Tk canvases} \label{\detokenize{users/whats_new:cairo-rendering-for-qt-wx-and-tk-canvases}} The new \sphinxcode{\sphinxupquote{Qt4Cairo}}, \sphinxcode{\sphinxupquote{Qt5Cairo}}, \sphinxcode{\sphinxupquote{WXCairo}}, and \sphinxcode{\sphinxupquote{TkCairo}} backends allow Qt, Wx, and Tk canvases to use Cairo rendering instead of Agg. \subsection{Added support for QT in new ToolManager} \label{\detokenize{users/whats_new:added-support-for-qt-in-new-toolmanager}} Now it is possible to use the ToolManager with Qt5 For example \begin{quote} import matplotlib matplotlib.use(‘QT5AGG’) matplotlib.rcParams{[}‘toolbar’{]} = ‘toolmanager’ import matplotlib.pyplot as plt plt.plot({[}1,2,3{]}) plt.show() \end{quote} Treat the new Tool classes experimental for now, the API will likely change and perhaps the rcParam as well The main example \sphinxcode{\sphinxupquote{examples/user\_interfaces/toolmanager\_sgskip.py}} shows more details, just adjust the header to use QT instead of GTK3 \subsection{TkAgg backend reworked to support PyPy} \label{\detokenize{users/whats_new:tkagg-backend-reworked-to-support-pypy}} \sphinxhref{https:/www.pypy.org}{PyPy} can now plot using the TkAgg backend, supported on PyPy 5.9 and greater (both PyPy for python 2.7 and PyPy for python 3.5). \subsection{Python logging library used for debug output} \label{\detokenize{users/whats_new:python-logging-library-used-for-debug-output}} Matplotlib has in the past (sporadically) used an internal verbose-output reporter. This version converts those calls to using the standard python \sphinxhref{https://docs.python.org/3/library/logging.html\#module-logging}{\sphinxcode{\sphinxupquote{logging}}} library. Support for the old \sphinxcode{\sphinxupquote{rcParams}} \sphinxcode{\sphinxupquote{verbose.level}} and \sphinxcode{\sphinxupquote{verbose.fileo}} is dropped. The command-line options \sphinxcode{\sphinxupquote{-{-}verbose-helpful}} and \sphinxcode{\sphinxupquote{-{-}verbose-debug}} are still accepted, but deprecated. They are now equivalent to setting \sphinxcode{\sphinxupquote{logging.INFO}} and \sphinxcode{\sphinxupquote{logging.DEBUG}}. The logger’s root name is \sphinxcode{\sphinxupquote{matplotlib}} and can be accessed from programs as: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{logging} \PYG{n}{mlog} \PYG{o}{=} \PYG{n}{logging}\PYG{o}{.}\PYG{n}{getLogger}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{matplotlib}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} Instructions for basic usage are in {\hyperref[\detokenize{faq/troubleshooting_faq:troubleshooting-faq}]{\sphinxcrossref{\DUrole{std,std-ref}{Troubleshooting}}}} and for developers in {\hyperref[\detokenize{devel/contributing:contributing}]{\sphinxcrossref{\DUrole{std,std-ref}{Contributing}}}}. \subsection{Improved \sphinxstyleliteralintitle{\sphinxupquote{repr}} for \sphinxstyleliteralintitle{\sphinxupquote{Transform}}s} \label{\detokenize{users/whats_new:improved-repr-for-transforms}} \sphinxcode{\sphinxupquote{Transform}}s now indent their \sphinxhref{https://docs.python.org/3/library/functions.html\#repr}{\sphinxcode{\sphinxupquote{repr}}}s in a more legible manner: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [1]: }\PYG{n}{l}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{)}\PYG{p}{;} \PYG{n}{l}\PYG{o}{.}\PYG{n}{get\PYGZus{}transform}\PYG{p}{(}\PYG{p}{)} \PYG{g+gh}{Out[1]:} \PYG{g+go}{CompositeGenericTransform(} \PYG{g+go}{ TransformWrapper(} \PYG{g+go}{ BlendedAffine2D(} \PYG{g+go}{ IdentityTransform(),} \PYG{g+go}{ IdentityTransform())),} \PYG{g+go}{ CompositeGenericTransform(} \PYG{g+go}{ BboxTransformFrom(} \PYG{g+go}{ TransformedBbox(} \PYG{g+go}{ Bbox(x0=\PYGZhy{}0.05500000000000001, y0=\PYGZhy{}0.05500000000000001, x1=0.05500000000000001, y1=0.05500000000000001),} \PYG{g+go}{ TransformWrapper(} \PYG{g+go}{ BlendedAffine2D(} \PYG{g+go}{ IdentityTransform(),} \PYG{g+go}{ IdentityTransform())))),} \PYG{g+go}{ BboxTransformTo(} \PYG{g+go}{ TransformedBbox(} \PYG{g+go}{ Bbox(x0=0.125, y0=0.10999999999999999, x1=0.9, y1=0.88),} \PYG{g+go}{ BboxTransformTo(} \PYG{g+go}{ TransformedBbox(} \PYG{g+go}{ Bbox(x0=0.0, y0=0.0, x1=6.4, y1=4.8),} \PYG{g+go}{ Affine2D(} \PYG{g+go}{ [[ 100. 0. 0.]} \PYG{g+go}{ [ 0. 100. 0.]} \PYG{g+go}{ [ 0. 0. 1.]])))))))} \end{sphinxVerbatim} \section{Previous Whats New} \label{\detokenize{users/whats_new:previous-whats-new}} \subsection{List of changes to Matplotlib prior to 2015} \label{\detokenize{users/prev_whats_new/changelog:list-of-changes-to-matplotlib-prior-to-2015}}\label{\detokenize{users/prev_whats_new/changelog:old-changelog}}\label{\detokenize{users/prev_whats_new/changelog::doc}} This is a list of the changes made to Matplotlib from 2003 to 2015. For more recent changes, please refer to the \sphinxhref{../whats\_new.html}{what’s new} or the \sphinxhref{../../api/api\_changes.html}{API changes}. \begin{description} \item[{2015-11-16 Levels passed to contour(f) and tricontour(f) must be in increasing}] \leavevmode order. \end{description} 2015-10-21 Added TextBox widget 2015-10-21 Added get\_ticks\_direction() \begin{description} \item[{2015-02-27 Added the rcParam ‘image.composite\_image’ to permit users}] \leavevmode to decide whether they want the vector graphics backends to combine all images within a set of axes into a single composite image. (If images do not get combined, users can open vector graphics files in Adobe Illustrator or Inkscape and edit each image individually.) \item[{2015-02-19 Rewrite of C++ code that calculates contours to add support for}] \leavevmode corner masking. This is controlled by the ‘corner\_mask’ keyword in plotting commands ‘contour’ and ‘contourf’. - IMT \item[{2015-01-23 Text bounding boxes are now computed with advance width rather than}] \leavevmode ink area. This may result in slightly different placement of text. \item[{2014-10-27 Allowed selection of the backend using the \sphinxcode{\sphinxupquote{MPLBACKEND}} environment}] \leavevmode variable. Added documentation on backend selection methods. \item[{2014-09-27 Overhauled \sphinxcode{\sphinxupquote{colors.LightSource}}. Added \sphinxcode{\sphinxupquote{LightSource.hillshade}} to}] \leavevmode allow the independent generation of illumination maps. Added new types of blending for creating more visually appealing shaded relief plots (e.g. \sphinxcode{\sphinxupquote{blend\_mode="overlay"}}, etc, in addition to the legacy “hsv” mode). \end{description} 2014-06-10 Added Colorbar.remove() 2014-06-07 Fixed bug so radial plots can be saved as ps in py3k. \begin{description} \item[{2014-06-01 Changed the fmt kwarg of errorbar to support the}] \leavevmode the mpl convention that “none” means “don’t draw it”, and to default to the empty string, so that plotting of data points is done with the plot() function defaults. Deprecated use of the None object in place “none”. \item[{2014-05-22 Allow the linscale keyword parameter of symlog scale to be}] \leavevmode smaller than one. \item[{2014-05-20 Added logic to in FontManager to invalidate font-cache if}] \leavevmode if font-family rcparams have changed. \end{description} 2014-05-16 Fixed the positioning of multi-line text in the PGF backend. \begin{description} \item[{2014-05-14 Added Axes.add\_image() as the standard way to add AxesImage}] \leavevmode instances to Axes. This improves the consistency with add\_artist(), add\_collection(), add\_container(), add\_line(), add\_patch(), and add\_table(). \end{description} 2014-05-02 Added colorblind-friendly colormap, named ‘Wistia’. \begin{description} \item[{2014-04-27 Improved input clean up in Axes.\{h\textbar{}v\}lines}] \leavevmode Coerce input into a 1D ndarrays (after dealing with units). \end{description} 2014-04-27 removed un-needed cast to float in stem \begin{description} \item[{2014-04-23 Updated references to “ipython -pylab”}] \leavevmode The preferred method for invoking pylab is now using the “\%pylab” magic. -Chris G. \item[{2014-04-22 Added (re-)generate a simple automatic legend to “Figure Options”}] \leavevmode dialog of the Qt4Agg backend. \item[{2014-04-22 Added an example showing the difference between}] \leavevmode interpolation = ‘none’ and interpolation = ‘nearest’ in \sphinxcode{\sphinxupquote{imshow()}} when saving vector graphics files. \item[{2014-04-22 Added violin plotting functions. See \sphinxcode{\sphinxupquote{Axes.violinplot}},}] \leavevmode \sphinxcode{\sphinxupquote{Axes.violin}}, \sphinxcode{\sphinxupquote{cbook.violin\_stats}} and \sphinxcode{\sphinxupquote{mlab.GaussianKDE}} for details. \item[{2014-04-10 Fixed the triangular marker rendering error. The “Up” triangle was}] \leavevmode rendered instead of “Right” triangle and vice-versa. \item[{2014-04-08 Fixed a bug in parasite\_axes.py by making a list out}] \leavevmode of a generator at line 263. \item[{2014-04-02 Added \sphinxcode{\sphinxupquote{clipon=False}} to patch creation of wedges and shadows}] \leavevmode in \sphinxcode{\sphinxupquote{pie}}. \item[{2014-02-25 In backend\_qt4agg changed from using update -\textgreater{} repaint under}] \leavevmode windows. See comment in source near \sphinxcode{\sphinxupquote{self.\_priv\_update}} for longer explaination. \item[{2014-03-27 Added tests for pie ccw parameter. Removed pdf and svg images}] \leavevmode from tests for pie linewidth parameter. \item[{2014-03-24 Changed the behaviour of axes to not ignore leading or trailing}] \leavevmode patches of height 0 (or width 0) while calculating the x and y axis limits. Patches having both height == 0 and width == 0 are ignored. \item[{2014-03-24 Added bool kwarg (manage\_xticks) to boxplot to enable/disable}] \leavevmode the managemnet of the xlimits and ticks when making a boxplot. Default in True which maintains current behavior by default. \item[{2014-03-23 Fixed a bug in projections/polar.py by making sure that the theta}] \leavevmode value being calculated when given the mouse coordinates stays within the range of 0 and 2 * pi. \item[{2014-03-22 Added the keyword arguments wedgeprops and textprops to pie.}] \leavevmode Users can control the wedge and text properties of the pie in more detail, if they choose. \item[{2014-03-17 Bug was fixed in append\_axes from the AxesDivider class would not}] \leavevmode append axes in the right location with respect to the reference locator axes \end{description} 2014-03-13 Add parameter ‘clockwise’ to function pie, True by default. 2014-02-28 Added ‘origin’ kwarg to \sphinxcode{\sphinxupquote{spy}} \begin{description} \item[{2014-02-27 Implemented separate horizontal/vertical axes padding to the}] \leavevmode ImageGrid in the AxesGrid toolkit \item[{2014-02-27 Allowed markevery property of matplotlib.lines.Line2D to be, an int}] \leavevmode numpy fancy index, slice object, or float. The float behaviour turns on markers at approximately equal display-coordinate-distances along the line. \item[{2014-02-25 In backend\_qt4agg changed from using update -\textgreater{} repaint under}] \leavevmode windows. See comment in source near \sphinxcode{\sphinxupquote{self.\_priv\_update}} for longer explaination. \item[{2014-01-02 \sphinxcode{\sphinxupquote{triplot}} now returns the artist it adds and support of line and}] \leavevmode marker kwargs has been improved. GBY \item[{2013-12-30 Made streamplot grid size consistent for different types of density}] \leavevmode argument. A 30x30 grid is now used for both density=1 and density=(1, 1). \item[{2013-12-03 Added a pure boxplot-drawing method that allow a more complete}] \leavevmode customization of boxplots. It takes a list of dicts contains stats. Also created a function (\sphinxcode{\sphinxupquote{cbook.boxplot\_stats}}) that generates the stats needed. \item[{2013-11-28 Added qhull extension module to perform Delaunay triangulation more}] \leavevmode robustly than before. It is used by tri.Triangulation (and hence all pyplot.tri* methods) and mlab.griddata. Deprecated matplotlib.delaunay module. - IMT \item[{2013-11-05 Add power-law normalization method. This is useful for,}] \leavevmode e.g., showing small populations in a “hist2d” histogram. \item[{2013-10-27 Added get\_rlabel\_position and set\_rlabel\_position methods to}] \leavevmode PolarAxes to control angular position of radial tick labels. \item[{2013-10-06 Add stride-based functions to mlab for easy creation of 2D arrays}] \leavevmode with less memory. \item[{2013-10-06 Improve window and detrend functions in mlab, particulart support for}] \leavevmode 2D arrays. \end{description} 2013-10-06 Improve performance of all spectrum-related mlab functions and plots. \begin{description} \item[{2013-10-06 Added support for magnitude, phase, and angle spectrums to}] \leavevmode axes.specgram, and support for magnitude, phase, angle, and complex spectrums to mlab-specgram. \item[{2013-10-06 Added magnitude\_spectrum, angle\_spectrum, and phase\_spectrum plots,}] \leavevmode as well as magnitude\_spectrum, angle\_spectrum, phase\_spectrum, and complex\_spectrum functions to mlab \item[{2013-07-12 Added support for datetime axes to 2d plots. Axis values are passed}] \leavevmode through Axes.convert\_xunits/Axes.convert\_yunits before being used by contour/contourf, pcolormesh and pcolor. \item[{2013-07-12 Allowed matplotlib.dates.date2num, matplotlib.dates.num2date,}] \leavevmode and matplotlib.dates.datestr2num to accept n-d inputs. Also factored in support for n-d arrays to matplotlib.dates.DateConverter and matplotlib.units.Registry. \item[{2013-06-26 Refactored the axes module: the axes module is now a folder,}] \leavevmode\begin{description} \item[{containing the following submodule:}] \leavevmode\begin{itemize} \item {} \_subplots.py, containing all the subplots helper methods \item {} \_base.py, containing several private methods and a new \_AxesBase class. This \_AxesBase class contains all the methods that are not directly linked to plots of the “old” Axes \item {} \_axes.py contains the Axes class. This class now inherits from \_AxesBase: it contains all “plotting” methods and labelling methods. \end{itemize} \end{description} This refactoring should not affect the API. Only private methods are not importable from the axes module anymore. \item[{2013-05-18 Added support for arbitrary rasterization resolutions to the}] \leavevmode SVG backend. Previously the resolution was hard coded to 72 dpi. Now the backend class takes a image\_dpi argument for its constructor, adjusts the image bounding box accordingly and forwards a magnification factor to the image renderer. The code and results now resemble those of the PDF backend. - MW \item[{2013-05-08 Changed behavior of hist when given stacked=True and normed=True.}] \leavevmode Histograms are now stacked first, then the sum is normalized. Previously, each histogram was normalized, then they were stacked. \end{description} 2013-04-25 Changed all instances of: \begin{quote} from matplotlib import MatplotlibDeprecationWarning as mplDeprecation to: from cbook import mplDeprecation and removed the import into the matplotlib namespace in \_\_init\_\_.py Thomas Caswell \end{quote} \begin{description} \item[{2013-04-15 Added ‘axes.xmargin’ and ‘axes.ymargin’ to rpParams to set default}] \leavevmode margins on auto-scaleing. - TAC \end{description} 2013-04-16 Added patheffect support for Line2D objects. -JJL \begin{description} \item[{2013-03-31 Added support for arbitrary unstructured user-specified}] \leavevmode triangulations to Axes3D.tricontour{[}f{]} - Damon McDougall \item[{2013-03-19 Added support for passing \sphinxcode{\sphinxupquote{linestyle}} kwarg to \sphinxcode{\sphinxupquote{step}} so all \sphinxcode{\sphinxupquote{plot}}}] \leavevmode kwargs are passed to the underlying \sphinxcode{\sphinxupquote{plot}} call. -TAC \item[{2013-02-25 Added classes CubicTriInterpolator, UniformTriRefiner, TriAnalyzer}] \leavevmode to matplotlib.tri module. - GBy \item[{2013-01-23 Add ‘savefig.directory’ to rcParams to remember and fill in the last}] \leavevmode directory saved to for figure save dialogs - Martin Spacek \item[{2013-01-13 Add eventplot method to axes and pyplot and EventCollection class}] \leavevmode to collections. \item[{2013-01-08 Added two extra titles to axes which are flush with the left and}] \leavevmode right edges of the plot respectively. Andrew Dawson \end{description} 2013-01-07 Add framealpha keyword argument to legend - PO 2013-01-16 Till Stensitzki added a baseline feature to stackplot \begin{description} \item[{2012-12-22 Added classes for interpolation within triangular grids}] \leavevmode (LinearTriInterpolator) and to find the triangles in which points lie (TrapezoidMapTriFinder) to matplotlib.tri module. - IMT \item[{2012-12-05 Added MatplotlibDeprecationWarning class for signaling deprecation.}] \leavevmode Matplotlib developers can use this class as follows: from matplotlib import MatplotlibDeprecationWarning as mplDeprecation In light of the fact that Python builtin DeprecationWarnings are ignored by default as of Python 2.7, this class was put in to allow for the signaling of deprecation, but via UserWarnings which are not ignored by default. - PI \item[{2012-11-27 Added the \sphinxstyleemphasis{mtext} parameter for supplying matplotlib.text.Text}] \leavevmode instances to RendererBase.draw\_tex and RendererBase.draw\_text. This allows backends to utilize additional text attributes, like the alignment of text elements. - pwuertz \item[{2012-11-26 deprecate matplotlib/mpl.py, which was used only in pylab.py and is}] \leavevmode now replaced by the more suitable \sphinxcode{\sphinxupquote{import matplotlib as mpl}}. - PI \end{description} 2012-11-25 Make rc\_context available via pyplot interface - PI \begin{description} \item[{2012-11-16 plt.set\_cmap no longer throws errors if there is not already}] \leavevmode an active colorable artist, such as an image, and just sets up the colormap to use from that point forward. - PI \item[{2012-11-16 Added the funcction \_get\_rbga\_face, which is identical to}] \leavevmode \_get\_rbg\_face except it return a (r,g,b,a) tuble, to line2D. Modified Line2D.draw to use \_get\_rbga\_face to get the markerface color so that any alpha set by markerfacecolor will respected. - Thomas Caswell \item[{2012-11-13 Add a symmetric log normalization class to colors.py.}] \leavevmode Also added some tests for the normalization class. Till Stensitzki \item[{2012-11-12 Make axes.stem take at least one argument.}] \leavevmode Uses a default range(n) when the first arg not provided. Damon McDougall \end{description} 2012-11-09 Make plt.subplot() without arguments act as subplot(111) - PI \begin{description} \item[{2012-11-08 Replaced plt.figure and plt.subplot calls by the newer, more}] \leavevmode convenient single call to plt.subplots() in the documentation examples - PI \end{description} 2012-10-05 Add support for saving animations as animated GIFs. - JVDP \begin{description} \item[{2012-08-11 Fix path-closing bug in patches.Polygon, so that regardless}] \leavevmode of whether the path is the initial one or was subsequently set by set\_xy(), get\_xy() will return a closed path if and only if get\_closed() is True. Thanks to Jacob Vanderplas. - EF \item[{2012-08-05 When a norm is passed to contourf, either or both of the}] \leavevmode vmin, vmax attributes of that norm are now respected. Formerly they were respected only if both were specified. In addition, vmin and/or vmax can now be passed to contourf directly as kwargs. - EF \item[{2012-07-24 Contourf handles the extend kwarg by mapping the extended}] \leavevmode ranges outside the normed 0-1 range so that they are handled by colormap colors determined by the set\_under and set\_over methods. Previously the extended ranges were mapped to 0 or 1 so that the “under” and “over” colormap colors were ignored. This change also increases slightly the color contrast for a given set of contour levels. - EF \end{description} 2012-06-24 Make use of mathtext in tick labels configurable - DSD 2012-06-05 Images loaded through PIL are now ordered correctly - CG 2012-06-02 Add new Axes method and pyplot function, hist2d. - PO \begin{description} \item[{2012-05-31 Remove support for ‘cairo.\textless{}format\textgreater{}’ style of backend specification.}] \leavevmode Deprecate ‘cairo.format’ and ‘savefig.extension’ rcParams and replace with ‘savefig.format’. - Martin Spacek \item[{2012-05-29 pcolormesh now obeys the passed in “edgecolor” kwarg.}] \leavevmode To support this, the “shading” argument to pcolormesh now only takes “flat” or “gouraud”. To achieve the old “faceted” behavior, pass “edgecolors=’k’”. - MGD \end{description} 2012-05-22 Added radius kwarg to pie charts. - HH \begin{description} \item[{2012-05-22 Collections now have a setting “offset\_position” to select whether}] \leavevmode the offsets are given in “screen” coordinates (default, following the old behavior) or “data” coordinates. This is currently used internally to improve the performance of hexbin. As a result, the “draw\_path\_collection” backend methods have grown a new argument “offset\_position”. - MGD \item[{2012-05-04 Add a new argument to pie charts - startingangle - that}] \leavevmode allows one to specify the angle offset for the first wedge of the chart. - EP \item[{2012-05-03 symlog scale now obeys the logarithmic base. Previously, it was}] \leavevmode completely ignored and always treated as base e. - MGD \item[{2012-05-03 Allow linscalex/y keyword to symlog scale that allows the size of}] \leavevmode the linear portion relative to the logarithmic portion to be adjusted. - MGD \item[{2012-04-14 Added new plot style: stackplot. This new feature supports stacked}] \leavevmode area plots. - Damon McDougall \item[{2012-04-06 When path clipping changes a LINETO to a MOVETO, it also}] \leavevmode changes any CLOSEPOLY command to a LINETO to the initial point. This fixes a problem with pdf and svg where the CLOSEPOLY would then draw a line to the latest MOVETO position instead of the intended initial position. - JKS \item[{2012-03-27 Add support to ImageGrid for placing colorbars only at}] \leavevmode one edge of each column/row. - RMM \item[{2012-03-07 Refactor movie writing into useful classes that make use}] \leavevmode of pipes to write image data to ffmpeg or mencoder. Also improve settings for these and the ability to pass custom options. - RMM \item[{2012-02-29 errorevery keyword added to errorbar to enable errorbar}] \leavevmode subsampling. fixes issue \#600. \item[{2012-02-28 Added plot\_trisurf to the mplot3d toolkit. This supports plotting}] \leavevmode three dimensional surfaces on an irregular grid. - Damon McDougall \item[{2012-01-23 The radius labels in polar plots no longer use a fixed}] \leavevmode padding, but use a different alignment depending on the quadrant they are in. This fixes numerical problems when (rmax - rmin) gets too small. - MGD \item[{2012-01-08 Add axes.streamplot to plot streamlines of a velocity field.}] \leavevmode Adapted from Tom Flannaghan streamplot implementation. -TSY \item[{2011-12-29 ps and pdf markers are now stroked only if the line width}] \leavevmode is nonzero for consistency with agg, fixes issue \#621. - JKS \end{description} 2011-12-27 Work around an EINTR bug in some versions of subprocess. - JKS \begin{description} \item[{2011-10-25 added support for operatorname to mathtext,}] \leavevmode including the ability to insert spaces, such as \$operatorname\{arg,max\}\$ - PI \item[{2011-08-18 Change api of Axes.get\_tightbbox and add an optional}] \leavevmode keyword parameter \sphinxstyleemphasis{call\_axes\_locator}. - JJL \item[{2011-07-29 A new rcParam “axes.formatter.use\_locale” was added, that,}] \leavevmode when True, will use the current locale to format tick labels. This means that, for example, in the fr\_FR locale, ‘,’ will be used as a decimal separator. - MGD \item[{2011-07-15 The set of markers available in the plot() and scatter()}] \leavevmode commands has been unified. In general, this gives more options to both than were previously available, however, there is one backward-incompatible change to the markers in scatter: \begin{quote} “d” used to mean “diamond”, it now means “narrow diamond”. “D” can be used for a “diamond”. \end{quote} -MGD \item[{2011-07-13 Fix numerical problems in symlog scale, particularly when}] \leavevmode linthresh \textless{}= 1.0. Symlog plots may look different if one was depending on the old broken behavior - MGD \item[{2011-07-10 Fixed argument handling error in tripcolor/triplot/tricontour,}] \leavevmode issue \#203. - IMT \item[{2011-07-08 Many functions added to mplot3d.axes3d to bring Axes3D}] \leavevmode objects more feature-parity with regular Axes objects. Significant revisions to the documentation as well. - BVR \item[{2011-07-07 Added compatibility with IPython strategy for picking}] \leavevmode a version of Qt4 support, and an rcParam for making the choice explicitly: backend.qt4. - EF \item[{2011-07-07 Modified AutoMinorLocator to improve automatic choice of}] \leavevmode the number of minor intervals per major interval, and to allow one to specify this number via a kwarg. - EF \item[{2011-06-28 3D versions of scatter, plot, plot\_wireframe, plot\_surface,}] \leavevmode bar3d, and some other functions now support empty inputs. - BVR \item[{2011-06-22 Add set\_theta\_offset, set\_theta\_direction and}] \leavevmode set\_theta\_zero\_location to polar axes to control the location of 0 and directionality of theta. - MGD \item[{2011-06-22 Add axes.labelweight parameter to set font weight to axis}] \leavevmode labels - MGD. \end{description} 2011-06-20 Add pause function to pyplot. - EF \begin{description} \item[{2011-06-16 Added \sphinxstyleemphasis{bottom} keyword parameter for the stem command.}] \leavevmode Also, implemented a legend handler for the stem plot. - JJL \end{description} 2011-06-16 Added legend.frameon rcParams. - Mike Kaufman 2011-05-31 Made backend\_qt4 compatible with PySide . - Gerald Storer \begin{description} \item[{2011-04-17 Disable keyboard auto-repeat in qt4 backend by ignoring}] \leavevmode key events resulting from auto-repeat. This makes constrained zoom/pan work. - EF \item[{2011-04-14 interpolation=”nearest” always interpolate images. A new}] \leavevmode mode “none” is introduced for no interpolation - JJL \item[{2011-04-03 Fixed broken pick interface to AsteriskCollection objects}] \leavevmode used by scatter. - EF \item[{2011-04-01 The plot directive Sphinx extension now supports all of the}] \leavevmode features in the Numpy fork of that extension. These include doctest formatting, an ‘include-source’ option, and a number of new configuration options. - MGD \item[{2011-03-29 Wrapped ViewVCCachedServer definition in a factory function.}] \leavevmode This class now inherits from urllib2.HTTPSHandler in order to fetch data from github, but HTTPSHandler is not defined if python was built without SSL support. - DSD \end{description} 2011-03-10 Update pytz version to 2011c, thanks to Simon Cross. - JKS 2011-03-06 Add standalone tests.py test runner script. - JKS \begin{description} \item[{2011-03-06 Set edgecolor to ‘face’ for scatter asterisk-type}] \leavevmode symbols; this fixes a bug in which these symbols were not responding to the c kwarg. The symbols have no face area, so only the edgecolor is visible. - EF \item[{2011-02-27 Support libpng version 1.5.x; suggestion by Michael}] \leavevmode Albert. Changed installation specification to a minimum of libpng version 1.2. - EF \item[{2011-02-20 clabel accepts a callable as an fmt kwarg; modified}] \leavevmode patch by Daniel Hyams. - EF \item[{2011-02-18 scatter({[}{]}, {[}{]}) is now valid. Also fixed issues}] \leavevmode with empty collections - BVR \end{description} 2011-02-07 Quick workaround for dviread bug \#3175113 - JKS \begin{description} \item[{2011-02-05 Add cbook memory monitoring for Windows, using}] \leavevmode tasklist. - EF \item[{2011-02-05 Speed up Normalize and LogNorm by using in-place}] \leavevmode operations and by using float32 for float32 inputs and for ints of 2 bytes or shorter; based on patch by Christoph Gohlke. - EF \item[{2011-02-04 Changed imshow to use rgba as uint8 from start to}] \leavevmode finish, instead of going through an intermediate step as double precision; thanks to Christoph Gohlke. - EF \item[{2011-01-13 Added zdir and offset arguments to contourf3d to}] \leavevmode bring contourf3d in feature parity with contour3d. - BVR \end{description} 2011-01-04 Tag 1.0.1 for release at r8896 2011-01-03 Added display of ticker offset to 3d plots. - BVR \begin{description} \item[{2011-01-03 Turn off tick labeling on interior subplots for}] \leavevmode pyplots.subplots when sharex/sharey is True. - JDH \end{description} 2010-12-29 Implement axes\_divider.HBox and VBox. -JJL 2010-11-22 Fixed error with Hammer projection. - BVR 2010-11-12 Fixed the placement and angle of axis labels in 3D plots. - BVR \begin{description} \item[{2010-11-07 New rc parameters examples.download and examples.directory}] \leavevmode allow bypassing the download mechanism in get\_sample\_data. - JKS \item[{2010-10-04 Fix JPEG saving bug: only accept the kwargs documented}] \leavevmode by PIL for JPEG files. - JKS \end{description} 2010-09-15 Remove unused \_wxagg extension and numerix.h. - EF 2010-08-25 Add new framework for doing animations with examples.- RM \begin{description} \item[{2010-08-21 Remove unused and inappropriate methods from Tick classes:}] \leavevmode set\_view\_interval, get\_minpos, and get\_data\_interval are properly found in the Axis class and don’t need to be duplicated in XTick and YTick. - EF \item[{2010-08-21 Change Axis.set\_view\_interval() so that when updating an}] \leavevmode existing interval, it respects the orientation of that interval, and can enlarge but not reduce the interval. This fixes a bug in which Axis.set\_ticks would change the view limits of an inverted axis. Whether set\_ticks should be affecting the viewLim at all remains an open question. - EF \item[{2010-08-16 Handle NaN’s correctly in path analysis routines. Fixes a}] \leavevmode bug where the best location for a legend was not calculated correctly when the line contains NaNs. - MGD \end{description} 2010-08-14 Fix bug in patch alpha handling, and in bar color kwarg - EF \begin{description} \item[{2010-08-12 Removed all traces of numerix module after 17 months of}] \leavevmode deprecation warnings. - EF \item[{2010-08-05 Added keyword arguments ‘thetaunits’ and ‘runits’ for polar}] \leavevmode plots. Fixed PolarAxes so that when it set default Formatters, it marked them as such. Fixed semilogx and semilogy to no longer blindly reset the ticker information on the non-log axis. Axes.arrow can now accept unitized data. - JRE \item[{2010-08-03 Add support for MPLSETUPCFG variable for custom setup.cfg}] \leavevmode filename. Used by sage buildbot to build an mpl w/ no gui support - JDH \item[{2010-08-01 Create directory specified by MPLCONFIGDIR if it does}] \leavevmode not exist. - ADS \end{description} 2010-07-20 Return Qt4’s default cursor when leaving the canvas - DSD 2010-07-06 Tagging for mpl 1.0 at r8502 \begin{description} \item[{2010-07-05 Added Ben Root’s patch to put 3D plots in arbitrary axes,}] \leavevmode allowing you to mix 3d and 2d in different axes/subplots or to have multiple 3D plots in one figure. See examples/mplot3d/subplot3d\_demo.py - JDH \item[{2010-07-05 Preferred kwarg names in set\_xlim are now ‘left’ and}] \leavevmode ‘right’; in set\_ylim, ‘bottom’ and ‘top’; original kwargs are still accepted without complaint. - EF \item[{2010-07-05 TkAgg and FltkAgg backends are now consistent with other}] \leavevmode interactive backends: when used in scripts from the command line (not from ipython -pylab), show blocks, and can be called more than once. - EF \item[{2010-07-02 Modified CXX/WrapPython.h to fix “swab bug” on solaris so}] \leavevmode mpl can compile on Solaris with CXX6 in the trunk. Closes tracker bug 3022815 - JDH \item[{2010-06-30 Added autoscale convenience method and corresponding}] \leavevmode pyplot function for simplified control of autoscaling; and changed axis, set\_xlim, and set\_ylim so that by default, they turn off the autoscaling on the relevant axis or axes. Therefore one can call set\_xlim before plotting a line, for example, and the limits will be retained. - EF \item[{2010-06-20 Added Axes.tick\_params and corresponding pyplot function}] \leavevmode to control tick and tick label appearance after an Axes has been created. - EF \item[{2010-06-09 Allow Axes.grid to control minor gridlines; allow}] \leavevmode Axes.grid and Axis.grid to control major and minor gridlines in the same method call. - EF \item[{2010-06-06 Change the way we do split/dividend adjustments in}] \leavevmode finance.py to handle dividends and fix the zero division bug reported in sf bug 2949906 and 2123566. Note that volume is not adjusted because the Yahoo CSV does not distinguish between share split and dividend adjustments making it near impossible to get volume adjustement right (unless we want to guess based on the size of the adjustment or scrape the html tables, which we don’t) - JDH \end{description} 2010-06-06 Updated dateutil to 1.5 and pytz to 2010h. 2010-06-02 Add error\_kw kwarg to Axes.bar(). - EF \begin{description} \item[{2010-06-01 Fix pcolormesh() and QuadMesh to pass on kwargs as}] \leavevmode appropriate. - RM \end{description} 2010-05-18 Merge mpl\_toolkits.gridspec into the main tree. - JJL \begin{description} \item[{2010-05-04 Improve backend\_qt4 so it displays figures with the}] \leavevmode correct size - DSD \item[{2010-04-20 Added generic support for connecting to a timer for events. This}] \leavevmode adds TimerBase, TimerGTK, TimerQT, TimerWx, and TimerTk to the backends and a new\_timer() method to each backend’s canvas to allow ease of creating a new timer. - RM \end{description} 2010-04-20 Added margins() Axes method and pyplot function. - EF 2010-04-18 update the axes\_grid documentation. -JJL \begin{description} \item[{2010-04-18 Control MaxNLocator parameters after instantiation,}] \leavevmode and via Axes.locator\_params method, with corresponding pyplot function. -EF \item[{2010-04-18 Control ScalarFormatter offsets directly and via the}] \leavevmode Axes.ticklabel\_format() method, and add that to pyplot. -EF \end{description} 2010-04-16 Add a close\_event to the backends. -RM 2010-04-06 modify axes\_grid examples to use axes\_grid1 and axisartist. -JJL 2010-04-06 rebase axes\_grid using axes\_grid1 and axisartist modules. -JJL \begin{description} \item[{2010-04-06 axes\_grid toolkit is splitted into two separate modules,}] \leavevmode axes\_grid1 and axisartist. -JJL \item[{2010-04-05 Speed up import: import pytz only if and when it is}] \leavevmode needed. It is not needed if the rc timezone is UTC. - EF \item[{2010-04-03 Added color kwarg to Axes.hist(), based on work by}] \leavevmode Jeff Klukas. - EF \item[{2010-03-24 refactor colorbar code so that no cla() is necessary when}] \leavevmode mappable is changed. -JJL \item[{2010-03-22 fix incorrect rubber band during the zoom mode when mouse}] \leavevmode leaves the axes. -JJL \end{description} 2010-03-21 x/y key during the zoom mode only changes the x/y limits. -JJL 2010-03-20 Added pyplot.sca() function suggested by JJL. - EF 2010-03-20 Added conditional support for new Tooltip API in gtk backend. - EF \begin{description} \item[{2010-03-20 Changed plt.fig\_subplot() to plt.subplots() after discussion on}] \leavevmode list, and changed its API to return axes as a numpy object array (with control of dimensions via squeeze keyword). FP. \end{description} 2010-03-13 Manually brought in commits from branch: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}} \PYG{n}{r8191} \PYG{o}{\textbar{}} \PYG{n}{leejjoon} \PYG{o}{\textbar{}} \PYG{l+m+mi}{2010}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{03}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{13} \PYG{l+m+mi}{17}\PYG{p}{:}\PYG{l+m+mi}{27}\PYG{p}{:}\PYG{l+m+mi}{57} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{0500} \PYG{p}{(}\PYG{n}{Sat}\PYG{p}{,} \PYG{l+m+mi}{13} \PYG{n}{Mar} \PYG{l+m+mi}{2010}\PYG{p}{)} \PYG{o}{\textbar{}} \PYG{l+m+mi}{1} \PYG{n}{line} \PYG{n}{fix} \PYG{n}{the} \PYG{n}{bug} \PYG{n}{that} \PYG{n}{handles} \PYG{k}{for} \PYG{n}{scatter} \PYG{n}{are} \PYG{n}{incorrectly} \PYG{n+nb}{set} \PYG{n}{when} \PYG{n}{dpi}\PYG{o}{!=}\PYG{l+m+mf}{72.} \PYG{n}{Thanks} \PYG{n}{to} \PYG{n}{Ray} \PYG{n}{Speth} \PYG{k}{for} \PYG{n}{the} \PYG{n}{bug} \PYG{n}{report}\PYG{o}{.} \end{sphinxVerbatim} 2010-03-03 Manually brought in commits from branch via diff/patch (svnmerge is broken): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}} \PYG{n}{r8175} \PYG{o}{\textbar{}} \PYG{n}{leejjoon} \PYG{o}{\textbar{}} \PYG{l+m+mi}{2010}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{03}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{03} \PYG{l+m+mi}{10}\PYG{p}{:}\PYG{l+m+mi}{03}\PYG{p}{:}\PYG{l+m+mi}{30} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{0800} \PYG{p}{(}\PYG{n}{Wed}\PYG{p}{,} \PYG{l+m+mi}{03} \PYG{n}{Mar} \PYG{l+m+mi}{2010}\PYG{p}{)} \PYG{o}{\textbar{}} \PYG{l+m+mi}{1} \PYG{n}{line} \PYG{n}{fix} \PYG{n}{arguments} \PYG{n}{of} \PYG{n}{allow\PYGZus{}rasterization}\PYG{o}{.}\PYG{n}{draw\PYGZus{}wrapper} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}} \PYG{n}{r8174} \PYG{o}{\textbar{}} \PYG{n}{jdh2358} \PYG{o}{\textbar{}} \PYG{l+m+mi}{2010}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{03}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{03} \PYG{l+m+mi}{09}\PYG{p}{:}\PYG{l+m+mi}{15}\PYG{p}{:}\PYG{l+m+mi}{58} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{0800} \PYG{p}{(}\PYG{n}{Wed}\PYG{p}{,} \PYG{l+m+mi}{03} \PYG{n}{Mar} \PYG{l+m+mi}{2010}\PYG{p}{)} \PYG{o}{\textbar{}} \PYG{l+m+mi}{1} \PYG{n}{line} \PYG{n}{added} \PYG{n}{support} \PYG{k}{for} \PYG{n}{favicon} \PYG{o+ow}{in} \PYG{n}{docs} \PYG{n}{build} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}} \PYG{n}{r8173} \PYG{o}{\textbar{}} \PYG{n}{jdh2358} \PYG{o}{\textbar{}} \PYG{l+m+mi}{2010}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{03}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{03} \PYG{l+m+mi}{08}\PYG{p}{:}\PYG{l+m+mi}{56}\PYG{p}{:}\PYG{l+m+mi}{16} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{0800} \PYG{p}{(}\PYG{n}{Wed}\PYG{p}{,} \PYG{l+m+mi}{03} \PYG{n}{Mar} \PYG{l+m+mi}{2010}\PYG{p}{)} \PYG{o}{\textbar{}} \PYG{l+m+mi}{1} \PYG{n}{line} \PYG{n}{applied} \PYG{n}{Mattias} \PYG{n}{get\PYGZus{}bounds} \PYG{n}{patch} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}} \PYG{n}{r8172} \PYG{o}{\textbar{}} \PYG{n}{jdh2358} \PYG{o}{\textbar{}} \PYG{l+m+mi}{2010}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{03}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{03} \PYG{l+m+mi}{08}\PYG{p}{:}\PYG{l+m+mi}{31}\PYG{p}{:}\PYG{l+m+mi}{42} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{0800} \PYG{p}{(}\PYG{n}{Wed}\PYG{p}{,} \PYG{l+m+mi}{03} \PYG{n}{Mar} \PYG{l+m+mi}{2010}\PYG{p}{)} \PYG{o}{\textbar{}} \PYG{l+m+mi}{1} \PYG{n}{line} \PYG{n}{fix} \PYG{n}{svnmerge} \PYG{n}{download} \PYG{n}{instructions} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}} \PYG{n}{r8171} \PYG{o}{\textbar{}} \PYG{n}{jdh2358} \PYG{o}{\textbar{}} \PYG{l+m+mi}{2010}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{03}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{03} \PYG{l+m+mi}{07}\PYG{p}{:}\PYG{l+m+mi}{47}\PYG{p}{:}\PYG{l+m+mi}{48} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{0800} \PYG{p}{(}\PYG{n}{Wed}\PYG{p}{,} \PYG{l+m+mi}{03} \PYG{n}{Mar} \PYG{l+m+mi}{2010}\PYG{p}{)} \PYG{o}{\textbar{}} \PYG{l+m+mi}{1} \PYG{n}{line} \end{sphinxVerbatim} 2010-02-25 add annotation\_demo3.py that demonstrates new functionality. -JJL \begin{description} \item[{2010-02-25 refactor Annotation to support arbitrary Transform as xycoords}] \leavevmode or textcoords. Also, if a tuple of two coordinates is provided, they are interpreted as coordinates for each x and y position. -JJL \item[{2010-02-24 Added pyplot.fig\_subplot(), to create a figure and a group of}] \leavevmode subplots in a single call. This offers an easier pattern than manually making figures and calling add\_subplot() multiple times. FP \item[{2010-02-17 Added Gokhan’s and Mattias’ customizable keybindings patch}] \leavevmode for the toolbar. You can now set the keymap.* properties in the matplotlibrc file. Newbindings were added for toggling log scaling on the x-axis. JDH \item[{2010-02-16 Committed TJ’s filled marker patch for}] \leavevmode left\textbar{}right\textbar{}bottom\textbar{}top\textbar{}full filled markers. See examples/pylab\_examples/filledmarker\_demo.py. JDH \item[{2010-02-11 Added ‘bootstrap’ option to boxplot. This allows bootstrap}] \leavevmode estimates of median confidence intervals. Based on an initial patch by Paul Hobson. - ADS \item[{2010-02-06 Added setup.cfg “basedirlist” option to override setting}] \leavevmode in setupext.py “basedir” dictionary; added “gnu0” platform requested by Benjamin Drung. - EF \end{description} 2010-02-06 Added ‘xy’ scaling option to EllipseCollection. - EF \begin{description} \item[{2010-02-03 Made plot\_directive use a custom PlotWarning category, so that}] \leavevmode warnings can be turned into fatal errors easily if desired. - FP \item[{2010-01-29 Added draggable method to Legend to allow mouse drag}] \leavevmode placement. Thanks Adam Fraser. JDH \item[{2010-01-25 Fixed a bug reported by Olle Engdegard, when using}] \leavevmode histograms with stepfilled and log=True - MM \end{description} 2010-01-16 Upgraded CXX to 6.1.1 - JDH \begin{description} \item[{2009-01-16 Don’t create minor ticks on top of existing major}] \leavevmode ticks. Patch by Neil Crighton. -ADS \item[{2009-01-16 Ensure three minor ticks always drawn (SF\# 2924245). Patch}] \leavevmode by Neil Crighton. -ADS \item[{2010-01-16 Applied patch by Ian Thomas to fix two contouring}] \leavevmode problems: now contourf handles interior masked regions, and the boundaries of line and filled contours coincide. - EF \item[{2009-01-11 The color of legend patch follows the rc parameters}] \leavevmode axes.facecolor and axes.edgecolor. -JJL \item[{2009-01-11 adjustable of Axes can be “box-forced” which allow}] \leavevmode sharing axes. -JJL \item[{2009-01-11 Add add\_click and pop\_click methods in}] \leavevmode BlockingContourLabeler. -JJL \end{description} 2010-01-03 Added rcParams{[}‘axes.color\_cycle’{]} - EF 2010-01-03 Added Pierre’s qt4 formlayout editor and toolbar button - JDH \begin{description} \item[{2009-12-31 Add support for using math text as marker symbols (Thanks to tcb)}] \leavevmode\begin{itemize} \item {} MGD \end{itemize} \end{description} 2009-12-31 Commit a workaround for a regression in PyQt4-4.6.\{0,1\} - DSD 2009-12-22 Fix cmap data for gist\_earth\_r, etc. -JJL \begin{description} \item[{2009-12-20 spines: put spines in data coordinates, add set\_bounds()}] \leavevmode call. -ADS \item[{2009-12-18 Don’t limit notch size in boxplot to q1-q3 range, as this}] \leavevmode is effectively making the data look better than it is. - ADS \item[{2009-12-18 mlab.prctile handles even-length data, such that the median}] \leavevmode is the mean of the two middle values. - ADS \end{description} 2009-12-15 Add raw-image (unsampled) support for the ps backend. - JJL \begin{description} \item[{2009-12-14 Add patch\_artist kwarg to boxplot, but keep old default.}] \leavevmode Convert boxplot\_demo2.py to use the new patch\_artist. - ADS \item[{2009-12-06 axes\_grid: reimplemented AxisArtist with FloatingAxes support.}] \leavevmode Added new examples. - JJL \item[{2009-12-01 Applied Laurent Dufrechou’s patch to improve blitting with}] \leavevmode the qt4 backend - DSD \item[{2009-11-13 The pdf backend now allows changing the contents of}] \leavevmode a pdf file’s information dictionary via PdfPages.infodict. - JKS \item[{2009-11-12 font\_manager.py should no longer cause EINTR on Python 2.6}] \leavevmode (but will on the 2.5 version of subprocess). Also the fc-list command in that file was fixed so now it should actually find the list of fontconfig fonts. - JKS \item[{2009-11-10 Single images, and all images in renderers with}] \leavevmode option\_image\_nocomposite (i.e. agg, macosx and the svg backend when rcParams{[}‘svg.image\_noscale’{]} is True), are now drawn respecting the zorder relative to other artists. (Note that there may now be inconsistencies across backends when more than one image is drawn at varying zorders, but this change introduces correct behavior for the backends in which it’s easy to do so.) \item[{2009-10-21 Make AutoDateLocator more configurable by adding options}] \leavevmode to control the maximum and minimum number of ticks. Also add control of the intervals to be used for ticking. This does not change behavior but opens previously hard-coded behavior to runtime modification{}`. - RMM \item[{2009-10-19 Add “path\_effects” support for Text and Patch. See}] \leavevmode examples/pylab\_examples/patheffect\_demo.py -JJL \item[{2009-10-19 Add “use\_clabeltext” option to clabel. If True, clabels}] \leavevmode will be created with ClabelText class, which recalculates rotation angle of the label during the drawing time. -JJL \item[{2009-10-16 Make AutoDateFormatter actually use any specified}] \leavevmode timezone setting.This was only working correctly when no timezone was specified. - RMM \end{description} 2009-09-27 Beginnings of a capability to test the pdf backend. - JKS \begin{description} \item[{2009-09-27 Add a savefig.extension rcparam to control the default}] \leavevmode filename extension used by savefig. - JKS \end{description} \bigskip\hrule\bigskip 2009-09-21 Tagged for release 0.99.1 2009-09-20 Fix usetex spacing errors in pdf backend. - JKS \begin{description} \item[{2009-09-20 Add Sphinx extension to highlight IPython console sessions,}] \leavevmode originally authored (I think) by Michael Droetboom. - FP \item[{2009-09-20 Fix off-by-one error in dviread.Tfm, and additionally protect}] \leavevmode against exceptions in case a dvi font is missing some metrics. - JKS \item[{2009-09-15 Implement draw\_text and draw\_tex method of backend\_base using}] \leavevmode the textpath module. Implement draw\_tex method of the svg backend. - JJL \end{description} 2009-09-15 Don’t fail on AFM files containing floating-point bounding boxes - JKS \begin{description} \item[{2009-09-13 AxesGrid}] \leavevmode{[}add modified version of colorbar. Add colorbar{]} location howto. - JJL \item[{2009-09-07 AxesGrid}] \leavevmode{[}implemented axisline style.{]} Added a demo examples/axes\_grid/demo\_axisline\_style.py- JJL \item[{2009-09-04 Make the textpath class as a separate moduel}] \leavevmode (textpath.py). Add support for mathtext and tex.- JJL \item[{2009-09-01 Added support for Gouraud interpolated triangles.}] \leavevmode pcolormesh now accepts shading=’gouraud’ as an option. - MGD \item[{2009-08-29 Added matplotlib.testing package, which contains a Nose}] \leavevmode plugin and a decorator that lets tests be marked as KnownFailures - ADS \item[{2009-08-20 Added scaled dict to AutoDateFormatter for customized}] \leavevmode scales - JDH \item[{2009-08-15 Pyplot interface: the current image is now tracked at the}] \leavevmode figure and axes level, addressing tracker item 1656374. - EF \item[{2009-08-15 Docstrings are now manipulated with decorators defined}] \leavevmode in a new module, docstring.py, thanks to Jason Coombs. - EF \item[{2009-08-14 Add support for image filtering for agg back end. See the example}] \leavevmode demo\_agg\_filter.py. -JJL \item[{2009-08-09 AnnotationBbox added. Similar to Annotation, but works with}] \leavevmode OffsetBox instead of Text. See the example demo\_annotation\_box.py. -JJL \item[{2009-08-07 BboxImage implemented. Two examples, demo\_bboximage.py and}] \leavevmode demo\_ribbon\_box.py added. - JJL \item[{2009-08-07 In an effort to simplify the backend API, all clipping rectangles}] \leavevmode and paths are now passed in using GraphicsContext objects, even on collections and images. Therefore: \begin{quote} \begin{description} \item[{draw\_path\_collection(self, master\_transform, cliprect, clippath,}] \leavevmode clippath\_trans, paths, all\_transforms, offsets, offsetTrans, facecolors, edgecolors, linewidths, linestyles, antialiaseds, urls) \begin{quote} becomes: \end{quote} \item[{draw\_path\_collection(self, gc, master\_transform, paths, all\_transforms,}] \leavevmode offsets, offsetTrans, facecolors, edgecolors, linewidths, linestyles, antialiaseds, urls) \item[{draw\_quad\_mesh(self, master\_transform, cliprect, clippath,}] \leavevmode clippath\_trans, meshWidth, meshHeight, coordinates, offsets, offsetTrans, facecolors, antialiased, showedges) \begin{quote} becomes: \end{quote} \item[{draw\_quad\_mesh(self, gc, master\_transform, meshWidth, meshHeight,}] \leavevmode coordinates, offsets, offsetTrans, facecolors, antialiased, showedges) \end{description} draw\_image(self, x, y, im, bbox, clippath=None, clippath\_trans=None) \begin{quote} becomes: \end{quote} draw\_image(self, gc, x, y, im) \end{quote} \begin{itemize} \item {} MGD \end{itemize} \end{description} 2009-08-06 Tagging the 0.99.0 release at svn r7397 - JDH \begin{itemize} \item {} fixed an alpha colormapping bug posted on sf 2832575 \item {} fix typo in axes\_divider.py. use nanmin, nanmax in angle\_helper.py (patch by Christoph Gohlke) \item {} remove dup gui event in enter/leave events in gtk \item {} lots of fixes for os x binaries (Thanks Russell Owen) \item {} attach gtk events to mpl events \textendash{} fixes sf bug 2816580 \item {} applied sf patch 2815064 (middle button events for wx) and patch 2818092 (resize events for wx) \item {} fixed boilerplate.py so it doesn’t break the ReST docs. \item {} removed a couple of cases of mlab.load \item {} fixed rec2csv win32 file handle bug from sf patch 2831018 \item {} added two examples from Josh Hemann: examples/pylab\_examples/barchart\_demo2.py and examples/pylab\_examples/boxplot\_demo2.py \item {} handled sf bugs 2831556 and 2830525; better bar error messages and backend driver configs \item {} added miktex win32 patch from sf patch 2820194 \item {} apply sf patches 2830233 and 2823885 for osx setup and 64 bit; thanks Michiel \end{itemize} \begin{description} \item[{2009-08-04 Made cbook.get\_sample\_data make use of the ETag and Last-Modified}] \leavevmode headers of mod\_dav\_svn. - JKS \item[{2009-08-03 Add PathCollection; modify contourf to use complex}] \leavevmode paths instead of simple paths with cuts. - EF \end{description} 2009-08-03 Fixed boilerplate.py so it doesn’t break the ReST docs. - JKS \begin{description} \item[{2009-08-03 pylab no longer provides a load and save function. These}] \leavevmode are available in matplotlib.mlab, or you can use numpy.loadtxt and numpy.savetxt for text files, or np.save and np.load for binary numpy arrays. - JDH \item[{2009-07-31 Added cbook.get\_sample\_data for urllib enabled fetching and}] \leavevmode cacheing of data needed for examples. See examples/misc/sample\_data\_demo.py - JDH \end{description} 2009-07-31 Tagging 0.99.0.rc1 at 7314 - MGD \begin{description} \item[{2009-07-30 Add set\_cmap and register\_cmap, and improve get\_cmap,}] \leavevmode to provide convenient handling of user-generated colormaps. Reorganized \_cm and cm modules. - EF \end{description} 2009-07-28 Quiver speed improved, thanks to tip by Ray Speth. -EF 2009-07-27 Simplify argument handling code for plot method. -EF 2009-07-25 Allow “plot(1, 2, ‘r*’)” to work. - EF \begin{description} \item[{2009-07-22 Added an ‘interp’ keyword to griddata so the faster linear}] \leavevmode interpolation method can be chosen. Default is ‘nn’, so default behavior (using natural neighbor method) is unchanged (JSW) \item[{2009-07-22 Improved boilerplate.py so that it generates the correct}] \leavevmode signatures for pyplot functions. - JKS \item[{2009-07-19 Fixed the docstring of Axes.step to reflect the correct}] \leavevmode meaning of the kwargs “pre” and “post” - See SF bug \sphinxurl{https://sourceforge.net/tracker/index.php?func=detail\&aid=2823304\&group\_id=80706\&atid=560720} - JDH \item[{2009-07-18 Fix support for hatches without color fills to pdf and svg}] \leavevmode backends. Add an example of that to hatch\_demo.py. - JKS \end{description} 2009-07-17 Removed fossils from swig version of agg backend. - EF 2009-07-14 initial submission of the annotation guide. -JJL \begin{description} \item[{2009-07-14 axes\_grid}] \leavevmode{[}minor improvements in anchored\_artists and{]} inset\_locator. -JJL \item[{2009-07-14 Fix a few bugs in ConnectionStyle algorithms. Add}] \leavevmode ConnectionPatch class. -JJL \item[{2009-07-11 Added a fillstyle Line2D property for half filled markers}] \leavevmode \textendash{} see examples/pylab\_examples/fillstyle\_demo.py JDH \item[{2009-07-08 Attempt to improve performance of qt4 backend, do not call}] \leavevmode qApp.processEvents while processing an event. Thanks Ole Streicher for tracking this down - DSD \item[{2009-06-24 Add withheader option to mlab.rec2csv and changed}] \leavevmode use\_mrecords default to False in mlab.csv2rec since this is partially broken - JDH \item[{2009-06-24 backend\_agg.draw\_marker quantizes the main path (as in the}] \leavevmode draw\_path). - JJL \end{description} 2009-06-24 axes\_grid: floating axis support added. - JJL \begin{description} \item[{2009-06-14 Add new command line options to backend\_driver.py to support}] \leavevmode running only some directories of tests - JKS \end{description} 2009-06-13 partial cleanup of mlab and its importation in pylab - EF \begin{description} \item[{2009-06-13 Introduce a rotation\_mode property for the Text artist. See}] \leavevmode examples/pylab\_examples/demo\_text\_rotation\_mode.py -JJL \item[{2009-06-07 add support for bz2 files per sf support request 2794556 -}] \leavevmode JDH \item[{2009-06-06 added a properties method to the artist and inspector to}] \leavevmode return a dict mapping property name -\textgreater{} value; see sf feature request 2792183 - JDH \end{description} 2009-06-06 added Neil’s auto minor tick patch; sf patch \#2789713 - JDH \begin{description} \item[{2009-06-06 do not apply alpha to rgba color conversion if input is}] \leavevmode already rgba - JDH \item[{2009-06-03 axes\_grid}] \leavevmode{[}Initial check-in of curvelinear grid support. See{]} examples/axes\_grid/demo\_curvelinear\_grid.py - JJL \end{description} 2009-06-01 Add set\_color method to Patch - EF 2009-06-01 Spine is now derived from Patch - ADS 2009-06-01 use cbook.is\_string\_like() instead of isinstance() for spines - ADS 2009-06-01 cla() support for spines - ADS 2009-06-01 Removed support for gtk \textless{} 2.4. - EF \begin{description} \item[{2009-05-29 Improved the animation\_blit\_qt4 example, which was a mix}] \leavevmode of the object-oriented and pylab interfaces. It is now strictly object-oriented - DSD \end{description} 2009-05-28 Fix axes\_grid toolkit to work with spine patch by ADS. - JJL \begin{description} \item[{2009-05-28 Applied fbianco’s patch to handle scroll wheel events in}] \leavevmode the qt4 backend - DSD \end{description} 2009-05-26 Add support for “axis spines” to have arbitrary location. -ADS \begin{description} \item[{2009-05-20 Add an empty matplotlibrc to the tests/ directory so that running}] \leavevmode tests will use the default set of rcparams rather than the user’s config. - RMM \item[{2009-05-19 Axis.grid(): allow use of which=’major,minor’ to have grid}] \leavevmode on major and minor ticks. -ADS \item[{2009-05-18 Make psd(), csd(), and cohere() wrap properly for complex/two-sided}] \leavevmode versions, like specgram() (SF \#2791686) - RMM \item[{2009-05-18 Fix the linespacing bug of multiline text (\#1239682). See}] \leavevmode examples/pylab\_examples/multiline.py -JJL \item[{2009-05-18 Add \sphinxstyleemphasis{annotation\_clip} attr. for text.Annotation class.}] \leavevmode If True, annotation is only drawn when the annotated point is inside the axes area. -JJL \item[{2009-05-17 Fix bug(\#2749174) that some properties of minor ticks are}] \leavevmode not conserved -JJL \item[{2009-05-17 applied Michiel’s sf patch 2790638 to turn off gtk event}] \leavevmode loop in setupext for pygtk\textgreater{}=2.15.10 - JDH \item[{2009-05-17 applied Michiel’s sf patch 2792742 to speed up Cairo and}] \leavevmode macosx collections; speedups can be 20x. Also fixes some bugs in which gc got into inconsistent state \end{description} \bigskip\hrule\bigskip 2008-05-17 Release 0.98.5.3 at r7107 from the branch - JDH \begin{description} \item[{2009-05-13 An optional offset and bbox support in restore\_bbox.}] \leavevmode Add animation\_blit\_gtk2.py. -JJL \item[{2009-05-13 psfrag in backend\_ps now uses baseline-alignment}] \leavevmode when preview.sty is used ((default is bottom-alignment). Also, a small api imporvement in OffsetBox-JJL \item[{2009-05-13 When the x-coordinate of a line is monotonically}] \leavevmode increasing, it is now automatically clipped at the stage of generating the transformed path in the draw method; this greatly speeds up zooming and panning when one is looking at a short segment of a long time series, for example. - EF \end{description} 2009-05-11 aspect=1 in log-log plot gives square decades. -JJL \begin{description} \item[{2009-05-08 clabel takes new kwarg, rightside\_up; if False, labels}] \leavevmode will not be flipped to keep them rightside-up. This allows the use of clabel to make streamfunction arrows, as requested by Evan Mason. - EF \item[{2009-05-07 ‘labelpad’ can now be passed when setting x/y labels. This}] \leavevmode allows controlling the spacing between the label and its axis. - RMM \item[{2009-05-06 print\_ps now uses mixed-mode renderer. Axes.draw rasterize}] \leavevmode artists whose zorder smaller than rasterization\_zorder. -JJL \end{description} 2009-05-06 Per-artist Rasterization, originally by Eric Bruning. -JJ \begin{description} \item[{2009-05-05 Add an example that shows how to make a plot that updates}] \leavevmode using data from another process. Thanks to Robert Cimrman - RMM \end{description} 2009-05-05 Add Axes.get\_legend\_handles\_labels method. - JJL \begin{description} \item[{2009-05-04 Fix bug that Text.Annotation is still drawn while set to}] \leavevmode not visible. - JJL \end{description} 2009-05-04 Added TJ’s fill\_betweenx patch - JDH \begin{description} \item[{2009-05-02 Added options to plotfile based on question from}] \leavevmode Joseph Smidt and patch by Matthias Michler. - EF \item[{2009-05-01 Changed add\_artist and similar Axes methods to}] \leavevmode return their argument. - EF \end{description} 2009-04-30 Incorrect eps bbox for landscape mode fixed - JJL 2009-04-28 Fixed incorrect bbox of eps output when usetex=True. - JJL \begin{description} \item[{2009-04-24 Changed use of os.open* to instead use subprocess.Popen.}] \leavevmode os.popen* are deprecated in 2.6 and are removed in 3.0. - RMM \item[{2009-04-20 Worked on axes\_grid documentation. Added}] \leavevmode axes\_grid.inset\_locator. - JJL \end{description} 2009-04-17 Initial check-in of the axes\_grid toolkit. - JJL \begin{description} \item[{2009-04-17 Added a support for bbox\_to\_anchor in}] \leavevmode offsetbox.AnchoredOffsetbox. Improved a documentation. - JJL \item[{2009-04-16 Fixed a offsetbox bug that multiline texts are not}] \leavevmode correctly aligned. - JJL \item[{2009-04-16 Fixed a bug in mixed mode renderer that images produced by}] \leavevmode an rasterizing backend are placed with incorrect size. - JJL \item[{2009-04-14 Added Jonathan Taylor’s Reinier Heeres’ port of John}] \leavevmode Porters’ mplot3d to svn trunk. Package in mpl\_toolkits.mplot3d and demo is examples/mplot3d/demo.py. Thanks Reiner \item[{2009-04-06 The pdf backend now escapes newlines and linefeeds in strings.}] \leavevmode Fixes sf bug \#2708559; thanks to Tiago Pereira for the report. \item[{2009-04-06 texmanager.make\_dvi now raises an error if LaTeX failed to}] \leavevmode create an output file. Thanks to Joao Luis Silva for reporting this. - JKS \item[{2009-04-05 \_png.read\_png() reads 12 bit PNGs (patch from}] \leavevmode Tobias Wood) - ADS \item[{2009-04-04 Allow log axis scale to clip non-positive values to}] \leavevmode small positive value; this is useful for errorbars. - EF \item[{2009-03-28 Make images handle nan in their array argument.}] \leavevmode A helper, cbook.safe\_masked\_invalid() was added. - EF \end{description} 2009-03-25 Make contour and contourf handle nan in their Z argument. - EF \begin{description} \item[{2009-03-20 Add AuxTransformBox in offsetbox.py to support some transformation.}] \leavevmode anchored\_text.py example is enhanced and renamed (anchored\_artists.py). - JJL \end{description} 2009-03-20 Add “bar” connection style for annotation - JJL \begin{description} \item[{2009-03-17 Fix bugs in edge color handling by contourf, found}] \leavevmode by Jae-Joon Lee. - EF \item[{2009-03-14 Added ‘LightSource’ class to colors module for}] \leavevmode creating shaded relief maps. shading\_example.py added to illustrate usage. - JSW \item[{2009-03-11 Ensure wx version \textgreater{}= 2.8; thanks to Sandro Tosi and}] \leavevmode Chris Barker. - EF \end{description} 2009-03-10 Fix join style bug in pdf. - JKS 2009-03-07 Add pyplot access to figure number list - EF 2009-02-28 hashing of FontProperties accounts current rcParams - JJL 2009-02-28 Prevent double-rendering of shared axis in twinx, twiny - EF 2009-02-26 Add optional bbox\_to\_anchor argument for legend class - JJL 2009-02-26 Support image clipping in pdf backend. - JKS 2009-02-25 Improve tick location subset choice in FixedLocator. - EF \begin{description} \item[{2009-02-24 Deprecate numerix, and strip out all but the numpy}] \leavevmode part of the code. - EF \item[{2009-02-21 Improve scatter argument handling; add an early error}] \leavevmode message, allow inputs to have more than one dimension. - EF \item[{2009-02-16 Move plot\_directive.py to the installed source tree. Add}] \leavevmode support for inline code content - MGD \item[{2009-02-16 Move mathmpl.py to the installed source tree so it is}] \leavevmode available to other projects. - MGD \end{description} 2009-02-14 Added the legend title support - JJL \begin{description} \item[{2009-02-10 Fixed a bug in backend\_pdf so it doesn’t break when the setting}] \leavevmode pdf.use14corefonts=True is used. Added test case in unit/test\_pdf\_use14corefonts.py. - NGR \item[{2009-02-08 Added a new imsave function to image.py and exposed it in}] \leavevmode the pyplot interface - GR \item[{2009-02-04 Some reorgnization of the legend code. anchored\_text.py}] \leavevmode added as an example. - JJL \end{description} 2009-02-04 Add extent keyword arg to hexbin - ADS 2009-02-04 Fix bug in mathtext related to dots and ldots - MGD 2009-02-03 Change default joinstyle to round - MGD 2009-02-02 Reduce number of marker XObjects in pdf output - JKS 2009-02-02 Change default resolution on polar plot to 1 - MGD \begin{description} \item[{2009-02-02 Avoid malloc errors in ttconv for fonts that don’t have}] \leavevmode e.g., PostName (a version of Tahoma triggered this) - JKS \item[{2009-01-30 Remove support for pyExcelerator in exceltools \textendash{} use xlwt}] \leavevmode instead - JDH \item[{2009-01-29 Document ‘resolution’ kwarg for polar plots. Support it}] \leavevmode when using pyplot.polar, not just Figure.add\_axes. - MGD \item[{2009-01-29 Rework the nan-handling/clipping/quantizing/simplification}] \leavevmode framework so each is an independent part of a pipeline. Expose the C++-implementation of all of this so it can be used from all Python backends. Add rcParam “path.simplify\_threshold” to control the threshold of similarity below which vertices will be removed. \end{description} 2009-01-26 Improved tight bbox option of the savefig. - JJL 2009-01-26 Make curves and NaNs play nice together - MGD \begin{description} \item[{2009-01-21 Changed the defaults of acorr and xcorr to use}] \leavevmode usevlines=True, maxlags=10 and normed=True since these are the best defaults \end{description} 2009-01-19 Fix bug in quiver argument handling. - EF 2009-01-19 Fix bug in backend\_gtk: don’t delete nonexistent toolbar. - EF \begin{description} \item[{2009-01-16 Implement bbox\_inches option for savefig. If bbox\_inches is}] \leavevmode “tight”, try to determine the tight bounding box. - JJL \item[{2009-01-16 Fix bug in is\_string\_like so it doesn’t raise an}] \leavevmode unnecessary exception. - EF \item[{2009-01-16 Fix an infinite recursion in the unit registry when searching}] \leavevmode for a converter for a sequence of strings. Add a corresponding test. - RM \item[{2009-01-16 Bugfix of C typedef of MPL\_Int64 that was failing on}] \leavevmode Windows XP 64 bit, as reported by George Goussard on numpy mailing list. - ADS \item[{2009-01-16 Added helper function LinearSegmentedColormap.from\_list to}] \leavevmode facilitate building simple custom colomaps. See examples/pylab\_examples/custom\_cmap\_fromlist.py - JDH \item[{2009-01-16 Applied Michiel’s patch for macosx backend to fix rounding}] \leavevmode bug. Closed sf bug 2508440 - JSW \item[{2009-01-10 Applied Michiel’s hatch patch for macosx backend and}] \leavevmode draw\_idle patch for qt. Closes sf patched 2497785 and 2468809 - JDH \end{description} 2009-01-10 Fix bug in pan/zoom with log coordinates. - EF 2009-01-06 Fix bug in setting of dashed negative contours. - EF 2009-01-06 Be fault tolerant when len(linestyles)\textgreater{}NLev in contour. - MM \begin{description} \item[{2009-01-06 Added marginals kwarg to hexbin to plot marginal densities}] \leavevmode JDH \item[{2009-01-06 Change user-visible multipage pdf object to PdfPages to}] \leavevmode avoid accidents with the file-like PdfFile. - JKS \end{description} 2009-01-05 Fix a bug in pdf usetex: allow using non-embedded fonts. - JKS 2009-01-05 optional use of preview.sty in usetex mode. - JJL 2009-01-02 Allow multipage pdf files. - JKS \begin{description} \item[{2008-12-31 Improve pdf usetex by adding support for font effects}] \leavevmode (slanting and extending). - JKS \item[{2008-12-29 Fix a bug in pdf usetex support, which occurred if the same}] \leavevmode Type-1 font was used with different encodings, e.g., with Minion Pro and MnSymbol. - JKS \end{description} 2008-12-20 fix the dpi-dependent offset of Shadow. - JJL \begin{description} \item[{2008-12-20 fix the hatch bug in the pdf backend. minor update}] \leavevmode in docs and example - JJL \item[{2008-12-19 Add axes\_locator attribute in Axes. Two examples are added.}] \leavevmode\begin{itemize} \item {} JJL \end{itemize} \item[{2008-12-19 Update Axes.legend documnetation. /api/api\_changes.rst is also}] \leavevmode updated to describe chages in keyword parameters. Issue a warning if old keyword parameters are used. - JJL \end{description} 2008-12-18 add new arrow style, a line + filled triangles. -JJL \bigskip\hrule\bigskip \begin{description} \item[{2008-12-18 Re-Released 0.98.5.2 from v0\_98\_5\_maint at r6679}] \leavevmode Released 0.98.5.2 from v0\_98\_5\_maint at r6667 \end{description} 2008-12-18 Removed configobj, experimental traits and doc/mpl\_data link - JDH \begin{description} \item[{2008-12-18 Fix bug where a line with NULL data limits prevents}] \leavevmode subsequent data limits from calculating correctly - MGD \end{description} 2008-12-17 Major documentation generator changes - MGD \begin{description} \item[{2008-12-17 Applied macosx backend patch with support for path}] \leavevmode collections, quadmesh, etc… - JDH \item[{2008-12-17 fix dpi-dependent behavior of text bbox and arrow in annotate}] \leavevmode -JJL \item[{2008-12-17 Add group id support in artist. Two examples which}] \leavevmode demostrate svg filter are added. -JJL \end{description} 2008-12-16 Another attempt to fix dpi-dependent behavior of Legend. -JJL 2008-12-16 Fixed dpi-dependent behavior of Legend and fancybox in Text. \begin{description} \item[{2008-12-16 Added markevery property to Line2D to support subsampling}] \leavevmode of markers - JDH \item[{2008-12-15 Removed mpl\_data symlink in docs. On platforms that do not}] \leavevmode support symlinks, these become copies, and the font files are large, so the distro becomes unneccessarily bloaded. Keeping the mpl\_examples dir because relative links are harder for the plot directive and the *.py files are not so large. - JDH \item[{2008-12-15 Fix \$ in non-math text with usetex off. Document}] \leavevmode differences between usetex on/off - MGD \end{description} 2008-12-15 Fix anti-aliasing when auto-snapping - MGD 2008-12-15 Fix grid lines not moving correctly during pan and zoom - MGD \begin{description} \item[{2008-12-12 Preparations to eliminate maskedarray rcParams key: its}] \leavevmode use will now generate a warning. Similarly, importing the obsolote numerix.npyma will generate a warning. - EF \item[{2008-12-12 Added support for the numpy.histogram() weights parameter}] \leavevmode to the axes hist() method. Docs taken from numpy - MM \end{description} 2008-12-12 Fixed warning in hist() with numpy 1.2 - MM \begin{description} \item[{2008-12-12 Removed external packages: configobj and enthought.traits}] \leavevmode which are only required by the experimental traited config and are somewhat out of date. If needed, install them independently, see: \sphinxurl{http://code.enthought.com/pages/traits.html} and: \sphinxurl{http://www.voidspace.org.uk/python/configobj.html} \item[{2008-12-12 Added support to asign labels to histograms of multiple}] \leavevmode data. - MM \end{description} \bigskip\hrule\bigskip 2008-12-11 Released 0.98.5 at svn r6573 \begin{description} \item[{2008-12-11 Use subprocess.Popen instead of os.popen in dviread}] \leavevmode (Windows problem reported by Jorgen Stenarson) - JKS \item[{2008-12-10 Added Michael’s font\_manager fix and Jae-Joon’s}] \leavevmode figure/subplot fix. Bumped version number to 0.98.5 - JDH \end{description} \bigskip\hrule\bigskip 2008-12-09 Released 0.98.4 at svn r6536 2008-12-08 Added mdehoon’s native macosx backend from sf patch 2179017 - JDH \begin{description} \item[{2008-12-08 Removed the prints in the set\_*style commands. Return the}] \leavevmode list of pprinted strings instead - JDH \item[{2008-12-08 Some of the changes Michael made to improve the output of}] \leavevmode the property tables in the rest docs broke of made difficult to use some of the interactive doc helpers, e.g., setp and getp. Having all the rest markup in the ipython shell also confused the docstrings. I added a new rc param docstring.harcopy, to format the docstrings differently for hardcopy and other use. Ther ArtistInspector could use a little refactoring now since there is duplication of effort between the rest out put and the non-rest output - JDH \item[{2008-12-08 Updated spectral methods (psd, csd, etc.) to scale one-sided}] \leavevmode densities by a factor of 2 and, optionally, scale all densities by the sampling frequency. This gives better MatLab compatibility. -RM \end{description} 2008-12-08 Fixed alignment of ticks in colorbars. -MGD \begin{description} \item[{2008-12-07 drop the deprecated “new” keyword of np.histogram() for}] \leavevmode numpy 1.2 or later. -JJL \item[{2008-12-06 Fixed a bug in svg backend that new\_figure\_manager()}] \leavevmode ignores keywords arguments such as figsize, etc. -JJL \item[{2008-12-05 Fixed a bug that the handlelength of the new legend class}] \leavevmode set too short when numpoints=1 -JJL \item[{2008-12-04 Added support for data with units (e.g., dates) to}] \leavevmode Axes.fill\_between. -RM \item[{2008-12-04 Added fancybox keyword to legend. Also applied some changes}] \leavevmode for better look, including baseline adjustment of the multiline texts so that it is center aligned. -JJL \item[{2008-12-02 The transmuter classes in the patches.py are reorganized as}] \leavevmode subclasses of the Style classes. A few more box and arrow styles are added. -JJL \item[{2008-12-02 Fixed a bug in the new legend class that didn’t allowed}] \leavevmode a tuple of coordinate vlaues as loc. -JJL \item[{2008-12-02 Improve checks for external dependencies, using subprocess}] \leavevmode (instead of deprecated popen*) and distutils (for version checking) - DSD \item[{2008-11-30 Reimplementation of the legend which supports baseline alignement,}] \leavevmode multi-column, and expand mode. - JJL \item[{2008-12-01 Fixed histogram autoscaling bug when bins or range are given}] \leavevmode explicitly (fixes Debian bug 503148) - MM \item[{2008-11-25 Added rcParam axes.unicode\_minus which allows plain hypen}] \leavevmode for minus when False - JDH \item[{2008-11-25 Added scatterpoints support in Legend. patch by Erik}] \leavevmode Tollerud - JJL \end{description} 2008-11-24 Fix crash in log ticking. - MGD \begin{description} \item[{2008-11-20 Added static helper method BrokenHBarCollection.span\_where}] \leavevmode and Axes/pyplot method fill\_between. See examples/pylab/fill\_between.py - JDH \item[{2008-11-12 Add x\_isdata and y\_isdata attributes to Artist instances,}] \leavevmode and use them to determine whether either or both coordinates are used when updating dataLim. This is used to fix autoscaling problems that had been triggered by axhline, axhspan, axvline, axvspan. - EF \item[{2008-11-11 Update the psd(), csd(), cohere(), and specgram() methods}] \leavevmode of Axes and the csd() cohere(), and specgram() functions in mlab to be in sync with the changes to psd(). In fact, under the hood, these all call the same core to do computations. - RM \item[{2008-11-11 Add ‘pad\_to’ and ‘sides’ parameters to mlab.psd() to}] \leavevmode allow controlling of zero padding and returning of negative frequency components, respecitively. These are added in a way that does not change the API. - RM \item[{2008-11-10 Fix handling of c kwarg by scatter; generalize}] \leavevmode is\_string\_like to accept numpy and numpy.ma string array scalars. - RM and EF \item[{2008-11-09 Fix a possible EINTR problem in dviread, which might help}] \leavevmode when saving pdf files from the qt backend. - JKS \end{description} 2008-11-05 Fix bug with zoom to rectangle and twin axes - MGD \begin{description} \item[{2008-10-24 Added Jae Joon’s fancy arrow, box and annotation}] \leavevmode enhancements \textendash{} see examples/pylab\_examples/annotation\_demo2.py \end{description} 2008-10-23 Autoscaling is now supported with shared axes - EF 2008-10-23 Fixed exception in dviread that happened with Minion - JKS \begin{description} \item[{2008-10-21 set\_xlim, ylim now return a copy of the viewlim array to}] \leavevmode avoid modify inplace surprises \item[{2008-10-20 Added image thumbnail generating function}] \leavevmode matplotlib.image.thumbnail. See examples/misc/image\_thumbnail.py - JDH \item[{2008-10-20 Applied scatleg patch based on ideas and work by Erik}] \leavevmode Tollerud and Jae-Joon Lee. - MM \item[{2008-10-11 Fixed bug in pdf backend: if you pass a file object for}] \leavevmode output instead of a filename, e.g., in a wep app, we now flush the object at the end. - JKS \end{description} 2008-10-08 Add path simplification support to paths with gaps. - EF \begin{description} \item[{2008-10-05 Fix problem with AFM files that don’t specify the font’s}] \leavevmode full name or family name. - JKS \item[{2008-10-04 Added ‘scilimits’ kwarg to Axes.ticklabel\_format() method,}] \leavevmode for easy access to the set\_powerlimits method of the major ScalarFormatter. - EF \item[{2008-10-04 Experimental new kwarg borderpad to replace pad in legend,}] \leavevmode based on suggestion by Jae-Joon Lee. - EF \item[{2008-09-27 Allow spy to ignore zero values in sparse arrays, based}] \leavevmode on patch by Tony Yu. Also fixed plot to handle empty data arrays, and fixed handling of markers in figlegend. - EF \item[{2008-09-24 Introduce drawstyles for lines. Transparently split linestyles}] \leavevmode like ‘steps\textendash{}’ into drawstyle ‘steps’ and linestyle ‘\textendash{}’. Legends always use drawstyle ‘default’. - MM \item[{2008-09-18 Fixed quiver and quiverkey bugs (failure to scale properly}] \leavevmode when resizing) and added additional methods for determining the arrow angles - EF \end{description} 2008-09-18 Fix polar interpolation to handle negative values of theta - MGD \begin{description} \item[{2008-09-14 Reorganized cbook and mlab methods related to numerical}] \leavevmode calculations that have little to do with the goals of those two modules into a separate module numerical\_methods.py Also, added ability to select points and stop point selection with keyboard in ginput and manual contour labeling code. Finally, fixed contour labeling bug. - DMK \end{description} 2008-09-11 Fix backtick in Postscript output. - MGD \begin{description} \item[{2008-09-10 {[} 2089958 {]} Path simplification for vector output backends}] \leavevmode Leverage the simplification code exposed through path\_to\_polygons to simplify certain well-behaved paths in the vector backends (PDF, PS and SVG). “path.simplify” must be set to True in matplotlibrc for this to work. - MGD \item[{2008-09-10 Add “filled” kwarg to Path.intersects\_path and}] \leavevmode Path.intersects\_bbox. - MGD \item[{2008-09-07 Changed full arrows slightly to avoid an xpdf rendering}] \leavevmode problem reported by Friedrich Hagedorn. - JKS \item[{2008-09-07 Fix conversion of quadratic to cubic Bezier curves in PDF}] \leavevmode and PS backends. Patch by Jae-Joon Lee. - JKS \end{description} 2008-09-06 Added 5-point star marker to plot command - EF 2008-09-05 Fix hatching in PS backend - MGD 2008-09-03 Fix log with base 2 - MGD \begin{description} \item[{2008-09-01 Added support for bilinear interpolation in}] \leavevmode NonUniformImage; patch by Gregory Lielens. - EF \item[{2008-08-28 Added support for multiple histograms with data of}] \leavevmode different length - MM \end{description} 2008-08-28 Fix step plots with log scale - MGD 2008-08-28 Fix masked arrays with markers in non-Agg backends - MGD 2008-08-28 Fix clip\_on kwarg so it actually works correctly - MGD 2008-08-25 Fix locale problems in SVG backend - MGD 2008-08-22 fix quiver so masked values are not plotted - JSW 2008-08-18 improve interactive pan/zoom in qt4 backend on windows - DSD \begin{description} \item[{2008-08-11 Fix more bugs in NaN/inf handling. In particular, path simplification}] \leavevmode (which does not handle NaNs or infs) will be turned off automatically when infs or NaNs are present. Also masked arrays are now converted to arrays with NaNs for consistent handling of masks and NaNs - MGD and EF \end{description} \bigskip\hrule\bigskip 2008-08-03 Released 0.98.3 at svn r5947 2008-08-01 Backported memory leak fixes in \_ttconv.cpp - MGD 2008-07-31 Added masked array support to griddata. - JSW \begin{description} \item[{2008-07-26 Added optional C and reduce\_C\_function arguments to}] \leavevmode axes.hexbin(). This allows hexbin to accumulate the values of C based on the x,y coordinates and display in hexagonal bins. - ADS \item[{2008-07-24 Deprecated (raise NotImplementedError) all the mlab2}] \leavevmode functions from matplotlib.mlab out of concern that some of them were not clean room implementations. JDH \item[{2008-07-24 Rewrite of a significant portion of the clabel code (class}] \leavevmode ContourLabeler) to improve inlining. - DMK \item[{2008-07-22 Added Barbs polygon collection (similar to Quiver) for plotting}] \leavevmode wind barbs. Added corresponding helpers to Axes and pyplot as well. (examples/pylab\_examples/barb\_demo.py shows it off.) - RMM \item[{2008-07-21 Added scikits.delaunay as matplotlib.delaunay. Added griddata}] \leavevmode function in matplotlib.mlab, with example (griddata\_demo.py) in pylab\_examples. griddata function will use mpl\_toolkits.\_natgrid if installed. - JSW \item[{2008-07-21 Re-introduced offset\_copy that works in the context of the}] \leavevmode new transforms. - MGD \item[{2008-07-21 Committed patch by Ryan May to add get\_offsets and}] \leavevmode set\_offsets to Collections base class - EF \item[{2008-07-21 Changed the “asarray” strategy in image.py so that}] \leavevmode colormapping of masked input should work for all image types (thanks Klaus Zimmerman) - EF \item[{2008-07-20 Rewrote cbook.delete\_masked\_points and corresponding}] \leavevmode unit test to support rgb color array inputs, datetime inputs, etc. - EF \item[{2008-07-20 Renamed unit/axes\_unit.py to cbook\_unit.py and modified}] \leavevmode in accord with Ryan’s move of delete\_masked\_points from axes to cbook. - EF \item[{2008-07-18 Check for nan and inf in axes.delete\_masked\_points().}] \leavevmode This should help hexbin and scatter deal with nans. - ADS \item[{2008-07-17 Added ability to manually select contour label locations.}] \leavevmode Also added a waitforbuttonpress function. - DMK \item[{2008-07-17 Fix bug with NaNs at end of path (thanks, Andrew Straw for}] \leavevmode the report) - MGD \item[{2008-07-16 Improve error handling in texmanager, thanks to Ian Henry}] \leavevmode for reporting - DSD \item[{2008-07-12 Added support for external backends with the}] \leavevmode “module://my\_backend” syntax - JDH \item[{2008-07-11 Fix memory leak related to shared axes. Grouper should}] \leavevmode store weak references. - MGD \end{description} 2008-07-10 Bugfix: crash displaying fontconfig pattern - MGD 2008-07-10 Bugfix: {[} 2013963 {]} update\_datalim\_bounds in Axes not works - MGD 2008-07-10 Bugfix: {[} 2014183 {]} multiple imshow() causes gray edges - MGD 2008-07-09 Fix rectangular axes patch on polar plots bug - MGD 2008-07-09 Improve mathtext radical rendering - MGD 2008-07-08 Improve mathtext superscript placement - MGD 2008-07-07 Fix custom scales in pcolormesh (thanks Matthew Turk) - MGD \begin{description} \item[{2008-07-03 Implemented findobj method for artist and pyplot - see}] \leavevmode examples/pylab\_examples/findobj\_demo.py - JDH \end{description} 2008-06-30 Another attempt to fix TextWithDash - DSD \begin{description} \item[{2008-06-30 Removed Qt4 NavigationToolbar2.destroy \textendash{} it appears to}] \leavevmode have been unnecessary and caused a bug reported by P. Raybaut - DSD \end{description} 2008-06-27 Fixed tick positioning bug - MM \begin{description} \item[{2008-06-27 Fix dashed text bug where text was at the wrong end of the}] \leavevmode dash - MGD \end{description} 2008-06-26 Fix mathtext bug for expressions like \$x\_\{leftarrow\}\$ - MGD 2008-06-26 Fix direction of horizontal/vertical hatches - MGD \begin{description} \item[{2008-06-25 Figure.figurePatch renamed Figure.patch, Axes.axesPatch}] \leavevmode renamed Axes.patch, Axes.axesFrame renamed Axes.frame, Axes.get\_frame, which returns Axes.patch, is deprecated. Examples and users guide updated - JDH \end{description} 2008-06-25 Fix rendering quality of pcolor - MGD \bigskip\hrule\bigskip 2008-06-24 Released 0.98.2 at svn r5667 - (source only for debian) JDH 2008-06-24 Added “transparent” kwarg to savefig. - MGD \begin{description} \item[{2008-06-24 Applied Stefan’s patch to draw a single centered marker over}] \leavevmode a line with numpoints==1 - JDH \end{description} 2008-06-23 Use splines to render circles in scatter plots - MGD \bigskip\hrule\bigskip 2008-06-22 Released 0.98.1 at revision 5637 \begin{description} \item[{2008-06-22 Removed axes3d support and replaced it with a}] \leavevmode NotImplementedError for one release cycle \end{description} 2008-06-21 fix marker placement bug in backend\_ps - DSD 2008-06-20 {[} 1978629 {]} scale documentation missing/incorrect for log - MGD \begin{description} \item[{2008-06-20 Added closed kwarg to PolyCollection. Fixes bug {[} 1994535}] \leavevmode {]} still missing lines on graph with svn (r 5548). - MGD \item[{2008-06-20 Added set/get\_closed method to Polygon; fixes error}] \leavevmode in hist - MM \item[{2008-06-19 Use relative font sizes (e.g., ‘medium’ and ‘large’) in}] \leavevmode rcsetup.py and matplotlibrc.template so that text will be scaled by default when changing rcParams{[}‘font.size’{]} - EF \item[{2008-06-17 Add a generic PatchCollection class that can contain any}] \leavevmode kind of patch. - MGD \item[{2008-06-13 Change pie chart label alignment to avoid having labels}] \leavevmode overwrite the pie - MGD \item[{2008-06-12 Added some helper functions to the mathtext parser to}] \leavevmode return bitmap arrays or write pngs to make it easier to use mathtext outside the context of an mpl figure. modified the mathpng sphinxext to use the mathtext png save functionality - see examples/api/mathtext\_asarray.py - JDH \item[{2008-06-11 Use matplotlib.mathtext to render math expressions in}] \leavevmode online docs - MGD \item[{2008-06-11 Move PNG loading/saving to its own extension module, and}] \leavevmode remove duplicate code in \_backend\_agg.cpp and \_image.cpp that does the same thing - MGD \item[{2008-06-11 Numerous mathtext bugfixes, primarily related to}] \leavevmode dpi-independence - MGD \item[{2008-06-10 Bar now applies the label only to the first patch only, and}] \leavevmode sets ‘\_nolegend\_’ for the other patch labels. This lets autolegend work as expected for hist and bar - see \sphinxurl{https://sourceforge.net/tracker/index.php?func=detail\&aid=1986597\&group\_id=80706\&atid=560720} JDH \item[{2008-06-10 Fix text baseline alignment bug. {[} 1985420 {]} Repair of}] \leavevmode baseline alignment in Text.\_get\_layout. Thanks Stan West - MGD \item[{2008-06-09 Committed Gregor’s image resample patch to downsampling}] \leavevmode images with new rcparam image.resample - JDH \item[{2008-06-09 Don’t install Enthought.Traits along with matplotlib. For}] \leavevmode matplotlib developers convenience, it can still be installed by setting an option in setup.cfg while we figure decide if there is a future for the traited config - DSD \end{description} 2008-06-09 Added range keyword arg to hist() - MM \begin{description} \item[{2008-06-07 Moved list of backends to rcsetup.py; made use of lower}] \leavevmode case for backend names consistent; use validate\_backend when importing backends subpackage - EF \item[{2008-06-06 hist() revision, applied ideas proposed by Erik Tollerud and}] \leavevmode Olle Engdegard: make histtype=’step’ unfilled by default and introduce histtype=’stepfilled’; use default color cycle; introduce reverse cumulative histogram; new align keyword - MM \item[{2008-06-06 Fix closed polygon patch and also provide the option to}] \leavevmode not close the polygon - MGD \item[{2008-06-05 Fix some dpi-changing-related problems with PolyCollection,}] \leavevmode as called by Axes.scatter() - MGD \item[{2008-06-05 Fix image drawing so there is no extra space to the right}] \leavevmode or bottom - MGD \item[{2006-06-04 Added a figure title command suptitle as a Figure method}] \leavevmode and pyplot command \textendash{} see examples/figure\_title.py - JDH \item[{2008-06-02 Added support for log to hist with histtype=’step’ and fixed}] \leavevmode a bug for log-scale stacked histograms - MM \end{description} \bigskip\hrule\bigskip 2008-05-29 Released 0.98.0 at revision 5314 \begin{description} \item[{2008-05-29 matplotlib.image.imread now no longer always returns RGBA}] \leavevmode \textendash{} if the image is luminance or RGB, it will return a MxN or MxNx3 array if possible. Also uint8 is no longer always forced to float. \end{description} 2008-05-29 Implement path clipping in PS backend - JDH \begin{description} \item[{2008-05-29 Fixed two bugs in texmanager.py:}] \leavevmode improved comparison of dvipng versions fixed a bug introduced when get\_grey method was added - DSD \item[{2008-05-28 Fix crashing of PDFs in xpdf and ghostscript when two-byte}] \leavevmode characters are used with Type 3 fonts - MGD \item[{2008-05-28 Allow keyword args to configure widget properties as}] \leavevmode requested in \sphinxurl{http://sourceforge.net/tracker/index.php?func=detail\&aid=1866207\&group\_id=80706\&atid=560722} - JDH \item[{2008-05-28 Replaced ‘-‘ with u’u2212’ for minus sign as requested in}] \leavevmode \sphinxurl{http://sourceforge.net/tracker/index.php?func=detail\&aid=1962574\&group\_id=80706\&atid=560720} \item[{2008-05-28 zero width/height Rectangles no longer influence the}] \leavevmode autoscaler. Useful for log histograms with empty bins - JDH \item[{2008-05-28 Fix rendering of composite glyphs in Type 3 conversion}] \leavevmode (particularly as evidenced in the Eunjin.ttf Korean font) Thanks Jae-Joon Lee for finding this! \item[{2008-05-27 Rewrote the cm.ScalarMappable callback infrastructure to}] \leavevmode use cbook.CallbackRegistry rather than custom callback handling. Amy users of add\_observer/notify of the cm.ScalarMappable should uae the cm.ScalarMappable.callbacksSM CallbackRegistry instead. JDH \item[{2008-05-27 Fix TkAgg build on Ubuntu 8.04 (and hopefully a more}] \leavevmode general solution for other platforms, too.) \item[{2008-05-24 Added PIL support for loading images to imread (if PIL is}] \leavevmode available) - JDH \item[{2008-05-23 Provided a function and a method for controlling the}] \leavevmode plot color cycle. - EF \item[{2008-05-23 Major revision of hist(). Can handle 2D arrays and create}] \leavevmode stacked histogram plots; keyword ‘width’ deprecated and rwidth (relative width) introduced; align=’edge’ changed to center of bin - MM \item[{2008-05-22 Added support for ReST-based doumentation using Sphinx.}] \leavevmode Documents are located in doc/, and are broken up into a users guide and an API reference. To build, run the make.py files. Sphinx-0.4 is needed to build generate xml, which will be useful for rendering equations with mathml, use sphinx from svn until 0.4 is released - DSD \end{description} 2008-05-21 Fix segfault in TkAgg backend - MGD 2008-05-21 Fix a “local variable unreferenced” bug in plotfile - MM \begin{description} \item[{2008-05-19 Fix crash when Windows can not access the registry to}] \leavevmode determine font path {[}Bug 1966974, thanks Patrik Simons{]} - MGD \item[{2008-05-16 removed some unneeded code w/ the python 2.4 requirement.}] \leavevmode cbook no longer provides compatibility for reversed, enumerate, set or izip. removed lib/subprocess, mpl1, sandbox/units, and the swig code. This stuff should remain on the maintenance branch for archival purposes. JDH \end{description} 2008-05-16 Reorganized examples dir - JDH \begin{description} \item[{2008-05-16 Added ‘elinewidth’ keyword arg to errorbar, based on patch}] \leavevmode by Christopher Brown - MM \item[{2008-05-16 Added ‘cumulative’ keyword arg to hist to plot cumulative}] \leavevmode histograms. For normed hists, this is normalized to one - MM \end{description} 2008-05-15 Fix Tk backend segfault on some machines - MGD 2008-05-14 Don’t use stat on Windows (fixes font embedding problem) - MGD 2008-05-09 Fix /singlequote (‘) in Postscript backend - MGD 2008-05-08 Fix kerning in SVG when embedding character outlines - MGD 2008-05-07 Switched to future numpy histogram semantic in hist - MM 2008-05-06 Fix strange colors when blitting in QtAgg and Qt4Agg - MGD \begin{description} \item[{2008-05-05 pass notify\_axes\_change to the figure’s add\_axobserver}] \leavevmode in the qt backends, like we do for the other backends. Thanks Glenn Jones for the report - DSD \end{description} 2008-05-02 Added step histograms, based on patch by Erik Tollerud. - MM \begin{description} \item[{2008-05-02 On PyQt \textless{}= 3.14 there is no way to determine the underlying}] \leavevmode Qt version. {[}1851364{]} - MGD \item[{2008-05-02 Don’t call sys.exit() when pyemf is not found {[}1924199{]} -}] \leavevmode MGD \item[{2008-05-02 Update \_subprocess.c from upstream Python 2.5.2 to get a}] \leavevmode few memory and reference-counting-related bugfixes. See bug 1949978. - MGD \item[{2008-04-30 Added some record array editing widgets for gtk \textendash{} see}] \leavevmode examples/rec\_edit*.py - JDH \end{description} 2008-04-29 Fix bug in mlab.sqrtm - MM \begin{description} \item[{2008-04-28 Fix bug in SVG text with Mozilla-based viewers (the symbol}] \leavevmode tag is not supported) - MGD \item[{2008-04-27 Applied patch by Michiel de Hoon to add hexbin}] \leavevmode axes method and pyplot function - EF \end{description} 2008-04-25 Enforce python \textgreater{}= 2.4; remove subprocess build - EF 2008-04-25 Enforce the numpy requirement at build time - JDH \begin{description} \item[{2008-04-24 Make numpy 1.1 and python 2.3 required when importing}] \leavevmode matplotlib - EF \item[{2008-04-24 Fix compilation issues on VS2003 (Thanks Martin Spacek for}] \leavevmode all the help) - MGD \item[{2008-04-24 Fix sub/superscripts when the size of the font has been}] \leavevmode changed - MGD \end{description} 2008-04-22 Use “svg.embed\_char\_paths” consistently everywhere - MGD 2008-04-20 Add support to MaxNLocator for symmetric axis autoscaling. - EF 2008-04-20 Fix double-zoom bug. - MM 2008-04-15 Speed up color mapping. - EF 2008-04-12 Speed up zooming and panning of dense images. - EF \begin{description} \item[{2008-04-11 Fix global font rcParam setting after initialization}] \leavevmode time. - MGD \item[{2008-04-11 Revert commits 5002 and 5031, which were intended to}] \leavevmode avoid an unnecessary call to draw(). 5002 broke saving figures before show(). 5031 fixed the problem created in 5002, but broke interactive plotting. Unnecessary call to draw still needs resolution - DSD \item[{2008-04-07 Improve color validation in rc handling, suggested}] \leavevmode by Lev Givon - EF \item[{2008-04-02 Allow to use both linestyle definition arguments, ‘-‘ and}] \leavevmode ‘solid’ etc. in plots/collections - MM \item[{2008-03-27 Fix saving to Unicode filenames with Agg backend}] \leavevmode (other backends appear to already work…) (Thanks, Christopher Barker) - MGD \item[{2008-03-26 Fix SVG backend bug that prevents copying and pasting in}] \leavevmode Inkscape (thanks Kaushik Ghose) - MGD \item[{2008-03-24 Removed an unnecessary call to draw() in the backend\_qt*}] \leavevmode mouseReleaseEvent. Thanks to Ted Drain - DSD \item[{2008-03-23 Fix a pdf backend bug which sometimes caused the outermost}] \leavevmode gsave to not be balanced with a grestore. - JKS \item[{2008-03-20 Fixed a minor bug in ContourSet.\_process\_linestyles when}] \leavevmode len(linestyles)==Nlev - MM \item[{2008-03-19 Changed ma import statements to “from numpy import ma”;}] \leavevmode this should work with past and future versions of numpy, whereas “import numpy.ma as ma” will work only with numpy \textgreater{}= 1.05, and “import numerix.npyma as ma” is obsolete now that maskedarray is replacing the earlier implementation, as of numpy 1.05. \item[{2008-03-14 Removed an apparently unnecessary call to}] \leavevmode FigureCanvasAgg.draw in backend\_qt*agg. Thanks to Ted Drain - DSD \item[{2008-03-10 Workaround a bug in backend\_qt4agg’s blitting due to a}] \leavevmode buffer width/bbox width mismatch in \_backend\_agg’s copy\_from\_bbox - DSD \item[{2008-02-29 Fix class Wx toolbar pan and zoom functions (Thanks Jeff}] \leavevmode Peery) - MGD \item[{2008-02-16 Added some new rec array functionality to mlab}] \leavevmode (rec\_summarize, rec2txt and rec\_groupby). See examples/rec\_groupby\_demo.py. Thanks to Tim M for rec2txt. \end{description} 2008-02-12 Applied Erik Tollerud’s span selector patch - JDH 2008-02-11 Update plotting() doc string to refer to getp/setp. - JKS \begin{description} \item[{2008-02-10 Fixed a problem with square roots in the pdf backend with}] \leavevmode usetex. - JKS \end{description} 2008-02-08 Fixed minor \_\_str\_\_ bugs so getp(gca()) works. - JKS \begin{description} \item[{2008-02-05 Added getters for title, xlabel, ylabel, as requested}] \leavevmode by Brandon Kieth - EF \item[{2008-02-05 Applied Gael’s ginput patch and created}] \leavevmode examples/ginput\_demo.py - JDH \item[{2008-02-03 Expose interpnames, a list of valid interpolation}] \leavevmode methods, as an AxesImage class attribute. - EF \item[{2008-02-03 Added BoundaryNorm, with examples in colorbar\_only.py}] \leavevmode and image\_masked.py. - EF \end{description} 2008-02-03 Force dpi=72 in pdf backend to fix picture size bug. - JKS 2008-02-01 Fix doubly-included font problem in Postscript backend - MGD 2008-02-01 Fix reference leak in ft2font Glyph objects. - MGD 2008-01-31 Don’t use unicode strings with usetex by default - DSD \begin{description} \item[{2008-01-31 Fix text spacing problems in PDF backend with \sphinxstyleemphasis{some} fonts,}] \leavevmode such as STIXGeneral. \item[{2008-01-31 Fix sqrt with radical number (broken by making {[} and {]}}] \leavevmode work below) - MGD \item[{2008-01-27 Applied Martin Teichmann’s patch to improve the Qt4}] \leavevmode backend. Uses Qt’s builtin toolbars and statusbars. See bug 1828848 - DSD \item[{2008-01-10 Moved toolkits to mpl\_toolkits, made mpl\_toolkits}] \leavevmode a namespace package - JSWHIT \item[{2008-01-10 Use setup.cfg to set the default parameters (tkagg,}] \leavevmode numpy) when building windows installers - DSD \end{description} 2008-01-10 Fix bug displaying {[} and {]} in mathtext - MGD \begin{description} \item[{2008-01-10 Fix bug when displaying a tick value offset with scientific}] \leavevmode notation. (Manifests itself as a warning that the times symbol can not be found). - MGD \item[{2008-01-10 Use setup.cfg to set the default parameters (tkagg,}] \leavevmode numpy) when building windows installers - DSD \end{description} \bigskip\hrule\bigskip 2008-01-06 Released 0.91.2 at revision 4802 \begin{description} \item[{2007-12-26 Reduce too-late use of matplotlib.use() to a warning}] \leavevmode instead of an exception, for backwards compatibility - EF \end{description} 2007-12-25 Fix bug in errorbar, identified by Noriko Minakawa - EF \begin{description} \item[{2007-12-25 Changed masked array importing to work with the upcoming}] \leavevmode numpy 1.05 (now the maskedarray branch) as well as with earlier versions. - EF \item[{2007-12-16 rec2csv saves doubles without losing precision. Also, it}] \leavevmode does not close filehandles passed in open. - JDH,ADS \item[{2007-12-13 Moved rec2gtk to matplotlib.toolkits.gtktools and rec2excel}] \leavevmode to matplotlib.toolkits.exceltools - JDH \item[{2007-12-12 Support alpha-blended text in the Agg and Svg backends -}] \leavevmode MGD \end{description} 2007-12-10 Fix SVG text rendering bug. - MGD \begin{description} \item[{2007-12-10 Increase accuracy of circle and ellipse drawing by using an}] \leavevmode 8-piece bezier approximation, rather than a 4-piece one. Fix PDF, SVG and Cairo backends so they can draw paths (meaning ellipses as well). - MGD \end{description} 2007-12-07 Issue a warning when drawing an image on a non-linear axis. - MGD \begin{description} \item[{2007-12-06 let widgets.Cursor initialize to the lower x and y bounds}] \leavevmode rather than 0,0, which can cause havoc for dates and other transforms - DSD \end{description} 2007-12-06 updated references to mpl data directories for py2exe - DSD 2007-12-06 fixed a bug in rcsetup, see bug 1845057 - DSD \begin{description} \item[{2007-12-05 Fix how fonts are cached to avoid loading the same one multiple times.}] \leavevmode (This was a regression since 0.90 caused by the refactoring of font\_manager.py) - MGD \end{description} 2007-12-05 Support arbitrary rotation of usetex text in Agg backend. - MGD 2007-12-04 Support ‘\textbar{}’ as a character in mathtext - MGD \bigskip\hrule\bigskip 2007-11-27 Released 0.91.1 at revision 4517 \bigskip\hrule\bigskip 2007-11-27 Released 0.91.0 at revision 4478 \begin{description} \item[{2007-11-13 All backends now support writing to a file-like object, not}] \leavevmode just a regular file. savefig() can be passed a file-like object in place of a file path. - MGD \item[{2007-11-13 Improved the default backend selection at build time:}] \leavevmode SVG -\textgreater{} Agg -\textgreater{} TkAgg -\textgreater{} WXAgg -\textgreater{} GTK -\textgreater{} GTKAgg. The last usable backend in this progression will be chosen in the default config file. If a backend is defined in setup.cfg, that will be the default backend - DSD \item[{2007-11-13 Improved creation of default config files at build time for}] \leavevmode traited config package - DSD \item[{2007-11-12 Exposed all the build options in setup.cfg. These options are}] \leavevmode read into a dict called “options” by setupext.py. Also, added “-mpl” tags to the version strings for packages provided by matplotlib. Versions provided by mpl will be identified and updated on subsequent installs - DSD \item[{2007-11-12 Added support for STIX fonts. A new rcParam,}] \leavevmode mathtext.fontset, can be used to choose between: \begin{description} \item[{‘cm’:}] \leavevmode The TeX/LaTeX Computer Modern fonts \item[{‘stix’:}] \leavevmode The STIX fonts (see stixfonts.org) \item[{‘stixsans’:}] \leavevmode The STIX fonts, using sans-serif glyphs by default \item[{‘custom’:}] \leavevmode A generic Unicode font, in which case the mathtext font must be specified using mathtext.bf, mathtext.it, mathtext.sf etc. \end{description} Added a new example, stix\_fonts\_demo.py to show how to access different fonts and unusual symbols. \begin{itemize} \item {} MGD \end{itemize} \item[{2007-11-12 Options to disable building backend extension modules moved}] \leavevmode from setup.py to setup.cfg - DSD \item[{2007-11-09 Applied Martin Teichmann’s patch 1828813: a QPainter is used in}] \leavevmode paintEvent, which has to be destroyed using the method end(). If matplotlib raises an exception before the call to end - and it does if you feed it with bad data - this method end() is never called and Qt4 will start spitting error messages \item[{2007-11-09 Moved pyparsing back into matplotlib namespace. Don’t use}] \leavevmode system pyparsing, API is too variable from one release to the next - DSD \item[{2007-11-08 Made pylab use straight numpy instead of oldnumeric}] \leavevmode by default - EF \item[{2007-11-08 Added additional record array utilites to mlab (rec2excel,}] \leavevmode rec2gtk, rec\_join, rec\_append\_field, rec\_drop\_field) - JDH \end{description} 2007-11-08 Updated pytz to version 2007g - DSD 2007-11-08 Updated pyparsing to version 1.4.8 - DSD \begin{description} \item[{2007-11-08 Moved csv2rec to recutils and added other record array}] \leavevmode utilities - JDH \end{description} 2007-11-08 If available, use existing pyparsing installation - DSD \begin{description} \item[{2007-11-07 Removed old enthought.traits from lib/matplotlib, added}] \leavevmode Gael Varoquaux’s enthought.traits-2.6b1, which is stripped of setuptools. The package is installed to site-packages if not already available - DSD \item[{2007-11-05 Added easy access to minor tick properties; slight mod}] \leavevmode of patch by Pierre G-M - EF \item[{2007-11-02 Commited Phil Thompson’s patch 1599876, fixes to Qt4Agg}] \leavevmode backend and qt4 blitting demo - DSD \item[{2007-11-02 Commited Phil Thompson’s patch 1599876, fixes to Qt4Agg}] \leavevmode backend and qt4 blitting demo - DSD \item[{2007-10-31 Made log color scale easier to use with contourf;}] \leavevmode automatic level generation now works. - EF \end{description} 2007-10-29 TRANSFORMS REFACTORING \begin{quote} The primary goal of this refactoring was to make it easier to extend matplotlib to support new kinds of projections. This is primarily an internal improvement, and the possible user-visible changes it allows are yet to come. The transformation framework was completely rewritten in Python (with Numpy). This will make it easier to add news kinds of transformations without writing C/C++ code. Transforms are composed into a ‘transform tree’, made of transforms whose value depends on other transforms (their children). When the contents of children change, their parents are automatically updated to reflect those changes. To do this an “invalidation” method is used: when children change, all of their ancestors are marked as “invalid”. When the value of a transform is accessed at a later time, its value is recomputed only if it is invalid, otherwise a cached value may be used. This prevents unnecessary recomputations of transforms, and contributes to better interactive performance. The framework can be used for both affine and non-affine transformations. However, for speed, we want use the backend renderers to perform affine transformations whenever possible. Therefore, it is possible to perform just the affine or non-affine part of a transformation on a set of data. The affine is always assumed to occur after the non-affine. For any transform: \begin{quote} full transform == non-affine + affine \end{quote} Much of the drawing has been refactored in terms of compound paths. Therefore, many methods have been removed from the backend interface and replaced with a a handful to draw compound paths. This will make updating the backends easier, since there is less to update. It also should make the backends more consistent in terms of functionality. User visible changes: \begin{itemize} \item {} POLAR PLOTS: Polar plots are now interactively zoomable, and the r-axis labels can be interactively rotated. Straight line segments are now interpolated to follow the curve of the r-axis. \item {} Non-rectangular clipping works in more backends and with more types of objects. \item {} Sharing an axis across figures is now done in exactly the same way as sharing an axis between two axes in the same figure: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig1} \PYG{o}{=} \PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{fig2} \PYG{o}{=} \PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig1}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig2}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{,} \PYG{n}{sharex}\PYG{o}{=}\PYG{n}{ax1}\PYG{p}{,} \PYG{n}{sharey}\PYG{o}{=}\PYG{n}{ax1}\PYG{p}{)} \end{sphinxVerbatim} \item {} linestyles now include steps-pre, steps-post and steps-mid. The old step still works and is equivalent to step-pre. \item {} Multiple line styles may be provided to a collection. \end{itemize} See API\_CHANGES for more low-level information about this refactoring. \end{quote} 2007-10-24 Added ax kwarg to Figure.colorbar and pyplot.colorbar - EF \begin{description} \item[{2007-10-19 Removed a gsave/grestore pair surrounding \_draw\_ps, which}] \leavevmode was causing a loss graphics state info (see “EPS output problem - scatter \& edgecolors” on mpl-dev, 2007-10-29) - DSD \item[{2007-10-15 Fixed a bug in patches.Ellipse that was broken for}] \leavevmode aspect=’auto’. Scale free ellipses now work properly for equal and auto on Agg and PS, and they fall back on a polygonal approximation for nonlinear transformations until we convince oursleves that the spline approximation holds for nonlinear transformations. Added unit/ellipse\_compare.py to compare spline with vertex approx for both aspects. JDH \item[{2007-10-05 remove generator expressions from texmanager and mpltraits.}] \leavevmode generator expressions are not supported by python-2.3 - DSD \item[{2007-10-01 Made matplotlib.use() raise an exception if called after}] \leavevmode backends has been imported. - EF \item[{2007-09-30 Modified update* methods of Bbox and Interval so they}] \leavevmode work with reversed axes. Prior to this, trying to set the ticks on a reversed axis failed with an uninformative error message. - EF \end{description} 2007-09-30 Applied patches to axes3d to fix index error problem - EF \begin{description} \item[{2007-09-24 Applied Eike Welk’s patch reported on mpl-dev on 2007-09-22}] \leavevmode Fixes a bug with multiple plot windows in the qt backend, ported the changes to backend\_qt4 as well - DSD \item[{2007-09-21 Changed cbook.reversed to yield the same result as the}] \leavevmode python reversed builtin - DSD \item[{2007-09-13 The usetex support in the pdf backend is more usable now,}] \leavevmode so I am enabling it. - JKS \end{description} 2007-09-12 Fixed a Axes.bar unit bug - JDH 2007-09-10 Made skiprows=1 the default on csv2rec - JDH \begin{description} \item[{2007-09-09 Split out the plotting part of pylab and put it in}] \leavevmode pyplot.py; removed numerix from the remaining pylab.py, which imports everything from pyplot.py. The intention is that apart from cleanups, the result of importing from pylab is nearly unchanged, but there is the new alternative of importing from pyplot to get the state-engine graphics without all the numeric functions. Numpified examples; deleted two that were obsolete; modified some to use pyplot. - EF \end{description} 2007-09-08 Eliminated gd and paint backends - EF 2007-09-06 .bmp file format is now longer an alias for .raw 2007-09-07 Added clip path support to pdf backend. - JKS \begin{description} \item[{2007-09-06 Fixed a bug in the embedding of Type 1 fonts in PDF.}] \leavevmode Now it doesn’t crash Preview.app. - JKS \item[{2007-09-06 Refactored image saving code so that all GUI backends can}] \leavevmode save most image types. See FILETYPES for a matrix of backends and their supported file types. Backend canvases should no longer write their own print\_figure() method \textendash{} instead they should write a print\_xxx method for each filetype they can output and add an entry to their class-scoped filetypes dictionary. - MGD \end{description} 2007-09-05 Fixed Qt version reporting in setupext.py - DSD \begin{description} \item[{2007-09-04 Embedding Type 1 fonts in PDF, and thus usetex support}] \leavevmode via dviread, sort of works. To test, enable it by renaming \_draw\_tex to draw\_tex. - JKS \item[{2007-09-03 Added ability of errorbar show limits via caret or}] \leavevmode arrowhead ends on the bars; patch by Manual Metz. - EF \item[{2007-09-03 Created type1font.py, added features to AFM and FT2Font}] \leavevmode (see API\_CHANGES), started work on embedding Type 1 fonts in pdf files. - JKS \end{description} 2007-09-02 Continued work on dviread.py. - JKS \begin{description} \item[{2007-08-16 Added a set\_extent method to AxesImage, allow data extent}] \leavevmode to be modified after initial call to imshow - DSD \item[{2007-08-14 Fixed a bug in pyqt4 subplots-adjust. Thanks to}] \leavevmode Xavier Gnata for the report and suggested fix - DSD \item[{2007-08-13 Use pickle to cache entire fontManager; change to using}] \leavevmode font\_manager module-level function findfont wrapper for the fontManager.findfont method - EF \end{description} 2007-08-11 Numpification and cleanup of mlab.py and some examples - EF 2007-08-06 Removed mathtext2 \begin{description} \item[{2007-07-31 Refactoring of distutils scripts.}] \leavevmode\begin{itemize} \item {} Will not fail on the entire build if an optional Python package (e.g., Tkinter) is installed but its development headers are not (e.g., tk-devel). Instead, it will continue to build all other extensions. \item {} Provide an overview at the top of the output to display what dependencies and their versions were found, and (by extension) what will be built. \item {} Use pkg-config, when available, to find freetype2, since this was broken on Mac OS-X when using MacPorts in a non- standard location. \end{itemize} \item[{2007-07-30 Reorganized configuration code to work with traited config}] \leavevmode objects. The new config system is located in the matplotlib.config package, but it is disabled by default. To enable it, set NEWCONFIG=True in matplotlib.\_\_init\_\_.py. The new configuration system will still use the old matplotlibrc files by default. To switch to the experimental, traited configuration, set USE\_TRAITED\_CONFIG=True in config.\_\_init\_\_.py. \item[{2007-07-29 Changed default pcolor shading to flat; added aliases}] \leavevmode to make collection kwargs agree with setter names, so updating works; related minor cleanups. Removed quiver\_classic, scatter\_classic, pcolor\_classic. - EF \end{description} 2007-07-26 Major rewrite of mathtext.py, using the TeX box layout model. \begin{quote} There is one (known) backward incompatible change. The font commands (cal, rm, it, tt) now behave as TeX does: they are in effect until the next font change command or the end of the grouping. Therefore uses of \$cal\{R\}\$ should be changed to \$\{cal R\}\$. Alternatively, you may use the new LaTeX-style font commands (mathcal, mathrm, mathit, mathtt) which do affect the following group, e.g., \$mathcal\{R\}\$. Other new features include: \begin{itemize} \item {} Math may be interspersed with non-math text. Any text with an even number of \$’s (non-escaped) will be sent to the mathtext parser for layout. \item {} Sub/superscripts are less likely to accidentally overlap. \item {} Support for sub/superscripts in either order, e.g., \$x\textasciicircum{}i\_j\$ and \$x\_j\textasciicircum{}i\$ are equivalent. \item {} Double sub/superscripts (e.g., \$x\_i\_j\$) are considered ambiguous and raise an exception. Use braces to disambiguate. \item {} \$frac\{x\}\{y\}\$ can be used for displaying fractions. \item {} \$sqrt{[}3{]}\{x\}\$ can be used to display the radical symbol with a root number and body. \item {} \$left(frac\{x\}\{y\}right)\$ may be used to create parentheses and other delimiters that automatically resize to the height of their contents. \item {} Spacing around operators etc. is now generally more like TeX. \item {} Added support (and fonts) for boldface (bf) and sans-serif (sf) symbols. \item {} Log-like function name shortcuts are supported. For example, \$sin(x)\$ may be used instead of \$\{rm sin\}(x)\$ \item {} Limited use of kerning for the easy case (same font) \end{itemize} Behind the scenes, the pyparsing.py module used for doing the math parsing was updated to the latest stable version (1.4.6). A lot of duplicate code was refactored out of the Font classes. \begin{itemize} \item {} MGD \end{itemize} \end{quote} 2007-07-19 completed numpification of most trivial cases - NN 2007-07-19 converted non-numpy relicts throughout the code - NN \begin{description} \item[{2007-07-19 replaced the Python code in numerix/ by a minimal wrapper around}] \leavevmode numpy that explicitly mentions all symbols that need to be addressed for further numpification - NN \item[{2007-07-18 make usetex respect changes to rcParams. texmanager used to}] \leavevmode only configure itself when it was created, now it reconfigures when rcParams are changed. Thank you Alexander Schmolck for contributing a patch - DSD \end{description} 2007-07-17 added validation to setting and changing rcParams - DSD \begin{description} \item[{2007-07-17 bugfix segfault in transforms module. Thanks Ben North for}] \leavevmode the patch. - ADS \item[{2007-07-16 clean up some code in ticker.ScalarFormatter, use unicode to}] \leavevmode render multiplication sign in offset ticklabel - DSD \item[{2007-07-16 fixed a formatting bug in ticker.ScalarFormatter’s scientific}] \leavevmode notation (10\textasciicircum{}0 was being rendered as 10 in some cases) - DSD \item[{2007-07-13 Add MPL\_isfinite64() and MPL\_isinf64() for testing}] \leavevmode doubles in (the now misnamed) MPL\_isnan.h. - ADS \end{description} 2007-07-13 The matplotlib.\_isnan module removed (use numpy.isnan) - ADS 2007-07-13 Some minor cleanups in \_transforms.cpp - ADS \begin{description} \item[{2007-07-13 Removed the rest of the numerix extension code detritus,}] \leavevmode numpified axes.py, and cleaned up the imports in axes.py - JDH \item[{2007-07-13 Added legend.loc as configurable option that could in}] \leavevmode future default to ‘best’. - NN \end{description} 2007-07-12 Bugfixes in mlab.py to coerce inputs into numpy arrays. -ADS 2007-07-11 Added linespacing kwarg to text.Text - EF 2007-07-11 Added code to store font paths in SVG files. - MGD 2007-07-10 Store subset of TTF font as a Type 3 font in PDF files. - MGD 2007-07-09 Store subset of TTF font as a Type 3 font in PS files. - MGD \begin{description} \item[{2007-07-09 Applied Paul’s pick restructure pick and add pickers,}] \leavevmode sourceforge patch 1749829 - JDH \end{description} 2007-07-09 Applied Allan’s draw\_lines agg optimization. JDH 2007-07-08 Applied Carl Worth’s patch to fix cairo draw\_arc - SC 2007-07-07 fixed bug 1712099: xpdf distiller on windows - DSD \begin{description} \item[{2007-06-30 Applied patches to tkagg, gtk, and wx backends to reduce}] \leavevmode memory leakage. Patches supplied by Mike Droettboom; see tracker numbers 1745400, 1745406, 1745408. Also made unit/memleak\_gui.py more flexible with command-line options. - EF \item[{2007-06-30 Split defaultParams into separate file rcdefaults (together with}] \leavevmode validation code). Some heavy refactoring was necessary to do so, but the overall behavior should be the same as before. - NN \item[{2007-06-27 Added MPLCONFIGDIR for the default location for mpl data}] \leavevmode and configuration. useful for some apache installs where HOME is not writable. Tried to clean up the logic in \_get\_config\_dir to support non-writable HOME where are writable HOME/.matplotlib already exists - JDH \item[{2007-06-27 Fixed locale bug reported at}] \leavevmode \sphinxurl{http://sourceforge.net/tracker/index.php?func=detail\&aid=1744154\&group\_id=80706\&atid=560720} by adding a cbook.unicode\_safe function - JDH \item[{2007-06-27 Applied Micheal’s tk savefig bugfix described at}] \leavevmode \sphinxurl{http://sourceforge.net/tracker/index.php?func=detail\&aid=1716732\&group\_id=80706\&atid=560720} Thanks Michael! \item[{2007-06-27 Patch for get\_py2exe\_datafiles() to work with new directory}] \leavevmode layout. (Thanks Tocer and also Werner Bruhin.) -ADS \item[{2007-06-27 Added a scroll event to the mpl event handling system and}] \leavevmode implemented it for backends GTK* \textendash{} other backend users/developers/maintainers, please add support for your backend. - JDH \item[{2007-06-25 Changed default to clip=False in colors.Normalize;}] \leavevmode modified ColorbarBase for easier colormap display - EF \end{description} 2007-06-13 Added maskedarray option to rc, numerix - EF 2007-06-11 Python 2.5 compatibility fix for mlab.py - EF \begin{description} \item[{2007-06-10 In matplotlibrc file, use ‘dashed’ \textbar{} ‘solid’ instead}] \leavevmode of a pair of floats for contour.negative\_linestyle - EF \item[{2007-06-08 Allow plot and fill fmt string to be any mpl string}] \leavevmode colorspec - EF \item[{2007-06-08 Added gnuplot file plotfile function to pylab \textendash{} see}] \leavevmode examples/plotfile\_demo.py - JDH \item[{2007-06-07 Disable build of numarray and Numeric extensions for}] \leavevmode internal MPL use and the numerix layer. - ADS \item[{2007-06-07 Added csv2rec to matplotlib.mlab to support automatically}] \leavevmode converting csv files to record arrays using type introspection, and turned on native datetime support using the new units support in matplotlib.dates. See examples/loadrec.py ! JDH \end{description} 2007-06-07 Simplified internal code of \_auto\_legend\_data - NN \begin{description} \item[{2007-06-04 Added labeldistance arg to Axes.pie to control the raidal}] \leavevmode distance of the wedge labels - JDH \item[{2007-06-03 Turned mathtext in SVG into single \textless{}text\textgreater{} with multiple \textless{}tspan\textgreater{}}] \leavevmode objects (easier to edit in inkscape). - NN \end{description} \bigskip\hrule\bigskip 2007-06-02 Released 0.90.1 at revision 3352 \begin{description} \item[{2007-06-02 Display only meaningful labels when calling legend()}] \leavevmode without args. - NN \item[{2007-06-02 Have errorbar follow the color cycle even if line is not plotted.}] \leavevmode Suppress plotting of errorbar caps for capsize=0. - NN \end{description} 2007-06-02 Set markers to same alpha value as line. - NN 2007-06-02 Fix mathtext position in svg backend. - NN \begin{description} \item[{2007-06-01 Deprecate Numeric and numarray for use as numerix. Props to}] \leavevmode Travis \textendash{} job well done. - ADS \item[{2007-05-18 Added LaTeX unicode support. Enable with the}] \leavevmode ‘text.latex.unicode’ rcParam. This requires the ucs and inputenc LaTeX packages. - ADS \item[{2007-04-23 Fixed some problems with polar \textendash{} added general polygon}] \leavevmode clipping to clip the lines a nd grids to the polar axes. Added support for set\_rmax to easily change the maximum radial grid. Added support for polar legend - JDH \item[{2007-04-16 Added Figure.autofmt\_xdate to handle adjusting the bottom}] \leavevmode and rotating the tick labels for date plots when the ticks often overlap - JDH \end{description} 2007-04-09 Beginnings of usetex support for pdf backend. -JKS \begin{description} \item[{2007-04-07 Fixed legend/LineCollection bug. Added label support}] \leavevmode to collections. - EF \item[{2007-04-06 Removed deprecated support for a float value as a gray-scale;}] \leavevmode now it must be a string, like ‘0.5’. Added alpha kwarg to ColorConverter.to\_rgba\_list. - EF \item[{2007-04-06 Fixed rotation of ellipses in pdf backend}] \leavevmode (sf bug \#1690559) -JKS \item[{2007-04-04 More matshow tweaks; documentation updates; new method}] \leavevmode set\_bounds() for formatters and locators. - EF \item[{2007-04-02 Fixed problem with imshow and matshow of integer arrays;}] \leavevmode fixed problems with changes to color autoscaling. - EF \item[{2007-04-01 Made image color autoscaling work correctly with}] \leavevmode a tracking colorbar; norm.autoscale now scales unconditionally, while norm.autoscale\_None changes only None-valued vmin, vmax. - EF \end{description} 2007-03-31 Added a qt-based subplot-adjustment dialog - DSD 2007-03-30 Fixed a bug in backend\_qt4, reported on mpl-dev - DSD \begin{description} \item[{2007-03-26 Removed colorbar\_classic from figure.py; fixed bug in}] \leavevmode Figure.clf() in which \_axobservers was not getting cleared. Modernization and cleanups. - EF \item[{2007-03-26 Refactored some of the units support \textendash{} units now live in}] \leavevmode the respective x and y Axis instances. See also API\_CHANGES for some alterations to the conversion interface. JDH \item[{2007-03-25 Fix masked array handling in quiver.py for numpy. (Numeric}] \leavevmode and numarray support for masked arrays is broken in other ways when using quiver. I didn’t pursue that.) - ADS \end{description} 2007-03-23 Made font\_manager.py close opened files. - JKS 2007-03-22 Made imshow default extent match matshow - EF \begin{description} \item[{2007-03-22 Some more niceties for xcorr \textendash{} a maxlags option, normed}] \leavevmode now works for xcorr as well as axorr, usevlines is supported, and a zero correlation hline is added. See examples/xcorr\_demo.py. Thanks Sameer for the patch. - JDH \item[{2007-03-21 Axes.vlines and Axes.hlines now create and returns a}] \leavevmode LineCollection, not a list of lines. This is much faster. The kwarg signature has changed, so consult the docs. Modified Axes.errorbar which uses vlines and hlines. See API\_CHANGES; the return signature for these three functions is now different \end{description} 2007-03-20 Refactored units support and added new examples - JDH 2007-03-19 Added Mike’s units patch - JDH \begin{description} \item[{2007-03-18 Matshow as an Axes method; test version matshow1() in}] \leavevmode pylab; added ‘integer’ Boolean kwarg to MaxNLocator initializer to force ticks at integer locations. - EF \end{description} 2007-03-17 Preliminary support for clipping to paths agg - JDH 2007-03-17 Text.set\_text() accepts anything convertible with ‘\%s’ - EF 2007-03-14 Add masked-array support to hist. - EF \begin{description} \item[{2007-03-03 Change barh to take a kwargs dict and pass it to bar.}] \leavevmode Fixes sf bug \#1669506. \item[{2007-03-02 Add rc parameter pdf.inheritcolor, which disables all}] \leavevmode color-setting operations in the pdf backend. The idea is that you include the resulting file in another program and set the colors (both stroke and fill color) there, so you can use the same pdf file for e.g., a paper and a presentation and have them in the surrounding color. You will probably not want to draw figure and axis frames in that case, since they would be filled in the same color. - JKS \end{description} 2007-02-26 Prevent building \_wxagg.so with broken Mac OS X wxPython. - ADS 2007-02-23 Require setuptools for Python 2.3 - ADS \begin{description} \item[{2007-02-22 WXAgg accelerator updates - KM}] \leavevmode WXAgg’s C++ accelerator has been fixed to use the correct wxBitmap constructor. The backend has been updated to use new wxPython functionality to provide fast blit() animation without the C++ accelerator. This requires wxPython 2.8 or later. Previous versions of wxPython can use the C++ acclerator or the old pure Python routines. setup.py no longer builds the C++ accelerator when wxPython \textgreater{}= 2.8 is present. The blit() method is now faster regardless of which agg/wxPython conversion routines are used. \item[{2007-02-21 Applied the PDF backend patch by Nicolas Grilly.}] \leavevmode This impacts several files and directories in matplotlib: \begin{itemize} \item {} Created the directory lib/matplotlib/mpl-data/fonts/pdfcorefonts, holding AFM files for the 14 PDF core fonts. These fonts are embedded in every PDF viewing application. \item {} setup.py: Added the directory pdfcorefonts to package\_data. \item {} lib/matplotlib/\_\_init\_\_.py: Added the default parameter ‘pdf.use14corefonts’. When True, the PDF backend uses only the 14 PDF core fonts. \item {} lib/matplotlib/afm.py: Added some keywords found in recent AFM files. Added a little workaround to handle Euro symbol. \item {} lib/matplotlib/fontmanager.py: Added support for the 14 PDF core fonts. These fonts have a dedicated cache (file pdfcorefont.cache), not the same as for other AFM files (file .afmfont.cache). Also cleaned comments to conform to CODING\_GUIDE. \item {} lib/matplotlib/backends/backend\_pdf.py: Added support for 14 PDF core fonts. Fixed some issues with incorrect character widths and encodings (works only for the most common encoding, WinAnsiEncoding, defined by the official PDF Reference). Removed parameter ‘dpi’ because it causes alignment issues. \end{itemize} -JKS (patch by Nicolas Grilly) \item[{2007-02-17 Changed ft2font.get\_charmap, and updated all the files where}] \leavevmode get\_charmap is mentioned - ES \end{description} 2007-02-13 Added barcode demo- JDH 2007-02-13 Added binary colormap to cm - JDH 2007-02-13 Added twiny to pylab - JDH \begin{description} \item[{2007-02-12 Moved data files into lib/matplotlib so that setuptools’}] \leavevmode develop mode works. Re-organized the mpl-data layout so that this source structure is maintained in the installation. (i.e., the ‘fonts’ and ‘images’ sub-directories are maintained in site-packages.) Suggest removing site-packages/matplotlib/mpl-data and \textasciitilde{}/.matplotlib/ttffont.cache before installing - ADS \item[{2007-02-07 Committed Rob Hetland’s patch for qt4: remove}] \leavevmode references to text()/latin1(), plus some improvements to the toolbar layout - DSD \end{description} \bigskip\hrule\bigskip 2007-02-06 Released 0.90.0 at revision 3003 \begin{description} \item[{2007-01-22 Extended the new picker API to text, patches and patch}] \leavevmode collections. Added support for user customizable pick hit testing and attribute tagging of the PickEvent - Details and examples in examples/pick\_event\_demo.py - JDH \item[{2007-01-16 Begun work on a new pick API using the mpl event handling}] \leavevmode frameowrk. Artists will define their own pick method with a configurable epsilon tolerance and return pick attrs. All artists that meet the tolerance threshold will fire a PickEvent with artist dependent attrs; e.g., a Line2D can set the indices attribute that shows the indices into the line that are within epsilon of the pick point. See examples/pick\_event\_demo.py. The implementation of pick for the remaining Artists remains to be done, but the core infrastructure at the level of event handling is in place with a proof-of-concept implementation for Line2D - JDH \item[{2007-01-16 src/\_image.cpp: update to use Py\_ssize\_t (for 64-bit systems).}] \leavevmode Use return value of fread() to prevent warning messages - SC. \item[{2007-01-15 src/\_image.cpp: combine buffer\_argb32() and buffer\_bgra32() into}] \leavevmode a new method color\_conv(format) - SC \item[{2007-01-14 backend\_cairo.py: update draw\_arc() so that}] \leavevmode examples/arctest.py looks correct - SC \item[{2007-01-12 backend\_cairo.py: enable clipping. Update draw\_image() so that}] \leavevmode examples/contour\_demo.py looks correct - SC \item[{2007-01-12 backend\_cairo.py: fix draw\_image() so that examples/image\_demo.py}] \leavevmode now looks correct - SC \item[{2007-01-11 Added Axes.xcorr and Axes.acorr to plot the cross}] \leavevmode correlation of x vs y or the autocorrelation of x. pylab wrappers also provided. See examples/xcorr\_demo.py - JDH \item[{2007-01-10 Added “Subplot.label\_outer” method. It will set the}] \leavevmode visibility of the ticklabels so that yticklabels are only visible in the first column and xticklabels are only visible in the last row - JDH \end{description} 2007-01-02 Added additional kwarg documentation - JDH \begin{description} \item[{2006-12-28 Improved error message for nonpositive input to log}] \leavevmode transform; added log kwarg to bar, barh, and hist, and modified bar method to behave sensibly by default when the ordinate has a log scale. (This only works if the log scale is set before or by the call to bar, hence the utility of the log kwarg.) - EF \item[{2006-12-27 backend\_cairo.py: update draw\_image() and \_draw\_mathtext() to work}] \leavevmode with numpy - SC \item[{2006-12-20 Fixed xpdf dependency check, which was failing on windows.}] \leavevmode Removed ps2eps dependency check. - DSD \end{description} 2006-12-19 Added Tim Leslie’s spectral patch - JDH \begin{description} \item[{2006-12-17 Added rc param ‘axes.formatter.limits’ to control}] \leavevmode the default threshold for switching to scientific notation. Added convenience method Axes.ticklabel\_format() for turning scientific notation on or off on either or both axes. - EF \item[{2006-12-16 Added ability to turn control scientific notation}] \leavevmode in ScalarFormatter - EF \end{description} 2006-12-16 Enhanced boxplot to handle more flexible inputs - EF \begin{description} \item[{2006-12-13 Replaced calls to where() in colors.py with much faster}] \leavevmode clip() and putmask() calls; removed inappropriate uses of getmaskorNone (which should be needed only very rarely); all in response to profiling by David Cournapeau. Also fixed bugs in my 2-D array support from 12-09. - EF \item[{2006-12-09 Replaced spy and spy2 with the new spy that combines}] \leavevmode marker and image capabilities - EF \item[{2006-12-09 Added support for plotting 2-D arrays with plot:}] \leavevmode columns are plotted as in Matlab - EF \item[{2006-12-09 Added linewidth kwarg to bar and barh; fixed arg}] \leavevmode checking bugs - EF \item[{2006-12-07 Made pcolormesh argument handling match pcolor;}] \leavevmode fixed kwarg handling problem noted by Pierre GM - EF \item[{2006-12-06 Made pcolor support vector X and/or Y instead of}] \leavevmode requiring 2-D arrays - EF \item[{2006-12-05 Made the default Artist.\_transform None (rather than}] \leavevmode invoking identity\_transform for each artist only to have it overridden later). Use artist.get\_transform() rather than artist.\_transform, even in derived classes, so that the default transform will be created lazily as needed - JDH \item[{2006-12-03 Added LogNorm to colors.py as illustrated by}] \leavevmode examples/pcolor\_log.py, based on suggestion by Jim McDonald. Colorbar modified to handle LogNorm. Norms have additional “inverse” method. - EF \item[{2006-12-02 Changed class names in colors.py to match convention:}] \leavevmode normalize -\textgreater{} Normalize, no\_norm -\textgreater{} NoNorm. Old names are still available. Changed \_\_init\_\_.py rc defaults to match those in matplotlibrc - EF \end{description} 2006-11-22 Fixed bug in set\_*lim that I had introduced on 11-15 - EF \begin{description} \item[{2006-11-22 Added examples/clippedline.py, which shows how to clip line}] \leavevmode data based on view limits \textendash{} it also changes the marker style when zoomed in - JDH \item[{2006-11-21 Some spy bug-fixes and added precision arg per Robert C’s}] \leavevmode suggestion - JDH \item[{2006-11-19 Added semi-automatic docstring generation detailing all the}] \leavevmode kwargs that functions take using the artist introspection tools; e.g., ‘help text now details the scatter kwargs that control the Text properties - JDH \item[{2006-11-17 Removed obsolete scatter\_classic, leaving a stub to}] \leavevmode raise NotImplementedError; same for pcolor\_classic - EF \end{description} 2006-11-15 Removed obsolete pcolor\_classic - EF \begin{description} \item[{2006-11-15 Fixed 1588908 reported by Russel Owen; factored}] \leavevmode nonsingular method out of ticker.py, put it into transforms.py as a function, and used it in set\_xlim and set\_ylim. - EF \item[{2006-11-14 Applied patch 1591716 by Ulf Larssen to fix a bug in}] \leavevmode apply\_aspect. Modified and applied patch 1594894 by mdehoon to fix bugs and improve formatting in lines.py. Applied patch 1573008 by Greg Willden to make psd etc. plot full frequency range for complex inputs. - EF \item[{2006-11-14 Improved the ability of the colorbar to track}] \leavevmode changes in corresponding image, pcolor, or contourf. - EF \item[{2006-11-11 Fixed bug that broke Numeric compatibility;}] \leavevmode added support for alpha to colorbar. The alpha information is taken from the mappable object, not specified as a kwarg. - EF \item[{2006-11-05 Added broken\_barh function for makring a sequence of}] \leavevmode horizontal bars broken by gaps \textendash{} see examples/broken\_barh.py \item[{2006-11-05 Removed lineprops and markerprops from the Annotation code}] \leavevmode and replaced them with an arrow configurable with kwarg arrowprops. See examples/annotation\_demo.py - JDH \item[{2006-11-02 Fixed a pylab subplot bug that was causing axes to be}] \leavevmode deleted with hspace or wspace equals zero in subplots\_adjust - JDH \item[{2006-10-31 Applied axes3d patch 1587359}] \leavevmode \sphinxurl{http://sourceforge.net/tracker/index.php?func=detail\&aid=1587359\&group\_id=80706\&atid=560722} JDH \end{description} \bigskip\hrule\bigskip 2006-10-26 Released 0.87.7 at revision 2835 2006-10-25 Made “tiny” kwarg in Locator.nonsingular much smaller - EF \begin{description} \item[{2006-10-17 Closed sf bug 1562496 update line props dash/solid/cap/join}] \leavevmode styles - JDH \item[{2006-10-17 Complete overhaul of the annotations API and example code -}] \leavevmode See matplotlib.text.Annotation and examples/annotation\_demo.py JDH \item[{2006-10-12 Committed Manuel Metz’s StarPolygon code and}] \leavevmode examples/scatter\_star\_poly.py - JDH \item[{2006-10-11 commented out all default values in matplotlibrc.template}] \leavevmode Default values should generally be taken from defaultParam in \_\_init\_\_.py - the file matplotlib should only contain those values that the user wants to explicitly change from the default. (see thread “marker color handling” on matplotlib-devel) \end{description} 2006-10-10 Changed default comment character for load to ‘\#’ - JDH \begin{description} \item[{2006-10-10 deactivated rcfile-configurability of markerfacecolor}] \leavevmode and markeredgecolor. Both are now hardcoded to the special value ‘auto’ to follow the line color. Configurability at run-time (using function arguments) remains functional. - NN \item[{2006-10-07 introduced dummy argument magnification=1.0 to}] \leavevmode FigImage.make\_image to satisfy unit test figimage\_demo.py The argument is not yet handled correctly, which should only show up when using non-standard DPI settings in PS backend, introduced by patch \#1562394. - NN \end{description} 2006-10-06 add backend-agnostic example: simple3d.py - NN 2006-09-29 fix line-breaking for SVG-inline images (purely cosmetic) - NN \begin{description} \item[{2006-09-29 reworked set\_linestyle and set\_marker}] \leavevmode markeredgecolor and markerfacecolor now default to a special value “auto” that keeps the color in sync with the line color further, the intelligence of axes.plot is cleaned up, improved and simplified. Complete compatibility cannot be guaranteed, but the new behavior should be much more predictable (see patch \#1104615 for details) - NN \item[{2006-09-29 changed implementation of clip-path in SVG to work around a}] \leavevmode limitation in inkscape - NN \item[{2006-09-29 added two options to matplotlibrc:}] \leavevmode svg.image\_inline svg.image\_noscale see patch \#1533010 for details - NN \end{description} 2006-09-29 axes.py: cleaned up kwargs checking - NN 2006-09-29 setup.py: cleaned up setup logic - NN 2006-09-29 setup.py: check for required pygtk versions, fixes bug \#1460783 - SC \bigskip\hrule\bigskip 2006-09-27 Released 0.87.6 at revision 2783 \begin{description} \item[{2006-09-24 Added line pointers to the Annotation code, and a pylab}] \leavevmode interface. See matplotlib.text.Annotation, examples/annotation\_demo.py and examples/annotation\_demo\_pylab.py - JDH \item[{2006-09-18 mathtext2.py: The SVG backend now supports the same things that}] \leavevmode the AGG backend does. Fixed some bugs with rendering, and out of bounds errors in the AGG backend - ES. Changed the return values of math\_parse\_s\_ft2font\_svg to support lines (fractions etc.) \item[{2006-09-17 Added an Annotation class to facilitate annotating objects}] \leavevmode and an examples file examples/annotation\_demo.py. I want to add dash support as in TextWithDash, but haven’t decided yet whether inheriting from TextWithDash is the right base class or if another approach is needed - JDH \end{description} \bigskip\hrule\bigskip 2006-09-05 Released 0.87.5 at revision 2761 \begin{description} \item[{2006-09-04 Added nxutils for some numeric add-on extension code \textendash{}}] \leavevmode specifically a better/more efficient inside polygon tester (see unit/inside\_poly\_*.py) - JDH \end{description} 2006-09-04 Made bitstream fonts the rc default - JDH \begin{description} \item[{2006-08-31 Fixed alpha-handling bug in ColorConverter, affecting}] \leavevmode collections in general and contour/contourf in particular. - EF \item[{2006-08-30 ft2font.cpp: Added draw\_rect\_filled method (now used by mathtext2}] \leavevmode to draw the fraction bar) to FT2Font - ES \item[{2006-08-29 setupext.py: wrap calls to tk.getvar() with str(). On some}] \leavevmode systems, getvar returns a Tcl\_Obj instead of a string - DSD \item[{2006-08-28 mathtext2.py: Sub/superscripts can now be complex (i.e.}] \leavevmode fractions etc.). The demo is also updated - ES \item[{2006-08-28 font\_manager.py: Added /usr/local/share/fonts to list of}] \leavevmode X11 font directories - DSD \item[{2006-08-28 mahtext2.py: Initial support for complex fractions. Also,}] \leavevmode rendering is now completely separated from parsing. The sub/superscripts now work better. Updated the mathtext2\_demo.py - ES \item[{2006-08-27 qt backends: don’t create a QApplication when backend is}] \leavevmode imported, do it when the FigureCanvasQt is created. Simplifies applications where mpl is embedded in qt. Updated embedding\_in\_qt* examples - DSD \item[{2006-08-27 mahtext2.py: Now the fonts are searched in the OS font dir and}] \leavevmode in the mpl-data dir. Also env is not a dict anymore. - ES \item[{2006-08-26 minor changes to \_\_init\_\_.py, mathtex2\_demo.py. Added matplotlibrc}] \leavevmode key “mathtext.mathtext2” (removed the key “mathtext2”) - ES \item[{2006-08-21 mathtext2.py: Initial support for fractions}] \leavevmode Updated the mathtext2\_demo.py \_mathtext\_data.py: removed “” from the unicode dicts mathtext.py: Minor modification (because of \_mathtext\_data.py)- ES \item[{2006-08-20 Added mathtext2.py: Replacement for mathtext.py. Supports \_ \textasciicircum{},}] \leavevmode rm, cal etc., sin, cos etc., unicode, recursive nestings, inline math mode. The only backend currently supported is Agg \_\_init\_\_.py: added new rc params for mathtext2 added mathtext2\_demo.py example - ES \end{description} 2006-08-19 Added embedding\_in\_qt4.py example - DSD 2006-08-11 Added scale free Ellipse patch for Agg - CM \begin{description} \item[{2006-08-10 Added converters to and from julian dates to matplotlib.dates}] \leavevmode (num2julian and julian2num) - JDH \item[{2006-08-08 Fixed widget locking so multiple widgets could share the}] \leavevmode event handling - JDH \end{description} 2006-08-07 Added scale free Ellipse patch to SVG and PS - CM 2006-08-05 Re-organized imports in numerix for numpy 1.0b2 \textendash{} TEO 2006-08-04 Added draw\_markers to PDF backend. - JKS 2006-08-01 Fixed a bug in postscript’s rendering of dashed lines - DSD \begin{description} \item[{2006-08-01 figure.py: savefig() update docstring to add support for ‘format’}] \leavevmode argument. backend\_cairo.py: print\_figure() add support ‘format’ argument. - SC \end{description} 2006-07-31 Don’t let postscript’s xpdf distiller compress images - DSD \begin{description} \item[{2006-07-31 Added shallowcopy() methods to all Transformations;}] \leavevmode removed copy\_bbox\_transform and copy\_bbox\_transform\_shallow from transforms.py; added offset\_copy() function to transforms.py to facilitate positioning artists with offsets. See examples/transoffset.py. - EF \end{description} 2006-07-31 Don’t let postscript’s xpdf distiller compress images - DSD \begin{description} \item[{2006-07-29 Fixed numerix polygon bug reported by Nick Fotopoulos.}] \leavevmode Added inverse\_numerix\_xy() transform method. Made autoscale\_view() preserve axis direction (e.g., increasing down).- EF \item[{2006-07-28 Added shallow bbox copy routine for transforms \textendash{} mainly}] \leavevmode useful for copying transforms to apply offset to. - JDH \item[{2006-07-28 Added resize method to FigureManager class}] \leavevmode for Qt and Gtk backend - CM \end{description} 2006-07-28 Added subplots\_adjust button to Qt backend - CM \begin{description} \item[{2006-07-26 Use numerix more in collections.}] \leavevmode Quiver now handles masked arrays. - EF \end{description} 2006-07-22 Fixed bug \#1209354 - DSD \begin{description} \item[{2006-07-22 make scatter() work with the kwarg “color”. Closes bug}] \leavevmode 1285750 - DSD \item[{2006-07-20 backend\_cairo.py: require pycairo 1.2.0.}] \leavevmode print\_figure() update to output SVG using cairo. \end{description} 2006-07-19 Added blitting for Qt4Agg - CM 2006-07-19 Added lasso widget and example examples/lasso\_demo.py - JDH 2006-07-18 Added blitting for QtAgg backend - CM 2006-07-17 Fixed bug \#1523585: skip nans in semilog plots - DSD \begin{description} \item[{2006-07-12 Add support to render the scientific notation label}] \leavevmode over the right-side y-axis - DSD \end{description} \bigskip\hrule\bigskip 2006-07-11 Released 0.87.4 at revision 2558 2006-07-07 Fixed a usetex bug with older versions of latex - DSD 2006-07-07 Add compatibility for NumPy 1.0 - TEO 2006-06-29 Added a Qt4Agg backend. Thank you James Amundson - DSD \begin{description} \item[{2006-06-26 Fixed a usetex bug. On windows, usetex will prcess}] \leavevmode postscript output in the current directory rather than in a temp directory. This is due to the use of spaces and tildes in windows paths, which cause problems with latex. The subprocess module is no longer used. - DSD \item[{2006-06-22 Various changes to bar(), barh(), and hist().}] \leavevmode Added ‘edgecolor’ keyword arg to bar() and barh(). The x and y args in barh() have been renamed to width and bottom respectively, and their order has been swapped to maintain a (position, value) order ala matlab. left, height, width and bottom args can now all be scalars or sequences. barh() now defaults to edge alignment instead of center alignment. Added a keyword arg ‘align’ to bar(), barh() and hist() that controls between edge or center bar alignment. Fixed ignoring the rcParams{[}‘patch.facecolor’{]} for bar color in bar() and barh(). Fixed ignoring the rcParams{[}‘lines.color’{]} for error bar color in bar() and barh(). Fixed a bug where patches would be cleared when error bars were plotted if rcParams{[}‘axes.hold’{]} was False. - MAS \item[{2006-06-22 Added support for numerix 2-D arrays as alternatives to}] \leavevmode a sequence of (x,y) tuples for specifying paths in collections, quiver, contour, pcolor, transforms. Fixed contour bug involving setting limits for color mapping. Added numpy-style all() to numerix. - EF \item[{2006-06-20 Added custom FigureClass hook to pylab interface - see}] \leavevmode examples/custom\_figure\_class.py \item[{2006-06-16 Added colormaps from gist (gist\_earth, gist\_stern,}] \leavevmode gist\_rainbow, gist\_gray, gist\_yarg, gist\_heat, gist\_ncar) - JW \item[{2006-06-16 Added a pointer to parent in figure canvas so you can}] \leavevmode access the container with fig.canvas.manager. Useful if you want to set the window title, e.g., in gtk fig.canvas.manager.window.set\_title, though a GUI neutral method would be preferable JDH \item[{2006-06-16 Fixed colorbar.py to handle indexed colors (i.e.,}] \leavevmode norm = no\_norm()) by centering each colored region on its index. - EF \item[{2006-06-15 Added scalex and scaley to Axes.autoscale\_view to support}] \leavevmode selective autoscaling just the x or y axis, and supported these command in plot so you can say plot(something, scaley=False) and just the x axis will be autoscaled. Modified axvline and axhline to support this, so for example axvline will no longer autoscale the y axis. JDH \end{description} 2006-06-13 Fix so numpy updates are backward compatible - TEO \begin{description} \item[{2006-06-12 Updated numerix to handle numpy restructuring of}] \leavevmode oldnumeric - TEO \item[{2006-06-12 Updated numerix.fft to handle numpy restructuring}] \leavevmode Added ImportError to numerix.linear\_algebra for numpy -TEO \item[{2006-06-11 Added quiverkey command to pylab and Axes, using}] \leavevmode QuiverKey class in quiver.py. Changed pylab and Axes to use quiver2 if possible, but drop back to the newly-renamed quiver\_classic if necessary. Modified examples/quiver\_demo.py to illustrate the new quiver and quiverkey. Changed LineCollection implementation slightly to improve compatibility with PolyCollection. - EF \item[{2006-06-11 Fixed a usetex bug for windows, running latex on files}] \leavevmode with spaces in their names or paths was failing - DSD \item[{2006-06-09 Made additions to numerix, changes to quiver to make it}] \leavevmode work with all numeric flavors. - EF \item[{2006-06-09 Added quiver2 function to pylab and method to axes,}] \leavevmode with implementation via a Quiver class in quiver.py. quiver2 will replace quiver before the next release; it is placed alongside it initially to facilitate testing and transition. See also examples/quiver2\_demo.py. - EF \item[{2006-06-08 Minor bug fix to make ticker.py draw proper minus signs}] \leavevmode with usetex - DSD \end{description} \bigskip\hrule\bigskip 2006-06-06 Released 0.87.3 at revision 2432 \begin{description} \item[{2006-05-30 More partial support for polygons with outline or fill,}] \leavevmode but not both. Made LineCollection inherit from ScalarMappable. - EF \end{description} 2006-05-29 Yet another revision of aspect-ratio handling. - EF \begin{description} \item[{2006-05-27 Committed a patch to prevent stroking zero-width lines in}] \leavevmode the svg backend - DSD \item[{2006-05-24 Fixed colorbar positioning bug identified by Helge}] \leavevmode Avlesen, and improved the algorithm; added a ‘pad’ kwarg to control the spacing between colorbar and parent axes. - EF \item[{2006-05-23 Changed color handling so that collection initializers}] \leavevmode can take any mpl color arg or sequence of args; deprecated float as grayscale, replaced by string representation of float. - EF \end{description} 2006-05-19 Fixed bug: plot failed if all points were masked - EF 2006-05-19 Added custom symbol option to scatter - JDH \begin{description} \item[{2006-05-18 New example, multi\_image.py; colorbar fixed to show}] \leavevmode offset text when the ScalarFormatter is used; FixedFormatter augmented to accept and display offset text. - EF \item[{2006-05-14 New colorbar; old one is renamed to colorbar\_classic.}] \leavevmode New colorbar code is in colorbar.py, with wrappers in figure.py and pylab.py. Fixed aspect-handling bug reported by Michael Mossey. Made backend\_bases.draw\_quad\_mesh() run.- EF \item[{2006-05-08 Changed handling of end ranges in contourf: replaced}] \leavevmode “clip-ends” kwarg with “extend”. See docstring for details. -EF \end{description} 2006-05-08 Added axisbelow to rc - JDH 2006-05-08 If using PyGTK require version 2.2+ - SC \begin{description} \item[{2006-04-19 Added compression support to PDF backend, controlled by}] \leavevmode new pdf.compression rc setting. - JKS \end{description} 2006-04-19 Added Jouni’s PDF backend 2006-04-18 Fixed a bug that caused agg to not render long lines \begin{description} \item[{2006-04-16 Masked array support for pcolormesh; made pcolormesh support the}] \leavevmode same combinations of X,Y,C dimensions as pcolor does; improved (I hope) description of grid used in pcolor, pcolormesh. - EF \end{description} 2006-04-14 Reorganized axes.py - EF \begin{description} \item[{2006-04-13 Fixed a bug Ryan found using usetex with sans-serif fonts and}] \leavevmode exponential tick labels - DSD \item[{2006-04-11 Refactored backend\_ps and backend\_agg to prevent module-level}] \leavevmode texmanager imports. Now these imports only occur if text.usetex rc setting is true - DSD \item[{2006-04-10 Committed changes required for building mpl on win32}] \leavevmode platforms with visual studio. This allows wxpython blitting for fast animations. - CM \end{description} 2006-04-10 Fixed an off-by-one bug in Axes.change\_geometry. \begin{description} \item[{2006-04-10 Fixed bug in pie charts where wedge wouldn’t have label in}] \leavevmode legend. Submitted by Simon Hildebrandt. - ADS \item[{2006-05-06 Usetex makes temporary latex and dvi files in a temporary}] \leavevmode directory, rather than in the user’s current working directory - DSD \item[{2006-04-05 Apllied Ken’s wx deprecation warning patch closing sf patch}] \leavevmode \#1465371 - JDH \item[{2006-04-05 Added support for the new API in the postscript backend.}] \leavevmode Allows values to be masked using nan’s, and faster file creation - DSD \item[{2006-04-05 Use python’s subprocess module for usetex calls to}] \leavevmode external programs. subprocess catches when they exit abnormally so an error can be raised. - DSD \item[{2006-04-03 Fixed the bug in which widgets would not respond to}] \leavevmode events. This regressed the twinx functionality, so I also updated subplots\_adjust to update axes that share an x or y with a subplot instance. - CM \item[{2006-04-02 Moved PBox class to transforms and deleted pbox.py;}] \leavevmode made pylab axis command a thin wrapper for Axes.axis; more tweaks to aspect-ratio handling; fixed Axes.specgram to account for the new imshow default of unit aspect ratio; made contour set the Axes.dataLim. - EF \end{description} 2006-03-31 Fixed the Qt “Underlying C/C++ object deleted” bug. - JRE 2006-03-31 Applied Vasily Sulatskov’s Qt Navigation Toolbar enhancement. - JRE \begin{description} \item[{2006-03-31 Ported Norbert’s rewriting of Halldor’s stineman\_interp}] \leavevmode algorithm to make it numerix compatible and added code to matplotlib.mlab. See examples/interp\_demo.py - JDH \item[{2006-03-30 Fixed a bug in aspect ratio handling; blocked potential}] \leavevmode crashes when panning with button 3; added axis(‘image’) support. - EF \item[{2006-03-28 More changes to aspect ratio handling; new PBox class}] \leavevmode in new file pbox.py to facilitate resizing and repositioning axes; made PolarAxes maintain unit aspect ratio. - EF \item[{2006-03-23 Refactored TextWithDash class to inherit from, rather than}] \leavevmode delegate to, the Text class. Improves object inspection and closes bug \# 1357969 - DSD \item[{2006-03-22 Improved aspect ratio handling, including pylab interface.}] \leavevmode Interactive resizing, pan, zoom of images and plots (including panels with a shared axis) should work. Additions and possible refactoring are still likely. - EF \end{description} 2006-03-21 Added another colorbrewer colormap (RdYlBu) - JSWHIT \begin{description} \item[{2006-03-21 Fixed tickmarks for logscale plots over very large ranges.}] \leavevmode Closes bug \# 1232920 - DSD \end{description} 2006-03-21 Added Rob Knight’s arrow code; see examples/arrow\_demo.py - JDH \begin{description} \item[{2006-03-20 Added support for masking values with nan’s, using ADS’s}] \leavevmode isnan module and the new API. Works for *Agg backends - DSD \end{description} 2006-03-20 Added contour.negative\_linestyle rcParam - ADS \begin{description} \item[{2006-03-20 Added \_isnan extension module to test for nan with Numeric}] \leavevmode\begin{itemize} \item {} ADS \end{itemize} \item[{2006-03-17 Added Paul and Alex’s support for faceting with quadmesh}] \leavevmode in sf patch 1411223 - JDH \item[{2006-03-17 Added Charle Twardy’s pie patch to support colors=None.}] \leavevmode Closes sf patch 1387861 - JDH \item[{2006-03-17 Applied sophana’s patch to support overlapping axes with}] \leavevmode toolbar navigation by toggling activation with the ‘a’ key. Closes sf patch 1432252 - JDH \item[{2006-03-17 Applied Aarre’s linestyle patch for backend EMF; closes sf}] \leavevmode patch 1449279 - JDH \item[{2006-03-17 Applied Jordan Dawe’s patch to support kwarg properties}] \leavevmode for grid lines in the grid command. Closes sf patch 1451661 - JDH \end{description} 2006-03-17 Center postscript output on page when using usetex - DSD \begin{description} \item[{2006-03-17 subprocess module built if Python \textless{}2.4 even if subprocess}] \leavevmode can be imported from an egg - ADS \item[{2006-03-17 Added \_subprocess.c from Python upstream and hopefully}] \leavevmode enabled building (without breaking) on Windows, although not tested. - ADS \item[{2006-03-17 Updated subprocess.py to latest Python upstream and}] \leavevmode reverted name back to subprocess.py - ADS \end{description} 2006-03-16 Added John Porter’s 3D handling code \bigskip\hrule\bigskip 2006-03-16 Released 0.87.2 at revision 2150 \begin{description} \item[{2006-03-15 Fixed bug in MaxNLocator revealed by \sphinxhref{mailto:daigos@infinito.it}{daigos@infinito.it}.}] \leavevmode The main change is that Locator.nonsingular now adjusts vmin and vmax if they are nearly the same, not just if they are equal. A new kwarg, “tiny”, sets the threshold. - EF \item[{2006-03-14 Added import of compatibility library for newer numpy}] \leavevmode linear\_algebra - TEO \item[{2006-03-12 Extended “load” function to support individual columns and}] \leavevmode moved “load” and “save” into matplotlib.mlab so they can be used outside of pylab \textendash{} see examples/load\_converter.py - JDH \item[{2006-03-12 Added AutoDateFormatter and AutoDateLocator submitted}] \leavevmode by James Evans. Try the load\_converter.py example for a demo. - ADS \end{description} 2006-03-11 Added subprocess module from python-2.4 - DSD \begin{description} \item[{2006-03-11 Fixed landscape orientation support with the usetex}] \leavevmode option. The backend\_ps print\_figure method was getting complicated, I added a \_print\_figure\_tex method to maintain some degree of sanity - DSD \item[{2006-03-11 Added “papertype” savefig kwarg for setting}] \leavevmode postscript papersizes. papertype and ps.papersize rc setting can also be set to “auto” to autoscale pagesizes - DSD \item[{2006-03-09 Apply P-J’s patch to make pstoeps work on windows}] \leavevmode patch report \# 1445612 - DSD \end{description} 2006-03-09 Make backend rc parameter case-insensitive - DSD \begin{description} \item[{2006-03-07 Fixed bug in backend\_ps related to C0-C6 papersizes,}] \leavevmode which were causing problems with postscript viewers. Supported page sizes include letter, legal, ledger, A0-A10, and B0-B10 - DSD \end{description} \bigskip\hrule\bigskip 2006-03-07 Released 0.87.1 \begin{description} \item[{2006-03-04 backend\_cairo.py:}] \leavevmode fix get\_rgb() bug reported by Keith Briggs. Require pycairo 1.0.2. Support saving png to file-like objects. - SC \end{description} 2006-03-03 Fixed pcolor handling of vmin, vmax - EF \begin{description} \item[{2006-03-02 improve page sizing with usetex with the latex}] \leavevmode geometry package. Closes bug \# 1441629 - DSD \item[{2006-03-02 Fixed dpi problem with usetex png output. Accepted a}] \leavevmode modified version of patch \# 1441809 - DSD \end{description} 2006-03-01 Fixed axis(‘scaled’) to deal with case xmax \textless{} xmin - JSWHIT 2006-03-01 Added reversed colormaps (with ‘\_r’ appended to name) - JSWHIT 2006-02-27 Improved eps bounding boxes with usetex - DSD 2006-02-27 Test svn commit, again! \begin{description} \item[{2006-02-27 Fixed two dependency checking bugs related to usetex}] \leavevmode on Windows - DSD \item[{2006-02-27 Made the rc deprecation warnings a little more human}] \leavevmode readable. \item[{2006-02-26 Update the previous gtk.main\_quit() bug fix to use gtk.main\_level()}] \leavevmode\begin{itemize} \item {} SC \end{itemize} \end{description} 2006-02-24 Implemented alpha support in contour and contourf - EF \begin{description} \item[{2006-02-22 Fixed gtk main quit bug when quit was called before}] \leavevmode mainloop. - JDH \item[{2006-02-22 Small change to colors.py to workaround apparent}] \leavevmode bug in numpy masked array module - JSWHIT \item[{2006-02-22 Fixed bug in ScalarMappable.to\_rgba() reported by}] \leavevmode Ray Jones, and fixed incorrect fix found by Jeff Whitaker - EF \end{description} \bigskip\hrule\bigskip 2006-02-22 Released 0.87 2006-02-21 Fixed portrait/landscape orientation in postscript backend - DSD 2006-02-21 Fix bug introduced in yesterday’s bug fix - SC \begin{description} \item[{2006-02-20 backend\_gtk.py FigureCanvasGTK.draw(): fix bug reported by}] \leavevmode David Tremouilles - SC \item[{2006-02-20 Remove the “pygtk.require(‘2.4’)” error from}] \leavevmode examples/embedding\_in\_gtk2.py - SC \item[{2006-02-18 backend\_gtk.py FigureCanvasGTK.draw(): simplify to use (rather than}] \leavevmode duplicate) the expose\_event() drawing code - SC \item[{2006-02-12 Added stagger or waterfall plot capability to LineCollection;}] \leavevmode illustrated in examples/collections.py. - EF \item[{2006-02-11 Massive cleanup of the usetex code in the postscript backend. Possibly}] \leavevmode fixed the clipping issue users were reporting with older versions of ghostscript - DSD \item[{2006-02-11 Added autolim kwarg to axes.add\_collection. Changed}] \leavevmode collection get\_verts() methods accordingly. - EF \item[{2006-02-09 added a temporary rc parameter text.dvipnghack, to allow Mac users to get nice}] \leavevmode results with the usetex option. - DSD \end{description} 2006-02-09 Fixed a bug related to setting font sizes with the usetex option. - DSD 2006-02-09 Fixed a bug related to usetex’s latex code. - DSD \begin{description} \item[{2006-02-09 Modified behavior of font.size rc setting. You should define font.size in pts,}] \leavevmode which will set the “medium” or default fontsize. Special text sizes like axis labels or tick labels can be given relative font sizes like small, large, x-large, etc. and will scale accordingly. - DSD \item[{2006-02-08 Added py2exe specific datapath check again. Also added new}] \leavevmode py2exe helper function get\_py2exe\_datafiles for use in py2exe setup.py scripts. - CM \end{description} 2006-02-02 Added box function to pylab \begin{description} \item[{2006-02-02 Fixed a problem in setupext.py, tk library formatted in unicode}] \leavevmode caused build problems - DSD \end{description} 2006-02-01 Dropped TeX engine support in usetex to focus on LaTeX. - DSD \begin{description} \item[{2006-01-29 Improved usetex option to respect the serif, sans-serif, monospace,}] \leavevmode and cursive rc settings. Removed the font.latex.package rc setting, it is no longer required - DSD \end{description} 2006-01-29 Fixed tex’s caching to include font.family rc information - DSD \begin{description} \item[{2006-01-29 Fixed subpixel rendering bug in *Agg that was causing}] \leavevmode uneven gridlines - JDH \item[{2006-01-28 Added fontcmd to backend\_ps’s RendererPS.draw\_tex, to support other}] \leavevmode font families in eps output - DSD \item[{2006-01-28 Added MaxNLocator to ticker.py, and changed contour.py to}] \leavevmode use it by default. - EF \item[{2006-01-28 Added fontcmd to backend\_ps’s RendererPS.draw\_tex, to support other}] \leavevmode font families in eps output - DSD \item[{2006-01-27 Buffered reading of matplotlibrc parameters in order to allow}] \leavevmode ‘verbose’ settings to be processed first (allows verbose.report during rc validation process) - DSD \item[{2006-01-27 Removed setuptools support from setup.py and created a}] \leavevmode separate setupegg.py file to replace it. - CM \item[{2006-01-26 Replaced the ugly datapath logic with a cleaner approach from}] \leavevmode \sphinxurl{http://wiki.python.org/moin/DistutilsInstallDataScattered}. Overrides the install\_data command. - CM \item[{2006-01-24 Don’t use character typecodes in cntr.c — changed to use}] \leavevmode defined typenumbers instead. - TEO \end{description} 2006-01-24 Fixed some bugs in usetex’s and ps.usedistiller’s dependency 2006-01-24 Added masked array support to scatter - EF \begin{description} \item[{2006-01-24 Fixed some bugs in usetex’s and ps.usedistiller’s dependency}] \leavevmode checking - DSD \end{description} \bigskip\hrule\bigskip 2006-01-24 Released 0.86.2 \begin{description} \item[{2006-01-20 Added a converters dict to pylab load to convert selected}] \leavevmode coloumns to float \textendash{} especially useful for files with date strings, uses a datestr2num converter - JDH \item[{2006-01-20 Added datestr2num to matplotlib dates to convert a string}] \leavevmode or sequence of strings to a matplotlib datenum \item[{2006-01-18 Added quadrilateral pcolormesh patch 1409190 by Alex Mont}] \leavevmode and Paul Kienzle \textendash{} this is *Agg only for now. See examples/quadmesh\_demo.py - JDH \end{description} 2006-01-18 Added Jouni’s boxplot patch - JDH 2006-01-18 Added comma delimiter for pylab save - JDH 2006-01-12 Added Ryan’s legend patch - JDH 2006-1-12 Fixed numpy / numeric to use .dtype.char to keep in SYNC with numpy SVN \bigskip\hrule\bigskip 2006-1-11 Released 0.86.1 2006-1-11 Fixed setup.py for win32 build and added rc template to the MANIFEST.in \begin{description} \item[{2006-1-10 Added xpdf distiller option. matplotlibrc ps.usedistiller can now be}] \leavevmode none, false, ghostscript, or xpdf. Validation checks for dependencies. This needs testing, but the xpdf option should produce the highest-quality output and small file sizes - DSD \item[{2006-01-10 For the usetex option, backend\_ps now does all the LaTeX work in the}] \leavevmode os’s temp directory - DSD \end{description} 2006-1-10 Added checks for usetex dependencies. - DSD \bigskip\hrule\bigskip 2006-1-9 Released 0.86 2006-1-4 Changed to support numpy (new name for scipy\_core) - TEO 2006-1-4 Added Mark’s scaled axes patch for shared axis 2005-12-28 Added Chris Barker’s build\_wxagg patch - JDH \begin{description} \item[{2005-12-27 Altered numerix/scipy to support new scipy package}] \leavevmode structure - TEO \end{description} 2005-12-20 Fixed Jame’s Boyles date tick reversal problem - JDH \begin{description} \item[{2005-12-20 Added Jouni’s rc patch to support lists of keys to set on -}] \leavevmode JDH \item[{2005-12-12 Updated pyparsing and mathtext for some speed enhancements}] \leavevmode (Thanks Paul McGuire) and minor fixes to scipy numerix and setuptools \item[{2005-12-12 Matplotlib data is now installed as package\_data in}] \leavevmode the matplotlib module. This gets rid of checking the many possibilities in matplotlib.\_get\_data\_path() - CM \item[{2005-12-11 Support for setuptools/pkg\_resources to build and use}] \leavevmode matplotlib as an egg. Still allows matplotlib to exist using a traditional distutils install. - ADS \item[{2005-12-03 Modified setup to build matplotlibrc based on compile time}] \leavevmode findings. It will set numerix in the order of scipy, numarray, Numeric depending on which are founds, and backend as in preference order GTKAgg, WXAgg, TkAgg, GTK, Agg, PS \item[{2005-12-03 Modified scipy patch to support Numeric, scipy and numarray}] \leavevmode Some work remains to be done because some of the scipy imports are broken if only the core is installed. e.g., apparently we need from scipy.basic.fftpack import * rather than from scipy.fftpack import * \item[{2005-12-03 Applied some fixes to Nicholas Young’s nonuniform image}] \leavevmode patch \end{description} 2005-12-01 Applied Alex Gontmakher hatch patch - PS only for now 2005-11-30 Added Rob McMullen’s EMF patch 2005-11-30 Added Daishi’s patch for scipy 2005-11-30 Fixed out of bounds draw markers segfault in agg 2005-11-28 Got TkAgg blitting working 100\% (cross fingers) correctly. - CM \begin{description} \item[{2005-11-27 Multiple changes in cm.py, colors.py, figure.py, image.py,}] \leavevmode contour.py, contour\_demo.py; new \_cm.py, examples/image\_masked.py. 1) Separated the color table data from cm.py out into a new file, \_cm.py, to make it easier to find the actual code in cm.py and to add new colormaps. Also added some line breaks to the color data dictionaries. Everything from \_cm.py is imported by cm.py, so the split should be transparent. 2) Enabled automatic generation of a colormap from a list of colors in contour; see modified examples/contour\_demo.py. 3) Support for imshow of a masked array, with the ability to specify colors (or no color at all) for masked regions, and for regions that are above or below the normally mapped region. See examples/image\_masked.py. 4) In support of the above, added two new classes, ListedColormap, and no\_norm, to colors.py, and modified the Colormap class to include common functionality. Added a clip kwarg to the normalize class. Reworked color handling in contour.py, especially in the ContourLabeller mixin. - EF \end{description} 2005-11-25 Changed text.py to ensure color is hashable. EF \bigskip\hrule\bigskip 2005-11-16 Released 0.85 2005-11-16 Changed the default default linewidth in rc to 1.0 \begin{description} \item[{2005-11-16 Replaced agg\_to\_gtk\_drawable with pure pygtk pixbuf code in}] \leavevmode backend\_gtkagg. When the equivalent is doe for blit, the agg extension code will no longer be needed \item[{2005-11-16 Added a maxdict item to cbook to prevent caches from}] \leavevmode growing w/o bounds \item[{2005-11-15 Fixed a colorup/colordown reversal bug in finance.py \textendash{}}] \leavevmode Thanks Gilles \item[{2005-11-15 Applied Jouni K Steppanen’s boxplot patch SF patch\#1349997}] \leavevmode\begin{itemize} \item {} JDH \end{itemize} \item[{2005-11-09 added axisbelow attr for Axes to determine whether ticks and such}] \leavevmode are above or below the actors \end{description} 2005-11-08 Added Nicolas’ irregularly spaced image patch \begin{description} \item[{2005-11-08 Deprecated HorizontalSpanSelector and replaced with}] \leavevmode SpanSelection that takes a third arg, direction. The new SpanSelector supports horizontal and vertical span selection, and the appropriate min/max is returned. - CM \end{description} 2005-11-08 Added lineprops dialog for gtk \begin{description} \item[{2005-11-03 Added FIFOBuffer class to mlab to support real time feeds}] \leavevmode and examples/fifo\_buffer.py \item[{2005-11-01 Contributed Nickolas Young’s patch for afm mathtext to}] \leavevmode support mathtext based upon the standard postscript Symbol font when ps.usetex = True. \end{description} 2005-10-26 Added support for scatter legends - thanks John Gill \begin{description} \item[{2005-10-20 Fixed image clipping bug that made some tex labels}] \leavevmode disappear. JDH \end{description} 2005-10-14 Removed sqrt from dvipng 1.6 alpha channel mask. 2005-10-14 Added width kwarg to hist function 2005-10-10 Replaced all instances of os.rename with shutil.move 2005-10-05 Added Michael Brady’s ydate patch 2005-10-04 Added rkern’s texmanager patch \begin{description} \item[{2005-09-25 contour.py modified to use a single ContourSet class}] \leavevmode that handles filled contours, line contours, and labels; added keyword arg (clip\_ends) to contourf. Colorbar modified to work with new ContourSet object; if the ContourSet has lines rather than polygons, the colorbar will follow suit. Fixed a bug introduced in 0.84, in which contourf(…,colors=…) was broken - EF \end{description} \bigskip\hrule\bigskip 2005-09-19 Released 0.84 \begin{description} \item[{2005-09-14 Added a new ‘resize\_event’ which triggers a callback with a}] \leavevmode backend\_bases.ResizeEvent object - JDH \end{description} 2005-09-14 font\_manager.py: removed chkfontpath from x11FontDirectory() - SC \begin{description} \item[{2005-09-14 Factored out auto date locator/formatter factory code into}] \leavevmode matplotlib.date.date\_ticker\_factory; applies John Bryne’s quiver patch. \end{description} 2005-09-13 Added Mark’s axes positions history patch \#1286915 \begin{description} \item[{2005-09-09 Added support for auto canvas resizing with}] \leavevmode fig.set\_figsize\_inches(9,5,forward=True) \# inches OR fig.resize(400,300) \# pixels \item[{2005-09-07 figure.py: update Figure.draw() to use the updated}] \leavevmode renderer.draw\_image() so that examples/figimage\_demo.py works again. examples/stock\_demo.py: remove data\_clipping (which no longer exists) - SC \end{description} 2005-09-06 Added Eric’s tick.direction patch: in or out in rc 2005-09-06 Added Martin’s rectangle selector widget \begin{description} \item[{2005-09-04 Fixed a logic err in text.py that was preventing rgxsuper}] \leavevmode from matching - JDH \end{description} 2005-08-29 Committed Ken’s wx blit patch \#1275002 \begin{description} \item[{2005-08-26 colorbar modifications - now uses contourf instead of imshow}] \leavevmode so that colors used by contourf are displayed correctly. Added two new keyword args (cspacing and clabels) that are only relevant for ContourMappable images - JSWHIT \end{description} 2005-08-24 Fixed a PS image bug reported by Darren - JDH \begin{description} \item[{2005-08-23 colors.py: change hex2color() to accept unicode strings as well as}] \leavevmode normal strings. Use isinstance() instead of types.IntType etc - SC \end{description} 2005-08-16 removed data\_clipping line and rc property - JDH \begin{description} \item[{2005-08-22 backend\_svg.py: Remove redundant “x=0.0 y=0.0” from svg element.}] \leavevmode Increase svg version from 1.0 to 1.1. Add viewBox attribute to svg element to allow SVG documents to scale-to-fit into an arbitrary viewport - SC \end{description} 2005-08-16 Added Eric’s dot marker patch - JDH 2005-08-08 Added blitting/animation for TkAgg - CM 2005-08-05 Fixed duplicate tickline bug - JDH \begin{description} \item[{2005-08-05 Fixed a GTK animation bug that cropped up when doing}] \leavevmode animations in gtk//gtkagg canvases that had widgets packed above them \end{description} 2005-08-05 Added Clovis Goldemberg patch to the tk save dialog \begin{description} \item[{2005-08-04 Removed origin kwarg from backend.draw\_image. origin is}] \leavevmode handled entirely by the frontend now. \end{description} 2005-07-03 Fixed a bug related to TeX commands in backend\_ps 2005-08-03 Fixed SVG images to respect upper and lower origins. 2005-08-03 Added flipud method to image and removed it from to\_str. \begin{description} \item[{2005-07-29 Modified figure.figaspect to take an array or number;}] \leavevmode modified backend\_svg to write utf-8 - JDH \item[{2005-07-30 backend\_svg.py: embed png image files in svg rather than linking}] \leavevmode to a separate png file, fixes bug \#1245306 (thanks to Norbert Nemec for the patch) - SC \end{description} \bigskip\hrule\bigskip 2005-07-29 Released 0.83.2 \begin{description} \item[{2005-07-27 Applied SF patch 1242648: minor rounding error in}] \leavevmode IndexDateFormatter in dates.py \item[{2005-07-27 Applied sf patch 1244732: Scale axis such that circle}] \leavevmode looks like circle - JDH \end{description} 2005-07-29 Improved message reporting in texmanager and backend\_ps - DSD \begin{description} \item[{2005-07-28 backend\_gtk.py: update FigureCanvasGTK.draw() (needed due to the}] \leavevmode recent expose\_event() change) so that examples/anim.py works in the usual way - SC \item[{2005-07-26 Added new widgets Cursor and HorizontalSpanSelector to}] \leavevmode matplotlib.widgets. See examples/widgets/cursor.py and examples/widgets/span\_selector.py - JDH \item[{2005-07-26 added draw event to mpl event hierarchy \textendash{} triggered on}] \leavevmode figure.draw \end{description} 2005-07-26 backend\_gtk.py: allow ‘f’ key to toggle window fullscreen mode \begin{description} \item[{2005-07-26 backend\_svg.py: write “\textless{}…/\textgreater{}” elements all on one line and remove}] \leavevmode surplus spaces - SC \item[{2005-07-25 backend\_svg.py: simplify code by deleting GraphicsContextSVG and}] \leavevmode RendererSVG.new\_gc(), and moving the gc.get\_capstyle() code into RendererSVG.\_get\_gc\_props\_svg() - SC \item[{2005-07-24 backend\_gtk.py: call FigureCanvasBase.motion\_notify\_event() on}] \leavevmode all motion-notify-events, not just ones where a modifier key or button has been pressed (fixes bug report from Niklas Volbers) - SC \item[{2005-07-24 backend\_gtk.py: modify print\_figure() use own pixmap, fixing}] \leavevmode problems where print\_figure() overwrites the display pixmap. return False from all button/key etc events - to allow the event to propagate further - SC \item[{2005-07-23 backend\_gtk.py: change expose\_event from using set\_back\_pixmap();}] \leavevmode clear() to draw\_drawable() - SC \item[{2005-07-23 backend\_gtk.py: removed pygtk.require()}] \leavevmode matplotlib/\_\_init\_\_.py: delete ‘FROZEN’ and ‘McPLError’ which are no longer used - SC \end{description} 2005-07-22 backend\_gdk.py: removed pygtk.require() - SC \begin{description} \item[{2005-07-21 backend\_svg.py: Remove unused imports. Remove methods doc strings}] \leavevmode which just duplicate the docs from backend\_bases.py. Rename draw\_mathtext to \_draw\_mathtext. - SC \item[{2005-07-17 examples/embedding\_in\_gtk3.py: new example demonstrating placing}] \leavevmode a FigureCanvas in a gtk.ScrolledWindow - SC \end{description} 2005-07-14 Fixed a Windows related bug (\#1238412) in texmanager - DSD \begin{description} \item[{2005-07-11 Fixed color kwarg bug, setting color=1 or 0 caused an}] \leavevmode exception - DSD \end{description} 2005-07-07 Added Eric’s MA set\_xdata Line2D fix - JDH \begin{description} \item[{2005-07-06 Made HOME/.matplotlib the new config dir where the}] \leavevmode matplotlibrc file, the ttf.cache, and the tex.cache live. The new default filenames in .matplotlib have no leading dot and are not hidden. e.g., the new names are matplotlibrc tex.cache ttffont.cache. This is how ipython does it so it must be right. If old files are found, a warning is issued and they are moved to the new location. Also fixed texmanager to put all files, including temp files in \textasciitilde{}/.matplotlib/tex.cache, which allows you to usetex in non-writable dirs. \item[{2005-07-05 Fixed bug \#1231611 in subplots adjust layout. The problem}] \leavevmode was that the text cacheing mechanism was not using the transformation affine in the key. - JDH \item[{2005-07-05 Fixed default backend import problem when using API (SF bug}] \leavevmode \# 1209354 - see API\_CHANGES for more info - JDH \end{description} 2005-07-04 backend\_gtk.py: require PyGTK version 2.0.0 or higher - SC \begin{description} \item[{2005-06-30 setupext.py: added numarray\_inc\_dirs for building against}] \leavevmode numarray when not installed in standard location - ADS \item[{2005-06-27 backend\_svg.py: write figure width, height as int, not float.}] \leavevmode Update to fix some of the pychecker warnings - SC \item[{2005-06-23 Updated examples/agg\_test.py to demonstrate curved paths}] \leavevmode and fills - JDH \item[{2005-06-21 Moved some texmanager and backend\_agg tex caching to class}] \leavevmode level rather than instance level - JDH \item[{2005-06-20 setupext.py: fix problem where \_nc\_backend\_gdk is installed to the}] \leavevmode wrong directory - SC \end{description} 2005-06-19 Added 10.4 support for CocoaAgg. - CM \begin{description} \item[{2005-06-18 Move Figure.get\_width\_height() to FigureCanvasBase and return}] \leavevmode int instead of float. - SC \item[{2005-06-18 Applied Ted Drain’s QtAgg patch: 1) Changed the toolbar to}] \leavevmode be a horizontal bar of push buttons instead of a QToolbar and updated the layout algorithms in the main window accordingly. This eliminates the ability to drag and drop the toolbar and detach it from the window. 2) Updated the resize algorithm in the main window to show the correct size for the plot widget as requested. This works almost correctly right now. It looks to me like the final size of the widget is off by the border of the main window but I haven’t figured out a way to get that information yet. We could just add a small margin to the new size but that seems a little hacky. 3) Changed the x/y location label to be in the toolbar like the Tk backend instead of as a status line at the bottom of the widget. 4) Changed the toolbar pixmaps to use the ppm files instead of the png files. I noticed that the Tk backend buttons looked much nicer and it uses the ppm files so I switched them. \item[{2005-06-17 Modified the gtk backend to not queue mouse motion events.}] \leavevmode This allows for live updates when dragging a slider. - CM \item[{2005-06-17 Added starter CocoaAgg backend. Only works on OS 10.3 for}] \leavevmode now and requires PyObjC. (10.4 is high priority) - CM \item[{2005-06-17 Upgraded pyparsing and applied Paul McGuire’s suggestions}] \leavevmode for speeding things up. This more than doubles the speed of mathtext in my simple tests. JDH \end{description} 2005-06-16 Applied David Cooke’s subplot make\_key patch \bigskip\hrule\bigskip 2005-06-15 0.82 released \begin{description} \item[{2005-06-15 Added subplot config tool to GTK* backends \textendash{} note you must}] \leavevmode now import the NavigationToolbar2 from your backend of choice rather than from backend\_gtk because it needs to know about the backend specific canvas \textendash{} see examples/embedding\_in\_gtk2.py. Ditto for wx backend \textendash{} see examples/embedding\_in\_wxagg.py \end{description} 2005-06-15 backend\_cairo.py: updated to use pycairo 0.5.0 - SC \begin{description} \item[{2005-06-14 Wrote some GUI neutral widgets (Button, Slider,}] \leavevmode RadioButtons, CheckButtons) in matplotlib.widgets. See examples/widgets/*.py - JDH \item[{2005-06-14 Exposed subplot parameters as rc vars and as the fig}] \leavevmode SubplotParams instance subplotpars. See figure.SubplotParams, figure.Figure.subplots\_adjust and the pylab method subplots\_adjust and examples/subplots\_adjust.py . Also added a GUI neutral widget for adjusting subplots, see examples/subplot\_toolbar.py - JDH \item[{2005-06-13 Exposed cap and join style for lines with new rc params and}] \leavevmode\begin{quote} line properties \end{quote} lines.dash\_joinstyle : miter \# miter\textbar{}round\textbar{}bevel lines.dash\_capstyle : butt \# butt\textbar{}round\textbar{}projecting lines.solid\_joinstyle : miter \# miter\textbar{}round\textbar{}bevel lines.solid\_capstyle : projecting \# butt\textbar{}round\textbar{}projecting \end{description} 2005-06-13 Added kwargs to Axes init 2005-06-13 Applied Baptiste’s tick patch - JDH \begin{description} \item[{2005-06-13 Fixed rc alias ‘l’ bug reported by Fernando by removing}] \leavevmode aliases for mainlevel rc options. - JDH \end{description} 2005-06-10 Fixed bug \#1217637 in ticker.py - DSD 2005-06-07 Fixed a bug in texmanager.py: .aux files not being removed - DSD 2005-06-08 Added Sean Richard’s hist binning fix \textendash{} see API\_CHANGES - JDH \begin{description} \item[{2005-06-07 Fixed a bug in texmanager.py: .aux files not being removed}] \leavevmode\begin{itemize} \item {} DSD \end{itemize} \end{description} \bigskip\hrule\bigskip 2005-06-07 matplotlib-0.81 released 2005-06-06 Added autoscale\_on prop to axes 2005-06-06 Added Nick’s picker “among” patch - JDH 2005-06-05 Fixed a TeX/LaTeX font discrepency in backend\_ps. - DSD \begin{description} \item[{2005-06-05 Added a ps.distill option in rc settings. If True, postscript}] \leavevmode output will be distilled using ghostscript, which should trim the file size and allow it to load more quickly. Hopefully this will address the issue of large ps files due to font definitions. Tested with gnu-ghostscript-8.16. - DSD \end{description} 2005-06-03 Improved support for tex handling of text in backend\_ps. - DSD \begin{description} \item[{2005-06-03 Added rc options to render text with tex or latex, and to select}] \leavevmode the latex font package. - DSD \end{description} 2005-06-03 Fixed a bug in ticker.py causing a ZeroDivisionError \begin{description} \item[{2005-06-02 backend\_gtk.py remove DBL\_BUFFER, add line to expose\_event to}] \leavevmode try to fix pygtk 2.6 redraw problem - SC \item[{2005-06-01 The default behavior of ScalarFormatter now renders scientific}] \leavevmode notation and large numerical offsets in a label at the end of the axis. - DSD \end{description} 2005-06-01 Added Nicholas’ frombyte image patch - JDH 2005-05-31 Added vertical TeX support for agg - JDH 2005-05-31 Applied Eric’s cntr patch - JDH \begin{description} \item[{2005-05-27 Finally found the pesky agg bug (which Maxim was kind}] \leavevmode enough to fix within hours) that was causing a segfault in the win32 cached marker drawing. Now windows users can get the enormouse performance benefits of caced markers w/o those occasional pesy screenshots. - JDH \item[{2005-05-27 Got win32 build system working again, using a more recent}] \leavevmode version of gtk and pygtk in the win32 build, gtk 2.6 from \sphinxurl{http://www.gimp.org/~tml/gimp/win32/downloads.html} (you will also need libpng12.dll to use these). I haven’t tested whether this binary build of mpl for win32 will work with older gtk runtimes, so you may need to upgrade. \item[{2005-05-27 Fixed bug where 2nd wxapp could be started if using wxagg}] \leavevmode backend. - ADS \end{description} 2005-05-26 Added Daishi text with dash patch \textendash{} see examples/dashtick.py \begin{description} \item[{2005-05-26 Moved backend\_latex functionality into backend\_ps. If}] \leavevmode text.usetex=True, the PostScript backend will use LaTeX to generate the .ps or .eps file. Ghostscript is required for eps output. - DSD \end{description} 2005-05-24 Fixed alignment and color issues in latex backend. - DSD \begin{description} \item[{2005-05-21 Fixed raster problem for small rasters with dvipng \textendash{} looks}] \leavevmode like it was a premultipled alpha problem - JDH \item[{2005-05-20 Added linewidth and faceted kwarg to scatter to control}] \leavevmode edgewidth and color. Also added autolegend patch to inspect line segments. \end{description} 2005-05-18 Added Orsay and JPL qt fixes - JDH \begin{description} \item[{2005-05-17 Added a psfrag latex backend \textendash{} some alignment issues need}] \leavevmode to be worked out. Run with -dLaTeX and a \sphinxstyleemphasis{.tex file and *.eps file are generated. latex and dvips the generated latex file to get ps output. Note xdvi *does} not work, you must generate ps.- JDH \item[{2005-05-13 Added Florent Rougon’s Axis set\_label1}] \leavevmode patch \end{description} 2005-05-17 pcolor optimization, fixed bug in previous pcolor patch - JSWHIT 2005-05-16 Added support for masked arrays in pcolor - JSWHIT \begin{description} \item[{2005-05-12 Started work on TeX text for antigrain using pngdvi \textendash{} see}] \leavevmode examples/tex\_demo.py and the new module matplotlib.texmanager. Rotated text not supported and rendering small glyps is not working right yet. BUt large fontsizes and/or high dpi saved figs work great. \item[{2005-05-10 New image resize options interpolation options. New values}] \leavevmode for the interp kwarg are ‘nearest’, ‘bilinear’, ‘bicubic’, ‘spline16’, ‘spline36’, ‘hanning’, ‘hamming’, ‘hermite’, ‘kaiser’, ‘quadric’, ‘catrom’, ‘gaussian’, ‘bessel’, ‘mitchell’, ‘sinc’, ‘lanczos’, ‘blackman’ See help(imshow) for details, particularly the interpolation, filternorm and filterrad kwargs \end{description} 2005-05-10 Applied Eric’s contour mem leak fixes - JDH \begin{description} \item[{2005-05-10 Extended python agg wrapper and started implementing}] \leavevmode backend\_agg2, an agg renderer based on the python wrapper. This will be more flexible and easier to extend than the current backend\_agg. See also examples/agg\_test.py - JDH \item[{2005-05-09 Added Marcin’s no legend patch to exclude lines from the}] \leavevmode autolegend builder plot(x, y, label=’nolegend’) \end{description} 2005-05-05 Upgraded to agg23 2005-05-05 Added newscalarformatter\_demo.py to examples. -DSD \begin{description} \item[{2005-05-04 Added NewScalarFormatter. Improved formatting of ticklabels,}] \leavevmode scientific notation, and the ability to plot large large numbers with small ranges, by determining a numerical offset. See ticker.NewScalarFormatter for more details. -DSD \end{description} 2005-05-03 Added the option to specify a delimiter in pylab.load -DSD 2005-04-28 Added Darren’s line collection example 2005-04-28 Fixed aa property in agg - JDH 2005-04-27 Set postscript page size in .matplotlibrc - DSD 2005-04-26 Added embedding in qt example. - JDH \begin{description} \item[{2005-04-14 Applied Michael Brady’s qt backend patch: 1) fix a bug}] \leavevmode where keyboard input was grabbed by the figure and not released 2) turn on cursor changes 3) clean up a typo and commented-out print statement. - JDH \item[{2005-04-14 Applied Eric Firing’s masked data lines patch and contour}] \leavevmode patch. Support for masked arrays has been added to the plot command and to the Line2D object. Only the valid points are plotted. A “valid\_only” kwarg was added to the get\_xdata() and get\_ydata() methods of Line2D; by default it is False, so that the original data arrays are returned. Setting it to True returns the plottable points. - see examples/masked\_demo.py - JDH \end{description} 2005-04-13 Applied Tim Leslie’s arrow key event handling patch - JDH \bigskip\hrule\bigskip 0.80 released \begin{description} \item[{2005-04-11 Applied a variant of rick’s xlim/ylim/axis patch. These}] \leavevmode functions now take kwargs to let you selectively alter only the min or max if desired. e.g., xlim(xmin=2) or axis(ymax=3). They always return the new lim. - JDH \item[{2005-04-11 Incorporated Werner’s wx patch \textendash{} wx backend should be}] \leavevmode compatible with wxpython2.4 and recent versions of 2.5. Some early versions of wxpython 2.5 will not work because there was a temporary change in the dc API that was rolled back to make it 2.4 compliant \item[{2005-04-11 modified tkagg show so that new figure window pops up on}] \leavevmode call to figure \end{description} 2005-04-11 fixed wxapp init bug \begin{description} \item[{2005-04-02 updated backend\_ps.draw\_lines, draw\_markers for use with the}] \leavevmode new API - DSD \end{description} 2005-04-01 Added editable polygon example \bigskip\hrule\bigskip 2005-03-31 0.74 released \begin{description} \item[{2005-03-30 Fixed and added checks for floating point inaccuracy in}] \leavevmode ticker.Base - DSD \item[{2005-03-30 updated /ellipse definition in backend\_ps.py to address bug}] \leavevmode \#1122041 - DSD \end{description} 2005-03-29 Added unicode support for Agg and PS - JDH 2005-03-28 Added Jarrod’s svg patch for text - JDH 2005-03-28 Added Ludal’s arrow and quiver patch - JDH \begin{description} \item[{2005-03-28 Added label kwarg to Axes to facilitate forcing the}] \leavevmode creation of new Axes with otherwise identical attributes \end{description} 2005-03-28 Applied boxplot and OSX font search patches 2005-03-27 Added ft2font NULL check to fix Japanase font bug - JDH \begin{description} \item[{2005-03-27 Added sprint legend patch plus John Gill’s tests and fix \textendash{}}] \leavevmode see examples/legend\_auto.py - JDH \end{description} \bigskip\hrule\bigskip 2005-03-19 0.73.1 released 2005-03-19 Reverted wxapp handling because it crashed win32 - JDH 2005-03-18 Add .number attribute to figure objects returned by figure() - FP \bigskip\hrule\bigskip 2005-03-18 0.73 released 2005-03-16 Fixed labelsep bug 2005-03-16 Applied Darren’s ticker fix for small ranges - JDH 2005-03-16 Fixed tick on horiz colorbar - JDH 2005-03-16 Added Japanses winreg patch - JDH \begin{description} \item[{2005-03-15 backend\_gtkagg.py: changed to use double buffering, this fixes}] \leavevmode the problem reported Joachim Berdal Haga - “Parts of plot lagging from previous frame in animation”. Tested with anim.py and it makes no noticable difference to performance (23.7 before, 23.6 after) - SC \item[{2005-03-14 add src/\_backend\_gdk.c extension to provide a substitute function}] \leavevmode for pixbuf.get\_pixels\_array(). Currently pixbuf.get\_pixels\_array() only works with Numeric, and then only works if pygtk has been compiled with Numeric support. The change provides a function pixbuf\_get\_pixels\_array() which works with Numeric and numarray and is always available. It means that backend\_gtk should be able to display images and mathtext in all circumstances. - SC \end{description} 2005-03-11 Upgraded CXX to 5.3.1 \begin{description} \item[{2005-03-10 remove GraphicsContextPS.set\_linestyle()}] \leavevmode and GraphicsContextSVG.set\_linestyle() since they do no more than the base class GraphicsContext.set\_linestyle() - SC \end{description} 2005-03-09 Refactored contour functionality into dedicated module 2005-03-09 Added Eric’s contourf updates and Nadia’s clabel functionality \begin{description} \item[{2005-03-09 Moved colorbar to figure.Figure to expose it for API developers}] \leavevmode\begin{itemize} \item {} JDH \end{itemize} \end{description} 2005-03-09 backend\_cairo.py: implemented draw\_markers() - SC \begin{description} \item[{2005-03-09 cbook.py: only use enumerate() (the python version) if the builtin}] \leavevmode\begin{description} \item[{version is not available.}] \leavevmode Add new function ‘izip’ which is set to itertools.izip if available and the python equivalent if not available. - SC \end{description} \item[{2005-03-07 backend\_gdk.py: remove PIXELS\_PER\_INCH from points\_to\_pixels(), but}] \leavevmode\begin{description} \item[{still use it to adjust font sizes. This allows the GTK version of}] \leavevmode line\_styles.py to more closely match GTKAgg, previously the markers were being drawn too large. - SC \end{description} \end{description} 2005-03-01 Added Eric’s contourf routines \begin{description} \item[{2005-03-01 Added start of proper agg SWIG wrapper. I would like to}] \leavevmode expose agg functionality directly a the user level and this module will serve that purpose eventually, and will hopefully take over most of the functionality of the current \_image and \_backend\_agg modules. - JDH \item[{2005-02-28 Fixed polyfit / polyval to convert input args to float}] \leavevmode arrays - JDH \item[{2005-02-25 Add experimental feature to backend\_gtk.py to enable/disable}] \leavevmode double buffering (DBL\_BUFFER=True/False) - SC \item[{2005-02-24 colors.py change ColorConverter.to\_rgb() so it always returns rgb}] \leavevmode (and not rgba), allow cnames keys to be cached, change the exception raised from RuntimeError to ValueError (like hex2color()) hex2color() use a regular expression to check the color string is valid - SC \item[{2005-02-23 Added rc param ps.useafm so backend ps can use native afm}] \leavevmode fonts or truetype. afme breaks mathtext but causes much smaller font sizes and may result in images that display better in some contexts (e.g., pdfs incorporated into latex docs viewed in acrobat reader). I would like to extend this approach to allow the user to use truetype only for mathtext, which should be easy. \item[{2005-02-23 Used sequence protocol rather than tuple in agg collection}] \leavevmode drawing routines for greater flexibility - JDH \end{description} \bigskip\hrule\bigskip 2005-02-22 0.72.1 released \begin{description} \item[{2005-02-21 fixed linestyles for collections \textendash{} contour now dashes for}] \leavevmode levels \textless{}0 \end{description} 2005-02-21 fixed ps color bug - JDH 2005-02-15 fixed missing qt file \begin{description} \item[{2005-02-15 banished error\_msg and report\_error. Internal backend}] \leavevmode methods like error\_msg\_gtk are preserved. backend writers, check your backends, and diff against 0.72 to make sure I did the right thing! - JDH \end{description} 2005-02-14 Added enthought traits to matplotlib tree - JDH \bigskip\hrule\bigskip 2005-02-14 0.72 released 2005-02-14 fix bug in cbook alltrue() and onetrue() - SC 2005-02-11 updated qtagg backend from Ted - JDH 2005-02-11 matshow fixes for figure numbering, return value and docs - FP 2005-02-09 new zorder example for fine control in zorder\_demo.py - FP \begin{description} \item[{2005-02-09 backend renderer draw\_lines now has transform in backend,}] \leavevmode as in draw\_markers; use numerix in \_backend\_agg, aded small line optimization to agg \end{description} 2005-02-09 subplot now deletes axes that it overlaps \begin{description} \item[{2005-02-08 Added transparent support for gzipped files in load/save - Fernando}] \leavevmode Perez (FP from now on). \item[{2005-02-08 Small optimizations in PS backend. They may have a big impact for}] \leavevmode large plots, otherwise they don’t hurt - FP \item[{2005-02-08 Added transparent support for gzipped files in load/save - Fernando}] \leavevmode Perez (FP from now on). \item[{2005-02-07 Added newstyle path drawing for markers - only implemented}] \leavevmode in agg currently - JDH \end{description} 2005-02-05 Some superscript text optimizations for ticking log plots \begin{description} \item[{2005-02-05 Added some default key press events to pylab figures: ‘g’}] \leavevmode toggles grid - JDH \item[{2005-02-05 Added some support for handling log switching for lines}] \leavevmode that have nonpos data - JDH \item[{2005-02-04 Added Nadia’s contour patch - contour now has matlab}] \leavevmode compatible syntax; this also fixed an unequal sized contour array bug- JDH \item[{2005-02-04 Modified GTK backends to allow the FigureCanvas to be resized}] \leavevmode smaller than its original size - SC \end{description} 2005-02-02 Fixed a bug in dates mx2num - JDH 2005-02-02 Incorporated Fernando’s matshow - JDH \begin{description} \item[{2005-02-01 Added Fernando’s figure num patch, including experemental}] \leavevmode support for pylab backend switching, LineCOllection.color warns, savefig now a figure method, fixed a close(fig) bug - JDH \end{description} 2005-01-31 updated datalim in contour - JDH 2005-01-30 Added backend\_qtagg.py provided by Sigve Tjora - SC \begin{description} \item[{2005-01-28 Added tk.inspect rc param to .matplotlibrc. IDLE users}] \leavevmode should set tk.pythoninspect:True and interactive:True and backend:TkAgg \item[{2005-01-28 Replaced examples/interactive.py with an updated script from}] \leavevmode Fernando Perez - SC \item[{2005-01-27 Added support for shared x or y axes. See}] \leavevmode examples/shared\_axis\_demo.py and examples/ganged\_plots.py \item[{2005-01-27 Added Lee’s patch for missing symbols leq and LEFTbracket}] \leavevmode to \_mathtext\_data - JDH \item[{2005-01-26 Added Baptiste’s two scales patch \textendash{} see help(twinx) in the}] \leavevmode pylab interface for more info. See also examples/two\_scales.py \item[{2005-01-24 Fixed a mathtext parser bug that prevented font changes in}] \leavevmode sub/superscripts - JDH \item[{2005-01-24 Fixed contour to work w/ interactive changes in colormaps,}] \leavevmode clim, etc - JDH \end{description} \bigskip\hrule\bigskip 2005-01-21 matplotlib-0.71 released 2005-01-21 Refactored numerix to solve vexing namespace issues - JDH 2005-01-21 Applied Nadia’s contour bug fix - JDH \begin{description} \item[{2005-01-20 Made some changes to the contour routine - particularly}] \leavevmode region=1 seems t fix a lot of the zigzag strangeness. Added colormaps as default for contour - JDH \item[{2005-01-19 Restored builtin names which were overridden (min, max,}] \leavevmode abs, round, and sum) in pylab. This is a potentially significant change for those who were relying on an array version of those functions that previously overrode builtin function names. - ADS \item[{2005-01-18 Added accents to mathtext: hat, breve, grave, bar,}] \leavevmode acute, tilde, vec, dot, ddot. All of them have the same syntax, e.g., to make an overbar you do bar\{o\} or to make an o umlaut you do ddot\{o\}. The shortcuts are also provided, e.g., “o ‘e {}`e \textasciitilde{}n .x \textasciicircum{}y - JDH \end{description} 2005-01-18 Plugged image resize memory leaks - JDH 2005-01-18 Fixed some mathtext parser problems relating to superscripts \begin{description} \item[{2005-01-17 Fixed a yticklabel problem for colorbars under change of}] \leavevmode clim - JDH \item[{2005-01-17 Cleaned up Destroy handling in wx reducing memleak/fig from}] \leavevmode approx 800k to approx 6k- JDH \end{description} 2005-01-17 Added kappa to latex\_to\_bakoma - JDH 2005-01-15 Support arbitrary colorbar axes and horizontal colorbars - JDH \begin{description} \item[{2005-01-15 Fixed colormap number of colors bug so that the colorbar}] \leavevmode has the same discretization as the image - JDH \end{description} 2005-01-15 Added Nadia’s x,y contour fix - JDH \begin{description} \item[{2005-01-15 backend\_cairo: added PDF support which requires pycairo 0.1.4.}] \leavevmode Its not usable yet, but is ready for when the Cairo PDF backend matures - SC \end{description} 2005-01-15 Added Nadia’s x,y contour fix 2005-01-12 Fixed set clip\_on bug in artist - JDH 2005-01-11 Reverted pythoninspect in tkagg - JDH \begin{description} \item[{2005-01-09 Fixed a backend\_bases event bug caused when an event is}] \leavevmode triggered when location is None - JDH \item[{2005-01-07 Add patch from Stephen Walton to fix bug in pylab.load()}] \leavevmode when the \% character is included in a comment. - ADS \item[{2005-01-07 Added markerscale attribute to Legend class. This allows}] \leavevmode the marker size in the legend to be adjusted relative to that in the plot. - ADS \item[{2005-01-06 Add patch from Ben Vanhaeren to make the FigureManagerGTK vbox a}] \leavevmode public attribute - SC \end{description} \bigskip\hrule\bigskip 2004-12-30 Release 0.70 \begin{description} \item[{2004-12-28 Added coord location to key press and added a}] \leavevmode examples/picker\_demo.py \end{description} 2004-12-28 Fixed coords notification in wx toolbar - JDH \begin{description} \item[{2004-12-28 Moved connection and disconnection event handling to the}] \leavevmode FigureCanvasBase. Backends now only need to connect one time for each of the button press, button release and key press/release functions. The base class deals with callbacks and multiple connections. This fixes flakiness on some backends (tk, wx) in the presence of multiple connections and/or disconnect - JDH \item[{2004-12-27 Fixed PS mathtext bug where color was not set - Jochen}] \leavevmode please verify correct - JDH \item[{2004-12-27 Added Shadow class and added shadow kwarg to legend and pie}] \leavevmode for shadow effect - JDH \end{description} 2004-12-27 Added pie charts and new example/pie\_demo.py \begin{description} \item[{2004-12-23 Fixed an agg text rotation alignment bug, fixed some text}] \leavevmode kwarg processing bugs, and added examples/text\_rotation.py to explain and demonstrate how text rotations and alignment work in matplotlib. - JDH \end{description} \bigskip\hrule\bigskip 2004-12-22 0.65.1 released - JDH \begin{description} \item[{2004-12-22 Fixed colorbar bug which caused colorbar not to respond to}] \leavevmode changes in colormap in some instances - JDH \item[{2004-12-22 Refactored NavigationToolbar in tkagg to support app}] \leavevmode embedding , init now takes (canvas, window) rather than (canvas, figman) - JDH \item[{2004-12-21 Refactored axes and subplot management - removed}] \leavevmode add\_subplot and add\_axes from the FigureManager. classic toolbar updates are done via an observer pattern on the figure using add\_axobserver. Figure now maintains the axes stack (for gca) and supports axes deletion. Ported changes to GTK, Tk, Wx, and FLTK. Please test! Added delaxes - JDH \item[{2004-12-21 Lots of image optimizations - 4x performance boost over}] \leavevmode 0.65 JDH \item[{2004-12-20 Fixed a figimage bug where the axes is shown and modified}] \leavevmode tkagg to move the destroy binding into the show method. \item[{2004-12-18 Minor refactoring of NavigationToolbar2 to support}] \leavevmode embedding in an application - JDH \end{description} 2004-12-14 Added linestyle to collections (currently broken) - JDH \begin{description} \item[{2004-12-14 Applied Nadia’s setupext patch to fix libstdc++ link}] \leavevmode problem with contour and solaris -JDH \item[{2004-12-14 A number of pychecker inspired fixes, including removal of}] \leavevmode True and False from cbook which I erroneously thought was needed for python2.2 - JDH \item[{2004-12-14 Finished porting doc strings for set introspection.}] \leavevmode Used silent\_list for many get funcs that return lists. JDH \end{description} 2004-12-13 dates.py: removed all timezone() calls, except for UTC - SC \bigskip\hrule\bigskip 2004-12-13 0.65 released - JDH \begin{description} \item[{2004-12-13 colors.py: rgb2hex(), hex2color() made simpler (and faster), also}] \leavevmode rgb2hex() - added round() instead of integer truncation hex2color() - changed 256.0 divisor to 255.0, so now ‘\#ffffff’ becomes (1.0,1.0,1.0) not (0.996,0.996,0.996) - SC \end{description} 2004-12-11 Added ion and ioff to pylab interface - JDH \begin{description} \item[{2004-12-11 backend\_template.py: delete FigureCanvasTemplate.realize() - most}] \leavevmode backends don’t use it and its no longer needed backend\_ps.py, backend\_svg.py: delete show() and draw\_if\_interactive() - they are not needed for image backends backend\_svg.py: write direct to file instead of StringIO - SC \item[{2004-12-10 Added zorder to artists to control drawing order of lines,}] \leavevmode patches and text in axes. See examples/zoder\_demo.py - JDH \end{description} 2004-12-10 Fixed colorbar bug with scatter - JDH 2004-12-10 Added Nadia Dencheva \textless{}\sphinxhref{mailto:dencheva@stsci.edu}{dencheva@stsci.edu}\textgreater{} contour code - JDH 2004-12-10 backend\_cairo.py: got mathtext working - SC 2004-12-09 Added Norm Peterson’s svg clipping patch 2004-12-09 Added Matthew Newville’s wx printing patch 2004-12-09 Migrated matlab to pylab - JDH \begin{description} \item[{2004-12-09 backend\_gtk.py: split into two parts}] \leavevmode\begin{itemize} \item {} backend\_gdk.py - an image backend \item {} backend\_gtk.py - A GUI backend that uses GDK - SC \end{itemize} \item[{2004-12-08 backend\_gtk.py: remove quit\_after\_print\_xvfb(*args), show\_xvfb(),}] \leavevmode Dialog\_MeasureTool(gtk.Dialog) one month after sending mail to matplotlib-users asking if anyone still uses these functions - SC \item[{2004-12-02 backend\_bases.py, backend\_template.py: updated some of the method}] \leavevmode documentation to make them consistent with each other - SC \item[{2004-12-04 Fixed multiple bindings per event for TkAgg mpl\_connect and}] \leavevmode mpl\_disconnect. Added a “test\_disconnect” command line parameter to coords\_demo.py JTM \end{description} 2004-12-04 Fixed some legend bugs JDH \begin{description} \item[{2004-11-30 Added over command for oneoff over plots. e.g., over(plot, x,}] \leavevmode y, lw=2). Works with any plot function. \end{description} 2004-11-30 Added bbox property to text - JDH \begin{description} \item[{2004-11-29 Zoom to rect now respect reversed axes limits (for both}] \leavevmode linear and log axes). - GL \item[{2004-11-29 Added the over command to the matlab interface. over}] \leavevmode allows you to add an overlay plot regardless of hold state. - JDH \item[{2004-11-25 Added Printf to mplutils for printf style format string}] \leavevmode formatting in C++ (should help write better exceptions) \item[{2004-11-24 IMAGE\_FORMAT: remove from agg and gtkagg backends as its no longer}] \leavevmode used - SC \item[{2004-11-23 Added matplotlib compatible set and get introspection. See}] \leavevmode set\_and\_get.py \item[{2004-11-23 applied Norbert’s patched and exposed legend configuration}] \leavevmode to kwargs - JDH \end{description} 2004-11-23 backend\_gtk.py: added a default exception handler - SC \begin{description} \item[{2004-11-18 backend\_gtk.py: change so that the backend knows about all image}] \leavevmode formats and does not need to use IMAGE\_FORMAT in other backends - SC \item[{2004-11-18 Fixed some report\_error bugs in string interpolation as}] \leavevmode reported on SF bug tracker- JDH \item[{2004-11-17 backend\_gtkcairo.py: change so all print\_figure() calls render using}] \leavevmode Cairo and get saved using backend\_gtk.print\_figure() - SC \item[{2004-11-13 backend\_cairo.py: Discovered the magic number (96) required for}] \leavevmode Cairo PS plots to come out the right size. Restored Cairo PS output and added support for landscape mode - SC \end{description} 2004-11-13 Added ishold - JDH \begin{description} \item[{2004-11-12 Added many new matlab colormaps - autumn bone cool copper}] \leavevmode flag gray hot hsv jet pink prism spring summer winter - PG \end{description} 2004-11-11 greatly simplify the emitted postscript code - JV \begin{description} \item[{2004-11-12 Added new plotting functions spy, spy2 for sparse matrix}] \leavevmode visualization - JDH \item[{2004-11-11 Added rgrids, thetragrids for customizing the grid}] \leavevmode locations and labels for polar plots - JDH \end{description} 2004-11-11 make the Gtk backends build without an X-server connection - JV \begin{description} \item[{2004-11-10 matplotlib/\_\_init\_\_.py: Added FROZEN to signal we are running under}] \leavevmode py2exe (or similar) - is used by backend\_gtk.py - SC \item[{2004-11-09 backend\_gtk.py: Made fix suggested by \sphinxhref{mailto:maffew@cat.org.au}{maffew@cat.org.au}}] \leavevmode to prevent problems when py2exe calls pygtk.require(). - SC \item[{2004-11-09 backend\_cairo.py: Added support for printing to a fileobject.}] \leavevmode Disabled cairo PS output which is not working correctly. - SC \end{description} \bigskip\hrule\bigskip 2004-11-08 matplotlib-0.64 released \begin{description} \item[{2004-11-04 Changed -dbackend processing to only use known backends, so}] \leavevmode we don’t clobber other non-matplotlib uses of -d, like -debug. \item[{2004-11-04 backend\_agg.py: added IMAGE\_FORMAT to list the formats that the}] \leavevmode backend can save to. backend\_gtkagg.py: added support for saving JPG files by using the GTK backend - SC \item[{2004-10-31 backend\_cairo.py: now produces png and ps files (although the figure}] \leavevmode sizing needs some work). pycairo did not wrap all the necessary functions, so I wrapped them myself, they are included in the backend\_cairo.py doc string. - SC \item[{2004-10-31 backend\_ps.py: clean up the generated PostScript code, use}] \leavevmode the PostScript stack to hold itermediate values instead of storing them in the dictionary. - JV \item[{2004-10-30 backend\_ps.py, ft2font.cpp, ft2font.h: fix the position of}] \leavevmode text in the PostScript output. The new FT2Font method get\_descent gives the distance between the lower edge of the bounding box and the baseline of a string. In backend\_ps the text is shifted upwards by this amount. - JV \item[{2004-10-30 backend\_ps.py: clean up the code a lot. Change the}] \leavevmode PostScript output to be more DSC compliant. All definitions for the generated PostScript are now in a PostScript dictionary ‘mpldict’. Moved the long comment about drawing ellipses from the PostScript output into a Python comment. - JV \item[{2004-10-30 backend\_gtk.py: removed FigureCanvasGTK.realize() as its no longer}] \leavevmode needed. Merged ColorManager into GraphicsContext backend\_bases.py: For set\_capstyle/joinstyle() only set cap or joinstyle if there is no error. - SC \item[{2004-10-30 backend\_gtk.py: tidied up print\_figure() and removed some of the}] \leavevmode dependency on widget events - SC \item[{2004-10-28 backend\_cairo.py: The renderer is complete except for mathtext,}] \leavevmode draw\_image() and clipping. gtkcairo works reasonably well. cairo does not yet create any files since I can’t figure how to set the ‘target surface’, I don’t think pycairo wraps the required functions - SC \item[{2004-10-28 backend\_gtk.py: Improved the save dialog (GTK 2.4 only) so it}] \leavevmode presents the user with a menu of supported image formats - SC \item[{2004-10-28 backend\_svg.py: change print\_figure() to restore original face/edge}] \leavevmode color backend\_ps.py : change print\_figure() to ensure original face/edge colors are restored even if there’s an IOError - SC \end{description} 2004-10-27 Applied Norbert’s errorbar patch to support barsabove kwarg 2004-10-27 Applied Norbert’s legend patch to support None handles \begin{description} \item[{2004-10-27 Added two more backends: backend\_cairo.py, backend\_gtkcairo.py}] \leavevmode They are not complete yet, currently backend\_gtkcairo just renders polygons, rectangles and lines - SC \end{description} 2004-10-21 Added polar axes and plots - JDH \begin{description} \item[{2004-10-20 Fixed corrcoef bug exposed by corrcoef(X) where X is matrix}] \leavevmode\begin{itemize} \item {} JDH \end{itemize} \item[{2004-10-19 Added kwarg support to xticks and yticks to set ticklabel}] \leavevmode text properties \textendash{} thanks to T. Edward Whalen for the suggestion \end{description} 2004-10-19 Added support for PIL images in imshow(), image.py - ADS \begin{description} \item[{2004-10-19 Re-worked exception handling in \_image.py and \_transforms.py}] \leavevmode to avoid masking problems with shared libraries. - JTM \item[{2004-10-16 Streamlined the matlab interface wrapper, removed the}] \leavevmode noplot option to hist - just use mlab.hist instead. \item[{2004-09-30 Added Andrew Dalke’s strftime code to extend the range of}] \leavevmode dates supported by the DateFormatter - JDH \end{description} 2004-09-30 Added barh - JDH \begin{description} \item[{2004-09-30 Removed fallback to alternate array package from numerix}] \leavevmode so that ImportErrors are easier to debug. JTM \end{description} 2004-09-30 Add GTK+ 2.4 support for the message in the toolbar. SC \begin{description} \item[{2004-09-30 Made some changes to support python22 - lots of doc}] \leavevmode fixes. - JDH \end{description} 2004-09-29 Added a Verbose class for reporting - JDH \bigskip\hrule\bigskip 2004-09-28 Released 0.63.0 \begin{description} \item[{2004-09-28 Added save to file object for agg - see}] \leavevmode examples/print\_stdout.py \end{description} 2004-09-24 Reorganized all py code to lib subdir \begin{description} \item[{2004-09-24 Fixed axes resize image edge effects on interpolation -}] \leavevmode required upgrade to agg22 which fixed an agg bug related to this problem \end{description} 2004-09-20 Added toolbar2 message display for backend\_tkagg. JTM \begin{description} \item[{2004-09-17 Added coords formatter attributes. These must be callable,}] \leavevmode\begin{quote} and return a string for the x or y data. These will be used to format the x and y data for the coords box. Default is the axis major formatter. e.g.: \end{quote} \# format the coords message box def price(x): return ‘\$\%1.2f’\%x ax.format\_xdata = DateFormatter(‘\%Y-\%m-\%d’) ax.format\_ydata = price \item[{2004-09-17 Total rewrite of dates handling to use python datetime with}] \leavevmode num2date, date2num and drange. pytz for timezone handling, dateutils for spohisticated ticking. date ranges from 0001-9999 are supported. rrules allow arbitrary date ticking. examples/date\_demo*.py converted to show new usage. new example examples/date\_demo\_rrule.py shows how to use rrules in date plots. The date locators are much more general and almost all of them have different constructors. See matplotlib.dates for more info. \item[{2004-09-15 Applied Fernando’s backend \_\_init\_\_ patch to support easier}] \leavevmode backend maintenance. Added his numutils to mlab. JDH \item[{2004-09-16 Re-designated all files in matplotlib/images as binary and}] \leavevmode w/o keyword substitution using “cvs admin -kb *.svg …”. See binary files in “info cvs” under Linux. This was messing up builds from CVS on windows since CVS was doing lf -\textgreater{} cr/lf and keyword substitution on the bitmaps. - JTM \item[{2004-09-15 Modified setup to build array-package-specific extensions}] \leavevmode for those extensions which are array-aware. Setup builds extensions automatically for either Numeric, numarray, or both, depending on what you have installed. Python proxy modules for the array-aware extensions import the version optimized for numarray or Numeric determined by numerix. - JTM \item[{2004-09-15 Moved definitions of infinity from mlab to numerix to avoid}] \leavevmode divide by zero warnings for numarray - JTM \end{description} 2004-09-09 Added axhline, axvline, axhspan and axvspan \bigskip\hrule\bigskip 2004-08-30 matplotlib 0.62.4 released \begin{description} \item[{2004-08-30 Fixed a multiple images with different extent bug,}] \leavevmode Fixed markerfacecolor as RGB tuple \item[{2004-08-27 Mathtext now more than 5x faster. Thanks to Paul Mcguire}] \leavevmode for fixes both to pyparsing and to the matplotlib grammar! mathtext broken on python2.2 \item[{2004-08-25 Exposed Darren’s and Greg’s log ticking and formatting}] \leavevmode options to semilogx and friends \end{description} 2004-08-23 Fixed grid w/o args to toggle grid state - JDH 2004-08-11 Added Gregory’s log patches for major and minor ticking 2004-08-18 Some pixel edge effects fixes for images 2004-08-18 Fixed TTF files reads in backend\_ps on win32. \begin{description} \item[{2004-08-18 Added base and subs properties for logscale plots, user}] \leavevmode modifiable using set\_{[}x,y{]}scale(‘log’,base=b,subs={[}mt1,mt2,…{]}) - GL \item[{2004-08-18 fixed a bug exposed by trying to find the HOME dir on win32}] \leavevmode thanks to Alan Issac for pointing to the light - JDH \end{description} 2004-08-18 fixed errorbar bug in setting ecolor - JDH 2004-08-12 Added Darren Dale’s exponential ticking patch 2004-08-11 Added Gregory’s fltkagg backend \bigskip\hrule\bigskip 2004-08-09 matplotlib-0.61.0 released \begin{description} \item[{2004-08-08 backend\_gtk.py: get rid of the final PyGTK deprecation warning by}] \leavevmode replacing gtkOptionMenu with gtkMenu in the 2.4 version of the classic toolbar. \item[{2004-08-06 Added Tk zoom to rect rectangle, proper idle drawing, and}] \leavevmode keybinding - JDH \end{description} 2004-08-05 Updated installing.html and INSTALL - JDH 2004-08-01 backend\_gtk.py: move all drawing code into the expose\_event() 2004-07-28 Added Greg’s toolbar2 and backend\_*agg patches - JDH \begin{description} \item[{2004-07-28 Added image.imread with support for loading png into}] \leavevmode numerix arrays \item[{2004-07-28 Added key modifiers to events - implemented dynamic updates}] \leavevmode and rubber banding for interactive pan/zoom - JDH \item[{2004-07-27 did a readthrough of SVG, replacing all the string}] \leavevmode additions with string interps for efficiency, fixed some layout problems, added font and image support (through external pngs) - JDH \item[{2004-07-25 backend\_gtk.py: modify toolbar2 to make it easier to support GTK+}] \leavevmode 2.4. Add GTK+ 2.4 toolbar support. - SC \end{description} 2004-07-24 backend\_gtk.py: Simplified classic toolbar creation - SC \begin{description} \item[{2004-07-24 Added images/matplotlib.svg to be used when GTK+ windows are}] \leavevmode minimised - SC \item[{2004-07-22 Added right mouse click zoom for NavigationToolbar2 panning}] \leavevmode mode. - JTM \item[{2004-07-22 Added NavigationToolbar2 support to backend\_tkagg.}] \leavevmode Minor tweak to backend\_bases. - JTM \item[{2004-07-22 Incorporated Gergory’s renderer cache and buffer object}] \leavevmode cache - JDH \item[{2004-07-22 Backend\_gtk.py: Added support for GtkFileChooser, changed}] \leavevmode FileSelection/FileChooser so that only one instance pops up, and made them both modal. - SC \item[{2004-07-21 Applied backend\_agg memory leak patch from hayden -}] \leavevmode \sphinxhref{mailto:jocallo@online.no}{jocallo@online.no}. Found and fixed a leak in binary operations on transforms. Moral of the story: never incref where you meant to decref! Fixed several leaks in ft2font: moral of story: almost always return Py::asObject over Py::Object - JDH \item[{2004-07-21 Fixed a to string memory allocation bug in agg and image}] \leavevmode modules - JDH \item[{2004-07-21 Added mpl\_connect and mpl\_disconnect to matlab interface -}] \leavevmode JDH \end{description} 2004-07-21 Added beginnings of users\_guide to CVS - JDH 2004-07-20 ported toolbar2 to wx 2004-07-20 upgraded to agg21 - JDH 2004-07-20 Added new icons for toolbar2 - JDH \begin{description} \item[{2004-07-19 Added vertical mathtext for *Agg and GTK - thanks Jim}] \leavevmode Benson! - JDH \end{description} 2004-07-16 Added ps/eps/svg savefig options to wx and gtk JDH 2004-07-15 Fixed python framework tk finder in setupext.py - JDH \begin{description} \item[{2004-07-14 Fixed layer images demo which was broken by the 07/12 image}] \leavevmode extent fixes - JDH \item[{2004-07-13 Modified line collections to handle arbitrary length}] \leavevmode segments for each line segment. - JDH \item[{2004-07-13 Fixed problems with image extent and origin -}] \leavevmode set\_image\_extent deprecated. Use imshow(blah, blah, extent=(xmin, xmax, ymin, ymax) instead - JDH \item[{2004-07-12 Added prototype for new nav bar with codifed event}] \leavevmode handling. Use mpl\_connect rather than connect for matplotlib event handling. toolbar style determined by rc toolbar param. backend status: gtk: prototype, wx: in progress, tk: not started - JDH \item[{2004-07-11 backend\_gtk.py: use builtin round() instead of redefining it.}] \leavevmode\begin{itemize} \item {} SC \end{itemize} \end{description} 2004-07-10 Added embedding\_in\_wx3 example - ADS 2004-07-09 Added dynamic\_image\_wxagg to examples - ADS 2004-07-09 added support for embedding TrueType fonts in PS files - PEB 2004-07-09 fixed a sfnt bug exposed if font cache is not built \begin{description} \item[{2004-07-09 added default arg None to matplotlib.matlab grid command to}] \leavevmode toggle current grid state \end{description} \bigskip\hrule\bigskip 2004-07-08 0.60.2 released 2004-07-08 fixed a mathtext bug for ‘6’ 2004-07-08 added some numarray bug workarounds \bigskip\hrule\bigskip 2004-07-07 0.60 released 2004-07-07 Fixed a bug in dynamic\_demo\_wx \begin{description} \item[{2004-07-07 backend\_gtk.py: raise SystemExit immediately if}] \leavevmode ‘import pygtk’ fails - SC \item[{2004-07-05 Added new mathtext commands over\{sym1\}\{sym2\} and}] \leavevmode under\{sym1\}\{sym2\} \item[{2004-07-05 Unified image and patch collections colormapping and}] \leavevmode scaling args. Updated docstrings for all - JDH \item[{2004-07-05 Fixed a figure legend bug and added}] \leavevmode examples/figlegend\_demo.py - JDH \end{description} 2004-07-01 Fixed a memory leak in image and agg to string methods \begin{description} \item[{2004-06-25 Fixed fonts\_demo spacing problems and added a kwargs}] \leavevmode version of the fonts\_demo fonts\_demo\_kw.py - JDH \end{description} 2004-06-25 finance.py: handle case when urlopen() fails - SC \begin{description} \item[{2004-06-24 Support for multiple images on axes and figure, with}] \leavevmode blending. Support for upper and lower image origins. clim, jet and gray functions in matlab interface operate on current image - JDH \item[{2004-06-23 ported code to Perry’s new colormap and norm scheme. Added}] \leavevmode new rc attributes image.aspect, image.interpolation, image.cmap, image.lut, image.origin \item[{2004-06-20 backend\_gtk.py: replace gtk.TRUE/FALSE with True/False.}] \leavevmode simplified \_make\_axis\_menu(). - SC \item[{2004-06-19 anim\_tk.py: Updated to use TkAgg by default (not GTK)}] \leavevmode backend\_gtk\_py: Added ‘\_’ in front of private widget creation functions - SC \item[{2004-06-17 backend\_gtk.py: Create a GC once in realise(), not every}] \leavevmode time draw() is called. - SC \item[{2004-06-16 Added new py2exe FAQ entry and added frozen support in}] \leavevmode get\_data\_path for py2exe - JDH \item[{2004-06-16 Removed GTKGD, which was always just a proof-of-concept}] \leavevmode backend - JDH \item[{2004-06-16 backend\_gtk.py updates to replace deprecated functions}] \leavevmode\begin{description} \item[{gtk.mainquit(), gtk.mainloop().}] \leavevmode Update NavigationToolbar to use the new GtkToolbar API - SC \end{description} \item[{2004-06-15 removed set\_default\_font from font\_manager to unify font}] \leavevmode customization using the new function rc. See API\_CHANGES for more info. The examples fonts\_demo.py and fonts\_demo\_kw.py are ported to the new API - JDH \item[{2004-06-15 Improved (yet again!) axis scaling to properly handle}] \leavevmode singleton plots - JDH \end{description} 2004-06-15 Restored the old FigureCanvasGTK.draw() - SC 2004-06-11 More memory leak fixes in transforms and ft2font - JDH \begin{description} \item[{2004-06-11 Eliminated numerix .numerix file and environment variable}] \leavevmode NUMERIX. Fixed bug which prevented command line overrides: \textendash{}numarray or \textendash{}numeric. - JTM \item[{2004-06-10 Added rc configuration function rc; deferred all rc param}] \leavevmode setting until object creation time; added new rc attrs: lines.markerfacecolor, lines.markeredgecolor, lines.markeredgewidth, patch.linewidth, patch.facecolor, patch.edgecolor, patch.antialiased; see examples/customize\_rc.py for usage - JDH \end{description} \bigskip\hrule\bigskip 2004-06-09 0.54.2 released \begin{description} \item[{2004-06-08 Rewrote ft2font using CXX as part of general memory leak}] \leavevmode fixes; also fixed transform memory leaks - JDH \end{description} 2004-06-07 Fixed several problems with log ticks and scaling - JDH 2004-06-07 Fixed width/height issues for images - JDH 2004-06-03 Fixed draw\_if\_interactive bug for semilogx; 2004-06-02 Fixed text clipping to clip to axes - JDH 2004-06-02 Fixed leading newline text and multiple newline text - JDH 2004-06-02 Fixed plot\_date to return lines - JDH 2004-06-01 Fixed plot to work with x or y having shape N,1 or 1,N - JDH 2004-05-31 Added renderer markeredgewidth attribute of Line2D. - ADS 2004-05-29 Fixed tick label clipping to work with navigation. \begin{description} \item[{2004-05-28 Added renderer grouping commands to support groups in}] \leavevmode SVG/PS. - JDH \item[{2004-05-28 Fixed, this time I really mean it, the singleton plot}] \leavevmode plot({[}0{]}) scaling bug; Fixed Flavio’s shape = N,1 bug - JDH \end{description} 2004-05-28 added colorbar - JDH \begin{description} \item[{2004-05-28 Made some changes to the matplotlib.colors.Colormap to}] \leavevmode propertly support clim - JDH \end{description} \bigskip\hrule\bigskip 2004-05-27 0.54.1 released \begin{description} \item[{2004-05-27 Lots of small bug fixes: rotated text at negative angles,}] \leavevmode errorbar capsize and autoscaling, right tick label position, gtkagg on win98, alpha of figure background, singleton plots - JDH \item[{2004-05-26 Added Gary’s errorbar stuff and made some fixes for length}] \leavevmode one plots and constant data plots - JDH \item[{2004-05-25 Tweaked TkAgg backend so that canvas.draw() works}] \leavevmode more like the other backends. Fixed a bug resulting in 2 draws per figure mangager show(). - JTM \end{description} \bigskip\hrule\bigskip 2004-05-19 0.54 released \begin{description} \item[{2004-05-18 Added newline separated text with rotations to text.Text}] \leavevmode layout - JDH \end{description} 2004-05-16 Added fast pcolor using PolyCollections. - JDH \begin{description} \item[{2004-05-14 Added fast polygon collections - changed scatter to use}] \leavevmode them. Added multiple symbols to scatter. 10x speedup on large scatters using *Agg and 5X speedup for ps. - JDH \item[{2004-05-14 On second thought… created an “nx” namespace in}] \leavevmode in numerix which maps type names onto typecodes the same way for both numarray and Numeric. This undoes my previous change immediately below. To get a typename for Int16 useable in a Numeric extension: say nx.Int16. - JTM \item[{2004-05-15 Rewrote transformation class in extension code, simplified}] \leavevmode all the artist constructors - JDH \item[{2004-05-14 Modified the type definitions in the numarray side of}] \leavevmode numerix so that they are Numeric typecodes and can be used with Numeric compilex extensions. The original numarray types were renamed to type\textless{}old\_name\textgreater{}. - JTM \item[{2004-05-06 Gary Ruben sent me a bevy of new plot symbols and markers.}] \leavevmode See matplotlib.matlab.plot - JDH \item[{2004-05-06 Total rewrite of mathtext - factored ft2font stuff out of}] \leavevmode layout engine and defined abstract class for font handling to lay groundwork for ps mathtext. Rewrote parser and made layout engine much more precise. Fixed all the layout hacks. Added spacing commands / and hspace. Added composite chars and defined angstrom. - JDH \item[{2004-05-05 Refactored text instances out of backend; aligned}] \leavevmode text with arbitrary rotations is now supported - JDH \end{description} 2004-05-05 Added a Matrix capability for numarray to numerix. JTM \begin{description} \item[{2004-05-04 Updated whats\_new.html.template to use dictionary and}] \leavevmode template loop, added anchors for all versions and items; updated goals.txt to use those for links. PG \item[{2004-05-04 Added fonts\_demo.py to backend\_driver, and AFM and TTF font}] \leavevmode caches to font\_manager.py - PEB \item[{2004-05-03 Redid goals.html.template to use a goals.txt file that}] \leavevmode has a pseudo restructured text organization. PG \item[{2004-05-03 Removed the close buttons on all GUIs and added the python}] \leavevmode \#! bang line to the examples following Steve Chaplin’s advice on matplotlib dev \item[{2004-04-29 Added CXX and rewrote backend\_agg using it; tracked down}] \leavevmode and fixed agg memory leak - JDH \end{description} 2004-04-29 Added stem plot command - JDH 2004-04-28 Fixed PS scaling and centering bug - JDH 2004-04-26 Fixed errorbar autoscale problem - JDH \begin{description} \item[{2004-04-22 Fixed copy tick attribute bug, fixed singular datalim}] \leavevmode ticker bug; fixed mathtext fontsize interactive bug. - JDH \item[{2004-04-21 Added calls to draw\_if\_interactive to axes(), legend(),}] \leavevmode and pcolor(). Deleted duplicate pcolor(). - JTM \end{description} \bigskip\hrule\bigskip 2004-04-21 matplotlib 0.53 release 2004-04-19 Fixed vertical alignment bug in PS backend - JDH \begin{description} \item[{2004-04-17 Added support for two scales on the “same axes” with tick}] \leavevmode different ticking and labeling left right or top bottom. See examples/two\_scales.py - JDH \item[{2004-04-17 Added default dirs as list rather than single dir in}] \leavevmode setupext.py - JDH \item[{2004-04-16 Fixed wx exception swallowing bug (and there was much}] \leavevmode rejoicing!) - JDH \item[{2004-04-16 Added new ticker locator a formatter, fixed default font}] \leavevmode return - JDH \item[{2004-04-16 Added get\_name method to FontProperties class. Fixed font lookup}] \leavevmode in GTK and WX backends. - PEB \end{description} 2004-04-16 Added get- and set\_fontstyle msethods. - PEB 2004-04-10 Mathtext fixes: scaling with dpi, - JDH 2004-04-09 Improved font detection algorithm. - PEB 2004-04-09 Move deprecation warnings from text.py to \_\_init\_\_.py - PEB 2004-04-09 Added default font customization - JDH 2004-04-08 Fixed viewlim set problem on axes and axis. - JDH \begin{description} \item[{2004-04-07 Added validate\_comma\_sep\_str and font properties paramaters to}] \leavevmode \_\_init\_\_. Removed font families and added rcParams to FontProperties \_\_init\_\_ arguments in font\_manager. Added default font property parameters to .matplotlibrc file with descriptions. Added deprecation warnings to the get\_ - and set\_fontXXX methods of the Text object. - PEB \end{description} 2004-04-06 Added load and save commands for ASCII data - JDH \begin{description} \item[{2004-04-05 Improved font caching by not reading AFM fonts until needed.}] \leavevmode Added better documentation. Changed the behaviour of the get\_family, set\_family, and set\_name methods of FontProperties. - PEB \end{description} 2004-04-05 Added WXAgg backend - JDH \begin{description} \item[{2004-04-04 Improved font caching in backend\_agg with changes to}] \leavevmode font\_manager - JDH \item[{2004-03-29 Fixed fontdicts and kwargs to work with new font manager -}] \leavevmode JDH \end{description} \bigskip\hrule\bigskip This is the Old, stale, never used changelog \begin{description} \item[{2002-12-10 - Added a TODO file and CHANGELOG. Lots to do \textendash{} get}] \leavevmode\begin{quote} crackin’! \end{quote} \begin{itemize} \item {} Fixed y zoom tool bug \item {} Adopted a compromise fix for the y data clipping problem. The problem was that for solid lines, the y data clipping (as opposed to the gc clipping) caused artifactual horizontal solid lines near the ylim boundaries. I did a 5\% offset hack in Axes set\_ylim functions which helped, but didn’t cure the problem for very high gain y zooms. So I disabled y data clipping for connected lines . If you need extensive y clipping, either plot(y,x) because x data clipping is always enabled, or change the \_set\_clip code to ‘if 1’ as indicated in the lines.py src. See \_set\_clip in lines.py and set\_ylim in figure.py for more information. \end{itemize} \item[{2002-12-11 - Added a measurement dialog to the figure window to}] \leavevmode\begin{quote} measure axes position and the delta x delta y with a left mouse drag. These defaults can be overridden by deriving from Figure and overrriding button\_press\_event, button\_release\_event, and motion\_notify\_event, and \_dialog\_measure\_tool. \end{quote} \begin{itemize} \item {} fixed the navigation dialog so you can check the axes the navigation buttons apply to. \end{itemize} \end{description} 2003-04-23 Released matplotlib v0.1 \begin{description} \item[{2003-04-24 Added a new line style PixelLine2D which is the plots the}] \leavevmode markers as pixels (as small as possible) with format symbol ‘,’ Added a new class Patch with derived classes Rectangle, RegularPolygon and Circle \end{description} 2003-04-25 Implemented new functions errorbar, scatter and hist \begin{quote} Added a new line type ‘\textbar{}’ which is a vline. syntax is plot(x, Y, ‘\textbar{}’) where y.shape = len(x),2 and each row gives the ymin,ymax for the respective values of x. Previously I had implemented vlines as a list of lines, but I needed the efficientcy of the numeric clipping for large numbers of vlines outside the viewport, so I wrote a dedicated class Vline2D which derives from Line2D \end{quote} 2003-05-01 \begin{quote} Fixed ytick bug where grid and tick show outside axis viewport with gc clip \end{quote} 2003-05-14 \begin{quote} Added new ways to specify colors 1) matlab format string 2) html-style hex string, 3) rgb tuple. See examples/color\_demo.py \end{quote} 2003-05-28 \begin{quote} Changed figure rendering to draw form a pixmap to reduce flicker. See examples/system\_monitor.py for an example where the plot is continusouly updated w/o flicker. This example is meant to simulate a system monitor that shows free CPU, RAM, etc… \end{quote} 2003-08-04 \begin{quote} Added Jon Anderson’s GTK shell, which doesn’t require pygtk to have threading built-in and looks nice! \end{quote} 2003-08-25 \begin{quote} Fixed deprecation warnings for python2.3 and pygtk-1.99.18 \end{quote} 2003-08-26 \begin{quote} Added figure text with new example examples/figtext.py \end{quote} 2003-08-27 \begin{quote} Fixed bugs i figure text with font override dictionairies and fig text that was placed outside the window bounding box \end{quote} 2003-09-1 thru 2003-09-15 \begin{quote} Added a postscript and a GD module backend \end{quote} 2003-09-16 \begin{quote} Fixed font scaling and point scaling so circles, squares, etc on lines will scale with DPI as will fonts. Font scaling is not fully implemented on the gtk backend because I have not figured out how to scale fonts to arbitrary sizes with GTK \end{quote} 2003-09-17 \begin{quote} Fixed figure text bug which crashed X windows on long figure text extending beyond display area. This was, I believe, due to the vestigial erase functionality that was no longer needed since I began rendering to a pixmap \end{quote} 2003-09-30 Added legend \begin{description} \item[{2003-10-01 Fixed bug when colors are specified with rgb tuple or hex}] \leavevmode string. \item[{2003-10-21 Andrew Straw provided some legend code which I modified}] \leavevmode and incorporated. Thanks Andrew! \item[{2003-10-27 Fixed a bug in axis.get\_view\_distance that affected zoom in}] \leavevmode versus out with interactive scrolling, and a bug in the axis text reset system that prevented the text from being redrawn on a interactive gtk view lim set with the widget Fixed a bug in that prevented the manual setting of ticklabel strings from working properly \item[{2003-11-02 - Do a nearest neighbor color pick on GD when}] \leavevmode allocate fails \item[{2003-11-02}] \leavevmode\begin{itemize} \item {} Added pcolor plot \item {} Added MRI example \item {} Fixed bug that screwed up label position if xticks or yticks were empty \item {} added nearest neighbor color picker when GD max colors exceeded \item {} fixed figure background color bug in GD backend \end{itemize} \item[{2003-11-10 - 2003-11-11}] \leavevmode\begin{itemize} \item {} major refactoring. \begin{itemize} \item {} Ticks (with labels, lines and grid) handled by dedicated class \item {} Artist now know bounding box and dpi \item {} Bounding boxes and transforms handled by dedicated classes \item {} legend in dedicated class. Does a better job of alignment and bordering. Can be initialized with specific line instances. See examples/legend\_demo2.py \end{itemize} \end{itemize} \end{description} 2003-11-14 Fixed legend positioning bug and added new position args 2003-11-16 Finsihed porting GD to new axes API 2003-11-20 - add TM for matlab on website and in docs 2003-11-20 - make a nice errorbar and scatter screenshot \begin{description} \item[{2003-11-20 - auto line style cycling for multiple line types}] \leavevmode broken \end{description} 2003-11-18 (using inkrect) :logical rect too big on gtk backend \begin{description} \item[{2003-11-18 ticks don’t reach edge of axes in gtk mode \textendash{}}] \leavevmode rounding error? \end{description} 2003-11-20 - port Gary’s errorbar code to new API before 0.40 \begin{description} \item[{2003-11-20 - problem with stale \_set\_font. legend axes box}] \leavevmode doesn’t resize on save in GTK backend \textendash{} see htdocs legend\_demo.py \end{description} 2003-11-21 - make a dash-dot dict for the GC 2003-12-15 - fix install path bug \subsection{New in matplotlib 0.98.4} \label{\detokenize{users/prev_whats_new/whats_new_0.98.4:new-in-matplotlib-0-98-4}}\label{\detokenize{users/prev_whats_new/whats_new_0.98.4:whats-new-0-98-4}}\label{\detokenize{users/prev_whats_new/whats_new_0.98.4::doc}} \begin{sphinxShadowBox} \sphinxstyletopictitle{Table of Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_0.98.4:id5}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_0.98.4:new-in-matplotlib-0-98-4}]{\sphinxcrossref{New in matplotlib 0.98.4}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_0.98.4:id6}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_0.98.4:legend-enhancements}]{\sphinxcrossref{Legend enhancements}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_0.98.4:id7}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_0.98.4:fancy-annotations-and-arrows}]{\sphinxcrossref{Fancy annotations and arrows}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_0.98.4:id8}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_0.98.4:native-os-x-backend}]{\sphinxcrossref{Native OS X backend}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_0.98.4:id9}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_0.98.4:psd-amplitude-scaling}]{\sphinxcrossref{psd amplitude scaling}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_0.98.4:id10}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_0.98.4:fill-between}]{\sphinxcrossref{Fill between}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_0.98.4:id11}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_0.98.4:lots-more}]{\sphinxcrossref{Lots more}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} It’s been four months since the last matplotlib release, and there are a lot of new features and bug-fixes. Thanks to Charlie Moad for testing and preparing the source release, including binaries for OS X and Windows for python 2.4 and 2.5 (2.6 and 3.0 will not be available until numpy is available on those releases). Thanks to the many developers who contributed to this release, with contributions from Jae-Joon Lee, Michael Droettboom, Ryan May, Eric Firing, Manuel Metz, Jouni K. Seppänen, Jeff Whitaker, Darren Dale, David Kaplan, Michiel de Hoon and many others who submitted patches \subsubsection{Legend enhancements} \label{\detokenize{users/prev_whats_new/whats_new_0.98.4:legend-enhancements}}\label{\detokenize{users/prev_whats_new/whats_new_0.98.4:legend-refactor}} Jae-Joon has rewritten the legend class, and added support for multiple columns and rows, as well as fancy box drawing. See {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.legend:matplotlib.pyplot.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend()}}}}} and {\hyperref[\detokenize{api/legend_api:matplotlib.legend.Legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.legend.Legend}}}}}. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/pyplots/whats\_new\_98\_4\_legend.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_whats_new_98_4_legend_0011}.png}}\caption{Whats New 98 4 Legend}\label{\detokenize{users/prev_whats_new/whats_new_0.98.4:id2}}\end{figure} \subsubsection{Fancy annotations and arrows} \label{\detokenize{users/prev_whats_new/whats_new_0.98.4:fancy-annotations-and-arrows}}\label{\detokenize{users/prev_whats_new/whats_new_0.98.4:fancy-annotations}} Jae-Joon has added lots of support to annotations for drawing fancy boxes and connectors in annotations. See {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.annotate:matplotlib.pyplot.annotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{annotate()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BoxStyle}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ArrowStyle}}}}}, and {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib.patches.ConnectionStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ConnectionStyle}}}}}. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/pyplots/whats\_new\_98\_4\_fancy.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_whats_new_98_4_fancy_0011}.png}}\caption{Whats New 98 4 Fancy}\label{\detokenize{users/prev_whats_new/whats_new_0.98.4:id3}}\end{figure} \subsubsection{Native OS X backend} \label{\detokenize{users/prev_whats_new/whats_new_0.98.4:native-os-x-backend}}\label{\detokenize{users/prev_whats_new/whats_new_0.98.4:psd-amplitude}} Michiel de Hoon has provided a native Mac OSX backend that is almost completely implemented in C. The backend can therefore use Quartz directly and, depending on the application, can be orders of magnitude faster than the existing backends. In addition, no third-party libraries are needed other than Python and NumPy. The backend is interactive from the usual terminal application on Mac using regular Python. It hasn’t been tested with ipython yet, but in principle it should to work there as well. Set ‘backend : macosx’ in your matplotlibrc file, or run your script with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{\PYGZgt{}} \PYG{n}{python} \PYG{n}{myfile}\PYG{o}{.}\PYG{n}{py} \PYG{o}{\PYGZhy{}}\PYG{n}{dmacosx} \end{sphinxVerbatim} \subsubsection{psd amplitude scaling} \label{\detokenize{users/prev_whats_new/whats_new_0.98.4:psd-amplitude-scaling}} Ryan May did a lot of work to rationalize the amplitude scaling of {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.psd:matplotlib.pyplot.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}} and friends. See \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_psd\_demo.py}. The changes should increase MATLAB compatibility and increase scaling options. \subsubsection{Fill between} \label{\detokenize{users/prev_whats_new/whats_new_0.98.4:fill-between}}\label{\detokenize{users/prev_whats_new/whats_new_0.98.4:id1}} Added a {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.fill_between:matplotlib.pyplot.fill_between}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill\_between()}}}}} function to make it easier to do shaded region plots in the presence of masked data. You can pass an \sphinxstyleemphasis{x} array and a \sphinxstyleemphasis{ylower} and \sphinxstyleemphasis{yupper} array to fill between, and an optional \sphinxstyleemphasis{where} argument which is a logical mask where you want to do the filling. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/pyplots/whats\_new\_98\_4\_fill\_between.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_whats_new_98_4_fill_between_0011}.png}}\caption{Whats New 98 4 Fill Between}\label{\detokenize{users/prev_whats_new/whats_new_0.98.4:id4}}\end{figure} \subsubsection{Lots more} \label{\detokenize{users/prev_whats_new/whats_new_0.98.4:lots-more}} Here are the 0.98.4 notes from the CHANGELOG: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{Added} \PYG{n}{mdehoon}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{s native macosx backend from sf patch 2179017 \PYGZhy{} JDH} \PYG{n}{Removed} \PYG{n}{the} \PYG{n}{prints} \PYG{o+ow}{in} \PYG{n}{the} \PYG{n}{set\PYGZus{}}\PYG{o}{*}\PYG{n}{style} \PYG{n}{commands}\PYG{o}{.} \PYG{n}{Return} \PYG{n}{the} \PYG{n+nb}{list} \PYG{n}{of} \PYG{n}{pretty}\PYG{o}{\PYGZhy{}}\PYG{n}{printed} \PYG{n}{strings} \PYG{n}{instead} \PYG{o}{\PYGZhy{}} \PYG{n}{JDH} \PYG{n}{Some} \PYG{n}{of} \PYG{n}{the} \PYG{n}{changes} \PYG{n}{Michael} \PYG{n}{made} \PYG{n}{to} \PYG{n}{improve} \PYG{n}{the} \PYG{n}{output} \PYG{n}{of} \PYG{n}{the} \PYG{n+nb}{property} \PYG{n}{tables} \PYG{o+ow}{in} \PYG{n}{the} \PYG{n}{rest} \PYG{n}{docs} \PYG{n}{broke} \PYG{n}{of} \PYG{n}{made} \PYG{n}{difficult} \PYG{n}{to} \PYG{n}{use} \PYG{n}{some} \PYG{n}{of} \PYG{n}{the} \PYG{n}{interactive} \PYG{n}{doc} \PYG{n}{helpers}\PYG{p}{,} \PYG{n}{e}\PYG{o}{.}\PYG{n}{g}\PYG{o}{.}\PYG{p}{,} \PYG{n}{setp} \PYG{o+ow}{and} \PYG{n}{getp}\PYG{o}{.} \PYG{n}{Having} \PYG{n+nb}{all} \PYG{n}{the} \PYG{n}{rest} \PYG{n}{markup} \PYG{o+ow}{in} \PYG{n}{the} \PYG{n}{ipython} \PYG{n}{shell} \PYG{n}{also} \PYG{n}{confused} \PYG{n}{the} \PYG{n}{docstrings}\PYG{o}{.} \PYG{n}{I} \PYG{n}{added} \PYG{n}{a} \PYG{n}{new} \PYG{n}{rc} \PYG{n}{param} \PYG{n}{docstring}\PYG{o}{.}\PYG{n}{harcopy}\PYG{p}{,} \PYG{n}{to} \PYG{n+nb}{format} \PYG{n}{the} \PYG{n}{docstrings} \PYG{n}{differently} \PYG{k}{for} \PYG{n}{hardcopy} \PYG{o+ow}{and} \PYG{n}{other} \PYG{n}{use}\PYG{o}{.} \PYG{n}{The} \PYG{n}{ArtistInspector} \PYG{n}{could} \PYG{n}{use} \PYG{n}{a} \PYG{n}{little} \PYG{n}{refactoring} \PYG{n}{now} \PYG{n}{since} \PYG{n}{there} \PYG{o+ow}{is} \PYG{n}{duplication} \PYG{n}{of} \PYG{n}{effort} \PYG{n}{between} \PYG{n}{the} \PYG{n}{rest} \PYG{n}{out} \PYG{n}{put} \PYG{o+ow}{and} \PYG{n}{the} \PYG{n}{non}\PYG{o}{\PYGZhy{}}\PYG{n}{rest} \PYG{n}{output} \PYG{o}{\PYGZhy{}} \PYG{n}{JDH} \PYG{n}{Updated} \PYG{n}{spectral} \PYG{n}{methods} \PYG{p}{(}\PYG{n}{psd}\PYG{p}{,} \PYG{n}{csd}\PYG{p}{,} \PYG{n}{etc}\PYG{o}{.}\PYG{p}{)} \PYG{n}{to} \PYG{n}{scale} \PYG{n}{one}\PYG{o}{\PYGZhy{}}\PYG{n}{sided} \PYG{n}{densities} \PYG{n}{by} \PYG{n}{a} \PYG{n}{factor} \PYG{n}{of} \PYG{l+m+mi}{2} \PYG{o+ow}{and}\PYG{p}{,} \PYG{n}{optionally}\PYG{p}{,} \PYG{n}{scale} \PYG{n+nb}{all} \PYG{n}{densities} \PYG{n}{by} \PYG{n}{the} \PYG{n}{sampling} \PYG{n}{frequency}\PYG{o}{.} \PYG{n}{This} \PYG{n}{gives} \PYG{n}{better} \PYG{n}{MATLAB} \PYG{n}{compatibility}\PYG{o}{.} \PYG{o}{\PYGZhy{}}\PYG{n}{RM} \PYG{n}{Fixed} \PYG{n}{alignment} \PYG{n}{of} \PYG{n}{ticks} \PYG{o+ow}{in} \PYG{n}{colorbars}\PYG{o}{.} \PYG{o}{\PYGZhy{}}\PYG{n}{MGD} \PYG{n}{drop} \PYG{n}{the} \PYG{n}{deprecated} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{new}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{keyword} \PYG{n}{of} \PYG{n}{np}\PYG{o}{.}\PYG{n}{histogram}\PYG{p}{(}\PYG{p}{)} \PYG{k}{for} \PYG{n}{numpy} \PYG{l+m+mf}{1.2} \PYG{o+ow}{or} \PYG{n}{later}\PYG{o}{.} \PYG{o}{\PYGZhy{}}\PYG{n}{JJL} \PYG{n}{Fixed} \PYG{n}{a} \PYG{n}{bug} \PYG{o+ow}{in} \PYG{n}{svg} \PYG{n}{backend} \PYG{n}{that} \PYG{n}{new\PYGZus{}figure\PYGZus{}manager}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ignores} \PYG{n}{keywords} \PYG{n}{arguments} \PYG{n}{such} \PYG{k}{as} \PYG{n}{figsize}\PYG{p}{,} \PYG{n}{etc}\PYG{o}{.} \PYG{o}{\PYGZhy{}}\PYG{n}{JJL} \PYG{n}{Fixed} \PYG{n}{a} \PYG{n}{bug} \PYG{n}{that} \PYG{n}{the} \PYG{n}{handlelength} \PYG{n}{of} \PYG{n}{the} \PYG{n}{new} \PYG{n}{legend} \PYG{k}{class} \PYG{n+nc}{set} \PYG{n}{too} \PYG{n}{short} \PYG{n}{when} \PYG{n}{numpoints}\PYG{o}{=}\PYG{l+m+mi}{1} \PYG{o}{\PYGZhy{}}\PYG{n}{JJL} \PYG{n}{Added} \PYG{n}{support} \PYG{k}{for} \PYG{n}{data} \PYG{k}{with} \PYG{n}{units} \PYG{p}{(}\PYG{n}{e}\PYG{o}{.}\PYG{n}{g}\PYG{o}{.}\PYG{p}{,} \PYG{n}{dates}\PYG{p}{)} \PYG{n}{to} \PYG{n}{Axes}\PYG{o}{.}\PYG{n}{fill\PYGZus{}between}\PYG{o}{.} \PYG{o}{\PYGZhy{}}\PYG{n}{RM} \PYG{n}{Added} \PYG{n}{fancybox} \PYG{n}{keyword} \PYG{n}{to} \PYG{n}{legend}\PYG{o}{.} \PYG{n}{Also} \PYG{n}{applied} \PYG{n}{some} \PYG{n}{changes} \PYG{k}{for} \PYG{n}{better} \PYG{n}{look}\PYG{p}{,} \PYG{n}{including} \PYG{n}{baseline} \PYG{n}{adjustment} \PYG{n}{of} \PYG{n}{the} \PYG{n}{multiline} \PYG{n}{texts} \PYG{n}{so} \PYG{n}{that} \PYG{n}{it} \PYG{o+ow}{is} \PYG{n}{center} \PYG{n}{aligned}\PYG{o}{.} \PYG{o}{\PYGZhy{}}\PYG{n}{JJL} \PYG{n}{The} \PYG{n}{transmuter} \PYG{n}{classes} \PYG{o+ow}{in} \PYG{n}{the} \PYG{n}{patches}\PYG{o}{.}\PYG{n}{py} \PYG{n}{are} \PYG{n}{reorganized} \PYG{k}{as} \PYG{n}{subclasses} \PYG{n}{of} \PYG{n}{the} \PYG{n}{Style} \PYG{n}{classes}\PYG{o}{.} \PYG{n}{A} \PYG{n}{few} \PYG{n}{more} \PYG{n}{box} \PYG{o+ow}{and} \PYG{n}{arrow} \PYG{n}{styles} \PYG{n}{are} \PYG{n}{added}\PYG{o}{.} \PYG{o}{\PYGZhy{}}\PYG{n}{JJL} \PYG{n}{Fixed} \PYG{n}{a} \PYG{n}{bug} \PYG{o+ow}{in} \PYG{n}{the} \PYG{n}{new} \PYG{n}{legend} \PYG{k}{class} \PYG{n+nc}{that} \PYG{n}{didn}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{t allowed a tuple of} \PYG{n}{coordinate} \PYG{n}{values} \PYG{k}{as} \PYG{n}{loc}\PYG{o}{.} \PYG{o}{\PYGZhy{}}\PYG{n}{JJL} \PYG{n}{Improve} \PYG{n}{checks} \PYG{k}{for} \PYG{n}{external} \PYG{n}{dependencies}\PYG{p}{,} \PYG{n}{using} \PYG{n}{subprocess} \PYG{p}{(}\PYG{n}{instead} \PYG{n}{of} \PYG{n}{deprecated} \PYG{n}{popen}\PYG{o}{*}\PYG{p}{)} \PYG{o+ow}{and} \PYG{n}{distutils} \PYG{p}{(}\PYG{k}{for} \PYG{n}{version} \PYG{n}{checking}\PYG{p}{)} \PYG{o}{\PYGZhy{}} \PYG{n}{DSD} \PYG{n}{Reimplementation} \PYG{n}{of} \PYG{n}{the} \PYG{n}{legend} \PYG{n}{which} \PYG{n}{supports} \PYG{n}{baseline} \PYG{n}{alignment}\PYG{p}{,} \PYG{n}{multi}\PYG{o}{\PYGZhy{}}\PYG{n}{column}\PYG{p}{,} \PYG{o+ow}{and} \PYG{n}{expand} \PYG{n}{mode}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{JJL} \PYG{n}{Fixed} \PYG{n}{histogram} \PYG{n}{autoscaling} \PYG{n}{bug} \PYG{n}{when} \PYG{n}{bins} \PYG{o+ow}{or} \PYG{n+nb}{range} \PYG{n}{are} \PYG{n}{given} \PYG{n}{explicitly} \PYG{p}{(}\PYG{n}{fixes} \PYG{n}{Debian} \PYG{n}{bug} \PYG{l+m+mi}{503148}\PYG{p}{)} \PYG{o}{\PYGZhy{}} \PYG{n}{MM} \PYG{n}{Added} \PYG{n}{rcParam} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{unicode\PYGZus{}minus} \PYG{n}{which} \PYG{n}{allows} \PYG{n}{plain} \PYG{n}{hyphen} \PYG{k}{for} \PYG{n}{minus} \PYG{n}{when} \PYG{k+kc}{False} \PYG{o}{\PYGZhy{}} \PYG{n}{JDH} \PYG{n}{Added} \PYG{n}{scatterpoints} \PYG{n}{support} \PYG{o+ow}{in} \PYG{n}{Legend}\PYG{o}{.} \PYG{n}{patch} \PYG{n}{by} \PYG{n}{Erik} \PYG{n}{Tollerud} \PYG{o}{\PYGZhy{}} \PYG{n}{JJL} \PYG{n}{Fix} \PYG{n}{crash} \PYG{o+ow}{in} \PYG{n}{log} \PYG{n}{ticking}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{MGD} \PYG{n}{Added} \PYG{n}{static} \PYG{n}{helper} \PYG{n}{method} \PYG{n}{BrokenHBarCollection}\PYG{o}{.}\PYG{n}{span\PYGZus{}where} \PYG{o+ow}{and} \PYG{n}{Axes}\PYG{o}{/}\PYG{n}{pyplot} \PYG{n}{method} \PYG{n}{fill\PYGZus{}between}\PYG{o}{.} \PYG{n}{See} \PYG{n}{examples}\PYG{o}{/}\PYG{n}{pylab}\PYG{o}{/}\PYG{n}{fill\PYGZus{}between}\PYG{o}{.}\PYG{n}{py} \PYG{o}{\PYGZhy{}} \PYG{n}{JDH} \PYG{n}{Add} \PYG{n}{x\PYGZus{}isdata} \PYG{o+ow}{and} \PYG{n}{y\PYGZus{}isdata} \PYG{n}{attributes} \PYG{n}{to} \PYG{n}{Artist} \PYG{n}{instances}\PYG{p}{,} \PYG{o+ow}{and} \PYG{n}{use} \PYG{n}{them} \PYG{n}{to} \PYG{n}{determine} \PYG{n}{whether} \PYG{n}{either} \PYG{o+ow}{or} \PYG{n}{both} \PYG{n}{coordinates} \PYG{n}{are} \PYG{n}{used} \PYG{n}{when} \PYG{n}{updating} \PYG{n}{dataLim}\PYG{o}{.} \PYG{n}{This} \PYG{o+ow}{is} \PYG{n}{used} \PYG{n}{to} \PYG{n}{fix} \PYG{n}{autoscaling} \PYG{n}{problems} \PYG{n}{that} \PYG{n}{had} \PYG{n}{been} \PYG{n}{triggered} \PYG{n}{by} \PYG{n}{axhline}\PYG{p}{,} \PYG{n}{axhspan}\PYG{p}{,} \PYG{n}{axvline}\PYG{p}{,} \PYG{n}{axvspan}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{EF} \PYG{n}{Update} \PYG{n}{the} \PYG{n}{psd}\PYG{p}{(}\PYG{p}{)}\PYG{p}{,} \PYG{n}{csd}\PYG{p}{(}\PYG{p}{)}\PYG{p}{,} \PYG{n}{cohere}\PYG{p}{(}\PYG{p}{)}\PYG{p}{,} \PYG{o+ow}{and} \PYG{n}{specgram}\PYG{p}{(}\PYG{p}{)} \PYG{n}{methods} \PYG{n}{of} \PYG{n}{Axes} \PYG{o+ow}{and} \PYG{n}{the} \PYG{n}{csd}\PYG{p}{(}\PYG{p}{)} \PYG{n}{cohere}\PYG{p}{(}\PYG{p}{)}\PYG{p}{,} \PYG{o+ow}{and} \PYG{n}{specgram}\PYG{p}{(}\PYG{p}{)} \PYG{n}{functions} \PYG{o+ow}{in} \PYG{n}{mlab} \PYG{n}{to} \PYG{n}{be} \PYG{o+ow}{in} \PYG{n}{sync} \PYG{k}{with} \PYG{n}{the} \PYG{n}{changes} \PYG{n}{to} \PYG{n}{psd}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.} \PYG{n}{In} \PYG{n}{fact}\PYG{p}{,} \PYG{n}{under} \PYG{n}{the} \PYG{n}{hood}\PYG{p}{,} \PYG{n}{these} \PYG{n+nb}{all} \PYG{n}{call} \PYG{n}{the} \PYG{n}{same} \PYG{n}{core} \PYG{n}{to} \PYG{n}{do} \PYG{n}{computations}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{RM} \PYG{n}{Add} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{pad\PYGZus{}to}\PYG{l+s+s1}{\PYGZsq{}} \PYG{o+ow}{and} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{sides}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{parameters} \PYG{n}{to} \PYG{n}{mlab}\PYG{o}{.}\PYG{n}{psd}\PYG{p}{(}\PYG{p}{)} \PYG{n}{to} \PYG{n}{allow} \PYG{n}{controlling} \PYG{n}{of} \PYG{n}{zero} \PYG{n}{padding} \PYG{o+ow}{and} \PYG{n}{returning} \PYG{n}{of} \PYG{n}{negative} \PYG{n}{frequency} \PYG{n}{components}\PYG{p}{,} \PYG{n}{respectively}\PYG{o}{.} \PYG{n}{These} \PYG{n}{are} \PYG{n}{added} \PYG{o+ow}{in} \PYG{n}{a} \PYG{n}{way} \PYG{n}{that} \PYG{n}{does} \PYG{o+ow}{not} \PYG{n}{change} \PYG{n}{the} \PYG{n}{API}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{RM} \PYG{n}{Fix} \PYG{n}{handling} \PYG{n}{of} \PYG{n}{c} \PYG{n}{kwarg} \PYG{n}{by} \PYG{n}{scatter}\PYG{p}{;} \PYG{n}{generalize} \PYG{n}{is\PYGZus{}string\PYGZus{}like} \PYG{n}{to} \PYG{n}{accept} \PYG{n}{numpy} \PYG{o+ow}{and} \PYG{n}{numpy}\PYG{o}{.}\PYG{n}{ma} \PYG{n}{string} \PYG{n}{array} \PYG{n}{scalars}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{RM} \PYG{o+ow}{and} \PYG{n}{EF} \PYG{n}{Fix} \PYG{n}{a} \PYG{n}{possible} \PYG{n}{EINTR} \PYG{n}{problem} \PYG{o+ow}{in} \PYG{n}{dviread}\PYG{p}{,} \PYG{n}{which} \PYG{n}{might} \PYG{n}{help} \PYG{n}{when} \PYG{n}{saving} \PYG{n}{pdf} \PYG{n}{files} \PYG{k+kn}{from} \PYG{n+nn}{the} \PYG{n}{qt} \PYG{n}{backend}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{JKS} \PYG{n}{Fix} \PYG{n}{bug} \PYG{k}{with} \PYG{n}{zoom} \PYG{n}{to} \PYG{n}{rectangle} \PYG{o+ow}{and} \PYG{n}{twin} \PYG{n}{axes} \PYG{o}{\PYGZhy{}} \PYG{n}{MGD} \PYG{n}{Added} \PYG{n}{Jae} \PYG{n}{Joon}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{s fancy arrow, box and annotation enhancements \PYGZhy{}\PYGZhy{}} \PYG{n}{see} \PYG{n}{examples}\PYG{o}{/}\PYG{n}{pylab\PYGZus{}examples}\PYG{o}{/}\PYG{n}{annotation\PYGZus{}demo2}\PYG{o}{.}\PYG{n}{py} \PYG{n}{Autoscaling} \PYG{o+ow}{is} \PYG{n}{now} \PYG{n}{supported} \PYG{k}{with} \PYG{n}{shared} \PYG{n}{axes} \PYG{o}{\PYGZhy{}} \PYG{n}{EF} \PYG{n}{Fixed} \PYG{n}{exception} \PYG{o+ow}{in} \PYG{n}{dviread} \PYG{n}{that} \PYG{n}{happened} \PYG{k}{with} \PYG{n}{Minion} \PYG{o}{\PYGZhy{}} \PYG{n}{JKS} \PYG{n}{set\PYGZus{}xlim}\PYG{p}{,} \PYG{n}{ylim} \PYG{n}{now} \PYG{k}{return} \PYG{n}{a} \PYG{n}{copy} \PYG{n}{of} \PYG{n}{the} \PYG{n}{viewlim} \PYG{n}{array} \PYG{n}{to} \PYG{n}{avoid} \PYG{n}{modify} \PYG{n}{inplace} \PYG{n}{surprises} \PYG{n}{Added} \PYG{n}{image} \PYG{n}{thumbnail} \PYG{n}{generating} \PYG{n}{function} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{image}\PYG{o}{.}\PYG{n}{thumbnail}\PYG{o}{.} \PYG{n}{See} \PYG{n}{examples}\PYG{o}{/}\PYG{n}{misc}\PYG{o}{/}\PYG{n}{image\PYGZus{}thumbnail}\PYG{o}{.}\PYG{n}{py} \PYG{o}{\PYGZhy{}} \PYG{n}{JDH} \PYG{n}{Applied} \PYG{n}{scatleg} \PYG{n}{patch} \PYG{n}{based} \PYG{n}{on} \PYG{n}{ideas} \PYG{o+ow}{and} \PYG{n}{work} \PYG{n}{by} \PYG{n}{Erik} \PYG{n}{Tollerud} \PYG{o+ow}{and} \PYG{n}{Jae}\PYG{o}{\PYGZhy{}}\PYG{n}{Joon} \PYG{n}{Lee}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{MM} \PYG{n}{Fixed} \PYG{n}{bug} \PYG{o+ow}{in} \PYG{n}{pdf} \PYG{n}{backend}\PYG{p}{:} \PYG{k}{if} \PYG{n}{you} \PYG{k}{pass} \PYG{n}{a} \PYG{n}{file} \PYG{n+nb}{object} \PYG{k}{for} \PYG{n}{output} \PYG{n}{instead} \PYG{n}{of} \PYG{n}{a} \PYG{n}{filename}\PYG{p}{,} \PYG{n}{e}\PYG{o}{.}\PYG{n}{g}\PYG{o}{.}\PYG{p}{,} \PYG{o+ow}{in} \PYG{n}{a} \PYG{n}{wep} \PYG{n}{app}\PYG{p}{,} \PYG{n}{we} \PYG{n}{now} \PYG{n}{flush} \PYG{n}{the} \PYG{n+nb}{object} \PYG{n}{at} \PYG{n}{the} \PYG{n}{end}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{JKS} \PYG{n}{Add} \PYG{n}{path} \PYG{n}{simplification} \PYG{n}{support} \PYG{n}{to} \PYG{n}{paths} \PYG{k}{with} \PYG{n}{gaps}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{EF} \PYG{n}{Fix} \PYG{n}{problem} \PYG{k}{with} \PYG{n}{AFM} \PYG{n}{files} \PYG{n}{that} \PYG{n}{don}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{t specify the font}\PYG{l+s+s1}{\PYGZsq{}}\PYG{n}{s} \PYG{n}{full} \PYG{n}{name} \PYG{o+ow}{or} \PYG{n}{family} \PYG{n}{name}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{JKS} \PYG{n}{Added} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{scilimits}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{kwarg} \PYG{n}{to} \PYG{n}{Axes}\PYG{o}{.}\PYG{n}{ticklabel\PYGZus{}format}\PYG{p}{(}\PYG{p}{)} \PYG{n}{method}\PYG{p}{,} \PYG{k}{for} \PYG{n}{easy} \PYG{n}{access} \PYG{n}{to} \PYG{n}{the} \PYG{n}{set\PYGZus{}powerlimits} \PYG{n}{method} \PYG{n}{of} \PYG{n}{the} \PYG{n}{major} \PYG{n}{ScalarFormatter}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{EF} \PYG{n}{Experimental} \PYG{n}{new} \PYG{n}{kwarg} \PYG{n}{borderpad} \PYG{n}{to} \PYG{n}{replace} \PYG{n}{pad} \PYG{o+ow}{in} \PYG{n}{legend}\PYG{p}{,} \PYG{n}{based} \PYG{n}{on} \PYG{n}{suggestion} \PYG{n}{by} \PYG{n}{Jae}\PYG{o}{\PYGZhy{}}\PYG{n}{Joon} \PYG{n}{Lee}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{EF} \PYG{n}{Allow} \PYG{n}{spy} \PYG{n}{to} \PYG{n}{ignore} \PYG{n}{zero} \PYG{n}{values} \PYG{o+ow}{in} \PYG{n}{sparse} \PYG{n}{arrays}\PYG{p}{,} \PYG{n}{based} \PYG{n}{on} \PYG{n}{patch} \PYG{n}{by} \PYG{n}{Tony} \PYG{n}{Yu}\PYG{o}{.} \PYG{n}{Also} \PYG{n}{fixed} \PYG{n}{plot} \PYG{n}{to} \PYG{n}{handle} \PYG{n}{empty} \PYG{n}{data} \PYG{n}{arrays}\PYG{p}{,} \PYG{o+ow}{and} \PYG{n}{fixed} \PYG{n}{handling} \PYG{n}{of} \PYG{n}{markers} \PYG{o+ow}{in} \PYG{n}{figlegend}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{EF} \PYG{n}{Introduce} \PYG{n}{drawstyles} \PYG{k}{for} \PYG{n}{lines}\PYG{o}{.} \PYG{n}{Transparently} \PYG{n}{split} \PYG{n}{linestyles} \PYG{n}{like} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{steps\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{into} \PYG{n}{drawstyle} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{steps}\PYG{l+s+s1}{\PYGZsq{}} \PYG{o+ow}{and} \PYG{n}{linestyle} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{.} \PYG{n}{Legends} \PYG{n}{always} \PYG{n}{use} \PYG{n}{drawstyle} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{MM} \PYG{n}{Fixed} \PYG{n}{quiver} \PYG{o+ow}{and} \PYG{n}{quiverkey} \PYG{n}{bugs} \PYG{p}{(}\PYG{n}{failure} \PYG{n}{to} \PYG{n}{scale} \PYG{n}{properly} \PYG{n}{when} \PYG{n}{resizing}\PYG{p}{)} \PYG{o+ow}{and} \PYG{n}{added} \PYG{n}{additional} \PYG{n}{methods} \PYG{k}{for} \PYG{n}{determining} \PYG{n}{the} \PYG{n}{arrow} \PYG{n}{angles} \PYG{o}{\PYGZhy{}} \PYG{n}{EF} \PYG{n}{Fix} \PYG{n}{polar} \PYG{n}{interpolation} \PYG{n}{to} \PYG{n}{handle} \PYG{n}{negative} \PYG{n}{values} \PYG{n}{of} \PYG{n}{theta} \PYG{o}{\PYGZhy{}} \PYG{n}{MGD} \PYG{n}{Reorganized} \PYG{n}{cbook} \PYG{o+ow}{and} \PYG{n}{mlab} \PYG{n}{methods} \PYG{n}{related} \PYG{n}{to} \PYG{n}{numerical} \PYG{n}{calculations} \PYG{n}{that} \PYG{n}{have} \PYG{n}{little} \PYG{n}{to} \PYG{n}{do} \PYG{k}{with} \PYG{n}{the} \PYG{n}{goals} \PYG{n}{of} \PYG{n}{those} \PYG{n}{two} \PYG{n}{modules} \PYG{n}{into} \PYG{n}{a} \PYG{n}{separate} \PYG{n}{module} \PYG{n}{numerical\PYGZus{}methods}\PYG{o}{.}\PYG{n}{py} \PYG{n}{Also}\PYG{p}{,} \PYG{n}{added} \PYG{n}{ability} \PYG{n}{to} \PYG{n}{select} \PYG{n}{points} \PYG{o+ow}{and} \PYG{n}{stop} \PYG{n}{point} \PYG{n}{selection} \PYG{k}{with} \PYG{n}{keyboard} \PYG{o+ow}{in} \PYG{n}{ginput} \PYG{o+ow}{and} \PYG{n}{manual} \PYG{n}{contour} \PYG{n}{labeling} \PYG{n}{code}\PYG{o}{.} \PYG{n}{Finally}\PYG{p}{,} \PYG{n}{fixed} \PYG{n}{contour} \PYG{n}{labeling} \PYG{n}{bug}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{DMK} \PYG{n}{Fix} \PYG{n}{backtick} \PYG{o+ow}{in} \PYG{n}{Postscript} \PYG{n}{output}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{MGD} \PYG{p}{[} \PYG{l+m+mi}{2089958} \PYG{p}{]} \PYG{n}{Path} \PYG{n}{simplification} \PYG{k}{for} \PYG{n}{vector} \PYG{n}{output} \PYG{n}{backends} \PYG{n}{Leverage} \PYG{n}{the} \PYG{n}{simplification} \PYG{n}{code} \PYG{n}{exposed} \PYG{n}{through} \PYG{n}{path\PYGZus{}to\PYGZus{}polygons} \PYG{n}{to} \PYG{n}{simplify} \PYG{n}{certain} \PYG{n}{well}\PYG{o}{\PYGZhy{}}\PYG{n}{behaved} \PYG{n}{paths} \PYG{o+ow}{in} \PYG{n}{the} \PYG{n}{vector} \PYG{n}{backends} \PYG{p}{(}\PYG{n}{PDF}\PYG{p}{,} \PYG{n}{PS} \PYG{o+ow}{and} \PYG{n}{SVG}\PYG{p}{)}\PYG{o}{.} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{path.simplify}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{must} \PYG{n}{be} \PYG{n+nb}{set} \PYG{n}{to} \PYG{k+kc}{True} \PYG{o+ow}{in} \PYG{n}{matplotlibrc} \PYG{k}{for} \PYG{n}{this} \PYG{n}{to} \PYG{n}{work}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{MGD} \PYG{n}{Add} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{filled}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{kwarg} \PYG{n}{to} \PYG{n}{Path}\PYG{o}{.}\PYG{n}{intersects\PYGZus{}path} \PYG{o+ow}{and} \PYG{n}{Path}\PYG{o}{.}\PYG{n}{intersects\PYGZus{}bbox}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{MGD} \PYG{n}{Changed} \PYG{n}{full} \PYG{n}{arrows} \PYG{n}{slightly} \PYG{n}{to} \PYG{n}{avoid} \PYG{n}{an} \PYG{n}{xpdf} \PYG{n}{rendering} \PYG{n}{problem} \PYG{n}{reported} \PYG{n}{by} \PYG{n}{Friedrich} \PYG{n}{Hagedorn}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{JKS} \PYG{n}{Fix} \PYG{n}{conversion} \PYG{n}{of} \PYG{n}{quadratic} \PYG{n}{to} \PYG{n}{cubic} \PYG{n}{Bezier} \PYG{n}{curves} \PYG{o+ow}{in} \PYG{n}{PDF} \PYG{o+ow}{and} \PYG{n}{PS} \PYG{n}{backends}\PYG{o}{.} \PYG{n}{Patch} \PYG{n}{by} \PYG{n}{Jae}\PYG{o}{\PYGZhy{}}\PYG{n}{Joon} \PYG{n}{Lee}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{JKS} \PYG{n}{Added} \PYG{l+m+mi}{5}\PYG{o}{\PYGZhy{}}\PYG{n}{point} \PYG{n}{star} \PYG{n}{marker} \PYG{n}{to} \PYG{n}{plot} \PYG{n}{command} \PYG{n}{q}\PYG{o}{\PYGZhy{}} \PYG{n}{EF} \PYG{n}{Fix} \PYG{n}{hatching} \PYG{o+ow}{in} \PYG{n}{PS} \PYG{n}{backend} \PYG{o}{\PYGZhy{}} \PYG{n}{MGD} \PYG{n}{Fix} \PYG{n}{log} \PYG{k}{with} \PYG{n}{base} \PYG{l+m+mi}{2} \PYG{o}{\PYGZhy{}} \PYG{n}{MGD} \PYG{n}{Added} \PYG{n}{support} \PYG{k}{for} \PYG{n}{bilinear} \PYG{n}{interpolation} \PYG{o+ow}{in} \PYG{n}{NonUniformImage}\PYG{p}{;} \PYG{n}{patch} \PYG{n}{by} \PYG{n}{Gregory} \PYG{n}{Lielens}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{EF} \PYG{n}{Added} \PYG{n}{support} \PYG{k}{for} \PYG{n}{multiple} \PYG{n}{histograms} \PYG{k}{with} \PYG{n}{data} \PYG{n}{of} \PYG{n}{different} \PYG{n}{length} \PYG{o}{\PYGZhy{}} \PYG{n}{MM} \PYG{n}{Fix} \PYG{n}{step} \PYG{n}{plots} \PYG{k}{with} \PYG{n}{log} \PYG{n}{scale} \PYG{o}{\PYGZhy{}} \PYG{n}{MGD} \PYG{n}{Fix} \PYG{n}{masked} \PYG{n}{arrays} \PYG{k}{with} \PYG{n}{markers} \PYG{o+ow}{in} \PYG{n}{non}\PYG{o}{\PYGZhy{}}\PYG{n}{Agg} \PYG{n}{backends} \PYG{o}{\PYGZhy{}} \PYG{n}{MGD} \PYG{n}{Fix} \PYG{n}{clip\PYGZus{}on} \PYG{n}{kwarg} \PYG{n}{so} \PYG{n}{it} \PYG{n}{actually} \PYG{n}{works} \PYG{n}{correctly} \PYG{o}{\PYGZhy{}} \PYG{n}{MGD} \PYG{n}{Fix} \PYG{n}{locale} \PYG{n}{problems} \PYG{o+ow}{in} \PYG{n}{SVG} \PYG{n}{backend} \PYG{o}{\PYGZhy{}} \PYG{n}{MGD} \PYG{n}{fix} \PYG{n}{quiver} \PYG{n}{so} \PYG{n}{masked} \PYG{n}{values} \PYG{n}{are} \PYG{o+ow}{not} \PYG{n}{plotted} \PYG{o}{\PYGZhy{}} \PYG{n}{JSW} \PYG{n}{improve} \PYG{n}{interactive} \PYG{n}{pan}\PYG{o}{/}\PYG{n}{zoom} \PYG{o+ow}{in} \PYG{n}{qt4} \PYG{n}{backend} \PYG{n}{on} \PYG{n}{windows} \PYG{o}{\PYGZhy{}} \PYG{n}{DSD} \PYG{n}{Fix} \PYG{n}{more} \PYG{n}{bugs} \PYG{o+ow}{in} \PYG{n}{NaN}\PYG{o}{/}\PYG{n}{inf} \PYG{n}{handling}\PYG{o}{.} \PYG{n}{In} \PYG{n}{particular}\PYG{p}{,} \PYG{n}{path} \PYG{n}{simplification} \PYG{p}{(}\PYG{n}{which} \PYG{n}{does} \PYG{o+ow}{not} \PYG{n}{handle} \PYG{n}{NaNs} \PYG{o+ow}{or} \PYG{n}{infs}\PYG{p}{)} \PYG{n}{will} \PYG{n}{be} \PYG{n}{turned} \PYG{n}{off} \PYG{n}{automatically} \PYG{n}{when} \PYG{n}{infs} \PYG{o+ow}{or} \PYG{n}{NaNs} \PYG{n}{are} \PYG{n}{present}\PYG{o}{.} \PYG{n}{Also} \PYG{n}{masked} \PYG{n}{arrays} \PYG{n}{are} \PYG{n}{now} \PYG{n}{converted} \PYG{n}{to} \PYG{n}{arrays} \PYG{k}{with} \PYG{n}{NaNs} \PYG{k}{for} \PYG{n}{consistent} \PYG{n}{handling} \PYG{n}{of} \PYG{n}{masks} \PYG{o+ow}{and} \PYG{n}{NaNs} \PYG{o}{\PYGZhy{}} \PYG{n}{MGD} \PYG{o+ow}{and} \PYG{n}{EF} \PYG{n}{Added} \PYG{n}{support} \PYG{k}{for} \PYG{n}{arbitrary} \PYG{n}{rasterization} \PYG{n}{resolutions} \PYG{n}{to} \PYG{n}{the} \PYG{n}{SVG} \PYG{n}{backend}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{MW} \end{sphinxVerbatim} \subsection{New in matplotlib 0.99} \label{\detokenize{users/prev_whats_new/whats_new_0.99:new-in-matplotlib-0-99}}\label{\detokenize{users/prev_whats_new/whats_new_0.99:whats-new-0-99}}\label{\detokenize{users/prev_whats_new/whats_new_0.99::doc}} \begin{sphinxShadowBox} \sphinxstyletopictitle{Table of Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_0.99:id4}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_0.99:new-in-matplotlib-0-99}]{\sphinxcrossref{New in matplotlib 0.99}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_0.99:id5}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_0.99:new-documentation}]{\sphinxcrossref{New documentation}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_0.99:id6}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_0.99:mplot3d}]{\sphinxcrossref{mplot3d}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_0.99:id7}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_0.99:axes-grid-toolkit}]{\sphinxcrossref{axes grid toolkit}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_0.99:id8}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_0.99:axis-spine-placement}]{\sphinxcrossref{Axis spine placement}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \subsubsection{New documentation} \label{\detokenize{users/prev_whats_new/whats_new_0.99:new-documentation}} Jae-Joon Lee has written two new guides {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Legend guide}}}} and {\hyperref[\detokenize{tutorials/text/annotations:plotting-guide-annotation}]{\sphinxcrossref{\DUrole{std,std-ref}{Advanced Annotation}}}}. Michael Sarahan has written {\hyperref[\detokenize{tutorials/introductory/images:sphx-glr-tutorials-introductory-images-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Image tutorial}}}}. John Hunter has written two new tutorials on working with paths and transformations: {\hyperref[\detokenize{tutorials/advanced/path_tutorial:sphx-glr-tutorials-advanced-path-tutorial-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Path Tutorial}}}} and {\hyperref[\detokenize{tutorials/advanced/transforms_tutorial:sphx-glr-tutorials-advanced-transforms-tutorial-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Transformations Tutorial}}}}. \subsubsection{mplot3d} \label{\detokenize{users/prev_whats_new/whats_new_0.99:mplot3d}}\label{\detokenize{users/prev_whats_new/whats_new_0.99:whats-new-mplot3d}} Reinier Heeres has ported John Porter’s mplot3d over to the new matplotlib transformations framework, and it is now available as a toolkit mpl\_toolkits.mplot3d (which now comes standard with all mpl installs). See \DUrole{xref,std,std-ref}{mplot3d-examples-index} and {\hyperref[\detokenize{tutorials/toolkits/mplot3d:toolkit-mplot3d-tutorial}]{\sphinxcrossref{\DUrole{std,std-ref}{Getting started}}}} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/pyplots/whats\_new\_99\_mplot3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_whats_new_99_mplot3d_0011}.png}}\caption{Whats New 99 Mplot3d}\label{\detokenize{users/prev_whats_new/whats_new_0.99:id1}}\end{figure} \subsubsection{axes grid toolkit} \label{\detokenize{users/prev_whats_new/whats_new_0.99:axes-grid-toolkit}}\label{\detokenize{users/prev_whats_new/whats_new_0.99:whats-new-axes-grid}} Jae-Joon Lee has added a new toolkit to ease displaying multiple images in matplotlib, as well as some support for curvilinear grids to support the world coordinate system. The toolkit is included standard with all new mpl installs. See \DUrole{xref,std,std-ref}{axes\_grid1-examples-index}, \DUrole{xref,std,std-ref}{axisartist-examples-index}, {\hyperref[\detokenize{tutorials/toolkits/axes_grid:axes-grid1-users-guide-index}]{\sphinxcrossref{\DUrole{std,std-ref}{What is axes\_grid1 toolkit?}}}} and {\hyperref[\detokenize{tutorials/toolkits/axisartist:axisartist-users-guide-index}]{\sphinxcrossref{\DUrole{std,std-ref}{axisartist}}}} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/pyplots/whats\_new\_99\_axes\_grid.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_whats_new_99_axes_grid_0011}.png}}\caption{Whats New 99 Axes Grid}\label{\detokenize{users/prev_whats_new/whats_new_0.99:id2}}\end{figure} \subsubsection{Axis spine placement} \label{\detokenize{users/prev_whats_new/whats_new_0.99:axis-spine-placement}}\label{\detokenize{users/prev_whats_new/whats_new_0.99:whats-new-spine}} Andrew Straw has added the ability to place “axis spines” \textendash{} the lines that denote the data limits \textendash{} in various arbitrary locations. No longer are your axis lines constrained to be a simple rectangle around the figure \textendash{} you can turn on or off left, bottom, right and top, as well as “detach” the spine to offset it away from the data. See \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_spine\_placement\_demo.py} and {\hyperref[\detokenize{api/spines_api:matplotlib.spines.Spine}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.spines.Spine}}}}}. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/pyplots/whats\_new\_99\_spines.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_whats_new_99_spines_0011}.png}}\caption{Whats New 99 Spines}\label{\detokenize{users/prev_whats_new/whats_new_0.99:id3}}\end{figure} \subsection{New in matplotlib 1.0} \label{\detokenize{users/prev_whats_new/whats_new_1.0:new-in-matplotlib-1-0}}\label{\detokenize{users/prev_whats_new/whats_new_1.0:whats-new-1-0}}\label{\detokenize{users/prev_whats_new/whats_new_1.0::doc}} \begin{sphinxShadowBox} \sphinxstyletopictitle{Table of Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.0:id4}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.0:new-in-matplotlib-1-0}]{\sphinxcrossref{New in matplotlib 1.0}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.0:id5}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.0:html5-canvas-backend}]{\sphinxcrossref{HTML5/Canvas backend}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.0:id6}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.0:sophisticated-subplot-grid-layout}]{\sphinxcrossref{Sophisticated subplot grid layout}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.0:id7}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.0:easy-pythonic-subplots}]{\sphinxcrossref{Easy pythonic subplots}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.0:id8}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.0:contour-fixes-and-and-triplot}]{\sphinxcrossref{Contour fixes and and triplot}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.0:id9}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.0:multiple-calls-to-show-supported}]{\sphinxcrossref{multiple calls to show supported}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.0:id10}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.0:mplot3d-graphs-can-be-embedded-in-arbitrary-axes}]{\sphinxcrossref{mplot3d graphs can be embedded in arbitrary axes}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.0:id11}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.0:tick-params}]{\sphinxcrossref{tick\_params}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.0:id12}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.0:lots-of-performance-and-feature-enhancements}]{\sphinxcrossref{Lots of performance and feature enhancements}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.0:id13}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.0:much-improved-software-carpentry}]{\sphinxcrossref{Much improved software carpentry}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.0:id14}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.0:bugfix-marathon}]{\sphinxcrossref{Bugfix marathon}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \subsubsection{HTML5/Canvas backend} \label{\detokenize{users/prev_whats_new/whats_new_1.0:html5-canvas-backend}}\label{\detokenize{users/prev_whats_new/whats_new_1.0:whats-new-html5}} Simon Ratcliffe and Ludwig Schwardt have released an \sphinxhref{http://code.google.com/p/mplh5canvas/}{HTML5/Canvas} backend for matplotlib. The backend is almost feature complete, and they have done a lot of work comparing their html5 rendered images with our core renderer Agg. The backend features client/server interactive navigation of matplotlib figures in an html5 compliant browser. \subsubsection{Sophisticated subplot grid layout} \label{\detokenize{users/prev_whats_new/whats_new_1.0:sophisticated-subplot-grid-layout}} Jae-Joon Lee has written {\hyperref[\detokenize{api/gridspec_api:module-matplotlib.gridspec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gridspec}}}}}, a new module for doing complex subplot layouts, featuring row and column spans and more. See {\hyperref[\detokenize{tutorials/intermediate/gridspec:sphx-glr-tutorials-intermediate-gridspec-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Figure Layouts Using GridSpec and Other Functions}}}} for a tutorial overview. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/userdemo/demo\_gridspec01.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_demo_gridspec01_0001}.png}}\caption{Demo Gridspec01}\label{\detokenize{users/prev_whats_new/whats_new_1.0:id1}}\end{figure} \subsubsection{Easy pythonic subplots} \label{\detokenize{users/prev_whats_new/whats_new_1.0:easy-pythonic-subplots}} Fernando Perez got tired of all the boilerplate code needed to create a figure and multiple subplots when using the matplotlib API, and wrote a {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots:matplotlib.pyplot.subplots}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots()}}}}} helper function. Basic usage allows you to create the figure and an array of subplots with numpy indexing (starts with 0). e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axarr} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{axarr}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} upper, left} \end{sphinxVerbatim} See \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplot\_demo.py} for several code examples. \subsubsection{Contour fixes and and triplot} \label{\detokenize{users/prev_whats_new/whats_new_1.0:contour-fixes-and-and-triplot}} Ian Thomas has fixed a long-standing bug that has vexed our most talented developers for years. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}} now handles interior masked regions, and the boundaries of line and filled contours coincide. Additionally, he has contributed a new module {\hyperref[\detokenize{api/tri_api:module-matplotlib.tri}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tri}}}}} and helper function {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.triplot:matplotlib.pyplot.triplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{triplot()}}}}} for creating and plotting unstructured triangular grids. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/images\_contours\_and\_fields/triplot\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_triplot_demo_0011}.png}}\caption{Triplot Demo}\label{\detokenize{users/prev_whats_new/whats_new_1.0:id2}}\end{figure} \subsubsection{multiple calls to show supported} \label{\detokenize{users/prev_whats_new/whats_new_1.0:multiple-calls-to-show-supported}} A long standing request is to support multiple calls to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.show:matplotlib.pyplot.show}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{show()}}}}}. This has been difficult because it is hard to get consistent behavior across operating systems, user interface toolkits and versions. Eric Firing has done a lot of work on rationalizing show across backends, with the desired behavior to make show raise all newly created figures and block execution until they are closed. Repeated calls to show should raise newly created figures since the last call. Eric has done a lot of testing on the user interface toolkits and versions and platforms he has access to, but it is not possible to test them all, so please report problems to the \sphinxhref{https://mail.python.org/mailman/listinfo/matplotlib-users}{mailing list} and \sphinxhref{https://github.com/matplotlib/matplotlib/issues}{bug tracker}. \subsubsection{mplot3d graphs can be embedded in arbitrary axes} \label{\detokenize{users/prev_whats_new/whats_new_1.0:mplot3d-graphs-can-be-embedded-in-arbitrary-axes}} You can now place an mplot3d graph into an arbitrary axes location, supporting mixing of 2D and 3D graphs in the same figure, and/or multiple 3D graphs in a single figure, using the “projection” keyword argument to add\_axes or add\_subplot. Thanks Ben Root. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/pyplots/whats\_new\_1\_subplot3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_whats_new_1_subplot3d_0011}.png}}\caption{Whats New 1 Subplot3d}\label{\detokenize{users/prev_whats_new/whats_new_1.0:id3}}\end{figure} \subsubsection{tick\_params} \label{\detokenize{users/prev_whats_new/whats_new_1.0:tick-params}} Eric Firing wrote tick\_params, a convenience method for changing the appearance of ticks and tick labels. See pyplot function {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tick_params:matplotlib.pyplot.tick_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tick\_params()}}}}} and associated Axes method {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.tick_params:matplotlib.axes.Axes.tick_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tick\_params()}}}}}. \subsubsection{Lots of performance and feature enhancements} \label{\detokenize{users/prev_whats_new/whats_new_1.0:lots-of-performance-and-feature-enhancements}}\begin{itemize} \item {} Faster magnification of large images, and the ability to zoom in to a single pixel \item {} Local installs of documentation work better \item {} Improved “widgets” \textendash{} mouse grabbing is supported \item {} More accurate snapping of lines to pixel boundaries \item {} More consistent handling of color, particularly the alpha channel, throughout the API \end{itemize} \subsubsection{Much improved software carpentry} \label{\detokenize{users/prev_whats_new/whats_new_1.0:much-improved-software-carpentry}} The matplotlib trunk is probably in as good a shape as it has ever been, thanks to improved \sphinxhref{http://software-carpentry.org/}{software carpentry}. We now have a \sphinxhref{https://buildbot.net}{buildbot} which runs a suite of \sphinxhref{http://code.google.com/p/python-nose/}{nose} regression tests on every svn commit, auto-generating a set of images and comparing them against a set of known-goods, sending emails to developers on failures with a pixel-by-pixel image comparison. Releases and release bugfixes happen in branches, allowing active new feature development to happen in the trunk while keeping the release branches stable. Thanks to Andrew Straw, Michael Droettboom and other matplotlib developers for the heavy lifting. \subsubsection{Bugfix marathon} \label{\detokenize{users/prev_whats_new/whats_new_1.0:bugfix-marathon}} Eric Firing went on a bug fixing and closing marathon, closing over 100 bugs on the \sphinxhref{http://sourceforge.net/tracker/?group\_id=80706\&atid=560720}{bug tracker} with help from Jae-Joon Lee, Michael Droettboom, Christoph Gohlke and Michiel de Hoon. \subsection{New in matplotlib 1.1} \label{\detokenize{users/prev_whats_new/whats_new_1.1:new-in-matplotlib-1-1}}\label{\detokenize{users/prev_whats_new/whats_new_1.1:whats-new-1-1}}\label{\detokenize{users/prev_whats_new/whats_new_1.1::doc}} \begin{sphinxShadowBox} \sphinxstyletopictitle{Table of Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.1:id5}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.1:new-in-matplotlib-1-1}]{\sphinxcrossref{New in matplotlib 1.1}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.1:id6}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.1:sankey-diagrams}]{\sphinxcrossref{Sankey Diagrams}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.1:id7}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.1:animation}]{\sphinxcrossref{Animation}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.1:id8}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.1:tight-layout}]{\sphinxcrossref{Tight Layout}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.1:id9}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.1:pyqt4-pyside-and-ipython}]{\sphinxcrossref{PyQT4, PySide, and IPython}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.1:id10}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.1:legend}]{\sphinxcrossref{Legend}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.1:id11}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.1:mplot3d}]{\sphinxcrossref{mplot3d}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.1:id12}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.1:numerix-support-removed}]{\sphinxcrossref{Numerix support removed}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.1:id13}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.1:markers}]{\sphinxcrossref{Markers}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.1:id14}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.1:other-improvements}]{\sphinxcrossref{Other improvements}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \begin{sphinxadmonition}{note}{Note:} matplotlib 1.1 supports Python 2.4 to 2.7 \end{sphinxadmonition} \subsubsection{Sankey Diagrams} \label{\detokenize{users/prev_whats_new/whats_new_1.1:sankey-diagrams}} Kevin Davies has extended Yannick Copin’s original Sankey example into a module ({\hyperref[\detokenize{api/sankey_api:module-matplotlib.sankey}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sankey}}}}}) and provided new examples (\DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_sankey\_basics.py}, \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_sankey\_links.py}, \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_sankey\_rankine.py}). \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/api/sankey\_rankine.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_sankey_rankine_0011}.png}}\caption{Sankey Rankine}\label{\detokenize{users/prev_whats_new/whats_new_1.1:id1}}\end{figure} \subsubsection{Animation} \label{\detokenize{users/prev_whats_new/whats_new_1.1:animation}} Ryan May has written a backend-independent framework for creating animated figures. The {\hyperref[\detokenize{api/animation_api:module-matplotlib.animation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animation}}}}} module is intended to replace the backend-specific examples formerly in the \DUrole{xref,std,std-ref}{examples-index} listings. Examples using the new framework are in \DUrole{xref,std,std-ref}{animation-examples-index}; see the entrancing \sphinxcode{\sphinxupquote{double pendulum \textless{}gallery/animation/double\_pendulum\_sgskip.py\textgreater{}}} which uses {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.save}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.animation.Animation.save()}}}}} to create the movie below. This should be considered as a beta release of the framework; please try it and provide feedback. \subsubsection{Tight Layout} \label{\detokenize{users/prev_whats_new/whats_new_1.1:tight-layout}} A frequent issue raised by users of matplotlib is the lack of a layout engine to nicely space out elements of the plots. While matplotlib still adheres to the philosophy of giving users complete control over the placement of plot elements, Jae-Joon Lee created the {\hyperref[\detokenize{api/tight_layout_api:module-matplotlib.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout}}}}} module and introduced a new command {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tight_layout:matplotlib.pyplot.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout()}}}}} to address the most common layout issues. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{whats_new_1-1-1_00_00}.pdf} \end{figure} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{whats_new_1-1-1_01_00}.pdf} \end{figure} The usage of this functionality can be as simple as \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{tight\PYGZus{}layout}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} and it will adjust the spacing between subplots so that the axis labels do not overlap with neighboring subplots. A {\hyperref[\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-tutorials-intermediate-tight-layout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Tight Layout guide}}}} has been created to show how to use this new tool. \subsubsection{PyQT4, PySide, and IPython} \label{\detokenize{users/prev_whats_new/whats_new_1.1:pyqt4-pyside-and-ipython}} Gerald Storer made the Qt4 backend compatible with PySide as well as PyQT4. At present, however, PySide does not support the PyOS\_InputHook mechanism for handling gui events while waiting for text input, so it cannot be used with the new version 0.11 of \sphinxhref{http://ipython.org}{IPython}. Until this feature appears in PySide, IPython users should use the PyQT4 wrapper for QT4, which remains the matplotlib default. An rcParam entry, “backend.qt4”, has been added to allow users to select PyQt4, PyQt4v2, or PySide. The latter two use the Version 2 Qt API. In most cases, users can ignore this rcParam variable; it is available to aid in testing, and to provide control for users who are embedding matplotlib in a PyQt4 or PySide app. \subsubsection{Legend} \label{\detokenize{users/prev_whats_new/whats_new_1.1:legend}} Jae-Joon Lee has improved plot legends. First, legends for complex plots such as {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.stem:matplotlib.pyplot.stem}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stem()}}}}} plots will now display correctly. Second, the ‘best’ placement of a legend has been improved in the presence of NANs. See the {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Legend guide}}}} for more detailed explanation and examples. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/text\_labels\_and\_annotations/legend\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_legend_demo_0041}.png}}\caption{Legend Demo4}\label{\detokenize{users/prev_whats_new/whats_new_1.1:id2}}\end{figure} \subsubsection{mplot3d} \label{\detokenize{users/prev_whats_new/whats_new_1.1:mplot3d}} In continuing the efforts to make 3D plotting in matplotlib just as easy as 2D plotting, Ben Root has made several improvements to the \sphinxcode{\sphinxupquote{mplot3d}} module. \begin{itemize} \item {} {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes3D}}}}} has been improved to bring the class towards feature-parity with regular Axes objects \item {} Documentation for {\hyperref[\detokenize{tutorials/toolkits/mplot3d:toolkit-mplot3d-tutorial}]{\sphinxcrossref{\DUrole{std,std-ref}{Getting started}}}} was significantly expanded \item {} Axis labels and orientation improved \item {} Most 3D plotting functions now support empty inputs \item {} Ticker offset display added: \end{itemize} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/offset.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_offset_0011}.png}}\caption{Offset}\label{\detokenize{users/prev_whats_new/whats_new_1.1:id3}}\end{figure} \begin{itemize} \item {} {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}} gains \sphinxstyleemphasis{zdir} and \sphinxstyleemphasis{offset} kwargs. You can now do this: \end{itemize} \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/contourf3d\_2.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_contourf3d_2_0012}.png}}\caption{Contourf3d 2}\label{\detokenize{users/prev_whats_new/whats_new_1.1:id4}}\end{figure} \subsubsection{Numerix support removed} \label{\detokenize{users/prev_whats_new/whats_new_1.1:numerix-support-removed}} After more than two years of deprecation warnings, Numerix support has now been completely removed from matplotlib. \subsubsection{Markers} \label{\detokenize{users/prev_whats_new/whats_new_1.1:markers}} The list of available markers for {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.scatter:matplotlib.pyplot.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter()}}}}} has now been merged. While they were mostly similar, some markers existed for one function, but not the other. This merge did result in a conflict for the ‘d’ diamond marker. Now, ‘d’ will be interpreted to always mean “thin” diamond while ‘D’ will mean “regular” diamond. Thanks to Michael Droettboom for this effort. \subsubsection{Other improvements} \label{\detokenize{users/prev_whats_new/whats_new_1.1:other-improvements}}\begin{itemize} \item {} Unit support for polar axes and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.arrow:matplotlib.axes.Axes.arrow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{arrow()}}}}} \item {} {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolarAxes}}}}} gains getters and setters for “theta\_direction”, and “theta\_offset” to allow for theta to go in either the clock-wise or counter-clockwise direction and to specify where zero degrees should be placed. {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_theta_zero_location}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_theta\_zero\_location()}}}}} is an added convenience function. \item {} Fixed error in argument handling for tri-functions such as {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tripcolor:matplotlib.pyplot.tripcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tripcolor()}}}}} \item {} \sphinxcode{\sphinxupquote{axes.labelweight}} parameter added to rcParams. \item {} For {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow()}}}}}, \sphinxstyleemphasis{interpolation=’nearest’} will now always perform an interpolation. A “none” option has been added to indicate no interpolation at all. \item {} An error in the Hammer projection has been fixed. \item {} \sphinxstyleemphasis{clabel} for {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}} now accepts a callable. Thanks to Daniel Hyams for the original patch. \item {} Jae-Joon Lee added the \sphinxcode{\sphinxupquote{HBox}} and \sphinxcode{\sphinxupquote{VBox}} classes. \item {} Christoph Gohlke reduced memory usage in {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow()}}}}}. \item {} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.scatter:matplotlib.pyplot.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter()}}}}} now accepts empty inputs. \item {} The behavior for ‘symlog’ scale has been fixed, but this may result in some minor changes to existing plots. This work was refined by ssyr. \item {} Peter Butterworth added named figure support to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figure:matplotlib.pyplot.figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure()}}}}}. \item {} Michiel de Hoon has modified the MacOSX backend to make its interactive behavior consistent with the other backends. \item {} Pim Schellart added a new colormap called “cubehelix”. Sameer Grover also added a colormap called “coolwarm”. See it and all other colormaps {\hyperref[\detokenize{tutorials/colors/colormaps:color-colormaps-reference}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}}. \item {} Many bug fixes and documentation improvements. \end{itemize} \subsection{New in matplotlib 1.2} \label{\detokenize{users/prev_whats_new/whats_new_1.2:new-in-matplotlib-1-2}}\label{\detokenize{users/prev_whats_new/whats_new_1.2:whats-new-1-2}}\label{\detokenize{users/prev_whats_new/whats_new_1.2::doc}} \begin{sphinxShadowBox} \sphinxstyletopictitle{Table of Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2:id6}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2:new-in-matplotlib-1-2}]{\sphinxcrossref{New in matplotlib 1.2}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2:id7}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2:python-3-x-support}]{\sphinxcrossref{Python 3.x support}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2:id8}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2:pgf-tikz-backend}]{\sphinxcrossref{PGF/TikZ backend}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2:id9}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2:locator-interface}]{\sphinxcrossref{Locator interface}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2:id10}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2:tri-surface-plots}]{\sphinxcrossref{Tri-Surface Plots}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2:id11}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2:control-the-lengths-of-colorbar-extensions}]{\sphinxcrossref{Control the lengths of colorbar extensions}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2:id12}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2:figures-are-picklable}]{\sphinxcrossref{Figures are picklable}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2:id13}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2:set-default-bounding-box-in-matplotlibrc}]{\sphinxcrossref{Set default bounding box in matplotlibrc}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2:id14}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2:new-boxplot-functionality}]{\sphinxcrossref{New Boxplot Functionality}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2:id15}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2:new-rc-parameter-functionality}]{\sphinxcrossref{New RC parameter functionality}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2:id16}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2:streamplot}]{\sphinxcrossref{Streamplot}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2:id17}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2:new-hist-functionality}]{\sphinxcrossref{New hist functionality}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2:id18}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2:updated-shipped-dependencies}]{\sphinxcrossref{Updated shipped dependencies}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2:id19}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2:face-centred-colors-in-tripcolor-plots}]{\sphinxcrossref{Face-centred colors in tripcolor plots}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2:id20}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2:hatching-patterns-in-filled-contour-plots-with-legends}]{\sphinxcrossref{Hatching patterns in filled contour plots, with legends}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2:id21}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2:known-issues-in-the-matplotlib-1-2-release}]{\sphinxcrossref{Known issues in the matplotlib 1.2 release}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \begin{sphinxadmonition}{note}{Note:} matplotlib 1.2 supports Python 2.6, 2.7, and 3.1 \end{sphinxadmonition} \subsubsection{Python 3.x support} \label{\detokenize{users/prev_whats_new/whats_new_1.2:python-3-x-support}} Matplotlib 1.2 is the first version to support Python 3.x, specifically Python 3.1 and 3.2. To make this happen in a reasonable way, we also had to drop support for Python versions earlier than 2.6. This work was done by Michael Droettboom, the Cape Town Python Users’ Group, many others and supported financially in part by the SAGE project. The following GUI backends work under Python 3.x: Gtk3Cairo, Qt4Agg, TkAgg and MacOSX. The other GUI backends do not yet have adequate bindings for Python 3.x, but continue to work on Python 2.6 and 2.7, particularly the Qt and QtAgg backends (which have been deprecated). The non-GUI backends, such as PDF, PS and SVG, work on both Python 2.x and 3.x. Features that depend on the Python Imaging Library, such as JPEG handling, do not work, since the version of PIL for Python 3.x is not sufficiently mature. \subsubsection{PGF/TikZ backend} \label{\detokenize{users/prev_whats_new/whats_new_1.2:pgf-tikz-backend}} Peter Würtz wrote a backend that allows matplotlib to export figures as drawing commands for LaTeX. These can be processed by PdfLaTeX, XeLaTeX or LuaLaTeX using the PGF/TikZ package. Usage examples and documentation are found in {\hyperref[\detokenize{tutorials/text/pgf:sphx-glr-tutorials-text-pgf-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Typesetting With XeLaTeX/LuaLaTeX}}}}. \noindent\sphinxincludegraphics{{pgf_preamble}.pdf} \subsubsection{Locator interface} \label{\detokenize{users/prev_whats_new/whats_new_1.2:locator-interface}} Philip Elson exposed the intelligence behind the tick Locator classes with a simple interface. For instance, to get no more than 5 sensible steps which span the values 10 and 19.5: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{ticker} \PYG{k}{as} \PYG{n+nn}{mticker} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{locator} \PYG{o}{=} \PYG{n}{mticker}\PYG{o}{.}\PYG{n}{MaxNLocator}\PYG{p}{(}\PYG{n}{nbins}\PYG{o}{=}\PYG{l+m+mi}{5}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{locator}\PYG{o}{.}\PYG{n}{tick\PYGZus{}values}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mf}{19.5}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{[ 10. 12. 14. 16. 18. 20.]} \end{sphinxVerbatim} \subsubsection{Tri-Surface Plots} \label{\detokenize{users/prev_whats_new/whats_new_1.2:tri-surface-plots}} Damon McDougall added a new plotting method for the \sphinxcode{\sphinxupquote{mplot3d}} toolkit called {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.plot_trisurf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot\_trisurf()}}}}}. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/trisurf3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_trisurf3d_0012}.png}}\caption{Trisurf3d}\label{\detokenize{users/prev_whats_new/whats_new_1.2:id1}}\end{figure} \subsubsection{Control the lengths of colorbar extensions} \label{\detokenize{users/prev_whats_new/whats_new_1.2:control-the-lengths-of-colorbar-extensions}} Andrew Dawson added a new keyword argument \sphinxstyleemphasis{extendfrac} to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.colorbar:matplotlib.pyplot.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} to control the length of minimum and maximum colorbar extensions. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{whats_new_1-2-1}.pdf} \end{figure} \subsubsection{Figures are picklable} \label{\detokenize{users/prev_whats_new/whats_new_1.2:figures-are-picklable}} Philip Elson added an experimental feature to make figures picklable for quick and easy short-term storage of plots. Pickle files are not designed for long term storage, are unsupported when restoring a pickle saved in another matplotlib version and are insecure when restoring a pickle from an untrusted source. Having said this, they are useful for short term storage for later modification inside matplotlib. \subsubsection{Set default bounding box in matplotlibrc} \label{\detokenize{users/prev_whats_new/whats_new_1.2:set-default-bounding-box-in-matplotlibrc}} Two new defaults are available in the matplotlibrc configuration file: \sphinxcode{\sphinxupquote{savefig.bbox}}, which can be set to ‘standard’ or ‘tight’, and \sphinxcode{\sphinxupquote{savefig.pad\_inches}}, which controls the bounding box padding. \subsubsection{New Boxplot Functionality} \label{\detokenize{users/prev_whats_new/whats_new_1.2:new-boxplot-functionality}} Users can now incorporate their own methods for computing the median and its confidence intervals into the \sphinxcode{\sphinxupquote{boxplot()}} method. For every column of data passed to boxplot, the user can specify an accompanying median and confidence interval. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/statistics/boxplot\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_boxplot_demo_0031}.png}}\caption{Boxplot Demo3}\label{\detokenize{users/prev_whats_new/whats_new_1.2:id2}}\end{figure} \subsubsection{New RC parameter functionality} \label{\detokenize{users/prev_whats_new/whats_new_1.2:new-rc-parameter-functionality}} Matthew Emmett added a function and a context manager to help manage RC parameters: {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rc_file}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rc\_file()}}}}} and {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rc_context}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rc\_context}}}}}. To load RC parameters from a file: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rc\PYGZus{}file}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{mpl.rc}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} To temporarily use RC parameters: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k}{with} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rc\PYGZus{}context}\PYG{p}{(}\PYG{n}{fname}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{mpl.rc}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{rc}\PYG{o}{=}\PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{text.usetex}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{k+kc}{True}\PYG{p}{\PYGZcb{}}\PYG{p}{)}\PYG{p}{:} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} } \PYG{o}{.}\PYG{o}{.}\PYG{o}{.} \end{sphinxVerbatim} \subsubsection{Streamplot} \label{\detokenize{users/prev_whats_new/whats_new_1.2:streamplot}} Tom Flannaghan and Tony Yu have added a new {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.streamplot:matplotlib.pyplot.streamplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{streamplot()}}}}} function to plot the streamlines of a vector field. This has been a long-requested feature and complements the existing {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.quiver:matplotlib.pyplot.quiver}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{quiver()}}}}} function for plotting vector fields. In addition to simply plotting the streamlines of the vector field, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.streamplot:matplotlib.pyplot.streamplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{streamplot()}}}}} allows users to map the colors and/or line widths of the streamlines to a separate parameter, such as the speed or local intensity of the vector field. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/images\_contours\_and\_fields/plot\_streamplot.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_plot_streamplot_0012}.png}}\caption{Plot Streamplot}\label{\detokenize{users/prev_whats_new/whats_new_1.2:id3}}\end{figure} \subsubsection{New hist functionality} \label{\detokenize{users/prev_whats_new/whats_new_1.2:new-hist-functionality}} Nic Eggert added a new \sphinxcode{\sphinxupquote{stacked}} kwarg to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hist:matplotlib.pyplot.hist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hist()}}}}} that allows creation of stacked histograms using any of the histogram types. Previously, this functionality was only available by using the \sphinxcode{\sphinxupquote{barstacked}} histogram type. Now, when \sphinxcode{\sphinxupquote{stacked=True}} is passed to the function, any of the histogram types can be stacked. The \sphinxcode{\sphinxupquote{barstacked}} histogram type retains its previous functionality for backwards compatibility. \subsubsection{Updated shipped dependencies} \label{\detokenize{users/prev_whats_new/whats_new_1.2:updated-shipped-dependencies}} The following dependencies that ship with matplotlib and are optionally installed alongside it have been updated: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{pytz}} 2012d \item {} \sphinxcode{\sphinxupquote{dateutil}} 1.5 on Python 2.x, and 2.1 on Python 3.x \end{itemize} \subsubsection{Face-centred colors in tripcolor plots} \label{\detokenize{users/prev_whats_new/whats_new_1.2:face-centred-colors-in-tripcolor-plots}} Ian Thomas extended {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tripcolor:matplotlib.pyplot.tripcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tripcolor()}}}}} to allow one color value to be specified for each triangular face rather than for each point in a triangulation. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/images\_contours\_and\_fields/tripcolor\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_tripcolor_demo_0011}.png}}\caption{Tripcolor Demo}\label{\detokenize{users/prev_whats_new/whats_new_1.2:id4}}\end{figure} \subsubsection{Hatching patterns in filled contour plots, with legends} \label{\detokenize{users/prev_whats_new/whats_new_1.2:hatching-patterns-in-filled-contour-plots-with-legends}} Phil Elson added support for hatching to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}}, together with the ability to use a legend to identify contoured ranges. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/images\_contours\_and\_fields/contourf\_hatching.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_contourf_hatching_0011}.png}}\caption{Contourf Hatching}\label{\detokenize{users/prev_whats_new/whats_new_1.2:id5}}\end{figure} \subsubsection{Known issues in the matplotlib 1.2 release} \label{\detokenize{users/prev_whats_new/whats_new_1.2:known-issues-in-the-matplotlib-1-2-release}}\begin{itemize} \item {} When using the Qt4Agg backend with IPython 0.11 or later, the save dialog will not display. This should be fixed in a future version of IPython. \end{itemize} \subsection{New in matplotlib 1.2.2} \label{\detokenize{users/prev_whats_new/whats_new_1.2.2:new-in-matplotlib-1-2-2}}\label{\detokenize{users/prev_whats_new/whats_new_1.2.2:whats-new-1-2-2}}\label{\detokenize{users/prev_whats_new/whats_new_1.2.2::doc}} \begin{sphinxShadowBox} \sphinxstyletopictitle{Table of Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2.2:id1}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2.2:new-in-matplotlib-1-2-2}]{\sphinxcrossref{New in matplotlib 1.2.2}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2.2:id2}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2.2:improved-collections}]{\sphinxcrossref{Improved collections}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.2.2:id3}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.2.2:multiple-images-on-same-axes-are-correctly-transparent}]{\sphinxcrossref{Multiple images on same axes are correctly transparent}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \subsubsection{Improved collections} \label{\detokenize{users/prev_whats_new/whats_new_1.2.2:improved-collections}} The individual items of a collection may now have different alpha values and be rendered correctly. This also fixes a bug where collections were always filled in the PDF backend. \subsubsection{Multiple images on same axes are correctly transparent} \label{\detokenize{users/prev_whats_new/whats_new_1.2.2:multiple-images-on-same-axes-are-correctly-transparent}} When putting multiple images onto the same axes, the background color of the axes will now show through correctly. \subsection{New in matplotlib 1.3} \label{\detokenize{users/prev_whats_new/whats_new_1.3:new-in-matplotlib-1-3}}\label{\detokenize{users/prev_whats_new/whats_new_1.3:whats-new-1-3}}\label{\detokenize{users/prev_whats_new/whats_new_1.3::doc}} \begin{sphinxShadowBox} \sphinxstyletopictitle{Table of Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.3:id7}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.3:new-in-matplotlib-1-3}]{\sphinxcrossref{New in matplotlib 1.3}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.3:id8}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.3:new-in-1-3-1}]{\sphinxcrossref{New in 1.3.1}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.3:id9}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.3:new-plotting-features}]{\sphinxcrossref{New plotting features}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.3:id10}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.3:updated-axes3d-contour-methods}]{\sphinxcrossref{Updated Axes3D.contour methods}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.3:id11}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.3:drawing}]{\sphinxcrossref{Drawing}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.3:id12}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.3:text}]{\sphinxcrossref{Text}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.3:id13}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.3:configuration-rcparams}]{\sphinxcrossref{Configuration (rcParams)}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.3:id14}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.3:backends}]{\sphinxcrossref{Backends}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.3:id15}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.3:documentation-and-examples}]{\sphinxcrossref{Documentation and examples}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.3:id16}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.3:infrastructure}]{\sphinxcrossref{Infrastructure}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \begin{sphinxadmonition}{note}{Note:} matplotlib 1.3 supports Python 2.6, 2.7, 3.2, and 3.3 \end{sphinxadmonition} \subsubsection{New in 1.3.1} \label{\detokenize{users/prev_whats_new/whats_new_1.3:new-in-1-3-1}} 1.3.1 is a bugfix release, primarily dealing with improved setup and handling of dependencies, and correcting and enhancing the documentation. The following changes were made in 1.3.1 since 1.3.0. \paragraph{Enhancements} \label{\detokenize{users/prev_whats_new/whats_new_1.3:enhancements}}\begin{itemize} \item {} Added a context manager for creating multi-page pdfs (see {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfPages}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.PdfPages}}}}}). \item {} The WebAgg backend should now have lower latency over heterogeneous Internet connections. \end{itemize} \paragraph{Bug fixes} \label{\detokenize{users/prev_whats_new/whats_new_1.3:bug-fixes}}\begin{itemize} \item {} Histogram plots now contain the endline. \item {} Fixes to the Molleweide projection. \item {} Handling recent fonts from Microsoft and Macintosh-style fonts with non-ascii metadata is improved. \item {} Hatching of fill between plots now works correctly in the PDF backend. \item {} Tight bounding box support now works in the PGF backend. \item {} Transparent figures now display correctly in the Qt4Agg backend. \item {} Drawing lines from one subplot to another now works. \item {} Unit handling on masked arrays has been improved. \end{itemize} \paragraph{Setup and dependencies} \label{\detokenize{users/prev_whats_new/whats_new_1.3:setup-and-dependencies}}\begin{itemize} \item {} Now works with any version of pyparsing 1.5.6 or later, without displaying hundreds of warnings. \item {} Now works with 64-bit versions of Ghostscript on MS-Windows. \item {} When installing from source into an environment without Numpy, Numpy will first be downloaded and built and then used to build matplotlib. \item {} Externally installed backends are now always imported using a fully-qualified path to the module. \item {} Works with newer version of wxPython. \item {} Can now build with a PyCXX installed globally on the system from source. \item {} Better detection of Gtk3 dependencies. \end{itemize} \paragraph{Testing} \label{\detokenize{users/prev_whats_new/whats_new_1.3:testing}}\begin{itemize} \item {} Tests should now work in non-English locales. \item {} PEP8 conformance tests now report on locations of issues. \end{itemize} \subsubsection{New plotting features} \label{\detokenize{users/prev_whats_new/whats_new_1.3:new-plotting-features}} \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{xkcd}}-style sketch plotting} \label{\detokenize{users/prev_whats_new/whats_new_1.3:xkcd-style-sketch-plotting}} To give your plots a sense of authority that they may be missing, Michael Droettboom (inspired by the work of many others in \sphinxhref{https://github.com/matplotlib/matplotlib/pull/1329/}{PR \#1329}) has added an \sphinxhref{http://xkcd.com/}{xkcd-style} sketch plotting mode. To use it, simply call {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xkcd:matplotlib.pyplot.xkcd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.xkcd()}}}}} before creating your plot. For really fine control, it is also possible to modify each artist’s sketch parameters individually with {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.Artist.set\_sketch\_params()}}}}}. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/showcase/xkcd.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_xkcd_0012}.png}}\caption{Xkcd}\label{\detokenize{users/prev_whats_new/whats_new_1.3:id1}}\end{figure} \subsubsection{Updated Axes3D.contour methods} \label{\detokenize{users/prev_whats_new/whats_new_1.3:updated-axes3d-contour-methods}} Damon McDougall updated the {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.tricontour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tricontour()}}}}} and {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.tricontourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tricontourf()}}}}} methods to allow 3D contour plots on abitrary unstructured user-specified triangulations. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/tricontour3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_tricontour3d_0011}.png}}\caption{Tricontour3d}\label{\detokenize{users/prev_whats_new/whats_new_1.3:id2}}\end{figure} \paragraph{New eventplot plot type} \label{\detokenize{users/prev_whats_new/whats_new_1.3:new-eventplot-plot-type}} Todd Jennings added a {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.eventplot:matplotlib.pyplot.eventplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{eventplot()}}}}} function to create multiple rows or columns of identical line segments \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/lines\_bars\_and\_markers/eventplot\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_eventplot_demo_0011}.png}}\caption{Eventplot Demo}\label{\detokenize{users/prev_whats_new/whats_new_1.3:id3}}\end{figure} As part of this feature, there is a new {\hyperref[\detokenize{api/collections_api:matplotlib.collections.EventCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{EventCollection}}}}} class that allows for plotting and manipulating rows or columns of identical line segments. \paragraph{Triangular grid interpolation} \label{\detokenize{users/prev_whats_new/whats_new_1.3:triangular-grid-interpolation}} Geoffroy Billotey and Ian Thomas added classes to perform interpolation within triangular grids: ({\hyperref[\detokenize{api/tri_api:matplotlib.tri.LinearTriInterpolator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LinearTriInterpolator}}}}} and {\hyperref[\detokenize{api/tri_api:matplotlib.tri.CubicTriInterpolator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CubicTriInterpolator}}}}}) and a utility class to find the triangles in which points lie ({\hyperref[\detokenize{api/tri_api:matplotlib.tri.TrapezoidMapTriFinder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TrapezoidMapTriFinder}}}}}). A helper class to perform mesh refinement and smooth contouring was also added ({\hyperref[\detokenize{api/tri_api:matplotlib.tri.UniformTriRefiner}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{UniformTriRefiner}}}}}). Finally, a class implementing some basic tools for triangular mesh improvement was added ({\hyperref[\detokenize{api/tri_api:matplotlib.tri.TriAnalyzer}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TriAnalyzer}}}}}). \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/images\_contours\_and\_fields/tricontour\_smooth\_user.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_tricontour_smooth_user_0011}.png}}\caption{Tricontour Smooth User}\label{\detokenize{users/prev_whats_new/whats_new_1.3:id4}}\end{figure} \paragraph{Baselines for stackplot} \label{\detokenize{users/prev_whats_new/whats_new_1.3:baselines-for-stackplot}} Till Stensitzki added non-zero baselines to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.stackplot:matplotlib.pyplot.stackplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stackplot()}}}}}. They may be symmetric or weighted. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/lines\_bars\_and\_markers/stackplot\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_stackplot_demo_0011}.png}}\caption{Stackplot Demo2}\label{\detokenize{users/prev_whats_new/whats_new_1.3:id5}}\end{figure} \paragraph{Rectangular colorbar extensions} \label{\detokenize{users/prev_whats_new/whats_new_1.3:rectangular-colorbar-extensions}} Andrew Dawson added a new keyword argument \sphinxstyleemphasis{extendrect} to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.colorbar:matplotlib.pyplot.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} to optionally make colorbar extensions rectangular instead of triangular. \paragraph{More robust boxplots} \label{\detokenize{users/prev_whats_new/whats_new_1.3:more-robust-boxplots}} Paul Hobson provided a fix to the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.boxplot:matplotlib.pyplot.boxplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{boxplot()}}}}} method that prevent whiskers from being drawn inside the box for oddly distributed data sets. \paragraph{Calling subplot() without arguments} \label{\detokenize{users/prev_whats_new/whats_new_1.3:calling-subplot-without-arguments}} A call to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot:matplotlib.pyplot.subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot()}}}}} without any arguments now acts the same as \sphinxcode{\sphinxupquote{subplot(111)}} or \sphinxcode{\sphinxupquote{subplot(1,1,1)}} \textendash{} it creates one axes for the whole figure. This was already the behavior for both {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axes:matplotlib.pyplot.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axes()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots:matplotlib.pyplot.subplots}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots()}}}}}, and now this consistency is shared with {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot:matplotlib.pyplot.subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot()}}}}}. \subsubsection{Drawing} \label{\detokenize{users/prev_whats_new/whats_new_1.3:drawing}} \paragraph{Independent alpha values for face and edge colors} \label{\detokenize{users/prev_whats_new/whats_new_1.3:independent-alpha-values-for-face-and-edge-colors}} Wes Campaigne modified how {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} objects are drawn such that (for backends supporting transparency) you can set different alpha values for faces and edges, by specifying their colors in RGBA format. Note that if you set the alpha attribute for the patch object (e.g. using {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_alpha()}}}}} or the \sphinxcode{\sphinxupquote{alpha}} keyword argument), that value will override the alpha components set in both the face and edge colors. \paragraph{Path effects on lines} \label{\detokenize{users/prev_whats_new/whats_new_1.3:path-effects-on-lines}} Thanks to Jae-Joon Lee, path effects now also work on plot lines. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/misc/patheffect\_demo.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_patheffect_demo_0011}.png}}\caption{Patheffect Demo}\label{\detokenize{users/prev_whats_new/whats_new_1.3:id6}}\end{figure} \paragraph{Easier creation of colormap and normalizer for levels with colors} \label{\detokenize{users/prev_whats_new/whats_new_1.3:easier-creation-of-colormap-and-normalizer-for-levels-with-colors}} Phil Elson added the {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.from_levels_and_colors:matplotlib.colors.from_levels_and_colors}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.from\_levels\_and\_colors()}}}}} function to easily create a colormap and normalizer for representation of discrete colors for plot types such as {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolormesh:matplotlib.pyplot.pcolormesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.pcolormesh()}}}}}, with a similar interface to that of \sphinxcode{\sphinxupquote{contourf()}}. \paragraph{Full control of the background color} \label{\detokenize{users/prev_whats_new/whats_new_1.3:full-control-of-the-background-color}} Wes Campaigne and Phil Elson fixed the Agg backend such that PNGs are now saved with the correct background color when \sphinxcode{\sphinxupquote{fig.patch.get\_alpha()}} is not 1. \paragraph{Improved \sphinxstyleliteralintitle{\sphinxupquote{bbox\_inches="tight"}} functionality} \label{\detokenize{users/prev_whats_new/whats_new_1.3:improved-bbox-inches-tight-functionality}} Passing \sphinxcode{\sphinxupquote{bbox\_inches="tight"}} through to \sphinxcode{\sphinxupquote{plt.save()}} now takes into account \sphinxstyleemphasis{all} artists on a figure - this was previously not the case and led to several corner cases which did not function as expected. \paragraph{Initialize a rotated rectangle} \label{\detokenize{users/prev_whats_new/whats_new_1.3:initialize-a-rotated-rectangle}} Damon McDougall extended the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}} constructor to accept an \sphinxcode{\sphinxupquote{angle}} kwarg, specifying the rotation of a rectangle in degrees. \subsubsection{Text} \label{\detokenize{users/prev_whats_new/whats_new_1.3:text}} \paragraph{Anchored text support} \label{\detokenize{users/prev_whats_new/whats_new_1.3:anchored-text-support}} The \sphinxcode{\sphinxupquote{svg}} and \sphinxcode{\sphinxupquote{pgf}} backends are now able to save text alignment information to their output formats. This allows to edit text elements in saved figures, using Inkscape for example, while preserving their intended position. For \sphinxcode{\sphinxupquote{svg}} please note that you’ll have to disable the default text-to-path conversion (\sphinxcode{\sphinxupquote{mpl.rc('svg', fonttype='none')}}). \paragraph{Better vertical text alignment and multi-line text} \label{\detokenize{users/prev_whats_new/whats_new_1.3:better-vertical-text-alignment-and-multi-line-text}} The vertical alignment of text is now consistent across backends. You may see small differences in text placement, particularly with rotated text. If you are using a custom backend, note that the \sphinxcode{\sphinxupquote{draw\_text}} renderer method is now passed the location of the baseline, not the location of the bottom of the text bounding box. Multi-line text will now leave enough room for the height of very tall or very low text, such as superscripts and subscripts. \paragraph{Left and right side axes titles} \label{\detokenize{users/prev_whats_new/whats_new_1.3:left-and-right-side-axes-titles}} Andrew Dawson added the ability to add axes titles flush with the left and right sides of the top of the axes using a new keyword argument \sphinxcode{\sphinxupquote{loc}} to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.title:matplotlib.pyplot.title}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{title()}}}}}. \paragraph{Improved manual contour plot label positioning} \label{\detokenize{users/prev_whats_new/whats_new_1.3:improved-manual-contour-plot-label-positioning}} Brian Mattern modified the manual contour plot label positioning code to interpolate along line segments and find the actual closest point on a contour to the requested position. Previously, the closest path vertex was used, which, in the case of straight contours was sometimes quite distant from the requested location. Much more precise label positioning is now possible. \subsubsection{Configuration (rcParams)} \label{\detokenize{users/prev_whats_new/whats_new_1.3:configuration-rcparams}} \paragraph{Quickly find rcParams} \label{\detokenize{users/prev_whats_new/whats_new_1.3:quickly-find-rcparams}} Phil Elson made it easier to search for rcParameters by passing a valid regular expression to {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.RcParams.find_all}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.RcParams.find\_all()}}}}}. {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.RcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.RcParams}}}}} now also has a pretty repr and str representation so that search results are printed prettily: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{rcParams}\PYG{o}{.}\PYG{n}{find\PYGZus{}all}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{.size}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{RcParams(\PYGZob{}\PYGZsq{}font.size\PYGZsq{}: 12,} \PYG{g+go}{ \PYGZsq{}xtick.major.size\PYGZsq{}: 4,} \PYG{g+go}{ \PYGZsq{}xtick.minor.size\PYGZsq{}: 2,} \PYG{g+go}{ \PYGZsq{}ytick.major.size\PYGZsq{}: 4,} \PYG{g+go}{ \PYGZsq{}ytick.minor.size\PYGZsq{}: 2\PYGZcb{})} \end{sphinxVerbatim} \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{axes.xmargin}} and \sphinxstyleliteralintitle{\sphinxupquote{axes.ymargin}} added to rcParams} \label{\detokenize{users/prev_whats_new/whats_new_1.3:axes-xmargin-and-axes-ymargin-added-to-rcparams}} \sphinxcode{\sphinxupquote{rcParam}} values (\sphinxcode{\sphinxupquote{axes.xmargin}} and \sphinxcode{\sphinxupquote{axes.ymargin}}) were added to configure the default margins used. Previously they were hard-coded to default to 0, default value of both rcParam values is 0. \paragraph{Changes to font rcParams} \label{\detokenize{users/prev_whats_new/whats_new_1.3:changes-to-font-rcparams}} The \sphinxcode{\sphinxupquote{font.*}} rcParams now affect only text objects created after the rcParam has been set, and will not retroactively affect already existing text objects. This brings their behavior in line with most other rcParams. \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{savefig.jpeg\_quality}} added to rcParams} \label{\detokenize{users/prev_whats_new/whats_new_1.3:savefig-jpeg-quality-added-to-rcparams}} rcParam value \sphinxcode{\sphinxupquote{savefig.jpeg\_quality}} was added so that the user can configure the default quality used when a figure is written as a JPEG. The default quality is 95; previously, the default quality was 75. This change minimizes the artifacting inherent in JPEG images, particularly with images that have sharp changes in color as plots often do. \subsubsection{Backends} \label{\detokenize{users/prev_whats_new/whats_new_1.3:backends}} \paragraph{WebAgg backend} \label{\detokenize{users/prev_whats_new/whats_new_1.3:webagg-backend}} Michael Droettboom, Phil Elson and others have developed a new backend, WebAgg, to display figures in a web browser. It works with animations as well as being fully interactive. \noindent\sphinxincludegraphics{{webagg_screenshot}.png} Future versions of matplotlib will integrate this backend with the IPython notebook for a fully web browser based plotting frontend. \paragraph{Remember save directory} \label{\detokenize{users/prev_whats_new/whats_new_1.3:remember-save-directory}} Martin Spacek made the save figure dialog remember the last directory saved to. The default is configurable with the new \sphinxcode{\sphinxupquote{savefig.directory}} rcParam in \sphinxcode{\sphinxupquote{matplotlibrc}}. \subsubsection{Documentation and examples} \label{\detokenize{users/prev_whats_new/whats_new_1.3:documentation-and-examples}} \paragraph{Numpydoc docstrings} \label{\detokenize{users/prev_whats_new/whats_new_1.3:numpydoc-docstrings}} Nelle Varoquaux has started an ongoing project to convert matplotlib’s docstrings to numpydoc format. See \sphinxhref{https://github.com/matplotlib/matplotlib/wiki/Mep10}{MEP10} for more information. \paragraph{Example reorganization} \label{\detokenize{users/prev_whats_new/whats_new_1.3:example-reorganization}} Tony Yu has begun work reorganizing the examples into more meaningful categories. The new gallery page is the fruit of this ongoing work. See \sphinxhref{https://github.com/matplotlib/matplotlib/wiki/MEP12}{MEP12} for more information. \paragraph{Examples now use subplots()} \label{\detokenize{users/prev_whats_new/whats_new_1.3:examples-now-use-subplots}} For the sake of brevity and clarity, most of the \DUrole{xref,std,std-ref}{examples} now use the newer {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots:matplotlib.pyplot.subplots}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots()}}}}}, which creates a figure and one (or multiple) axes object(s) in one call. The old way involved a call to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figure:matplotlib.pyplot.figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure()}}}}}, followed by one (or multiple) {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot:matplotlib.pyplot.subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot()}}}}} calls. \subsubsection{Infrastructure} \label{\detokenize{users/prev_whats_new/whats_new_1.3:infrastructure}} \paragraph{Housecleaning} \label{\detokenize{users/prev_whats_new/whats_new_1.3:housecleaning}} A number of features that were deprecated in 1.2 or earlier, or have not been in a working state for a long time have been removed. Highlights include removing the Qt version 3 backends, and the FltkAgg and Emf backends. See {\hyperref[\detokenize{api/api_changes:changes-in-1-3}]{\sphinxcrossref{\DUrole{std,std-ref}{Changes in 1.3.x}}}} for a complete list. \paragraph{New setup script} \label{\detokenize{users/prev_whats_new/whats_new_1.3:new-setup-script}} matplotlib 1.3 includes an entirely rewritten setup script. We now ship fewer dependencies with the tarballs and installers themselves. Notably, \sphinxcode{\sphinxupquote{pytz}}, \sphinxcode{\sphinxupquote{dateutil}}, \sphinxcode{\sphinxupquote{pyparsing}} and \sphinxcode{\sphinxupquote{six}} are no longer included with matplotlib. You can either install them manually first, or let \sphinxcode{\sphinxupquote{pip}} install them as dependencies along with matplotlib. It is now possible to not include certain subcomponents, such as the unit test data, in the install. See \sphinxcode{\sphinxupquote{setup.cfg.template}} for more information. \paragraph{XDG base directory support} \label{\detokenize{users/prev_whats_new/whats_new_1.3:xdg-base-directory-support}} On Linux, matplotlib now uses the \sphinxcode{\sphinxupquote{XDG base directory specification}} to find the \sphinxcode{\sphinxupquote{matplotlibrc}} configuration file. \sphinxcode{\sphinxupquote{matplotlibrc}} should now be kept in \sphinxcode{\sphinxupquote{config/matplotlib}}, rather than \sphinxcode{\sphinxupquote{matplotlib}}. If your configuration is found in the old location, it will still be used, but a warning will be displayed. \paragraph{Catch opening too many figures using pyplot} \label{\detokenize{users/prev_whats_new/whats_new_1.3:catch-opening-too-many-figures-using-pyplot}} Figures created through \sphinxcode{\sphinxupquote{pyplot.figure}} are retained until they are explicitly closed. It is therefore common for new users of matplotlib to run out of memory when creating a large series of figures in a loop without closing them. matplotlib will now display a \sphinxhref{https://docs.python.org/3/library/exceptions.html\#RuntimeWarning}{\sphinxcode{\sphinxupquote{RuntimeWarning}}} when too many figures have been opened at once. By default, this is displayed for 20 or more figures, but the exact number may be controlled using the \sphinxcode{\sphinxupquote{figure.max\_open\_warning}} rcParam. \subsection{New in matplotlib 1.4} \label{\detokenize{users/prev_whats_new/whats_new_1.4:new-in-matplotlib-1-4}}\label{\detokenize{users/prev_whats_new/whats_new_1.4:whats-new-1-4}}\label{\detokenize{users/prev_whats_new/whats_new_1.4::doc}} Thomas A. Caswell served as the release manager for the 1.4 release. \begin{sphinxShadowBox} \sphinxstyletopictitle{Table of Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.4:id3}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.4:new-in-matplotlib-1-4}]{\sphinxcrossref{New in matplotlib 1.4}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.4:id4}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.4:new-colormap}]{\sphinxcrossref{New colormap}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.4:id5}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.4:the-nbagg-backend}]{\sphinxcrossref{The nbagg backend}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.4:id6}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.4:new-plotting-features}]{\sphinxcrossref{New plotting features}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.4:id7}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.4:date-handling}]{\sphinxcrossref{Date handling}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.4:id8}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.4:configuration-rcparams}]{\sphinxcrossref{Configuration (rcParams)}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.4:id9}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.4:style-package-added}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{style}} package added}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.4:id10}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.4:backends}]{\sphinxcrossref{Backends}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.4:id11}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.4:text}]{\sphinxcrossref{Text}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.4:id12}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.4:sphinx-extensions}]{\sphinxcrossref{Sphinx extensions}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.4:id13}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.4:legend-and-patheffects-documentation}]{\sphinxcrossref{Legend and PathEffects documentation}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.4:id14}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.4:widgets}]{\sphinxcrossref{Widgets}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.4:id15}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.4:gae-integration}]{\sphinxcrossref{GAE integration}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \begin{sphinxadmonition}{note}{Note:} matplotlib 1.4 supports Python 2.6, 2.7, 3.3, and 3.4 \end{sphinxadmonition} \subsubsection{New colormap} \label{\detokenize{users/prev_whats_new/whats_new_1.4:new-colormap}} In heatmaps, a green-to-red spectrum is often used to indicate intensity of activity, but this can be problematic for the red/green colorblind. A new, colorblind-friendly colormap is now available at \sphinxcode{\sphinxupquote{matplotlib.cm.Wistia}}. This colormap maintains the red/green symbolism while achieving deuteranopic legibility through brightness variations. See \sphinxhref{https://github.com/wistia/heatmap-palette}{here} for more information. \subsubsection{The nbagg backend} \label{\detokenize{users/prev_whats_new/whats_new_1.4:the-nbagg-backend}} Phil Elson added a new backend, named “nbagg”, which enables interactive figures in a live IPython notebook session. The backend makes use of the infrastructure developed for the webagg backend, which itself gives standalone server backed interactive figures in the browser, however nbagg does not require a dedicated matplotlib server as all communications are handled through the IPython Comm machinery. As with other backends nbagg can be enabled inside the IPython notebook with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{nbagg}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} Once figures are created and then subsequently shown, they will placed in an interactive widget inside the notebook allowing panning and zooming in the same way as any other matplotlib backend. Because figures require a connection to the IPython notebook server for their interactivity, once the notebook is saved, each figure will be rendered as a static image - thus allowing non-interactive viewing of figures on services such as \sphinxhref{http://nbviewer.ipython.org/}{nbviewer}. \subsubsection{New plotting features} \label{\detokenize{users/prev_whats_new/whats_new_1.4:new-plotting-features}} \paragraph{Power-law normalization} \label{\detokenize{users/prev_whats_new/whats_new_1.4:power-law-normalization}} Ben Gamari added a power-law normalization method, {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.PowerNorm:matplotlib.colors.PowerNorm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PowerNorm}}}}}. This class maps a range of values to the interval {[}0,1{]} with power-law scaling with the exponent provided by the constructor’s \sphinxcode{\sphinxupquote{gamma}} argument. Power law normalization can be useful for, e.g., emphasizing small populations in a histogram. \paragraph{Fully customizable boxplots} \label{\detokenize{users/prev_whats_new/whats_new_1.4:fully-customizable-boxplots}} Paul Hobson overhauled the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.boxplot:matplotlib.pyplot.boxplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{boxplot()}}}}} method such that it is now completely customizable in terms of the styles and positions of the individual artists. Under the hood, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.boxplot:matplotlib.pyplot.boxplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{boxplot()}}}}} relies on a new function ({\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.boxplot_stats}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{boxplot\_stats()}}}}}), which accepts any data structure currently compatible with {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.boxplot:matplotlib.pyplot.boxplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{boxplot()}}}}}, and returns a list of dictionaries containing the positions for each element of the boxplots. Then a second method, \sphinxcode{\sphinxupquote{bxp()}} is called to draw the boxplots based on the stats. The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.boxplot:matplotlib.pyplot.boxplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{boxplot()}}}}} function can be used as before to generate boxplots from data in one step. But now the user has the flexibility to generate the statistics independently, or to modify the output of {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.boxplot_stats}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{boxplot\_stats()}}}}} prior to plotting with \sphinxcode{\sphinxupquote{bxp()}}. Lastly, each artist (e.g., the box, outliers, cap, notches) can now be toggled on or off and their styles can be passed in through individual kwargs. See the examples: \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_boxplot.py} and \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_bxp.py} Added a bool kwarg, \sphinxcode{\sphinxupquote{manage\_xticks}}, which if False disables the management of the ticks and limits on the x-axis by {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.bxp:matplotlib.axes.Axes.bxp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bxp()}}}}}. \paragraph{Support for datetime axes in 2d plots} \label{\detokenize{users/prev_whats_new/whats_new_1.4:support-for-datetime-axes-in-2d-plots}} Andrew Dawson added support for datetime axes to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolormesh:matplotlib.pyplot.pcolormesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolormesh()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:matplotlib.pyplot.pcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolor()}}}}}. \paragraph{Support for additional spectrum types} \label{\detokenize{users/prev_whats_new/whats_new_1.4:support-for-additional-spectrum-types}} Todd Jennings added support for new types of frequency spectrum plots: {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.magnitude_spectrum:matplotlib.pyplot.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.phase_spectrum:matplotlib.pyplot.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}}, and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.angle_spectrum:matplotlib.pyplot.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}}, as well as corresponding functions in mlab. He also added these spectrum types to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.specgram:matplotlib.pyplot.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}}, as well as adding support for linear scaling there (in addition to the existing dB scaling). Support for additional spectrum types was also added to {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}}. He also increased the performance for all of these functions and plot types. \paragraph{Support for detrending and windowing 2D arrays in mlab} \label{\detokenize{users/prev_whats_new/whats_new_1.4:support-for-detrending-and-windowing-2d-arrays-in-mlab}} Todd Jennings added support for 2D arrays in the {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_mean}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_mean()}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_none()}}}}}, and {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend()}}}}}, as well as adding {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.apply_window}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{apply\_window()}}}}} which support windowing 2D arrays. \paragraph{Support for strides in mlab} \label{\detokenize{users/prev_whats_new/whats_new_1.4:support-for-strides-in-mlab}} Todd Jennings added some functions to mlab to make it easier to use numpy strides to create memory-efficient 2D arrays. This includes {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.stride_repeat}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stride\_repeat()}}}}}, which repeats an array to create a 2D array, and {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.stride_windows}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stride\_windows()}}}}}, which uses a moving window to create a 2D array from a 1D array. \paragraph{Formatter for new-style formatting strings} \label{\detokenize{users/prev_whats_new/whats_new_1.4:formatter-for-new-style-formatting-strings}} Added \sphinxcode{\sphinxupquote{FormatStrFormatterNewStyle}} which does the same job as \sphinxcode{\sphinxupquote{FormatStrFormatter}}, but accepts new-style formatting strings instead of printf-style formatting strings \paragraph{Consistent grid sizes in streamplots} \label{\detokenize{users/prev_whats_new/whats_new_1.4:consistent-grid-sizes-in-streamplots}} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.streamplot:matplotlib.pyplot.streamplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{streamplot()}}}}} uses a base grid size of 30x30 for both \sphinxcode{\sphinxupquote{density=1}} and \sphinxcode{\sphinxupquote{density=(1, 1)}}. Previously a grid size of 30x30 was used for \sphinxcode{\sphinxupquote{density=1}}, but a grid size of 25x25 was used for \sphinxcode{\sphinxupquote{density=(1, 1)}}. \paragraph{Get a list of all tick labels (major and minor)} \label{\detokenize{users/prev_whats_new/whats_new_1.4:get-a-list-of-all-tick-labels-major-and-minor}} Added the \sphinxcode{\sphinxupquote{kwarg}} ‘which’ to \sphinxcode{\sphinxupquote{get\_xticklabels()}}, \sphinxcode{\sphinxupquote{get\_yticklabels()}} and \sphinxcode{\sphinxupquote{get\_ticklabels()}}. ‘which’ can be ‘major’, ‘minor’, or ‘both’ select which ticks to return, like \sphinxcode{\sphinxupquote{set\_ticks\_position()}}. If ‘which’ is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}} then the old behaviour (controlled by the bool \sphinxcode{\sphinxupquote{minor}}). \paragraph{Separate horizontal/vertical axes padding support in ImageGrid} \label{\detokenize{users/prev_whats_new/whats_new_1.4:separate-horizontal-vertical-axes-padding-support-in-imagegrid}} The \sphinxcode{\sphinxupquote{kwarg}} ‘axes\_pad’ to \sphinxcode{\sphinxupquote{mpl\_toolkits.axes\_grid1.ImageGrid}} can now be a tuple if separate horizontal/vertical padding is needed. This is supposed to be very helpful when you have a labelled legend next to every subplot and you need to make some space for legend’s labels. \paragraph{Support for skewed transformations} \label{\detokenize{users/prev_whats_new/whats_new_1.4:support-for-skewed-transformations}} The {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Affine2D}}}}} gained additional methods \sphinxcode{\sphinxupquote{skew}} and \sphinxcode{\sphinxupquote{skew\_deg}} to create skewed transformations. Additionally, matplotlib internals were cleaned up to support using such transforms in \sphinxcode{\sphinxupquote{Axes}}. This transform is important for some plot types, specifically the Skew-T used in meteorology. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/api/skewt.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_skewt_0011}.png}}\caption{Skewt}\label{\detokenize{users/prev_whats_new/whats_new_1.4:id1}}\end{figure} \paragraph{Support for specifying properties of wedge and text in pie charts.} \label{\detokenize{users/prev_whats_new/whats_new_1.4:support-for-specifying-properties-of-wedge-and-text-in-pie-charts}} Added the \sphinxcode{\sphinxupquote{kwargs}} ‘wedgeprops’ and ‘textprops’ to \sphinxcode{\sphinxupquote{pie()}} to accept properties for wedge and text objects in a pie. For example, one can specify wedgeprops = \{‘linewidth’:3\} to specify the width of the borders of the wedges in the pie. For more properties that the user can specify, look at the docs for the wedge and text objects. \paragraph{Fixed the direction of errorbar upper/lower limits} \label{\detokenize{users/prev_whats_new/whats_new_1.4:fixed-the-direction-of-errorbar-upper-lower-limits}} Larry Bradley fixed the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.errorbar:matplotlib.pyplot.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar()}}}}} method such that the upper and lower limits (\sphinxstyleemphasis{lolims}, \sphinxstyleemphasis{uplims}, \sphinxstyleemphasis{xlolims}, \sphinxstyleemphasis{xuplims}) now point in the correct direction. \paragraph{More consistent add-object API for Axes} \label{\detokenize{users/prev_whats_new/whats_new_1.4:more-consistent-add-object-api-for-axes}} Added the Axes method {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.add_image:matplotlib.axes.Axes.add_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_image}}}}} to put image handling on a par with artists, collections, containers, lines, patches, and tables. \paragraph{Violin Plots} \label{\detokenize{users/prev_whats_new/whats_new_1.4:violin-plots}} Per Parker, Gregory Kelsie, Adam Ortiz, Kevin Chan, Geoffrey Lee, Deokjae Donald Seo, and Taesu Terry Lim added a basic implementation for violin plots. Violin plots can be used to represent the distribution of sample data. They are similar to box plots, but use a kernel density estimation function to present a smooth approximation of the data sample used. The added features are: \sphinxcode{\sphinxupquote{violin()}} - Renders a violin plot from a collection of statistics. {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.violin_stats}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{violin\_stats()}}}}} - Produces a collection of statistics suitable for rendering a violin plot. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.violinplot:matplotlib.pyplot.violinplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{violinplot()}}}}} - Creates a violin plot from a set of sample data. This method makes use of {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.violin_stats}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{violin\_stats()}}}}} to process the input data, and {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.violin_stats}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{violin\_stats()}}}}} to do the actual rendering. Users are also free to modify or replace the output of {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.violin_stats}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{violin\_stats()}}}}} in order to customize the violin plots to their liking. This feature was implemented for a software engineering course at the University of Toronto, Scarborough, run in Winter 2014 by Anya Tafliovich. \paragraph{More \sphinxstyleliteralintitle{\sphinxupquote{markevery}} options to show only a subset of markers} \label{\detokenize{users/prev_whats_new/whats_new_1.4:more-markevery-options-to-show-only-a-subset-of-markers}} Rohan Walker extended the \sphinxcode{\sphinxupquote{markevery}} property in {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}}. You can now specify a subset of markers to show with an int, slice object, numpy fancy indexing, or float. Using a float shows markers at approximately equal display-coordinate-distances along the line. \paragraph{Added size related functions to specialized \sphinxstyleliteralintitle{\sphinxupquote{Collections}}} \label{\detokenize{users/prev_whats_new/whats_new_1.4:added-size-related-functions-to-specialized-collections}} Added the \sphinxcode{\sphinxupquote{get\_size}} and \sphinxcode{\sphinxupquote{set\_size}} functions to control the size of elements of specialized collections ( {\hyperref[\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AsteriskPolygonCollection}}}}} {\hyperref[\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BrokenBarHCollection}}}}} {\hyperref[\detokenize{api/collections_api:matplotlib.collections.CircleCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CircleCollection}}}}} {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PathCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathCollection}}}}} {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} {\hyperref[\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RegularPolyCollection}}}}} {\hyperref[\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{StarPolygonCollection}}}}}). \paragraph{Fixed the mouse coordinates giving the wrong theta value in Polar graph} \label{\detokenize{users/prev_whats_new/whats_new_1.4:fixed-the-mouse-coordinates-giving-the-wrong-theta-value-in-polar-graph}} Added code to \sphinxcode{\sphinxupquote{transform\_non\_affine()}} to ensure that the calculated theta value was between the range of 0 and 2 * pi since the problem was that the value can become negative after applying the direction and rotation to the theta calculation. \paragraph{Simple quiver plot for mplot3d toolkit} \label{\detokenize{users/prev_whats_new/whats_new_1.4:simple-quiver-plot-for-mplot3d-toolkit}} A team of students in an \sphinxstyleemphasis{Engineering Large Software Systems} course, taught by Prof. Anya Tafliovich at the University of Toronto, implemented a simple version of a quiver plot in 3D space for the mplot3d toolkit as one of their term project. This feature is documented in {\hyperref[\detokenize{tutorials/toolkits/mplot3d:mpl_toolkits.mplot3d.Axes3D.quiver}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{quiver()}}}}}. The team members are: Ryan Steve D’Souza, Victor B, xbtsw, Yang Wang, David, Caradec Bisesar and Vlad Vassilovski. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/quiver3d.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_quiver3d_0012}.png}}\caption{Quiver3d}\label{\detokenize{users/prev_whats_new/whats_new_1.4:id2}}\end{figure} \paragraph{polar-plot r-tick locations} \label{\detokenize{users/prev_whats_new/whats_new_1.4:polar-plot-r-tick-locations}} Added the ability to control the angular position of the r-tick labels on a polar plot via \sphinxcode{\sphinxupquote{set\_rlabel\_position()}}. \subsubsection{Date handling} \label{\detokenize{users/prev_whats_new/whats_new_1.4:date-handling}} \paragraph{n-d array support for date conversion} \label{\detokenize{users/prev_whats_new/whats_new_1.4:n-d-array-support-for-date-conversion}} Andrew Dawson added support for n-d array handling to {\hyperref[\detokenize{api/dates_api:matplotlib.dates.num2date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.num2date()}}}}}, {\hyperref[\detokenize{api/dates_api:matplotlib.dates.date2num}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.date2num()}}}}} and \sphinxcode{\sphinxupquote{matplotlib.dates.datestr2num()}}. Support is also added to the unit conversion interfaces \sphinxcode{\sphinxupquote{matplotlib.dates.DateConverter}} and {\hyperref[\detokenize{api/units_api:matplotlib.units.Registry}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.units.Registry}}}}}. \subsubsection{Configuration (rcParams)} \label{\detokenize{users/prev_whats_new/whats_new_1.4:configuration-rcparams}} \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{savefig.transparent}} added} \label{\detokenize{users/prev_whats_new/whats_new_1.4:savefig-transparent-added}} Controls whether figures are saved with a transparent background by default. Previously \sphinxcode{\sphinxupquote{savefig}} always defaulted to a non-transparent background. \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{axes.titleweight}}} \label{\detokenize{users/prev_whats_new/whats_new_1.4:axes-titleweight}} Added rcParam to control the weight of the title \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{axes.formatter.useoffset}} added} \label{\detokenize{users/prev_whats_new/whats_new_1.4:axes-formatter-useoffset-added}} Controls the default value of \sphinxcode{\sphinxupquote{useOffset}} in \sphinxcode{\sphinxupquote{ScalarFormatter}}. If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} and the data range is much smaller than the data average, then an offset will be determined such that the tick labels are meaningful. If \sphinxhref{https://docs.python.org/3/library/constants.html\#False}{\sphinxcode{\sphinxupquote{False}}} then the full number will be formatted in all conditions. \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{nbagg.transparent}} added} \label{\detokenize{users/prev_whats_new/whats_new_1.4:nbagg-transparent-added}} Controls whether nbagg figures have a transparent background. \sphinxcode{\sphinxupquote{nbagg.transparent}} is \sphinxcode{\sphinxupquote{True}} by default. \paragraph{XDG compliance} \label{\detokenize{users/prev_whats_new/whats_new_1.4:xdg-compliance}} Matplotlib now looks for configuration files (both rcparams and style) in XDG compliant locations. \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{style}} package added} \label{\detokenize{users/prev_whats_new/whats_new_1.4:style-package-added}} You can now easily switch between different styles using the new \sphinxcode{\sphinxupquote{style}} package: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{matplotlib} \PYG{k}{import} \PYG{n}{style} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{style}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{dark\PYGZus{}background}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} Subsequent plots will use updated colors, sizes, etc. To list all available styles, use: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print} \PYG{n}{style}\PYG{o}{.}\PYG{n}{available} \end{sphinxVerbatim} You can add your own custom \sphinxcode{\sphinxupquote{\textless{}style name\textgreater{}.mplstyle}} files to \sphinxcode{\sphinxupquote{\textasciitilde{}/.matplotlib/stylelib}} or call \sphinxcode{\sphinxupquote{use}} with a URL pointing to a file with \sphinxcode{\sphinxupquote{matplotlibrc}} settings. \sphinxstyleemphasis{Note that this is an experimental feature}, and the interface may change as users test out this new feature. \subsubsection{Backends} \label{\detokenize{users/prev_whats_new/whats_new_1.4:backends}} \paragraph{Qt5 backend} \label{\detokenize{users/prev_whats_new/whats_new_1.4:qt5-backend}} Martin Fitzpatrick and Tom Badran implemented a Qt5 backend. The differences in namespace locations between Qt4 and Qt5 was dealt with by shimming Qt4 to look like Qt5, thus the Qt5 implementation is the primary implementation. Backwards compatibility for Qt4 is maintained by wrapping the Qt5 implementation. The Qt5Agg backend currently does not work with IPython’s \%matplotlib magic. The 1.4.0 release has a known bug where the toolbar is broken. This can be fixed by: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{cd} \PYG{n}{path}\PYG{o}{/}\PYG{n}{to}\PYG{o}{/}\PYG{n}{installed}\PYG{o}{/}\PYG{n}{matplotlib} \PYG{n}{wget} \PYG{n}{https}\PYG{p}{:}\PYG{o}{/}\PYG{o}{/}\PYG{n}{github}\PYG{o}{.}\PYG{n}{com}\PYG{o}{/}\PYG{n}{matplotlib}\PYG{o}{/}\PYG{n}{matplotlib}\PYG{o}{/}\PYG{n}{pull}\PYG{o}{/}\PYG{l+m+mf}{3322.}\PYG{n}{diff} \PYG{c+c1}{\PYGZsh{} unix2dos 3322.diff (if on windows to fix line endings)} \PYG{n}{patch} \PYG{o}{\PYGZhy{}}\PYG{n}{p2} \PYG{o}{\PYGZlt{}} \PYG{l+m+mf}{3322.}\PYG{n}{diff} \end{sphinxVerbatim} \paragraph{Qt4 backend} \label{\detokenize{users/prev_whats_new/whats_new_1.4:qt4-backend}} Rudolf Höfler changed the appearance of the subplottool. All sliders are vertically arranged now, buttons for tight layout and reset were added. Furthermore, the subplottool is now implemented as a modal dialog. It was previously a QMainWindow, leaving the SPT open if one closed the plot window. In the figure options dialog one can now choose to (re-)generate a simple automatic legend. Any explicitly set legend entries will be lost, but changes to the curves’ label, linestyle, et cetera will now be updated in the legend. Interactive performance of the Qt4 backend has been dramatically improved under windows. The mapping of key-signals from Qt to values matplotlib understands was greatly improved (For both Qt4 and Qt5). \paragraph{Cairo backends} \label{\detokenize{users/prev_whats_new/whats_new_1.4:cairo-backends}} The Cairo backends are now able to use the \sphinxhref{https://github.com/SimonSapin/cairocffi}{cairocffi bindings} which are more actively maintained than the \sphinxhref{https://www.cairographics.org/pycairo/}{pycairo bindings}. \paragraph{Gtk3Agg backend} \label{\detokenize{users/prev_whats_new/whats_new_1.4:gtk3agg-backend}} The Gtk3Agg backend now works on Python 3.x, if the \sphinxhref{https://github.com/SimonSapin/cairocffi}{cairocffi bindings} are installed. \paragraph{PDF backend} \label{\detokenize{users/prev_whats_new/whats_new_1.4:pdf-backend}} Added context manager for saving to multi-page PDFs. \subsubsection{Text} \label{\detokenize{users/prev_whats_new/whats_new_1.4:text}} \paragraph{Text URLs supported by SVG backend} \label{\detokenize{users/prev_whats_new/whats_new_1.4:text-urls-supported-by-svg-backend}} The \sphinxcode{\sphinxupquote{svg}} backend will now render {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} objects’ url as a link in output SVGs. This allows one to make clickable text in saved figures using the url kwarg of the {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} class. \paragraph{Anchored sizebar font} \label{\detokenize{users/prev_whats_new/whats_new_1.4:anchored-sizebar-font}} Added the \sphinxcode{\sphinxupquote{fontproperties}} kwarg to \sphinxcode{\sphinxupquote{AnchoredSizeBar}} to control the font properties. \subsubsection{Sphinx extensions} \label{\detokenize{users/prev_whats_new/whats_new_1.4:sphinx-extensions}} The \sphinxcode{\sphinxupquote{:context:}} directive in the {\hyperref[\detokenize{devel/plot_directive:module-matplotlib.sphinxext.plot_directive}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot\_directive}}}}} Sphinx extension can now accept an optional \sphinxcode{\sphinxupquote{reset}} setting, which will cause the context to be reset. This allows more than one distinct context to be present in documentation. To enable this option, use \sphinxcode{\sphinxupquote{:context: reset}} instead of \sphinxcode{\sphinxupquote{:context:}} any time you want to reset the context. \subsubsection{Legend and PathEffects documentation} \label{\detokenize{users/prev_whats_new/whats_new_1.4:legend-and-patheffects-documentation}} The {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Legend guide}}}} and {\hyperref[\detokenize{tutorials/advanced/patheffects_guide:sphx-glr-tutorials-advanced-patheffects-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Path effects guide}}}} have both been updated to better reflect the full potential of each of these powerful features. \subsubsection{Widgets} \label{\detokenize{users/prev_whats_new/whats_new_1.4:widgets}} \paragraph{Span Selector} \label{\detokenize{users/prev_whats_new/whats_new_1.4:span-selector}} Added an option \sphinxcode{\sphinxupquote{span\_stays}} to the {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.SpanSelector}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SpanSelector}}}}} which makes the selector rectangle stay on the axes after you release the mouse. \subsubsection{GAE integration} \label{\detokenize{users/prev_whats_new/whats_new_1.4:gae-integration}} Matplotlib will now run on google app engine. \subsection{New in matplotlib 1.5} \label{\detokenize{users/prev_whats_new/whats_new_1.5:new-in-matplotlib-1-5}}\label{\detokenize{users/prev_whats_new/whats_new_1.5:whats-new-1-5}}\label{\detokenize{users/prev_whats_new/whats_new_1.5::doc}} \begin{sphinxShadowBox} \sphinxstyletopictitle{Table of Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.5:id4}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.5:new-in-matplotlib-1-5}]{\sphinxcrossref{New in matplotlib 1.5}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.5:id5}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.5:interactive-oo-usage}]{\sphinxcrossref{Interactive OO usage}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.5:id6}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.5:working-with-labeled-data-like-pandas-dataframes}]{\sphinxcrossref{Working with labeled data like pandas DataFrames}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.5:id7}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.5:added-axes-prop-cycle-key-to-rcparams}]{\sphinxcrossref{Added \sphinxcode{\sphinxupquote{axes.prop\_cycle}} key to rcParams}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.5:id8}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.5:new-colormaps}]{\sphinxcrossref{New Colormaps}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.5:id9}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.5:styles}]{\sphinxcrossref{Styles}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.5:id10}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.5:backends}]{\sphinxcrossref{Backends}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.5:id11}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.5:configuration-rcparams}]{\sphinxcrossref{Configuration (rcParams)}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.5:id12}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.5:widgets}]{\sphinxcrossref{Widgets}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.5:id13}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.5:new-plotting-features}]{\sphinxcrossref{New plotting features}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.5:id14}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.5:toolmanager}]{\sphinxcrossref{ToolManager}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.5:id15}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.5:cbook-is-sequence-of-strings-recognizes-string-objects}]{\sphinxcrossref{cbook.is\_sequence\_of\_strings recognizes string objects}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.5:id16}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.5:new-close-figs-argument-for-plot-directive}]{\sphinxcrossref{New \sphinxcode{\sphinxupquote{close-figs}} argument for plot directive}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.5:id17}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.5:support-for-url-string-arguments-to-imread}]{\sphinxcrossref{Support for URL string arguments to \sphinxcode{\sphinxupquote{imread}}}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.5:id18}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.5:display-hook-for-animations-in-the-ipython-notebook}]{\sphinxcrossref{Display hook for animations in the IPython notebook}}} \item {} \phantomsection\label{\detokenize{users/prev_whats_new/whats_new_1.5:id19}}{\hyperref[\detokenize{users/prev_whats_new/whats_new_1.5:prefixed-pkg-config-for-building}]{\sphinxcrossref{Prefixed pkg-config for building}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \begin{sphinxadmonition}{note}{Note:} matplotlib 1.5 supports Python 2.7, 3.4, and 3.5 \end{sphinxadmonition} \subsubsection{Interactive OO usage} \label{\detokenize{users/prev_whats_new/whats_new_1.5:interactive-oo-usage}} All \sphinxcode{\sphinxupquote{Artists}} now keep track of if their internal state has been changed but not reflected in the display (‘stale’) by a call to \sphinxcode{\sphinxupquote{draw}}. It is thus possible to pragmatically determine if a given \sphinxcode{\sphinxupquote{Figure}} needs to be re-drawn in an interactive session. To facilitate interactive usage a \sphinxcode{\sphinxupquote{draw\_all}} method has been added to \sphinxcode{\sphinxupquote{pyplot}} which will redraw all of the figures which are ‘stale’. To make this convenient for interactive use matplotlib now registers a function either with IPython’s ‘post\_execute’ event or with the displayhook in the standard python REPL to automatically call \sphinxcode{\sphinxupquote{plt.draw\_all}} just before control is returned to the REPL. This ensures that the draw command is deferred and only called once. The upshot of this is that for interactive backends (including \sphinxcode{\sphinxupquote{\%matplotlib notebook}}) in interactive mode (with \sphinxcode{\sphinxupquote{plt.ion()}}) \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{In [1]: }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{g+gp}{In [2]: }\PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{g+gp}{In [3]: }\PYG{n}{ln}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{9}\PYG{p}{,} \PYG{l+m+mi}{16}\PYG{p}{]}\PYG{p}{)} \PYG{g+gp}{In [4]: }\PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \PYG{g+gp}{In [5]: }\PYG{n}{ln}\PYG{o}{.}\PYG{n}{set\PYGZus{}color}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} will automatically update the plot to be green. Any subsequent modifications to the \sphinxcode{\sphinxupquote{Artist}} objects will do likewise. This is the first step of a larger consolidation and simplification of the pyplot internals. \subsubsection{Working with labeled data like pandas DataFrames} \label{\detokenize{users/prev_whats_new/whats_new_1.5:working-with-labeled-data-like-pandas-dataframes}} Plot methods which take arrays as inputs can now also work with labeled data and unpack such data. This means that the following two examples produce the same plot: Example \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{df} \PYG{o}{=} \PYG{n}{pandas}\PYG{o}{.}\PYG{n}{DataFrame}\PYG{p}{(}\PYG{p}{\PYGZob{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{var1}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{,}\PYG{l+m+mi}{4}\PYG{p}{,}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{6}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{var2}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{,}\PYG{l+m+mi}{4}\PYG{p}{,}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{6}\PYG{p}{]}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{df}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{var1}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{p}{,} \PYG{n}{df}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{var2}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} Example \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{var1}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{var2}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{data}\PYG{o}{=}\PYG{n}{df}\PYG{p}{)} \end{sphinxVerbatim} This works for most plotting methods, which expect arrays/sequences as inputs. \sphinxcode{\sphinxupquote{data}} can be anything which supports \sphinxcode{\sphinxupquote{\_\_getitem\_\_}} (\sphinxcode{\sphinxupquote{dict}}, \sphinxcode{\sphinxupquote{pandas.DataFrame}}, \sphinxcode{\sphinxupquote{h5py}}, …) to access \sphinxcode{\sphinxupquote{array}} like values with string keys. In addition to this, some other changes were made, which makes working with labeled data (ex \sphinxcode{\sphinxupquote{pandas.Series}}) easier: \begin{itemize} \item {} For plotting methods with \sphinxcode{\sphinxupquote{label}} keyword argument, one of the data inputs is designated as the label source. If the user does not supply a \sphinxcode{\sphinxupquote{label}} that value object will be introspected for a label, currently by looking for a \sphinxcode{\sphinxupquote{name}} attribute. If the value object does not have a \sphinxcode{\sphinxupquote{name}} attribute but was specified by as a key into the \sphinxcode{\sphinxupquote{data}} kwarg, then the key is used. In the above examples, this results in an implicit \sphinxcode{\sphinxupquote{label="var2"}} for both cases. \item {} \sphinxcode{\sphinxupquote{plot()}} now uses the index of a \sphinxcode{\sphinxupquote{Series}} instead of \sphinxcode{\sphinxupquote{np.arange(len(y))}}, if no \sphinxcode{\sphinxupquote{x}} argument is supplied. \end{itemize} \subsubsection{Added \sphinxstyleliteralintitle{\sphinxupquote{axes.prop\_cycle}} key to rcParams} \label{\detokenize{users/prev_whats_new/whats_new_1.5:added-axes-prop-cycle-key-to-rcparams}} This is a more generic form of the now-deprecated \sphinxcode{\sphinxupquote{axes.color\_cycle}} param. Now, we can cycle more than just colors, but also linestyles, hatches, and just about any other artist property. Cycler notation is used for defining property cycles. Adding cyclers together will be like you are \sphinxcode{\sphinxupquote{zip()}}-ing together two or more property cycles together: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{axes}\PYG{o}{.}\PYG{n}{prop\PYGZus{}cycle}\PYG{p}{:} \PYG{n}{cycler}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{rgb}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{o}{+} \PYG{n}{cycler}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lw}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} You can even multiply cyclers, which is like using \sphinxcode{\sphinxupquote{itertools.product()}} on two or more property cycles. Remember to use parentheses if writing a multi-line \sphinxcode{\sphinxupquote{prop\_cycle}} parameter. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../tutorials/intermediate/color\_cycle.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_color_cycle_0011}.png}}\caption{Color Cycle}\label{\detokenize{users/prev_whats_new/whats_new_1.5:id1}}\end{figure} \subsubsection{New Colormaps} \label{\detokenize{users/prev_whats_new/whats_new_1.5:new-colormaps}} All four of the colormaps proposed as the new default are available as \sphinxcode{\sphinxupquote{'viridis'}} (the new default in 2.0), \sphinxcode{\sphinxupquote{'magma'}}, \sphinxcode{\sphinxupquote{'plasma'}}, and \sphinxcode{\sphinxupquote{'inferno'}} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{whats_new_1-5-1}.pdf} \end{figure} \subsubsection{Styles} \label{\detokenize{users/prev_whats_new/whats_new_1.5:styles}} Several new styles have been added, including many styles from the Seaborn project. Additionally, in order to prep for the upcoming 2.0 style-change release, a ‘classic’ and ‘default’ style has been added. For this release, the ‘default’ and ‘classic’ styles are identical. By using them now in your scripts, you can help ensure a smooth transition during future upgrades of matplotlib, so that you can upgrade to the snazzy new defaults when you are ready! \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{style} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{style}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{classic}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} The ‘default’ style will give you matplotlib’s latest plotting styles: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{style}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \subsubsection{Backends} \label{\detokenize{users/prev_whats_new/whats_new_1.5:backends}} \paragraph{New backend selection} \label{\detokenize{users/prev_whats_new/whats_new_1.5:new-backend-selection}} The environment variable \index{MPLBACKEND}\index{environment variable!MPLBACKEND}{\hyperref[\detokenize{faq/environment_variables_faq:envvar-MPLBACKEND}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MPLBACKEND}}}}} can now be used to set the matplotlib backend. \paragraph{wx backend has been updated} \label{\detokenize{users/prev_whats_new/whats_new_1.5:wx-backend-has-been-updated}} The wx backend can now be used with both wxPython classic and \sphinxhref{http://wxpython.org/Phoenix/docs/html/main.html}{Phoenix}. wxPython classic has to be at least version 2.8.12 and works on Python 2.x. As of May 2015 no official release of wxPython Phoenix is available but a current snapshot will work on Python 2.7+ and 3.4+. If you have multiple versions of wxPython installed, then the user code is responsible setting the wxPython version. How to do this is explained in the comment at the beginning of the example \sphinxcode{\sphinxupquote{examplesuser\_interfacesembedding\_in\_wx2.py}}. \subsubsection{Configuration (rcParams)} \label{\detokenize{users/prev_whats_new/whats_new_1.5:configuration-rcparams}} Some parameters have been added, others have been improved. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Parameter &\sphinxstyletheadfamily Description \\ \hline \sphinxcode{\sphinxupquote{\{x,y\}axis.labelpad}} & mplot3d now respects these parameters \\ \hline \sphinxcode{\sphinxupquote{axes.labelpad}} & Default space between the axis and the label \\ \hline \sphinxcode{\sphinxupquote{errorbar.capsize}} & Default length of end caps on error bars \\ \hline \sphinxcode{\sphinxupquote{\{x,y\}tick.minor.visible}} & Default visibility of minor x/y ticks \\ \hline \sphinxcode{\sphinxupquote{legend.framealpha}} & Default transparency of the legend frame box \\ \hline \sphinxcode{\sphinxupquote{legend.facecolor}} & Default facecolor of legend frame box (or \sphinxcode{\sphinxupquote{'inherit'}} from \sphinxcode{\sphinxupquote{axes.facecolor}}) \\ \hline \sphinxcode{\sphinxupquote{legend.edgecolor}} & Default edgecolor of legend frame box (or \sphinxcode{\sphinxupquote{'inherit'}} from \sphinxcode{\sphinxupquote{axes.edgecolor}}) \\ \hline \sphinxcode{\sphinxupquote{figure.titlesize}} & Default font size for figure suptitles \\ \hline \sphinxcode{\sphinxupquote{figure.titleweight}} & Default font weight for figure suptitles \\ \hline \sphinxcode{\sphinxupquote{image.composite\_image}} & Whether a vector graphics backend should composite several images into a single image or not when saving. Useful when needing to edit the files further in Inkscape or other programs. \\ \hline \sphinxcode{\sphinxupquote{markers.fillstyle}} & Default fillstyle of markers. Possible values are \sphinxcode{\sphinxupquote{'full'}} (the default), \sphinxcode{\sphinxupquote{'left'}}, \sphinxcode{\sphinxupquote{'right'}}, \sphinxcode{\sphinxupquote{'bottom'}}, \sphinxcode{\sphinxupquote{'top'}} and \sphinxcode{\sphinxupquote{'none'}} \\ \hline \sphinxcode{\sphinxupquote{toolbar}} & Added \sphinxcode{\sphinxupquote{'toolmanager'}} as a valid value, enabling the experimental \sphinxcode{\sphinxupquote{ToolManager}} feature. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \subsubsection{Widgets} \label{\detokenize{users/prev_whats_new/whats_new_1.5:widgets}} \paragraph{Active state of Selectors} \label{\detokenize{users/prev_whats_new/whats_new_1.5:active-state-of-selectors}} All selectors now implement \sphinxcode{\sphinxupquote{set\_active}} and \sphinxcode{\sphinxupquote{get\_active}} methods (also called when accessing the \sphinxcode{\sphinxupquote{active}} property) to properly update and query whether they are active. \paragraph{Moved \sphinxstyleliteralintitle{\sphinxupquote{ignore}}, \sphinxstyleliteralintitle{\sphinxupquote{set\_active}}, and \sphinxstyleliteralintitle{\sphinxupquote{get\_active}} methods to base class \sphinxstyleliteralintitle{\sphinxupquote{Widget}}} \label{\detokenize{users/prev_whats_new/whats_new_1.5:moved-ignore-set-active-and-get-active-methods-to-base-class-widget}} Pushes up duplicate methods in child class to parent class to avoid duplication of code. \paragraph{Adds enable/disable feature to MultiCursor} \label{\detokenize{users/prev_whats_new/whats_new_1.5:adds-enable-disable-feature-to-multicursor}} A MultiCursor object can be disabled (and enabled) after it has been created without destroying the object. Example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{multi\PYGZus{}cursor}\PYG{o}{.}\PYG{n}{active} \PYG{o}{=} \PYG{k+kc}{False} \end{sphinxVerbatim} \paragraph{Improved RectangleSelector and new EllipseSelector Widget} \label{\detokenize{users/prev_whats_new/whats_new_1.5:improved-rectangleselector-and-new-ellipseselector-widget}} Adds an \sphinxcode{\sphinxupquote{interactive}} keyword which enables visible handles for manipulating the shape after it has been drawn. Adds keyboard modifiers for: \begin{itemize} \item {} Moving the existing shape (default key = ‘space’) \item {} Making the shape square (default ‘shift’) \item {} Make the initial point the center of the shape (default ‘control’) \item {} Square and center can be combined \end{itemize} \paragraph{Allow Artists to Display Pixel Data in Cursor} \label{\detokenize{users/prev_whats_new/whats_new_1.5:allow-artists-to-display-pixel-data-in-cursor}} Adds \sphinxcode{\sphinxupquote{get\_pixel\_data}} and \sphinxcode{\sphinxupquote{format\_pixel\_data}} methods to artists which can be used to add zdata to the cursor display in the status bar. Also adds an implementation for Images. \subsubsection{New plotting features} \label{\detokenize{users/prev_whats_new/whats_new_1.5:new-plotting-features}} \paragraph{Auto-wrapping Text} \label{\detokenize{users/prev_whats_new/whats_new_1.5:auto-wrapping-text}} Added the keyword argument “wrap” to Text, which automatically breaks long lines of text when being drawn. Works for any rotated text, different modes of alignment, and for text that are either labels or titles. This breaks at the \sphinxcode{\sphinxupquote{Figure}}, not \sphinxcode{\sphinxupquote{Axes}} edge. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{whats_new_1-5-2}.pdf} \end{figure} \paragraph{Contour plot corner masking} \label{\detokenize{users/prev_whats_new/whats_new_1.5:contour-plot-corner-masking}} Ian Thomas rewrote the C++ code that calculates contours to add support for corner masking. This is controlled by a new keyword argument \sphinxcode{\sphinxupquote{corner\_mask}} in the functions {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}}. The previous behaviour, which is now obtained using \sphinxcode{\sphinxupquote{corner\_mask=False}}, was for a single masked point to completely mask out all four quads touching that point. The new behaviour, obtained using \sphinxcode{\sphinxupquote{corner\_mask=True}}, only masks the corners of those quads touching the point; any triangular corners comprising three unmasked points are contoured as usual. If the \sphinxcode{\sphinxupquote{corner\_mask}} keyword argument is not specified, the default value is taken from rcParams. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/images\_contours\_and\_fields/contour\_corner\_mask.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_contour_corner_mask_0011}.png}}\caption{Contour Corner Mask}\label{\detokenize{users/prev_whats_new/whats_new_1.5:id2}}\end{figure} \paragraph{Mostly unified linestyles for \sphinxstyleliteralintitle{\sphinxupquote{Line2D}}, \sphinxstyleliteralintitle{\sphinxupquote{Patch}} and \sphinxstyleliteralintitle{\sphinxupquote{Collection}}} \label{\detokenize{users/prev_whats_new/whats_new_1.5:mostly-unified-linestyles-for-line2d-patch-and-collection}} The handling of linestyles for Lines, Patches and Collections has been unified. Now they all support defining linestyles with short symbols, like \sphinxcode{\sphinxupquote{"-{-}"}}, as well as with full names, like \sphinxcode{\sphinxupquote{"dashed"}}. Also the definition using a dash pattern (\sphinxcode{\sphinxupquote{(0., {[}3., 3.{]})}}) is supported for all methods using \sphinxcode{\sphinxupquote{Line2D}}, \sphinxcode{\sphinxupquote{Patch}} or \sphinxcode{\sphinxupquote{Collection}}. \paragraph{Legend marker order} \label{\detokenize{users/prev_whats_new/whats_new_1.5:legend-marker-order}} Added ability to place the label before the marker in a legend box with \sphinxcode{\sphinxupquote{markerfirst}} keyword \paragraph{Support for legend for PolyCollection and stackplot} \label{\detokenize{users/prev_whats_new/whats_new_1.5:support-for-legend-for-polycollection-and-stackplot}} Added a \sphinxcode{\sphinxupquote{legend\_handler}} for {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} as well as a \sphinxcode{\sphinxupquote{labels}} argument to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.stackplot:matplotlib.axes.Axes.stackplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stackplot()}}}}}. \paragraph{Support for alternate pivots in mplot3d quiver plot} \label{\detokenize{users/prev_whats_new/whats_new_1.5:support-for-alternate-pivots-in-mplot3d-quiver-plot}} Added a \sphinxcode{\sphinxupquote{pivot}} kwarg to {\hyperref[\detokenize{tutorials/toolkits/mplot3d:mpl_toolkits.mplot3d.Axes3D.quiver}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{quiver()}}}}} that controls the pivot point around which the quiver line rotates. This also determines the placement of the arrow head along the quiver line. \paragraph{Logit Scale} \label{\detokenize{users/prev_whats_new/whats_new_1.5:logit-scale}} Added support for the ‘logit’ axis scale, a nonlinear transformation \begin{equation}x -> \log10(x / (1-x))\end{equation} for data between 0 and 1 excluded. \paragraph{Add step kwargs to fill\_between} \label{\detokenize{users/prev_whats_new/whats_new_1.5:add-step-kwargs-to-fill-between}} Added \sphinxcode{\sphinxupquote{step}} kwarg to \sphinxcode{\sphinxupquote{Axes.fill\_between}} to allow to fill between lines drawn using the ‘step’ draw style. The values of \sphinxcode{\sphinxupquote{step}} match those of the \sphinxcode{\sphinxupquote{where}} kwarg of \sphinxcode{\sphinxupquote{Axes.step}}. The asymmetry of of the kwargs names is not ideal, but \sphinxcode{\sphinxupquote{Axes.fill\_between}} already has a \sphinxcode{\sphinxupquote{where}} kwarg. This is particularly useful for plotting pre-binned histograms. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/api/filled\_step.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_filled_step_0011}.png}}\caption{Filled Step}\label{\detokenize{users/prev_whats_new/whats_new_1.5:id3}}\end{figure} \paragraph{Square Plot} \label{\detokenize{users/prev_whats_new/whats_new_1.5:square-plot}} Implemented square plots feature as a new parameter in the axis function. When argument ‘square’ is specified, equal scaling is set, and the limits are set such that \sphinxcode{\sphinxupquote{xmax-xmin == ymax-ymin}}. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{whats_new_1-5-3}.pdf} \end{figure} \paragraph{Updated figimage to take optional resize parameter} \label{\detokenize{users/prev_whats_new/whats_new_1.5:updated-figimage-to-take-optional-resize-parameter}} Added the ability to plot simple 2D-Array using \sphinxcode{\sphinxupquote{plt.figimage(X, resize=True)}}. This is useful for plotting simple 2D-Array without the Axes or whitespacing around the image. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{whats_new_1-5-4}.pdf} \end{figure} \paragraph{Updated Figure.savefig() can now use figure’s dpi} \label{\detokenize{users/prev_whats_new/whats_new_1.5:updated-figure-savefig-can-now-use-figure-s-dpi}} Added support to save the figure with the same dpi as the figure on the screen using \sphinxcode{\sphinxupquote{dpi='figure'}}. Example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{f} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{dpi}\PYG{o}{=}\PYG{l+m+mi}{25}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} dpi set to 25} \PYG{n}{S} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{scatter}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,}\PYG{p}{[}\PYG{l+m+mi}{4}\PYG{p}{,}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{6}\PYG{p}{]}\PYG{p}{)} \PYG{n}{f}\PYG{o}{.}\PYG{n}{savefig}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{output.png}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{dpi}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{figure}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} output savefig dpi set to 25 (same as figure)} \end{sphinxVerbatim} \paragraph{Updated Table to control edge visibility} \label{\detokenize{users/prev_whats_new/whats_new_1.5:updated-table-to-control-edge-visibility}} Added the ability to toggle the visibility of lines in Tables. Functionality added to the \sphinxcode{\sphinxupquote{pyplot.table()}} factory function under the keyword argument “edges”. Values can be the strings “open”, “closed”, “horizontal”, “vertical” or combinations of the letters “L”, “R”, “T”, “B” which represent left, right, top, and bottom respectively. Example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{table}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{edges}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{open}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} No line visible} \PYG{n}{table}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{edges}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{closed}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} All lines visible} \PYG{n}{table}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{edges}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{horizontal}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Only top and bottom lines visible} \PYG{n}{table}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{edges}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{LT}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Only left and top lines visible.} \end{sphinxVerbatim} \paragraph{Zero r/cstride support in plot\_wireframe} \label{\detokenize{users/prev_whats_new/whats_new_1.5:zero-r-cstride-support-in-plot-wireframe}} Adam Hughes added support to mplot3d’s plot\_wireframe to draw only row or column line plots. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{whats_new_1-5-5}.pdf} \end{figure} \paragraph{Plot bar and barh with labels} \label{\detokenize{users/prev_whats_new/whats_new_1.5:plot-bar-and-barh-with-labels}} Added kwarg \sphinxcode{\sphinxupquote{"tick\_label"}} to \sphinxcode{\sphinxupquote{bar}} and \sphinxcode{\sphinxupquote{barh}} to support plotting bar graphs with a text label for each bar. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{whats_new_1-5-6}.pdf} \end{figure} \paragraph{Added center and frame kwargs to pie} \label{\detokenize{users/prev_whats_new/whats_new_1.5:added-center-and-frame-kwargs-to-pie}} These control where the center of the pie graph are and if the Axes frame is shown. \paragraph{Fixed 3D filled contour plot polygon rendering} \label{\detokenize{users/prev_whats_new/whats_new_1.5:fixed-3d-filled-contour-plot-polygon-rendering}} Certain cases of 3D filled contour plots that produce polygons with multiple holes produced improper rendering due to a loss of path information between {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} and {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Poly3DCollection}}}}}. A function {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_verts_and_codes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_verts\_and\_codes()}}}}} was added to allow path information to be retained for proper rendering. \paragraph{Dense colorbars are rasterized} \label{\detokenize{users/prev_whats_new/whats_new_1.5:dense-colorbars-are-rasterized}} Vector file formats (pdf, ps, svg) are efficient for many types of plot element, but for some they can yield excessive file size and even rendering artifacts, depending on the renderer used for screen display. This is a problem for colorbars that show a large number of shades, as is most commonly the case. Now, if a colorbar is showing 50 or more colors, it will be rasterized in vector backends. \paragraph{DateFormatter strftime} \label{\detokenize{users/prev_whats_new/whats_new_1.5:dateformatter-strftime}} \sphinxcode{\sphinxupquote{strftime}} method will format a \sphinxhref{https://docs.python.org/3/library/datetime.html\#datetime.datetime}{\sphinxcode{\sphinxupquote{datetime.datetime}}} object with the format string passed to the formatter’s constructor. This method accepts datetimes with years before 1900, unlike \sphinxhref{https://docs.python.org/3/library/datetime.html\#datetime.datetime.strftime}{\sphinxcode{\sphinxupquote{datetime.datetime.strftime()}}}. \paragraph{Artist-level \{get,set\}\_usetex for text} \label{\detokenize{users/prev_whats_new/whats_new_1.5:artist-level-get-set-usetex-for-text}} Add \sphinxcode{\sphinxupquote{\{get,set\}\_usetex}} methods to {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} objects which allow artist-level control of LaTeX rendering vs the internal mathtex rendering. \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{ax.remove()}} works as expected} \label{\detokenize{users/prev_whats_new/whats_new_1.5:ax-remove-works-as-expected}} As with artists added to an {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}, \sphinxcode{\sphinxupquote{Axes}} objects can be removed from their figure via {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.remove:matplotlib.axes.Axes.remove}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove()}}}}}. \paragraph{API Consistency fix within Locators set\_params() function} \label{\detokenize{users/prev_whats_new/whats_new_1.5:api-consistency-fix-within-locators-set-params-function}} {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator.set_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_params()}}}}} function, which sets parameters within a {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Locator}}}}} type instance, is now available to all \sphinxcode{\sphinxupquote{Locator}} types. The implementation also prevents unsafe usage by strictly defining the parameters that a user can set. To use, call \sphinxcode{\sphinxupquote{set\_params()}} on a \sphinxcode{\sphinxupquote{Locator}} instance with desired arguments: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{loc} \PYG{o}{=} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{ticker}\PYG{o}{.}\PYG{n}{LogLocator}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Set given attributes for loc.} \PYG{n}{loc}\PYG{o}{.}\PYG{n}{set\PYGZus{}params}\PYG{p}{(}\PYG{n}{numticks}\PYG{o}{=}\PYG{l+m+mi}{8}\PYG{p}{,} \PYG{n}{numdecs}\PYG{o}{=}\PYG{l+m+mi}{8}\PYG{p}{,} \PYG{n}{subs}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mf}{2.0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{base}\PYG{o}{=}\PYG{l+m+mi}{8}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} The below will error, as there is no such parameter for LogLocator} \PYG{c+c1}{\PYGZsh{} named foo} \PYG{c+c1}{\PYGZsh{} loc.set\PYGZus{}params(foo=\PYGZsq{}bar\PYGZsq{})} \end{sphinxVerbatim} \paragraph{Date Locators} \label{\detokenize{users/prev_whats_new/whats_new_1.5:date-locators}} Date Locators (derived from {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{DateLocator}}}}}) now implement the \sphinxcode{\sphinxupquote{tick\_values()}} method. This is expected of all Locators derived from \sphinxcode{\sphinxupquote{Locator}}. The Date Locators can now be used easily without creating axes \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{datetime} \PYG{k}{import} \PYG{n}{datetime} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{dates} \PYG{k}{import} \PYG{n}{YearLocator} \PYG{n}{t0} \PYG{o}{=} \PYG{n}{datetime}\PYG{p}{(}\PYG{l+m+mi}{2002}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mi}{9}\PYG{p}{,} \PYG{l+m+mi}{12}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{)} \PYG{n}{tf} \PYG{o}{=} \PYG{n}{datetime}\PYG{p}{(}\PYG{l+m+mi}{2005}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mi}{9}\PYG{p}{,} \PYG{l+m+mi}{12}\PYG{p}{,} \PYG{l+m+mi}{15}\PYG{p}{)} \PYG{n}{loc} \PYG{o}{=} \PYG{n}{YearLocator}\PYG{p}{(}\PYG{p}{)} \PYG{n}{values} \PYG{o}{=} \PYG{n}{loc}\PYG{o}{.}\PYG{n}{tick\PYGZus{}values}\PYG{p}{(}\PYG{n}{t0}\PYG{p}{,} \PYG{n}{tf}\PYG{p}{)} \end{sphinxVerbatim} \paragraph{OffsetBoxes now support clipping} \label{\detokenize{users/prev_whats_new/whats_new_1.5:offsetboxes-now-support-clipping}} \sphinxcode{\sphinxupquote{Artists}} draw onto objects of type \sphinxcode{\sphinxupquote{OffsetBox}} through \sphinxcode{\sphinxupquote{DrawingArea}} and \sphinxcode{\sphinxupquote{TextArea}}. The \sphinxcode{\sphinxupquote{TextArea}} calculates the required space for the text and so the text is always within the bounds, for this nothing has changed. However, \sphinxcode{\sphinxupquote{DrawingArea}} acts as a parent for zero or more \sphinxcode{\sphinxupquote{Artists}} that draw on it and may do so beyond the bounds. Now child \sphinxcode{\sphinxupquote{Artists}} can be clipped to the bounds of the \sphinxcode{\sphinxupquote{DrawingArea}}. \paragraph{OffsetBoxes now considered by tight\_layout} \label{\detokenize{users/prev_whats_new/whats_new_1.5:offsetboxes-now-considered-by-tight-layout}} When {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tight_layout:matplotlib.pyplot.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout()}}}}} or \sphinxcode{\sphinxupquote{Figure.tight\_layout()}} or \sphinxcode{\sphinxupquote{GridSpec.tight\_layout()}} is called, \sphinxcode{\sphinxupquote{OffsetBoxes}} that are anchored outside the axes will not get chopped out. The \sphinxcode{\sphinxupquote{OffsetBoxes}} will also not get overlapped by other axes in case of multiple subplots. \paragraph{Per-page pdf notes in multi-page pdfs (PdfPages)} \label{\detokenize{users/prev_whats_new/whats_new_1.5:per-page-pdf-notes-in-multi-page-pdfs-pdfpages}} Add a new method {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfPages.attach_note}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{attach\_note()}}}}} to the PdfPages class, allowing the attachment of simple text notes to pages in a multi-page pdf of figures. The new note is visible in the list of pdf annotations in a viewer that has this facility (Adobe Reader, OSX Preview, Skim, etc.). Per default the note itself is kept off-page to prevent it to appear in print-outs. \sphinxcode{\sphinxupquote{PdfPages.attach\_note}} needs to be called before \sphinxcode{\sphinxupquote{savefig()}} in order to be added to the correct figure. \paragraph{Updated fignum\_exists to take figure name} \label{\detokenize{users/prev_whats_new/whats_new_1.5:updated-fignum-exists-to-take-figure-name}} Added the ability to check the existence of a figure using its name instead of just the figure number. Example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{figure}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{figure}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fignum\PYGZus{}exists}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{figure}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{}true} \end{sphinxVerbatim} \subsubsection{ToolManager} \label{\detokenize{users/prev_whats_new/whats_new_1.5:toolmanager}} Federico Ariza wrote the new {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolManager}}}}} that comes as replacement for \sphinxcode{\sphinxupquote{NavigationToolbar2}} \sphinxcode{\sphinxupquote{ToolManager}} offers a new way of looking at the user interactions with the figures. Before we had the \sphinxcode{\sphinxupquote{NavigationToolbar2}} with its own tools like \sphinxcode{\sphinxupquote{zoom/pan/home/save/...}} and also we had the shortcuts like \sphinxcode{\sphinxupquote{yscale/grid/quit/....}} \sphinxcode{\sphinxupquote{Toolmanager}} relocate all those actions as \sphinxcode{\sphinxupquote{Tools}} (located in {\hyperref[\detokenize{api/backend_tools_api:module-matplotlib.backend_tools}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{backend\_tools}}}}}), and defines a way to \sphinxcode{\sphinxupquote{access/trigger/reconfigure}} them. The \sphinxcode{\sphinxupquote{Toolbars}} are replaced for \sphinxcode{\sphinxupquote{ToolContainers}} that are just GUI interfaces to \sphinxcode{\sphinxupquote{trigger}} the tools. But don’t worry the default backends include a \sphinxcode{\sphinxupquote{ToolContainer}} called \sphinxcode{\sphinxupquote{toolbar}} \begin{sphinxadmonition}{note}{Note:} At the moment, we release this primarily for feedback purposes and should be treated as experimental until further notice as API changes will occur. For the moment the \sphinxcode{\sphinxupquote{ToolManager}} works only with the \sphinxcode{\sphinxupquote{GTK3}} and \sphinxcode{\sphinxupquote{Tk}} backends. Make sure you use one of those. Port for the rest of the backends is comming soon. To activate the \sphinxcode{\sphinxupquote{ToolManager}} include the following at the top of your file \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{toolbar}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{toolmanager}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} \end{sphinxadmonition} \paragraph{Interact with the ToolContainer} \label{\detokenize{users/prev_whats_new/whats_new_1.5:interact-with-the-toolcontainer}} The most important feature is the ability to easily reconfigure the ToolContainer (aka toolbar). For example, if we want to remove the “forward” button we would just do. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{manager}\PYG{o}{.}\PYG{n}{toolmanager}\PYG{o}{.}\PYG{n}{remove\PYGZus{}tool}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{forward}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} Now if you want to programmatically trigger the “home” button \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{manager}\PYG{o}{.}\PYG{n}{toolmanager}\PYG{o}{.}\PYG{n}{trigger\PYGZus{}tool}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{home}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \paragraph{New Tools for ToolManager} \label{\detokenize{users/prev_whats_new/whats_new_1.5:new-tools-for-toolmanager}} It is possible to add new tools to the ToolManager A very simple tool that prints “You’re awesome” would be: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{backend\PYGZus{}tools} \PYG{k}{import} \PYG{n}{ToolBase} \PYG{k}{class} \PYG{n+nc}{AwesomeTool}\PYG{p}{(}\PYG{n}{ToolBase}\PYG{p}{)}\PYG{p}{:} \PYG{k}{def} \PYG{n+nf}{trigger}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{o}{*}\PYG{n}{args}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{You}\PYG{l+s+s2}{\PYGZsq{}}\PYG{l+s+s2}{re awesome}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} To add this tool to \sphinxcode{\sphinxupquote{ToolManager}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{manager}\PYG{o}{.}\PYG{n}{toolmanager}\PYG{o}{.}\PYG{n}{add\PYGZus{}tool}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Awesome}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{AwesomeTool}\PYG{p}{)} \end{sphinxVerbatim} If we want to add a shortcut (“d”) for the tool \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{manager}\PYG{o}{.}\PYG{n}{toolmanager}\PYG{o}{.}\PYG{n}{update\PYGZus{}keymap}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Awesome}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{d}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} To add it to the toolbar inside the group ‘foo’ \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{manager}\PYG{o}{.}\PYG{n}{toolbar}\PYG{o}{.}\PYG{n}{add\PYGZus{}tool}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Awesome}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{foo}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} There is a second class of tools, “Toggleable Tools”, this are almost the same as our basic tools, just that belong to a group, and are mutually exclusive inside that group. For tools derived from \sphinxcode{\sphinxupquote{ToolToggleBase}} there are two basic methods \sphinxcode{\sphinxupquote{enable}} and \sphinxcode{\sphinxupquote{disable}} that are called automatically whenever it is toggled. A full example is located in \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_toolmanager\_sgskip.py} \subsubsection{cbook.is\_sequence\_of\_strings recognizes string objects} \label{\detokenize{users/prev_whats_new/whats_new_1.5:cbook-is-sequence-of-strings-recognizes-string-objects}} This is primarily how pandas stores a sequence of strings \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{pandas} \PYG{k}{as} \PYG{n+nn}{pd} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{cbook} \PYG{k}{as} \PYG{n+nn}{cbook} \PYG{n}{a} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{array}\PYG{p}{(}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{a}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{c}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{cbook}\PYG{o}{.}\PYG{n}{is\PYGZus{}sequence\PYGZus{}of\PYGZus{}strings}\PYG{p}{(}\PYG{n}{a}\PYG{p}{)}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} True} \PYG{n}{a} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{array}\PYG{p}{(}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{a}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{c}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{n}{dtype}\PYG{o}{=}\PYG{n+nb}{object}\PYG{p}{)} \PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{cbook}\PYG{o}{.}\PYG{n}{is\PYGZus{}sequence\PYGZus{}of\PYGZus{}strings}\PYG{p}{(}\PYG{n}{a}\PYG{p}{)}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} True} \PYG{n}{s} \PYG{o}{=} \PYG{n}{pd}\PYG{o}{.}\PYG{n}{Series}\PYG{p}{(}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{a}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{c}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{cbook}\PYG{o}{.}\PYG{n}{is\PYGZus{}sequence\PYGZus{}of\PYGZus{}strings}\PYG{p}{(}\PYG{n}{s}\PYG{p}{)}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} True} \end{sphinxVerbatim} Previously, the last two prints returned false. \subsubsection{New \sphinxstyleliteralintitle{\sphinxupquote{close-figs}} argument for plot directive} \label{\detokenize{users/prev_whats_new/whats_new_1.5:new-close-figs-argument-for-plot-directive}} Matplotlib has a sphinx extension \sphinxcode{\sphinxupquote{plot\_directive}} that creates plots for inclusion in sphinx documents. Matplotlib 1.5 adds a new option to the plot directive - \sphinxcode{\sphinxupquote{close-figs}} - that closes any previous figure windows before creating the plots. This can help avoid some surprising duplicates of plots when using \sphinxcode{\sphinxupquote{plot\_directive}}. \subsubsection{Support for URL string arguments to \sphinxstyleliteralintitle{\sphinxupquote{imread}}} \label{\detokenize{users/prev_whats_new/whats_new_1.5:support-for-url-string-arguments-to-imread}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imread:matplotlib.pyplot.imread}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imread()}}}}} function now accepts URL strings that point to remote PNG files. This circumvents the generation of a HTTPResponse object directly. \subsubsection{Display hook for animations in the IPython notebook} \label{\detokenize{users/prev_whats_new/whats_new_1.5:display-hook-for-animations-in-the-ipython-notebook}} {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Animation}}}}} instances gained a \sphinxcode{\sphinxupquote{\_repr\_html\_}} method to support inline display of animations in the notebook. The method used to display is controlled by the \sphinxcode{\sphinxupquote{animation.html}} rc parameter, which currently supports values of \sphinxcode{\sphinxupquote{none}} and \sphinxcode{\sphinxupquote{html5}}. \sphinxcode{\sphinxupquote{none}} is the default, performing no display. \sphinxcode{\sphinxupquote{html5}} converts the animation to an h264 encoded video, which is embedded directly in the notebook. Users not wishing to use the \sphinxcode{\sphinxupquote{\_repr\_html\_}} display hook can also manually call the \sphinxcode{\sphinxupquote{to\_html5\_video}} method to get the HTML and display using IPython’s \sphinxcode{\sphinxupquote{HTML}} display class: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{IPython}\PYG{n+nn}{.}\PYG{n+nn}{display} \PYG{k}{import} \PYG{n}{HTML} \PYG{n}{HTML}\PYG{p}{(}\PYG{n}{anim}\PYG{o}{.}\PYG{n}{to\PYGZus{}html5\PYGZus{}video}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \subsubsection{Prefixed pkg-config for building} \label{\detokenize{users/prev_whats_new/whats_new_1.5:prefixed-pkg-config-for-building}} Handling of \sphinxcode{\sphinxupquote{pkg-config}} has been fixed in so far as it is now possible to set it using the environment variable \sphinxcode{\sphinxupquote{PKG\_CONFIG}}. This is important if your toolchain is prefixed. This is done in a simpilar way as setting \sphinxcode{\sphinxupquote{CC}} or \sphinxcode{\sphinxupquote{CXX}} before building. An example follows. \begin{quote} export PKG\_CONFIG=x86\_64-pc-linux-gnu-pkg-config \end{quote} \subsection{New in matplotlib 2.0} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:new-in-matplotlib-2-0}}\label{\detokenize{users/prev_whats_new/whats_new_2.0.0:whats-new-2-0-0}}\label{\detokenize{users/prev_whats_new/whats_new_2.0.0::doc}} \begin{sphinxadmonition}{note}{Note:} matplotlib 2.0 supports Python 2.7, and 3.4+ \end{sphinxadmonition} \subsubsection{Default style changes} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:default-style-changes}} The major changes in v2.0 are related to overhauling the default styles. \paragraph{Changes to the default style} \label{\detokenize{users/dflt_style_changes:changes-to-the-default-style}}\label{\detokenize{users/dflt_style_changes::doc}} The most important changes in matplotlib 2.0 are the changes to the default style. While it is impossible to select the best default for all cases, these are designed to work well in the most common cases. A ‘classic’ style sheet is provided so reverting to the 1.x default values is a single line of python \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{style} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{k}{as} \PYG{n+nn}{mpl} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{style}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{classic}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} See {\hyperref[\detokenize{tutorials/introductory/customizing:customizing-with-matplotlibrc-files}]{\sphinxcrossref{\DUrole{std,std-ref}{The matplotlibrc file}}}} for details about how to persistently and selectively revert many of these changes. \begin{sphinxShadowBox} \sphinxstyletopictitle{Table of Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id1}}{\hyperref[\detokenize{users/dflt_style_changes:colors-color-cycles-and-color-maps}]{\sphinxcrossref{Colors, color cycles, and color maps}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id2}}{\hyperref[\detokenize{users/dflt_style_changes:colors-in-default-property-cycle}]{\sphinxcrossref{Colors in default property cycle}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id3}}{\hyperref[\detokenize{users/dflt_style_changes:colormap}]{\sphinxcrossref{Colormap}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id4}}{\hyperref[\detokenize{users/dflt_style_changes:interactive-figures}]{\sphinxcrossref{Interactive figures}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id5}}{\hyperref[\detokenize{users/dflt_style_changes:grid-lines}]{\sphinxcrossref{Grid lines}}} \end{itemize} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id6}}{\hyperref[\detokenize{users/dflt_style_changes:figure-size-font-size-and-screen-dpi}]{\sphinxcrossref{Figure size, font size, and screen dpi}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id7}}{\hyperref[\detokenize{users/dflt_style_changes:plotting-functions}]{\sphinxcrossref{Plotting functions}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id8}}{\hyperref[\detokenize{users/dflt_style_changes:scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter}}}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id9}}{\hyperref[\detokenize{users/dflt_style_changes:plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id10}}{\hyperref[\detokenize{users/dflt_style_changes:errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar}}}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id11}}{\hyperref[\detokenize{users/dflt_style_changes:boxplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{boxplot}}}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id12}}{\hyperref[\detokenize{users/dflt_style_changes:fill-between-and-fill-betweenx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill\_between}} and \sphinxcode{\sphinxupquote{fill\_betweenx}}}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id13}}{\hyperref[\detokenize{users/dflt_style_changes:patch-edges-and-color}]{\sphinxcrossref{Patch edges and color}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id14}}{\hyperref[\detokenize{users/dflt_style_changes:hexbin}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hexbin}}}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id15}}{\hyperref[\detokenize{users/dflt_style_changes:bar-and-barh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bar}} and \sphinxcode{\sphinxupquote{barh}}}}} \end{itemize} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id16}}{\hyperref[\detokenize{users/dflt_style_changes:hatching}]{\sphinxcrossref{Hatching}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id17}}{\hyperref[\detokenize{users/dflt_style_changes:fonts}]{\sphinxcrossref{Fonts}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id18}}{\hyperref[\detokenize{users/dflt_style_changes:normal-text}]{\sphinxcrossref{Normal text}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id19}}{\hyperref[\detokenize{users/dflt_style_changes:math-text}]{\sphinxcrossref{Math text}}} \end{itemize} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id20}}{\hyperref[\detokenize{users/dflt_style_changes:legends}]{\sphinxcrossref{Legends}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id21}}{\hyperref[\detokenize{users/dflt_style_changes:image}]{\sphinxcrossref{Image}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id22}}{\hyperref[\detokenize{users/dflt_style_changes:interpolation}]{\sphinxcrossref{Interpolation}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id23}}{\hyperref[\detokenize{users/dflt_style_changes:colormapping-pipeline}]{\sphinxcrossref{Colormapping pipeline}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id24}}{\hyperref[\detokenize{users/dflt_style_changes:shading}]{\sphinxcrossref{Shading}}} \end{itemize} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id25}}{\hyperref[\detokenize{users/dflt_style_changes:plot-layout}]{\sphinxcrossref{Plot layout}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id26}}{\hyperref[\detokenize{users/dflt_style_changes:auto-limits}]{\sphinxcrossref{Auto limits}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id27}}{\hyperref[\detokenize{users/dflt_style_changes:z-order}]{\sphinxcrossref{Z-order}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id28}}{\hyperref[\detokenize{users/dflt_style_changes:ticks}]{\sphinxcrossref{Ticks}}} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id29}}{\hyperref[\detokenize{users/dflt_style_changes:tick-label-formatting}]{\sphinxcrossref{Tick label formatting}}} \end{itemize} \item {} \phantomsection\label{\detokenize{users/dflt_style_changes:id30}}{\hyperref[\detokenize{users/dflt_style_changes:mplot3d}]{\sphinxcrossref{mplot3d}}} \end{itemize} \end{sphinxShadowBox} \subparagraph{Colors, color cycles, and color maps} \label{\detokenize{users/dflt_style_changes:colors-color-cycles-and-color-maps}} \subparagraph{Colors in default property cycle} \label{\detokenize{users/dflt_style_changes:colors-in-default-property-cycle}} The colors in the default property cycle have been changed from \sphinxcode{\sphinxupquote{{[}'b', 'g', 'r', 'c', 'm', 'y', 'k'{]}}} to the category10 color palette used by \sphinxhref{https://github.com/vega/vega/wiki/Scales\#scale-range-literals}{Vega} and \sphinxhref{https://github.com/d3/d3-3.x-api-reference/blob/master/Ordinal-Scales.md\#category10}{d3} originally developed at Tableau. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-1}.pdf} \end{figure} In addition to changing the colors, an additional method to specify colors was added. Previously, the default colors were the single character short-hand notations for red, green, blue, cyan, magenta, yellow, and black. This made them easy to type and usable in the abbreviated style string in \sphinxcode{\sphinxupquote{plot}}, however the new default colors are only specified via hex values. To access these colors outside of the property cycling the notation for colors \sphinxcode{\sphinxupquote{'CN'}}, where \sphinxcode{\sphinxupquote{N}} takes values 0-9, was added to denote the first 10 colors in \sphinxcode{\sphinxupquote{mpl.rcParams{[}'axes.prop\_cycle'{]}}} See {\hyperref[\detokenize{tutorials/colors/colors:sphx-glr-tutorials-colors-colors-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Specifying Colors}}}} for more details. To restore the old color cycle use \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{cycler} \PYG{k}{import} \PYG{n}{cycler} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes.prop\PYGZus{}cycle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{n}{cycler}\PYG{p}{(}\PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bgrcmyk}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} or set \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{axes}\PYG{o}{.}\PYG{n}{prop\PYGZus{}cycle} \PYG{p}{:} \PYG{n}{cycler}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bgrcmyk}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} in your \sphinxcode{\sphinxupquote{matplotlibrc}} file. \subparagraph{Colormap} \label{\detokenize{users/dflt_style_changes:colormap}}\begin{description} \item[{The new default color map used by {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}} instances is}] \leavevmode \sphinxcode{\sphinxupquote{'viridis'}} (aka \sphinxhref{https://bids.github.io/colormap/}{option D}). \end{description} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-2}.pdf} \end{figure} For an introduction to color theory and how ‘viridis’ was generated watch Nathaniel Smith and Stéfan van der Walt’s talk from SciPy2015. See \sphinxhref{https://bids.github.io/colormap/}{here for many more details} about the other alternatives and the tools used to create the color map. For details on all of the color maps available in matplotlib see {\hyperref[\detokenize{tutorials/colors/colormaps:sphx-glr-tutorials-colors-colormaps-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Colormaps in Matplotlib}}}}. The previous default can be restored using \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{image.cmap}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{jet}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} or setting \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{image}\PYG{o}{.}\PYG{n}{cmap} \PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{jet}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} in your \sphinxcode{\sphinxupquote{matplotlibrc}} file; however this is strongly discouraged. \subparagraph{Interactive figures} \label{\detokenize{users/dflt_style_changes:interactive-figures}} The default interactive figure background color has changed from grey to white, which matches the default background color used when saving. The previous defaults can be restored by \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{figure.facecolor}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{0.75}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} or by setting \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{figure}\PYG{o}{.}\PYG{n}{facecolor} \PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{0.75}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} in your \sphinxcode{\sphinxupquote{matplotlibrc}} file. \subparagraph{Grid lines} \label{\detokenize{users/dflt_style_changes:grid-lines}} The default style of grid lines was changed from black dashed lines to thicker solid light grey lines. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-3}.pdf} \end{figure} The previous default can be restored by using: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{grid.color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{grid.linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{:}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{grid.linewidth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mf}{0.5} \end{sphinxVerbatim} or by setting: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{grid}\PYG{o}{.}\PYG{n}{color} \PYG{p}{:} \PYG{n}{k} \PYG{c+c1}{\PYGZsh{} grid color} \PYG{n}{grid}\PYG{o}{.}\PYG{n}{linestyle} \PYG{p}{:} \PYG{p}{:} \PYG{c+c1}{\PYGZsh{} dotted} \PYG{n}{grid}\PYG{o}{.}\PYG{n}{linewidth} \PYG{p}{:} \PYG{l+m+mf}{0.5} \PYG{c+c1}{\PYGZsh{} in points} \end{sphinxVerbatim} in your \sphinxcode{\sphinxupquote{matplotlibrc}} file. \subparagraph{Figure size, font size, and screen dpi} \label{\detokenize{users/dflt_style_changes:figure-size-font-size-and-screen-dpi}} The default dpi used for on-screen display was changed from 80 dpi to 100 dpi, the same as the default dpi for saving files. Due to this change, the on-screen display is now more what-you-see-is-what-you-get for saved files. To keep the figure the same size in terms of pixels, in order to maintain approximately the same size on the screen, the default figure size was reduced from 8x6 inches to 6.4x4.8 inches. As a consequence of this the default font sizes used for the title, tick labels, and axes labels were reduced to maintain their size relative to the overall size of the figure. By default the dpi of the saved image is now the dpi of the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance being saved. This will have consequences if you are trying to match text in a figure directly with external text. The previous defaults can be restored by \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{figure.figsize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{p}{[}\PYG{l+m+mf}{8.0}\PYG{p}{,} \PYG{l+m+mf}{6.0}\PYG{p}{]} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{figure.dpi}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mi}{80} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{savefig.dpi}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mi}{100} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{font.size}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mi}{12} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{legend.fontsize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{large}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{figure.titlesize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{medium}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} or by setting: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{figure}\PYG{o}{.}\PYG{n}{figsize} \PYG{p}{:} \PYG{p}{[}\PYG{l+m+mf}{8.0}\PYG{p}{,} \PYG{l+m+mf}{6.0}\PYG{p}{]} \PYG{n}{figure}\PYG{o}{.}\PYG{n}{dpi} \PYG{p}{:} \PYG{l+m+mi}{80} \PYG{n}{savefig}\PYG{o}{.}\PYG{n}{dpi} \PYG{p}{:} \PYG{l+m+mi}{100} \PYG{n}{font}\PYG{o}{.}\PYG{n}{size} \PYG{p}{:} \PYG{l+m+mf}{12.0} \PYG{n}{legend}\PYG{o}{.}\PYG{n}{fontsize} \PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{large}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{figure}\PYG{o}{.}\PYG{n}{titlesize} \PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{medium}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} In your \sphinxcode{\sphinxupquote{matplotlibrc}} file. In addition, the \sphinxcode{\sphinxupquote{forward}} kwarg to \sphinxcode{\sphinxupquote{set\_size\_inches}} now defaults to \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} to improve the interactive experience. Backend canvases that adjust the size of their bound {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure}}}}} must pass \sphinxcode{\sphinxupquote{forward=False}} to avoid circular behavior. This default is not configurable. \subparagraph{Plotting functions} \label{\detokenize{users/dflt_style_changes:plotting-functions}} \subparagraph{\sphinxstyleliteralintitle{\sphinxupquote{scatter}}} \label{\detokenize{users/dflt_style_changes:scatter}} The following changes were made to the default behavior of {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.scatter:matplotlib.axes.Axes.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter}}}}} \begin{itemize} \item {} The default size of the elements in a scatter plot is now based on the rcParam \sphinxcode{\sphinxupquote{lines.markersize}} so it is consistent with \sphinxcode{\sphinxupquote{plot(X, Y, 'o')}}. The old value was 20, and the new value is 36 (6\textasciicircum{}2). \item {} scatter markers no longer have a black edge. \item {} if the color of the markers is not specified it will follow the property cycle, pulling from the ‘patches’ cycle on the \sphinxcode{\sphinxupquote{Axes}}. \end{itemize} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-4}.pdf} \end{figure} The classic default behavior of {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.scatter:matplotlib.axes.Axes.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter}}}}} can only be recovered through \sphinxcode{\sphinxupquote{mpl.style.use('classic')}}. The marker size can be recovered via \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParam}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines.markersize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sqrt}\PYG{p}{(}\PYG{l+m+mi}{20}\PYG{p}{)} \end{sphinxVerbatim} however, this will also affect the default marker size of {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}. To recover the classic behavior on a per-call basis pass the following kwargs: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{classic\PYGZus{}kwargs} \PYG{o}{=} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{s}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{20}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{edgecolors}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{c}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}} \end{sphinxVerbatim} \subparagraph{\sphinxstyleliteralintitle{\sphinxupquote{plot}}} \label{\detokenize{users/dflt_style_changes:plot}} The following changes were made to the default behavior of {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} \begin{itemize} \item {} the default linewidth increased from 1 to 1.5 \item {} the dash patterns associated with \sphinxcode{\sphinxupquote{'-{-}'}}, \sphinxcode{\sphinxupquote{':'}}, and \sphinxcode{\sphinxupquote{'-.'}} have changed \item {} the dash patterns now scale with line width \end{itemize} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-5}.pdf} \end{figure} The previous defaults can be restored by setting: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines.linewidth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mf}{1.0} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines.dashed\PYGZus{}pattern}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{p}{[}\PYG{l+m+mi}{6}\PYG{p}{,} \PYG{l+m+mi}{6}\PYG{p}{]} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines.dashdot\PYGZus{}pattern}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{]} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines.dotted\PYGZus{}pattern}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines.scale\PYGZus{}dashes}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{k+kc}{False} \end{sphinxVerbatim} or by setting: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{lines}\PYG{o}{.}\PYG{n}{linewidth} \PYG{p}{:} \PYG{l+m+mf}{1.0} \PYG{n}{lines}\PYG{o}{.}\PYG{n}{dashed\PYGZus{}pattern} \PYG{p}{:} \PYG{l+m+mi}{6}\PYG{p}{,} \PYG{l+m+mi}{6} \PYG{n}{lines}\PYG{o}{.}\PYG{n}{dashdot\PYGZus{}pattern} \PYG{p}{:} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{5} \PYG{n}{lines}\PYG{o}{.}\PYG{n}{dotted\PYGZus{}pattern} \PYG{p}{:} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{3} \PYG{n}{lines}\PYG{o}{.}\PYG{n}{scale\PYGZus{}dashes}\PYG{p}{:} \PYG{k+kc}{False} \end{sphinxVerbatim} in your \sphinxcode{\sphinxupquote{matplotlibrc}} file. \subparagraph{\sphinxstyleliteralintitle{\sphinxupquote{errorbar}}} \label{\detokenize{users/dflt_style_changes:errorbar}} By default, caps on the ends of errorbars are not present. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-6}.pdf} \end{figure} This also changes the return value of {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.errorbar:matplotlib.axes.Axes.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar()}}}}} as the list of ‘caplines’ will be empty by default. The previous defaults can be restored by setting: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{errorbar.capsize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mi}{3} \end{sphinxVerbatim} or by setting \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{errorbar}\PYG{o}{.}\PYG{n}{capsize} \PYG{p}{:} \PYG{l+m+mi}{3} \end{sphinxVerbatim} in your \sphinxcode{\sphinxupquote{matplotlibrc}} file. \subparagraph{\sphinxstyleliteralintitle{\sphinxupquote{boxplot}}} \label{\detokenize{users/dflt_style_changes:boxplot}} Previously, boxplots were composed of a mish-mash of styles that were, for better for worse, inherited from Matlab. Most of the elements were blue, but the medians were red. The fliers (outliers) were black plus-symbols (\sphinxcode{\sphinxupquote{+}}) and the whiskers were dashed lines, which created ambiguity if the (solid and black) caps were not drawn. For the new defaults, everything is black except for the median and mean lines (if drawn), which are set to the first two elements of the current color cycle. Also, the default flier markers are now hollow circles, which maintain the ability of the plus-symbols to overlap without obscuring data too much. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-7}.pdf} \end{figure} The previous defaults can be restored by setting: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxplot.flierprops.color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxplot.flierprops.marker}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{+}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxplot.flierprops.markerfacecolor}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{none}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxplot.flierprops.markeredgecolor}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxplot.boxprops.color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxplot.whiskerprops.color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxplot.whiskerprops.linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxplot.medianprops.color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxplot.meanprops.color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxplot.meanprops.marker}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZca{}}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxplot.meanprops.markerfacecolor}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxplot.meanprops.markeredgecolor}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxplot.meanprops.markersize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mi}{6} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxplot.meanprops.linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{boxplot.meanprops.linewidth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mf}{1.0} \end{sphinxVerbatim} or by setting: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{boxplot}\PYG{o}{.}\PYG{n}{flierprops}\PYG{o}{.}\PYG{n}{color}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{boxplot}\PYG{o}{.}\PYG{n}{flierprops}\PYG{o}{.}\PYG{n}{marker}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{+}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{boxplot}\PYG{o}{.}\PYG{n}{flierprops}\PYG{o}{.}\PYG{n}{markerfacecolor}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{none}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{boxplot}\PYG{o}{.}\PYG{n}{flierprops}\PYG{o}{.}\PYG{n}{markeredgecolor}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{boxplot}\PYG{o}{.}\PYG{n}{boxprops}\PYG{o}{.}\PYG{n}{color}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{boxplot}\PYG{o}{.}\PYG{n}{whiskerprops}\PYG{o}{.}\PYG{n}{color}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{boxplot}\PYG{o}{.}\PYG{n}{whiskerprops}\PYG{o}{.}\PYG{n}{linestyle}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{boxplot}\PYG{o}{.}\PYG{n}{medianprops}\PYG{o}{.}\PYG{n}{color}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{boxplot}\PYG{o}{.}\PYG{n}{meanprops}\PYG{o}{.}\PYG{n}{color}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{boxplot}\PYG{o}{.}\PYG{n}{meanprops}\PYG{o}{.}\PYG{n}{marker}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZca{}}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{boxplot}\PYG{o}{.}\PYG{n}{meanprops}\PYG{o}{.}\PYG{n}{markerfacecolor}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{boxplot}\PYG{o}{.}\PYG{n}{meanprops}\PYG{o}{.}\PYG{n}{markeredgecolor}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{boxplot}\PYG{o}{.}\PYG{n}{meanprops}\PYG{o}{.}\PYG{n}{markersize}\PYG{p}{:} \PYG{l+m+mi}{6} \PYG{n}{boxplot}\PYG{o}{.}\PYG{n}{meanprops}\PYG{o}{.}\PYG{n}{linestyle}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{boxplot}\PYG{o}{.}\PYG{n}{meanprops}\PYG{o}{.}\PYG{n}{linewidth}\PYG{p}{:} \PYG{l+m+mf}{1.0} \end{sphinxVerbatim} in your \sphinxcode{\sphinxupquote{matplotlibrc}} file. \subparagraph{\sphinxstyleliteralintitle{\sphinxupquote{fill\_between}} and \sphinxstyleliteralintitle{\sphinxupquote{fill\_betweenx}}} \label{\detokenize{users/dflt_style_changes:fill-between-and-fill-betweenx}} {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.fill_between:matplotlib.axes.Axes.fill_between}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill\_between}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.fill_betweenx:matplotlib.axes.Axes.fill_betweenx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill\_betweenx}}}}} both follow the patch color cycle. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-8}.pdf} \end{figure} If the facecolor is set via the \sphinxcode{\sphinxupquote{facecolors}} or \sphinxcode{\sphinxupquote{color}} keyword argument, then the color is not cycled. To restore the previous behavior, explicitly pass the keyword argument \sphinxcode{\sphinxupquote{facecolors='C0'}} to the method call. \subparagraph{Patch edges and color} \label{\detokenize{users/dflt_style_changes:patch-edges-and-color}} Most artists drawn with a patch (\sphinxcode{\sphinxupquote{\textasciitilde{}matplotlib.axes.Axes.bar}}, \sphinxcode{\sphinxupquote{\textasciitilde{}matplotlib.axes.Axes.pie}}, etc) no longer have a black edge by default. The default face color is now \sphinxcode{\sphinxupquote{'C0'}} instead of \sphinxcode{\sphinxupquote{'b'}}. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-9}.pdf} \end{figure} The previous defaults can be restored by setting: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{patch.force\PYGZus{}edgecolor}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{k+kc}{True} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{patch.facecolor}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} or by setting: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{patch}\PYG{o}{.}\PYG{n}{facecolor} \PYG{p}{:} \PYG{n}{b} \PYG{n}{patch}\PYG{o}{.}\PYG{n}{force\PYGZus{}edgecolor} \PYG{p}{:} \PYG{k+kc}{True} \end{sphinxVerbatim} in your \sphinxcode{\sphinxupquote{matplotlibrc}} file. \subparagraph{\sphinxstyleliteralintitle{\sphinxupquote{hexbin}}} \label{\detokenize{users/dflt_style_changes:hexbin}} The default value of the \sphinxcode{\sphinxupquote{linecolor}} kwarg for \sphinxcode{\sphinxupquote{hexbin}} has changed from \sphinxcode{\sphinxupquote{'none'}} to \sphinxcode{\sphinxupquote{'face'}}. If ‘none’ is now supplied, no line edges are drawn around the hexagons. \subparagraph{\sphinxstyleliteralintitle{\sphinxupquote{bar}} and \sphinxstyleliteralintitle{\sphinxupquote{barh}}} \label{\detokenize{users/dflt_style_changes:bar-and-barh}}\label{\detokenize{users/dflt_style_changes:barbarh-align}} The default value of the \sphinxcode{\sphinxupquote{align}} kwarg for both \sphinxcode{\sphinxupquote{bar}} and \sphinxcode{\sphinxupquote{barh}} is changed from \sphinxcode{\sphinxupquote{'edge'}} to \sphinxcode{\sphinxupquote{'center'}}. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-10}.pdf} \end{figure} To restore the previous behavior explicitly pass the keyword argument \sphinxcode{\sphinxupquote{align='edge'}} to the method call. \subparagraph{Hatching} \label{\detokenize{users/dflt_style_changes:hatching}} The color of the lines in the hatch is now determined by \begin{itemize} \item {} If an edge color is explicitly set, use that for the hatch color \item {} If the edge color is not explicitly set, use \sphinxcode{\sphinxupquote{rcParam{[}'hatch.color'{]}}} which is looked up at artist creation time. \end{itemize} The width of the lines in a hatch pattern is now configurable by the rcParams \sphinxcode{\sphinxupquote{hatch.linewidth}}, which defaults to 1 point. The old behavior for the line width was different depending on backend: \begin{itemize} \item {} PDF: 0.1 pt \item {} SVG: 1.0 pt \item {} PS: 1 px \item {} Agg: 1 px \end{itemize} The old line width behavior can not be restored across all backends simultaneously, but can be restored for a single backend by setting: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{hatch.linewidth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mf}{0.1} \PYG{c+c1}{\PYGZsh{} previous pdf hatch linewidth} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{hatch.linewidth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mf}{1.0} \PYG{c+c1}{\PYGZsh{} previous svg hatch linewidth} \end{sphinxVerbatim} The behavior of the PS and Agg backends was DPI dependent, thus: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{figure.dpi}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{n}{dpi} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{savefig.dpi}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{n}{dpi} \PYG{c+c1}{\PYGZsh{} or leave as default \PYGZsq{}figure\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{hatch.linewidth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mf}{1.0} \PYG{o}{/} \PYG{n}{dpi} \PYG{c+c1}{\PYGZsh{} previous ps and Agg hatch linewidth} \end{sphinxVerbatim} There is no direct API level control of the hatch color or linewidth. Hatching patterns are now rendered at a consistent density, regardless of DPI. Formerly, high DPI figures would be more dense than the default, and low DPI figures would be less dense. This old behavior cannot be directly restored, but the density may be increased by repeating the hatch specifier. \subparagraph{Fonts} \label{\detokenize{users/dflt_style_changes:fonts}}\label{\detokenize{users/dflt_style_changes:default-changes-font}} \subparagraph{Normal text} \label{\detokenize{users/dflt_style_changes:normal-text}} The default font has changed from “Bitstream Vera Sans” to “DejaVu Sans”. DejaVu Sans has additional international and math characters, but otherwise has the same appearance as Bitstream Vera Sans. Latin, Greek, Cyrillic, Armenian, Georgian, Hebrew, and Arabic are \sphinxhref{https://dejavu-fonts.github.io/}{all supported} (but right-to-left rendering is still not handled by matplotlib). In addition, DejaVu contains a sub-set of emoji symbols. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-11}.pdf} \end{figure} See the \sphinxhref{http://dejavu.sourceforge.net/samples/DejaVuSans.pdf}{DejaVu Sans PDF sample for full coverage}. \subparagraph{Math text} \label{\detokenize{users/dflt_style_changes:math-text}} The default math font when using the built-in math rendering engine (mathtext) has changed from “Computer Modern” (i.e. LaTeX-like) to “DejaVu Sans”. This change has no effect if the TeX backend is used (i.e. \sphinxcode{\sphinxupquote{text.usetex}} is \sphinxcode{\sphinxupquote{True}}). \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-12}.pdf} \end{figure} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-13}.pdf} \end{figure} To revert to the old behavior set the: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{mathtext.fontset}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{cm}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{mathtext.rm}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{serif}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} or set: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mathtext}\PYG{o}{.}\PYG{n}{fontset}\PYG{p}{:} \PYG{n}{cm} \PYG{n}{mathtext}\PYG{o}{.}\PYG{n}{rm} \PYG{p}{:} \PYG{n}{serif} \end{sphinxVerbatim} in your \sphinxcode{\sphinxupquote{matplotlibrc}} file. This \sphinxcode{\sphinxupquote{rcParam}} is consulted when the text is drawn, not when the artist is created. Thus all mathtext on a given \sphinxcode{\sphinxupquote{canvas}} will use the same fontset. \subparagraph{Legends} \label{\detokenize{users/dflt_style_changes:legends}}\begin{itemize} \item {} By default, the number of points displayed in a legend is now 1. \item {} The default legend location is \sphinxcode{\sphinxupquote{'best'}}, so the legend will be automatically placed in a location to minimize overlap with data. \item {} The legend defaults now include rounded corners, a lighter boundary, and partially transparent boundary and background. \end{itemize} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-14}.pdf} \end{figure} The previous defaults can be restored by setting: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{legend.fancybox}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{k+kc}{False} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{legend.loc}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{upper right}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{legend.numpoints}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mi}{2} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{legend.fontsize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{large}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{legend.framealpha}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{k+kc}{None} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{legend.scatterpoints}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mi}{3} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{legend.edgecolor}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{inherit}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} or by setting: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{legend}\PYG{o}{.}\PYG{n}{fancybox} \PYG{p}{:} \PYG{k+kc}{False} \PYG{n}{legend}\PYG{o}{.}\PYG{n}{loc} \PYG{p}{:} \PYG{n}{upper} \PYG{n}{right} \PYG{n}{legend}\PYG{o}{.}\PYG{n}{numpoints} \PYG{p}{:} \PYG{l+m+mi}{2} \PYG{c+c1}{\PYGZsh{} the number of points in the legend line} \PYG{n}{legend}\PYG{o}{.}\PYG{n}{fontsize} \PYG{p}{:} \PYG{n}{large} \PYG{n}{legend}\PYG{o}{.}\PYG{n}{framealpha} \PYG{p}{:} \PYG{k+kc}{None} \PYG{c+c1}{\PYGZsh{} opacity of legend frame} \PYG{n}{legend}\PYG{o}{.}\PYG{n}{scatterpoints} \PYG{p}{:} \PYG{l+m+mi}{3} \PYG{c+c1}{\PYGZsh{} number of scatter points} \PYG{n}{legend}\PYG{o}{.}\PYG{n}{edgecolor} \PYG{p}{:} \PYG{n}{inherit} \PYG{c+c1}{\PYGZsh{} legend edge color (\PYGZsq{}inherit\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} means it uses axes.edgecolor)} \end{sphinxVerbatim} in your \sphinxcode{\sphinxupquote{matplotlibrc}} file. \subparagraph{Image} \label{\detokenize{users/dflt_style_changes:image}} \subparagraph{Interpolation} \label{\detokenize{users/dflt_style_changes:interpolation}} The default interpolation method for {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.imshow:matplotlib.axes.Axes.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow}}}}} is now \sphinxcode{\sphinxupquote{'nearest'}} and by default it resamples the data (both up and down sampling) before color mapping. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-15}.pdf} \end{figure} To restore the previous behavior set: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{image.interpolation}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bilinear}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{image.resample}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{k+kc}{False} \end{sphinxVerbatim} or set: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{image}\PYG{o}{.}\PYG{n}{interpolation} \PYG{p}{:} \PYG{n}{bilinear} \PYG{c+c1}{\PYGZsh{} see help(imshow) for options} \PYG{n}{image}\PYG{o}{.}\PYG{n}{resample} \PYG{p}{:} \PYG{k+kc}{False} \end{sphinxVerbatim} in your \sphinxcode{\sphinxupquote{matplotlibrc}} file. \subparagraph{Colormapping pipeline} \label{\detokenize{users/dflt_style_changes:colormapping-pipeline}} Previously, the input data was normalized, then color mapped, and then resampled to the resolution required for the screen. This meant that the final resampling was being done in color space. Because the color maps are not generally linear in RGB space, colors not in the color map may appear in the final image. This bug was addressed by an almost complete overhaul of the image handling code. The input data is now normalized, then resampled to the correct resolution (in normalized dataspace), and then color mapped to RGB space. This ensures that only colors from the color map appear in the final image. (If your viewer subsequently resamples the image, the artifact may reappear.) The previous behavior cannot be restored. \subparagraph{Shading} \label{\detokenize{users/dflt_style_changes:shading}}\begin{itemize} \item {} The default shading mode for light source shading, in \sphinxcode{\sphinxupquote{matplotlib.colors.LightSource.shade}}, is now \sphinxcode{\sphinxupquote{overlay}}. Formerly, it was \sphinxcode{\sphinxupquote{hsv}}. \end{itemize} \subparagraph{Plot layout} \label{\detokenize{users/dflt_style_changes:plot-layout}} \subparagraph{Auto limits} \label{\detokenize{users/dflt_style_changes:auto-limits}} The previous auto-scaling behavior was to find ‘nice’ round numbers as view limits that enclosed the data limits, but this could produce bad plots if the data happened to fall on a vertical or horizontal line near the chosen ‘round number’ limit. The new default sets the view limits to 5\% wider than the data range. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-16}.pdf} \end{figure} The size of the padding in the x and y directions is controlled by the \sphinxcode{\sphinxupquote{'axes.xmargin'}} and \sphinxcode{\sphinxupquote{'axes.ymargin'}} rcParams respectively. Whether the view limits should be ‘round numbers’ is controlled by the \sphinxcode{\sphinxupquote{'axes.autolimit\_mode'}} rcParam. In the original \sphinxcode{\sphinxupquote{'round\_number'}} mode, the view limits coincide with ticks. The previous default can be restored by using: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes.autolimit\PYGZus{}mode}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{round\PYGZus{}numbers}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes.xmargin}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mi}{0} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes.ymargin}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mi}{0} \end{sphinxVerbatim} or setting: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{axes}\PYG{o}{.}\PYG{n}{autolimit\PYGZus{}mode}\PYG{p}{:} \PYG{n}{round\PYGZus{}numbers} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{xmargin}\PYG{p}{:} \PYG{l+m+mi}{0} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{ymargin}\PYG{p}{:} \PYG{l+m+mi}{0} \end{sphinxVerbatim} in your \sphinxcode{\sphinxupquote{matplotlibrc}} file. \subparagraph{Z-order} \label{\detokenize{users/dflt_style_changes:z-order}}\begin{itemize} \item {} Ticks and grids are now plotted above solid elements such as filled contours, but below lines. To return to the previous behavior of plotting ticks and grids above lines, set \sphinxcode{\sphinxupquote{rcParams{[}'axes.axisbelow'{]} = False}}. \end{itemize} \subparagraph{Ticks} \label{\detokenize{users/dflt_style_changes:ticks}} \subparagraph{Direction} \label{\detokenize{users/dflt_style_changes:direction}} To reduce the collision of tick marks with data, the default ticks now point outward by default. In addition, ticks are now drawn only on the bottom and left spines to prevent a porcupine appearance, and for a cleaner separation between subplots. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-17}.pdf} \end{figure} To restore the previous behavior set: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{xtick.direction}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{in}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ytick.direction}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{in}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{xtick.top}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{k+kc}{True} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ytick.right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{k+kc}{True} \end{sphinxVerbatim} or set: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{xtick}\PYG{o}{.}\PYG{n}{top}\PYG{p}{:} \PYG{k+kc}{True} \PYG{n}{xtick}\PYG{o}{.}\PYG{n}{direction}\PYG{p}{:} \PYG{o+ow}{in} \PYG{n}{ytick}\PYG{o}{.}\PYG{n}{right}\PYG{p}{:} \PYG{k+kc}{True} \PYG{n}{ytick}\PYG{o}{.}\PYG{n}{direction}\PYG{p}{:} \PYG{o+ow}{in} \end{sphinxVerbatim} in your \sphinxcode{\sphinxupquote{matplotlibrc}} file. \subparagraph{Number of ticks} \label{\detokenize{users/dflt_style_changes:number-of-ticks}} The default {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Locator}}}}} used for the x and y axis is {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.AutoLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AutoLocator}}}}} which tries to find, up to some maximum number, ‘nicely’ spaced ticks. The locator now includes an algorithm to estimate the maximum number of ticks that will leave room for the tick labels. By default it also ensures that there are at least two ticks visible. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-18}.pdf} \end{figure} There is no way, other than using \sphinxcode{\sphinxupquote{mpl.style.use('classic')}}, to restore the previous behavior as the default. On an axis-by-axis basis you may either control the existing locator via: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{get\PYGZus{}major\PYGZus{}locator}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{set\PYGZus{}params}\PYG{p}{(}\PYG{n}{nbins}\PYG{o}{=}\PYG{l+m+mi}{9}\PYG{p}{,} \PYG{n}{steps}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} or create a new {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MaxNLocator}}}}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{ticker} \PYG{k}{as} \PYG{n+nn}{mticker} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}locator}\PYG{p}{(}\PYG{n}{mticker}\PYG{o}{.}\PYG{n}{MaxNLocator}\PYG{p}{(}\PYG{n}{nbins}\PYG{o}{=}\PYG{l+m+mi}{9}\PYG{p}{,} \PYG{n}{steps}\PYG{o}{=}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} The algorithm used by {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MaxNLocator}}}}} has been improved, and this may change the choice of tick locations in some cases. This also affects {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.AutoLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AutoLocator}}}}}, which uses \sphinxcode{\sphinxupquote{MaxNLocator}} internally. For a log-scaled axis the default locator is the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogLocator}}}}}. Previously the maximum number of ticks was set to 15, and could not be changed. Now there is a \sphinxcode{\sphinxupquote{numticks}} kwarg for setting the maximum to any integer value, to the string ‘auto’, or to its default value of None which is equivalent to ‘auto’. With the ‘auto’ setting the maximum number will be no larger than 9, and will be reduced depending on the length of the axis in units of the tick font size. As in the case of the AutoLocator, the heuristic algorithm reduces the incidence of overlapping tick labels but does not prevent it. \subparagraph{Tick label formatting} \label{\detokenize{users/dflt_style_changes:tick-label-formatting}} \subparagraph{\sphinxstyleliteralintitle{\sphinxupquote{LogFormatter}} labeling of minor ticks} \label{\detokenize{users/dflt_style_changes:logformatter-labeling-of-minor-ticks}} Minor ticks on a log axis are now labeled when the axis view limits span a range less than or equal to the interval between two major ticks. See {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogFormatter}}}}} for details. The minor tick labeling is turned off when using \sphinxcode{\sphinxupquote{mpl.style.use('classic')}}, but cannot be controlled independently via \sphinxcode{\sphinxupquote{rcParams}}. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-19}.pdf} \end{figure} \subparagraph{\sphinxstyleliteralintitle{\sphinxupquote{ScalarFormatter}} tick label formatting with offsets} \label{\detokenize{users/dflt_style_changes:scalarformatter-tick-label-formatting-with-offsets}} With the default of \sphinxcode{\sphinxupquote{rcParams{[}'axes.formatter.useoffset'{]} = True}}, an offset will be used when it will save 4 or more digits. This can be controlled with the new rcParam, \sphinxcode{\sphinxupquote{axes.formatter.offset\_threshold}}. To restore the previous behavior of using an offset to save 2 or more digits, use \sphinxcode{\sphinxupquote{rcParams{[}'axes.formatter.offset\_threshold'{]} = 2}}. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{dflt_style_changes-20}.pdf} \end{figure} \subparagraph{\sphinxstyleliteralintitle{\sphinxupquote{AutoDateFormatter}} format strings} \label{\detokenize{users/dflt_style_changes:autodateformatter-format-strings}} The default date formats are now all based on ISO format, i.e., with the slowest-moving value first. The date formatters are configurable through the \sphinxcode{\sphinxupquote{date.autoformatter.*}} rcParams. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|T|} \hline \sphinxstyletheadfamily Threshold (tick interval \textgreater{}= than) &\sphinxstyletheadfamily rcParam &\sphinxstyletheadfamily classic &\sphinxstyletheadfamily v2.0 \\ \hline 365 days & \sphinxcode{\sphinxupquote{'date.autoformatter.year'}} & \sphinxcode{\sphinxupquote{'\%Y'}} & \sphinxcode{\sphinxupquote{'\%Y'}} \\ \hline 30 days & \sphinxcode{\sphinxupquote{'date.autoformatter.month'}} & \sphinxcode{\sphinxupquote{'\%b \%Y'}} & \sphinxcode{\sphinxupquote{'\%Y-\%m'}} \\ \hline 1 day & \sphinxcode{\sphinxupquote{'date.autoformatter.day'}} & \sphinxcode{\sphinxupquote{'\%b \%d \%Y'}} & \sphinxcode{\sphinxupquote{'\%Y-\%m-\%d'}} \\ \hline 1 hour & \sphinxcode{\sphinxupquote{'date.autoformatter.hour'}} & \sphinxcode{\sphinxupquote{'\%H:\%M:\%S'}} & \sphinxcode{\sphinxupquote{'\%H:\%M'}} \\ \hline 1 minute & \sphinxcode{\sphinxupquote{'date.autoformatter.minute'}} & \sphinxcode{\sphinxupquote{'\%H:\%M:\%S.\%f'}} & \sphinxcode{\sphinxupquote{'\%H:\%M:\%S'}} \\ \hline 1 second & \sphinxcode{\sphinxupquote{'date.autoformatter.second'}} & \sphinxcode{\sphinxupquote{'\%H:\%M:\%S.\%f'}} & \sphinxcode{\sphinxupquote{'\%H:\%M:\%S'}} \\ \hline 1 microsecond & \sphinxcode{\sphinxupquote{'date.autoformatter.microsecond'}} & \sphinxcode{\sphinxupquote{'\%H:\%M:\%S.\%f'}} & \sphinxcode{\sphinxupquote{'\%H:\%M:\%S.\%f'}} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Python’s \sphinxcode{\sphinxupquote{\%x}} and \sphinxcode{\sphinxupquote{\%X}} date formats may be of particular interest to format dates based on the current locale. The previous default can be restored by: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date.autoformatter.year}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{Y}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date.autoformatter.month}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{b }\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{Y}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date.autoformatter.day}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{b }\PYG{l+s+si}{\PYGZpc{}d}\PYG{l+s+s1}{ }\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{Y}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date.autoformatter.hour}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{H:}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{M:}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{S}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date.autoformatter.minute}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{H:}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{M:}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{S.}\PYG{l+s+si}{\PYGZpc{}f}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date.autoformatter.second}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{H:}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{M:}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{S.}\PYG{l+s+si}{\PYGZpc{}f}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date.autoformatter.microsecond}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{H:}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{M:}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{S.}\PYG{l+s+si}{\PYGZpc{}f}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} or setting \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{date}\PYG{o}{.}\PYG{n}{autoformatter}\PYG{o}{.}\PYG{n}{year} \PYG{p}{:} \PYG{o}{\PYGZpc{}}\PYG{n}{Y} \PYG{n}{date}\PYG{o}{.}\PYG{n}{autoformatter}\PYG{o}{.}\PYG{n}{month} \PYG{p}{:} \PYG{o}{\PYGZpc{}}\PYG{n}{b} \PYG{o}{\PYGZpc{}}\PYG{n}{Y} \PYG{n}{date}\PYG{o}{.}\PYG{n}{autoformatter}\PYG{o}{.}\PYG{n}{day} \PYG{p}{:} \PYG{o}{\PYGZpc{}}\PYG{n}{b} \PYG{o}{\PYGZpc{}}\PYG{n}{d} \PYG{o}{\PYGZpc{}}\PYG{n}{Y} \PYG{n}{date}\PYG{o}{.}\PYG{n}{autoformatter}\PYG{o}{.}\PYG{n}{hour} \PYG{p}{:} \PYG{o}{\PYGZpc{}}\PYG{n}{H}\PYG{p}{:}\PYG{o}{\PYGZpc{}}\PYG{n}{M}\PYG{p}{:}\PYG{o}{\PYGZpc{}}\PYG{n}{S} \PYG{n}{date}\PYG{o}{.}\PYG{n}{autoformatter}\PYG{o}{.}\PYG{n}{minute} \PYG{p}{:} \PYG{o}{\PYGZpc{}}\PYG{n}{H}\PYG{p}{:}\PYG{o}{\PYGZpc{}}\PYG{n}{M}\PYG{p}{:}\PYG{o}{\PYGZpc{}}\PYG{n}{S}\PYG{o}{.}\PYG{o}{\PYGZpc{}}\PYG{n}{f} \PYG{n}{date}\PYG{o}{.}\PYG{n}{autoformatter}\PYG{o}{.}\PYG{n}{second} \PYG{p}{:} \PYG{o}{\PYGZpc{}}\PYG{n}{H}\PYG{p}{:}\PYG{o}{\PYGZpc{}}\PYG{n}{M}\PYG{p}{:}\PYG{o}{\PYGZpc{}}\PYG{n}{S}\PYG{o}{.}\PYG{o}{\PYGZpc{}}\PYG{n}{f} \PYG{n}{date}\PYG{o}{.}\PYG{n}{autoformatter}\PYG{o}{.}\PYG{n}{microsecond} \PYG{p}{:} \PYG{o}{\PYGZpc{}}\PYG{n}{H}\PYG{p}{:}\PYG{o}{\PYGZpc{}}\PYG{n}{M}\PYG{p}{:}\PYG{o}{\PYGZpc{}}\PYG{n}{S}\PYG{o}{.}\PYG{o}{\PYGZpc{}}\PYG{n}{f} \end{sphinxVerbatim} in your \sphinxcode{\sphinxupquote{matplotlibrc}} file. \subparagraph{mplot3d} \label{\detokenize{users/dflt_style_changes:mplot3d}}\begin{itemize} \item {} mplot3d now obeys some style-related rcParams, rather than using hard-coded defaults. These include: \begin{itemize} \item {} xtick.major.width \item {} ytick.major.width \item {} xtick.color \item {} ytick.color \item {} axes.linewidth \item {} axes.edgecolor \item {} grid.color \item {} grid.linewidth \item {} grid.linestyle \end{itemize} \end{itemize} \subsubsection{Improved color conversion API and RGBA support} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:improved-color-conversion-api-and-rgba-support}} The {\hyperref[\detokenize{api/colors_api:module-matplotlib.colors}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colors}}}}} gained a new color conversion API with full support for the alpha channel. The main public functions are {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.is_color_like:matplotlib.colors.is_color_like}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{is\_color\_like()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.to_rgba:matplotlib.colors.to_rgba}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.to\_rgba()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.to_rgba_array:matplotlib.colors.to_rgba_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.to\_rgba\_array()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.to_hex:matplotlib.colors.to_hex}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{to\_hex()}}}}}. RGBA quadruplets are encoded in hex format as \sphinxcode{\sphinxupquote{\#rrggbbaa}}. A side benefit is that the Qt options editor now allows setting the alpha channel of the artists as well. \subsubsection{New Configuration (rcParams)} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:new-configuration-rcparams}} New rcparams added \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Parameter &\sphinxstyletheadfamily Description \\ \hline \sphinxcode{\sphinxupquote{date.autoformatter.year}} & format string for ‘year’ scale dates \\ \hline \sphinxcode{\sphinxupquote{date.autoformatter.month}} & format string for ‘month’ scale dates \\ \hline \sphinxcode{\sphinxupquote{date.autoformatter.day}} & format string for ‘day’ scale dates \\ \hline \sphinxcode{\sphinxupquote{date.autoformatter.hour}} & format string for ‘hour’ scale times \\ \hline \sphinxcode{\sphinxupquote{date.autoformatter.minute}} & format string for ‘minute’ scale times \\ \hline \sphinxcode{\sphinxupquote{date.autoformatter.second}} & format string for ‘second’ scale times \\ \hline \sphinxcode{\sphinxupquote{date.autoformatter.microsecond}} & format string for ‘microsecond’ scale times \\ \hline \sphinxcode{\sphinxupquote{scatter.marker}} & default marker for scatter plot \\ \hline \sphinxcode{\sphinxupquote{svg.hashsalt}} & see note \\ \hline \sphinxcode{\sphinxupquote{xtick.top}}, \sphinxcode{\sphinxupquote{xtick.minor.top}}, \sphinxcode{\sphinxupquote{xtick.major.top}} \sphinxcode{\sphinxupquote{xtick.bottom}}, \sphinxcode{\sphinxupquote{xtick.minor.bottom}}, \sphinxcode{\sphinxupquote{xtick.major.bottom}} \sphinxcode{\sphinxupquote{ytick.left}}, \sphinxcode{\sphinxupquote{ytick.minor.left}}, \sphinxcode{\sphinxupquote{ytick.major.left}} \sphinxcode{\sphinxupquote{ytick.right}}, \sphinxcode{\sphinxupquote{ytick.minor.right}}, \sphinxcode{\sphinxupquote{ytick.major.right}} & Control where major and minor ticks are drawn. The global values are \sphinxcode{\sphinxupquote{and}} ed with the corresponding major/minor values. \\ \hline \sphinxcode{\sphinxupquote{hist.bins}} & The default number of bins to use in {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hist:matplotlib.axes.Axes.hist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hist}}}}}. This can be an \sphinxhref{https://docs.python.org/3/library/functions.html\#int}{\sphinxcode{\sphinxupquote{int}}}, a list of floats, or \sphinxcode{\sphinxupquote{'auto'}} if numpy \textgreater{}= 1.11 is installed. \\ \hline \sphinxcode{\sphinxupquote{lines.scale\_dashes}} & Whether the line dash patterns should scale with linewidth. \\ \hline \sphinxcode{\sphinxupquote{axes.formatter.offset\_threshold}} & Minimum number of digits saved in tick labels that triggers using an offset. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \paragraph{Added \sphinxstyleliteralintitle{\sphinxupquote{svg.hashsalt}} key to rcParams} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:added-svg-hashsalt-key-to-rcparams}} If \sphinxcode{\sphinxupquote{svg.hashsalt}} is \sphinxcode{\sphinxupquote{None}} (which it is by default), the svg backend uses \sphinxcode{\sphinxupquote{uuid4}} to generate the hash salt. If it is not \sphinxcode{\sphinxupquote{None}}, it must be a string that is used as the hash salt instead of \sphinxcode{\sphinxupquote{uuid4}}. This allows for deterministic SVG output. \paragraph{Removed the \sphinxstyleliteralintitle{\sphinxupquote{svg.image\_noscale}} rcParam} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:removed-the-svg-image-noscale-rcparam}} As a result of the extensive changes to image handling, the \sphinxcode{\sphinxupquote{svg.image\_noscale}} rcParam has been removed. The same functionality may be achieved by setting \sphinxcode{\sphinxupquote{interpolation='none'}} on individual images or globally using the \sphinxcode{\sphinxupquote{image.interpolation}} rcParam. \subsubsection{Qualitative colormaps} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:qualitative-colormaps}} ColorBrewer’s “qualitative” colormaps (“Accent”, “Dark2”, “Paired”, “Pastel1”, “Pastel2”, “Set1”, “Set2”, “Set3”) were intended for discrete categorical data, with no implication of value, and therefore have been converted to \sphinxcode{\sphinxupquote{ListedColormap}} instead of \sphinxcode{\sphinxupquote{LinearSegmentedColormap}}, so the colors will no longer be interpolated and they can be used for choropleths, labeled image features, etc. \subsubsection{Axis offset label now responds to \sphinxstyleliteralintitle{\sphinxupquote{labelcolor}}} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:axis-offset-label-now-responds-to-labelcolor}} Axis offset labels are now colored the same as axis tick markers when \sphinxcode{\sphinxupquote{labelcolor}} is altered. \subsubsection{Improved offset text choice} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:improved-offset-text-choice}} The default offset-text choice was changed to only use significant digits that are common to all ticks (e.g. 1231..1239 -\textgreater{} 1230, instead of 1231), except when they straddle a relatively large multiple of a power of ten, in which case that multiple is chosen (e.g. 1999..2001-\textgreater{}2000). \subsubsection{Style parameter blacklist} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:style-parameter-blacklist}} In order to prevent unexpected consequences from using a style, style files are no longer able to set parameters that affect things unrelated to style. These parameters include: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{interactive}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{backend}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{backend.qt4}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{webagg.port}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{webagg.port\PYGZus{}retries}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{webagg.open\PYGZus{}in\PYGZus{}browser}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{backend\PYGZus{}fallback}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{toolbar}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{timezone}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{datapath}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{figure.max\PYGZus{}open\PYGZus{}warning}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{savefig.directory}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{tk.window\PYGZus{}focus}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{docstring.hardcopy}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} \subsubsection{Change in default font} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:change-in-default-font}} The default font used by matplotlib in text has been changed to DejaVu Sans and DejaVu Serif for the sans-serif and serif families, respectively. The DejaVu font family is based on the previous matplotlib default \textendash{}Bitstream Vera\textendash{} but includes a much wider range of characters. The default mathtext font has been changed from Computer Modern to the DejaVu family to maintain consistency with regular text. Two new options for the \sphinxcode{\sphinxupquote{mathtext.fontset}} configuration parameter have been added: \sphinxcode{\sphinxupquote{dejavusans}} (default) and \sphinxcode{\sphinxupquote{dejavuserif}}. Both of these options use DejaVu glyphs whenever possible and fall back to STIX symbols when a glyph is not found in DejaVu. To return to the previous behavior, set the rcParam \sphinxcode{\sphinxupquote{mathtext.fontset}} to \sphinxcode{\sphinxupquote{cm}}. \subsubsection{Faster text rendering} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:faster-text-rendering}} Rendering text in the Agg backend is now less fuzzy and about 20\% faster to draw. \subsubsection{Improvements for the Qt figure options editor} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:improvements-for-the-qt-figure-options-editor}} Various usability improvements were implemented for the Qt figure options editor, among which: \begin{itemize} \item {} Line style entries are now sorted without duplicates. \item {} The colormap and normalization limits can now be set for images. \item {} Line edits for floating values now display only as many digits as necessary to avoid precision loss. An important bug was also fixed regarding input validation using Qt5 and a locale where the decimal separator is “,”. \item {} The axes selector now uses shorter, more user-friendly names for axes, and does not crash if there are no axes. \item {} Line and image entries using the default labels (“\_lineX”, “\_imageX”) are now sorted numerically even when there are more than 10 entries. \end{itemize} \subsubsection{Improved image support} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:improved-image-support}} Prior to version 2.0, matplotlib resampled images by first applying the color map and then resizing the result. Since the resampling was performed on the colored image, this introduced colors in the output image that didn’t actually exist in the color map. Now, images are resampled first (and entirely in floating-point, if the input image is floating-point), and then the color map is applied. In order to make this important change, the image handling code was almost entirely rewritten. As a side effect, image resampling uses less memory and fewer datatype conversions than before. The experimental private feature where one could “skew” an image by setting the private member \sphinxcode{\sphinxupquote{\_image\_skew\_coordinate}} has been removed. Instead, images will obey the transform of the axes on which they are drawn. \paragraph{Non-linear scales on image plots} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:non-linear-scales-on-image-plots}} \sphinxcode{\sphinxupquote{imshow()}} now draws data at the requested points in data space after the application of non-linear scales. The image on the left demonstrates the new, correct behavior. The old behavior can be recreated using \sphinxcode{\sphinxupquote{pcolormesh()}} as demonstrated on the right. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{whats_new_2-0-0-1}.pdf} \end{figure} This can be understood by analogy to plotting a histogram with linearly spaced bins with a logarithmic x-axis. Equal sized bins will be displayed as wider for small \sphinxstyleemphasis{x} and narrower for large \sphinxstyleemphasis{x}. \subsubsection{Support for HiDPI (Retina) displays in the NbAgg and WebAgg backends} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:support-for-hidpi-retina-displays-in-the-nbagg-and-webagg-backends}} The NbAgg and WebAgg backends will now use the full resolution of your high-pixel-density display. \subsubsection{Change in the default animation codec} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:change-in-the-default-animation-codec}} The default animation codec has been changed from \sphinxcode{\sphinxupquote{mpeg4}} to \sphinxcode{\sphinxupquote{h264}}, which is more efficient. It can be set via the \sphinxcode{\sphinxupquote{animation.codec}} rcParam. \subsubsection{Deprecated support for mencoder in animation} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:deprecated-support-for-mencoder-in-animation}} The use of mencoder for writing video files with mpl is problematic; switching to ffmpeg is strongly advised. All support for mencoder will be removed in version 2.2. \subsubsection{Boxplot Zorder Keyword Argument} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:boxplot-zorder-keyword-argument}} The \sphinxcode{\sphinxupquote{zorder}} parameter now exists for \sphinxcode{\sphinxupquote{boxplot()}}. This allows the zorder of a boxplot to be set in the plotting function call. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{boxplot}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{,} \PYG{n}{zorder}\PYG{o}{=}\PYG{l+m+mi}{10}\PYG{p}{)} \end{sphinxVerbatim} \subsubsection{Filled \sphinxstyleliteralintitle{\sphinxupquote{+}} and \sphinxstyleliteralintitle{\sphinxupquote{x}} markers} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:filled-and-x-markers}} New fillable \sphinxstyleemphasis{plus} and \sphinxstyleemphasis{x} markers have been added. See the {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markers}}}}} module and \DUrole{xref,std,std-ref}{marker reference} examples. \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{rcount}} and \sphinxstyleliteralintitle{\sphinxupquote{ccount}} for \sphinxstyleliteralintitle{\sphinxupquote{plot\_surface()}}} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:rcount-and-ccount-for-plot-surface}} As of v2.0, mplot3d’s \sphinxcode{\sphinxupquote{plot\_surface()}} now accepts \sphinxcode{\sphinxupquote{rcount}} and \sphinxcode{\sphinxupquote{ccount}} arguments for controlling the sampling of the input data for plotting. These arguments specify the maximum number of evenly spaced samples to take from the input data. These arguments are also the new default sampling method for the function, and is considered a style change. The old \sphinxcode{\sphinxupquote{rstride}} and \sphinxcode{\sphinxupquote{cstride}} arguments, which specified the size of the evenly spaced samples, become the default when ‘classic’ mode is invoked, and are still available for use. There are no plans for deprecating these arguments. \subsubsection{Streamplot Zorder Keyword Argument Changes} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:streamplot-zorder-keyword-argument-changes}} The \sphinxcode{\sphinxupquote{zorder}} parameter for \sphinxcode{\sphinxupquote{streamplot()}} now has default value of \sphinxcode{\sphinxupquote{None}} instead of \sphinxcode{\sphinxupquote{2}}. If \sphinxcode{\sphinxupquote{None}} is given as \sphinxcode{\sphinxupquote{zorder}}, \sphinxcode{\sphinxupquote{streamplot()}} has a default \sphinxcode{\sphinxupquote{zorder}} of \sphinxcode{\sphinxupquote{matplotlib.lines.Line2D.zorder}}. \subsubsection{Extension to \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backend\_bases.GraphicsContextBase}}} \label{\detokenize{users/prev_whats_new/whats_new_2.0.0:extension-to-matplotlib-backend-bases-graphicscontextbase}}\label{\detokenize{users/prev_whats_new/whats_new_2.0.0:gc-get-hatch-color-wn}} To support standardizing hatch behavior across the backends we ship the {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_hatch_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.GraphicsContextBase.get\_hatch\_color}}}}} method as added to {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.GraphicsContextBase}}}}}. This is only used during the render process in the backends we ship so will not break any third-party backends. If you maintain a third-party backend which extends {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GraphicsContextBase}}}}} this method is now available to you and should be used to color hatch patterns. \subsection{New in Matplotlib 2.1.0} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:new-in-matplotlib-2-1-0}}\label{\detokenize{users/prev_whats_new/whats_new_2.1.0:whats-new-2-1-0}}\label{\detokenize{users/prev_whats_new/whats_new_2.1.0::doc}} \subsubsection{Documentation} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:documentation}} The examples have been migrated to use \sphinxhref{https://sphinx-gallery.readthedocs.io/en/latest/}{sphinx gallery}. This allows better mixing of prose and code in the examples, provides links to download the examples as both a Python script and a Jupyter notebook, and improves the thumbnail galleries. The examples have been re-organized into {\hyperref[\detokenize{tutorials/index:tutorials}]{\sphinxcrossref{\DUrole{std,std-ref}{Tutorials}}}} and a \DUrole{xref,std,std-ref}{gallery}. Many docstrings and examples have been clarified and improved. \subsubsection{New features} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:new-features}} \paragraph{String categorical values} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:string-categorical-values}} All plotting functions now support string categorical values as input. For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{data} \PYG{o}{=} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{apples}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{oranges}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{15}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lemons}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{limes}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{20}\PYG{p}{\PYGZcb{}} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{bar}\PYG{p}{(}\PYG{n}{data}\PYG{o}{.}\PYG{n}{keys}\PYG{p}{(}\PYG{p}{)}\PYG{p}{,} \PYG{n}{data}\PYG{o}{.}\PYG{n}{values}\PYG{p}{(}\PYG{p}{)}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lightgray}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{whats_new_2-1-0-1}.pdf} \end{figure} \paragraph{Interactive JS widgets for animation} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:interactive-js-widgets-for-animation}} Jake Vanderplas’ JSAnimation package has been merged into Matplotlib. This adds to Matplotlib the \sphinxcode{\sphinxupquote{HTMLWriter}} class for generating a JavaScript HTML animation, suitable for the IPython notebook. This can be activated by default by setting the \sphinxcode{\sphinxupquote{animation.html}} rc parameter to \sphinxcode{\sphinxupquote{jshtml}}. One can also call the {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.to_jshtml}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{to\_jshtml}}}}} method to manually convert an animation. This can be displayed using IPython’s \sphinxcode{\sphinxupquote{HTML}} display class: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{IPython}\PYG{n+nn}{.}\PYG{n+nn}{display} \PYG{k}{import} \PYG{n}{HTML} \PYG{n}{HTML}\PYG{p}{(}\PYG{n}{animation}\PYG{o}{.}\PYG{n}{to\PYGZus{}jshtml}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} The \sphinxcode{\sphinxupquote{HTMLWriter}} class can also be used to generate an HTML file by asking for the \sphinxcode{\sphinxupquote{html}} writer. \paragraph{Enhancements to polar plot} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:enhancements-to-polar-plot}} The polar axes transforms have been greatly re-factored to allow for more customization of view limits and tick labelling. Additional options for view limits allow for creating an annulus, a sector, or some combination of the two. The {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_rorigin}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_rorigin()}}}}} method may be used to provide an offset to the minimum plotting radius, producing an annulus. The {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_theta_zero_location}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_theta\_zero\_location()}}}}} method now has an optional \sphinxcode{\sphinxupquote{offset}} argument. This argument may be used to further specify the zero location based on the given anchor point. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/pie\_and\_polar\_charts/polar\_scatter.html\#scatter-plot-on-polar-axis-with-offset-origin}{\sphinxincludegraphics[scale=0.7]{{sphx_glr_polar_scatter_002}.png}}\caption{Polar Offset Demo}\label{\detokenize{users/prev_whats_new/whats_new_2.1.0:id1}}\end{figure} The {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_thetamin}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_thetamin()}}}}} and {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_thetamax}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_thetamax()}}}}} methods may be used to limit the range of angles plotted, producing sectors of a circle. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/pie\_and\_polar\_charts/polar\_scatter.html\#scatter-plot-on-polar-axis-confined-to-a-sector}{\sphinxincludegraphics[scale=0.7]{{sphx_glr_polar_scatter_003}.png}}\caption{Polar Sector Demo}\label{\detokenize{users/prev_whats_new/whats_new_2.1.0:id2}}\end{figure} Previous releases allowed plots containing negative radii for which the negative values are simply used as labels, and the real radius is shifted by the configured minimum. This release also allows negative radii to be used for grids and ticks, which were previously silently ignored. Radial ticks have been modified to be parallel to the circular grid line, and angular ticks have been modified to be parallel to the grid line. It may also be useful to rotate tick \sphinxstyleemphasis{labels} to match the boundary. Calling \sphinxcode{\sphinxupquote{ax.tick\_params(rotation='auto')}} will enable the new behavior: radial tick labels will be parallel to the circular grid line, and angular tick labels will be perpendicular to the grid line (i.e., parallel to the outer boundary). Additionally, tick labels now obey the padding settings that previously only worked on Cartesian plots. Consequently, the \sphinxcode{\sphinxupquote{frac}} argument to {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_thetagrids}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolarAxes.set\_thetagrids}}}}} is no longer applied. Tick padding can be modified with the \sphinxcode{\sphinxupquote{pad}} argument to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.tick_params:matplotlib.axes.Axes.tick_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.tick\_params}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_tick_params:matplotlib.axis.Axis.set_tick_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_tick\_params}}}}}. \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{Figure}} class now has \sphinxstyleliteralintitle{\sphinxupquote{subplots}} method} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:figure-class-now-has-subplots-method}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} class now has a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.subplots}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots()}}}}} method which behaves the same as {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots:matplotlib.pyplot.subplots}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pyplot.subplots()}}}}} but on an existing figure. \paragraph{Metadata savefig keyword argument} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:metadata-savefig-keyword-argument}} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.savefig:matplotlib.pyplot.savefig}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{savefig()}}}}} now accepts \sphinxcode{\sphinxupquote{metadata}} as a keyword argument. It can be used to store key/value pairs in the image metadata. \begin{itemize} \item {} ‘png’ with Agg backend \item {} ‘pdf’ with PDF backend (see {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.writeInfoDict}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{writeInfoDict()}}}}} for a list of supported keywords) \item {} ‘eps’ and ‘ps’ with PS backend (only ‘Creator’ key is accepted) \end{itemize} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{savefig}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{test.png}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{metadata}\PYG{o}{=}\PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Software}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{My awesome software}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \end{sphinxVerbatim} \paragraph{Busy Cursor} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:busy-cursor}} The interactive GUI backends will now change the cursor to busy when Matplotlib is rendering the canvas. \paragraph{PolygonSelector} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:polygonselector}} A {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.PolygonSelector}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolygonSelector}}}}} class has been added to {\hyperref[\detokenize{api/widgets_api:module-matplotlib.widgets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.widgets}}}}}. See \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_polygon\_selector\_demo.py} for details. \paragraph{Added \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.ticker.PercentFormatter}}} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:added-matplotlib-ticker-percentformatter}} The new {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.PercentFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PercentFormatter}}}}} formatter has some nice features like being able to convert from arbitrary data scales to percents, a customizable percent symbol and either automatic or manual control over the decimal points. \paragraph{Reproducible PS, PDF and SVG output} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:reproducible-ps-pdf-and-svg-output}} The \sphinxcode{\sphinxupquote{SOURCE\_DATE\_EPOCH}} environment variable can now be used to set the timestamp value in the PS and PDF outputs. See \sphinxhref{https://reproducible-builds.org/specs/source-date-epoch/}{source date epoch}. Alternatively, calling \sphinxcode{\sphinxupquote{savefig}} with \sphinxcode{\sphinxupquote{metadata=\{'CreationDate': None\}}} will omit the timestamp altogether for the PDF backend. The reproducibility of the output from the PS and PDF backends has so far been tested using various plot elements but only default values of options such as \sphinxcode{\sphinxupquote{\{ps,pdf\}.fonttype}} that can affect the output at a low level, and not with the mathtext or usetex features. When Matplotlib calls external tools (such as PS distillers or LaTeX) their versions need to be kept constant for reproducibility, and they may add sources of nondeterminism outside the control of Matplotlib. For SVG output, the \sphinxcode{\sphinxupquote{svg.hashsalt}} rc parameter has been added in an earlier release. This parameter changes some random identifiers in the SVG file to be deterministic. The downside of this setting is that if more than one file is generated using deterministic identifiers and they end up as parts of one larger document, the identifiers can collide and cause the different parts to affect each other. These features are now enabled in the tests for the PDF and SVG backends, so most test output files (but not all of them) are now deterministic. \paragraph{Orthographic projection for mplot3d} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:orthographic-projection-for-mplot3d}} {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes3D}}}}} now accepts \sphinxcode{\sphinxupquote{proj\_type}} keyword argument and has a method {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_proj_type}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_proj\_type()}}}}}. The default option is \sphinxcode{\sphinxupquote{'persp'}} as before, and supplying \sphinxcode{\sphinxupquote{'ortho'}} enables orthographic view. Compare the z-axis which is vertical in orthographic view, but slightly skewed in the perspective view. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{from} \PYG{n+nn}{mpl\PYGZus{}toolkits.mplot3d} \PYG{k+kn}{import} \PYG{n}{Axes3D} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{6}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{projection}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{3d}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{set\PYGZus{}proj\PYGZus{}type}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{persp}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Perspective (default)}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{projection}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{3d}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax2}\PYG{o}{.}\PYG{n}{set\PYGZus{}proj\PYGZus{}type}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ortho}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax2}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Orthographic}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{whats_new_2-1-0-2}.pdf} \end{figure} \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{voxels}} function for mplot3d} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:voxels-function-for-mplot3d}} {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes3D}}}}} now has a {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.voxels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{voxels}}}}} method, for visualizing boolean 3D data. Uses could include plotting a sparse 3D heat map, or visualizing a volumetric model. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/mplot3d/voxels\_numpy\_logo.html}{\sphinxincludegraphics[scale=0.7]{{sphx_glr_voxels_numpy_logo_001}.png}}\caption{Voxel Demo}\label{\detokenize{users/prev_whats_new/whats_new_2.1.0:id3}}\end{figure} \subsubsection{Improvements} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:improvements}} \paragraph{CheckButtons widget \sphinxstyleliteralintitle{\sphinxupquote{get\_status}} function} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:checkbuttons-widget-get-status-function}} A {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.CheckButtons.get_status}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_status()}}}}} method has been added to the {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.CheckButtons}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.widgets.CheckButtons}}}}} class. This \sphinxcode{\sphinxupquote{get\_status}} method allows user to query the status (True/False) of all of the buttons in the \sphinxcode{\sphinxupquote{CheckButtons}} object. \paragraph{Add \sphinxstyleliteralintitle{\sphinxupquote{fill\_bar}} argument to \sphinxstyleliteralintitle{\sphinxupquote{AnchoredSizeBar}}} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:add-fill-bar-argument-to-anchoredsizebar}} The \sphinxcode{\sphinxupquote{mpl\_toolkits}} class \sphinxcode{\sphinxupquote{AnchoredSizeBar}} now has an additional \sphinxcode{\sphinxupquote{fill\_bar}} argument, which makes the size bar a solid rectangle instead of just drawing the border of the rectangle. The default is \sphinxcode{\sphinxupquote{None}}, and whether or not the bar will be filled by default depends on the value of \sphinxcode{\sphinxupquote{size\_vertical}}. If \sphinxcode{\sphinxupquote{size\_vertical}} is nonzero, \sphinxcode{\sphinxupquote{fill\_bar}} will be set to \sphinxcode{\sphinxupquote{True}}. If \sphinxcode{\sphinxupquote{size\_vertical}} is zero then \sphinxcode{\sphinxupquote{fill\_bar}} will be set to \sphinxcode{\sphinxupquote{False}}. If you wish to override this default behavior, set \sphinxcode{\sphinxupquote{fill\_bar}} to \sphinxcode{\sphinxupquote{True}} or \sphinxcode{\sphinxupquote{False}} to unconditionally always or never use a filled patch rectangle for the size bar. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{from} \PYG{n+nn}{mpl\PYGZus{}toolkits.axes\PYGZus{}grid1.anchored\PYGZus{}artists} \PYG{k+kn}{import} \PYG{n}{AnchoredSizeBar} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{)} \PYG{n}{bar0} \PYG{o}{=} \PYG{n}{AnchoredSizeBar}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{p}{,} \PYG{l+m+mf}{0.3}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{unfilled}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{loc}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{n}{frameon}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{,} \PYG{n}{size\PYGZus{}vertical}\PYG{o}{=}\PYG{l+m+mf}{0.05}\PYG{p}{,} \PYG{n}{fill\PYGZus{}bar}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{add\PYGZus{}artist}\PYG{p}{(}\PYG{n}{bar0}\PYG{p}{)} \PYG{n}{bar1} \PYG{o}{=} \PYG{n}{AnchoredSizeBar}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{p}{,} \PYG{l+m+mf}{0.3}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{filled}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{loc}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{n}{frameon}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{,} \PYG{n}{size\PYGZus{}vertical}\PYG{o}{=}\PYG{l+m+mf}{0.05}\PYG{p}{,} \PYG{n}{fill\PYGZus{}bar}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{add\PYGZus{}artist}\PYG{p}{(}\PYG{n}{bar1}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{whats_new_2-1-0-3}.pdf} \end{figure} \paragraph{Annotation can use a default arrow style} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:annotation-can-use-a-default-arrow-style}} Annotations now use the default arrow style when setting \sphinxcode{\sphinxupquote{arrowprops=\{\}}}, rather than no arrow (the new behavior actually matches the documentation). \paragraph{Barbs and Quiver Support Dates} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:barbs-and-quiver-support-dates}} When using the {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.quiver:matplotlib.axes.Axes.quiver}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{quiver()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.barbs:matplotlib.axes.Axes.barbs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{barbs()}}}}} plotting methods, it is now possible to pass dates, just like for other methods like {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot()}}}}}. This also allows these functions to handle values that need unit-conversion applied. \paragraph{Hexbin default line color} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:hexbin-default-line-color}} The default \sphinxcode{\sphinxupquote{linecolor}} keyword argument for {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hexbin:matplotlib.axes.Axes.hexbin}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hexbin()}}}}} is now \sphinxcode{\sphinxupquote{'face'}}, and supplying \sphinxcode{\sphinxupquote{'none'}} now prevents lines from being drawn around the hexagons. \paragraph{Figure.legend() can be called without arguments} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:figure-legend-can-be-called-without-arguments}} Calling {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure.legend()}}}}} can now be done with no arguments. In this case a legend will be created that contains all the artists on all the axes contained within the figure. \paragraph{Multiple legend keys for legend entries} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:multiple-legend-keys-for-legend-entries}} A legend entry can now contain more than one legend key. The extended {\hyperref[\detokenize{api/legend_api:matplotlib.legend_handler.HandlerTuple}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{HandlerTuple}}}}} class now accepts two parameters: \sphinxcode{\sphinxupquote{ndivide}} divides the legend area in the specified number of sections; \sphinxcode{\sphinxupquote{pad}} changes the padding between the legend keys. \begin{figure}[htbp] \centering \capstart \sphinxhref{../../gallery/text\_labels\_and\_annotations/legend\_demo.html}{\sphinxincludegraphics[scale=0.7]{{sphx_glr_legend_demo_004}.png}}\caption{Multiple Legend Keys}\label{\detokenize{users/prev_whats_new/whats_new_2.1.0:id4}}\end{figure} \paragraph{New parameter \sphinxstyleliteralintitle{\sphinxupquote{clear}} for \sphinxstyleliteralintitle{\sphinxupquote{figure()}}} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:new-parameter-clear-for-figure}} When the pyplot’s function {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figure:matplotlib.pyplot.figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure()}}}}} is called with a \sphinxcode{\sphinxupquote{num}} parameter, a new window is only created if no existing window with the same value exists. A new bool parameter \sphinxcode{\sphinxupquote{clear}} was added for explicitly clearing its existing contents. This is particularly useful when utilized in interactive sessions. Since {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots:matplotlib.pyplot.subplots}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots()}}}}} also accepts keyword arguments from {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figure:matplotlib.pyplot.figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure()}}}}}, it can also be used there: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{fig0} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{num}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{fig0}\PYG{o}{.}\PYG{n}{suptitle}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{A fancy plot}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{fig0.texts: }\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{p}{[}\PYG{n}{t}\PYG{o}{.}\PYG{n}{get\PYGZus{}text}\PYG{p}{(}\PYG{p}{)} \PYG{k}{for} \PYG{n}{t} \PYG{o+ow}{in} \PYG{n}{fig0}\PYG{o}{.}\PYG{n}{texts}\PYG{p}{]}\PYG{p}{)} \PYG{n}{fig1} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{num}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{clear}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} do not clear contents of window} \PYG{n}{fig1}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Really fancy!}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{fig0 is fig1: }\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{fig0} \PYG{o+ow}{is} \PYG{n}{fig1}\PYG{p}{)} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{fig1.texts: }\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{p}{[}\PYG{n}{t}\PYG{o}{.}\PYG{n}{get\PYGZus{}text}\PYG{p}{(}\PYG{p}{)} \PYG{k}{for} \PYG{n}{t} \PYG{o+ow}{in} \PYG{n}{fig1}\PYG{o}{.}\PYG{n}{texts}\PYG{p}{]}\PYG{p}{)} \PYG{n}{fig2}\PYG{p}{,} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{num}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{clear}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} clear contents} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{fig0 is fig2: }\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{fig0} \PYG{o+ow}{is} \PYG{n}{fig2}\PYG{p}{)} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{fig2.texts: }\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{p}{[}\PYG{n}{t}\PYG{o}{.}\PYG{n}{get\PYGZus{}text}\PYG{p}{(}\PYG{p}{)} \PYG{k}{for} \PYG{n}{t} \PYG{o+ow}{in} \PYG{n}{fig2}\PYG{o}{.}\PYG{n}{texts}\PYG{p}{]}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} The output:} \PYG{c+c1}{\PYGZsh{} fig0.texts: [\PYGZsq{}A fancy plot\PYGZsq{}]} \PYG{c+c1}{\PYGZsh{} fig0 is fig1: True} \PYG{c+c1}{\PYGZsh{} fig1.texts: [\PYGZsq{}A fancy plot\PYGZsq{}, \PYGZsq{}Really fancy!\PYGZsq{}]} \PYG{c+c1}{\PYGZsh{} fig0 is fig2: True} \PYG{c+c1}{\PYGZsh{} fig2.texts: []} \end{sphinxVerbatim} \paragraph{Specify minimum value to format as scalar for \sphinxstyleliteralintitle{\sphinxupquote{LogFormatterMathtext}}} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:specify-minimum-value-to-format-as-scalar-for-logformattermathtext}} {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogFormatterMathtext}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogFormatterMathtext}}}}} now includes the option to specify a minimum value exponent to format as a scalar (i.e., 0.001 instead of 10$^{\text{-3}}$). \paragraph{New quiverkey angle keyword argument} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:new-quiverkey-angle-keyword-argument}} Plotting a {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.quiverkey:matplotlib.axes.Axes.quiverkey}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{quiverkey()}}}}} now admits the \sphinxcode{\sphinxupquote{angle}} keyword argument, which sets the angle at which to draw the key arrow. \paragraph{Colormap reversed method} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:colormap-reversed-method}} The methods {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.LinearSegmentedColormap:matplotlib.colors.LinearSegmentedColormap.reversed}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.LinearSegmentedColormap.reversed()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.ListedColormap:matplotlib.colors.ListedColormap.reversed}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.ListedColormap.reversed()}}}}} return a reversed instance of the Colormap. This implements a way for any Colormap to be reversed. \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{Artist.setp}} (and \sphinxstyleliteralintitle{\sphinxupquote{pyplot.setp}}) accept a \sphinxstyleliteralintitle{\sphinxupquote{file}} argument} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:artist-setp-and-pyplot-setp-accept-a-file-argument}} The argument is keyword-only. It allows an output file other than \sphinxhref{https://docs.python.org/3/library/sys.html\#sys.stdout}{\sphinxcode{\sphinxupquote{sys.stdout}}} to be specified. It works exactly like the \sphinxcode{\sphinxupquote{file}} argument to \sphinxhref{https://docs.python.org/3/library/functions.html\#print}{\sphinxcode{\sphinxupquote{print}}}. \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{streamplot}} streamline generation more configurable} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:streamplot-streamline-generation-more-configurable}} The starting point, direction, and length of the stream lines can now be configured. This allows to follow the vector field for a longer time and can enhance the visibility of the flow pattern in some use cases. \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{Axis.set\_tick\_params}} now responds to \sphinxstyleliteralintitle{\sphinxupquote{rotation}}} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:axis-set-tick-params-now-responds-to-rotation}} Bulk setting of tick label rotation is now possible via {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_tick_params:matplotlib.axis.Axis.set_tick_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_tick\_params()}}}}} using the \sphinxcode{\sphinxupquote{rotation}} keyword. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}tick\PYGZus{}params}\PYG{p}{(}\PYG{n}{which}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{both}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{90}\PYG{p}{)} \end{sphinxVerbatim} \paragraph{Shading in 3D bar plots} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:shading-in-3d-bar-plots}} A new \sphinxcode{\sphinxupquote{shade}} parameter has been added the 3D {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.bar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bar}}}}} plotting method. The default behavior remains to shade the bars, but now users have the option of setting \sphinxcode{\sphinxupquote{shade}} to \sphinxcode{\sphinxupquote{False}}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{from} \PYG{n+nn}{mpl\PYGZus{}toolkits.mplot3d} \PYG{k+kn}{import} \PYG{n}{Axes3D} \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{)} \PYG{n}{x2d}\PYG{p}{,} \PYG{n}{y2d} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{meshgrid}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y} \PYG{o}{=} \PYG{n}{x2d}\PYG{o}{.}\PYG{n}{ravel}\PYG{p}{(}\PYG{p}{)}\PYG{p}{,} \PYG{n}{y2d}\PYG{o}{.}\PYG{n}{ravel}\PYG{p}{(}\PYG{p}{)} \PYG{n}{z} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{zeros\PYGZus{}like}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)} \PYG{n}{dz} \PYG{o}{=} \PYG{n}{x} \PYG{o}{+} \PYG{n}{y} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{6}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{projection}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{3d}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{bar3d}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{z}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{dz}\PYG{p}{,} \PYG{n}{shade}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Shading On}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{projection}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{3d}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax2}\PYG{o}{.}\PYG{n}{bar3d}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{z}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{dz}\PYG{p}{,} \PYG{n}{shade}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{)} \PYG{n}{ax2}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Shading Off}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{whats_new_2-1-0-4}.pdf} \end{figure} \paragraph{New \sphinxstyleliteralintitle{\sphinxupquote{which}} Parameter for \sphinxstyleliteralintitle{\sphinxupquote{autofmt\_xdate}}} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:new-which-parameter-for-autofmt-xdate}} A \sphinxcode{\sphinxupquote{which}} parameter now exists for the method {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.autofmt_xdate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{autofmt\_xdate()}}}}}. This allows a user to format \sphinxcode{\sphinxupquote{major}}, \sphinxcode{\sphinxupquote{minor}} or \sphinxcode{\sphinxupquote{both}} tick labels selectively. The default behavior will rotate and align the \sphinxcode{\sphinxupquote{major}} tick labels. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{o}{.}\PYG{n}{autofmt\PYGZus{}xdate}\PYG{p}{(}\PYG{n}{bottom}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{30}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{which}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{minor}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \paragraph{New Figure Parameter for \sphinxstyleliteralintitle{\sphinxupquote{subplot2grid}}} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:new-figure-parameter-for-subplot2grid}} A \sphinxcode{\sphinxupquote{fig}} parameter now exists for the function {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot2grid:matplotlib.pyplot.subplot2grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot2grid()}}}}}. This allows a user to specify the figure where the subplots will be created. If \sphinxcode{\sphinxupquote{fig}} is \sphinxcode{\sphinxupquote{None}} (default) then the method will use the current figure retrieved by {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.gcf:matplotlib.pyplot.gcf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gcf()}}}}}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{subplot2grid}\PYG{p}{(}\PYG{n}{shape}\PYG{p}{,} \PYG{n}{loc}\PYG{p}{,} \PYG{n}{rowspan}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{colspan}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{fig}\PYG{o}{=}\PYG{n}{myfig}\PYG{p}{)} \end{sphinxVerbatim} \paragraph{Interpolation in \sphinxstyleliteralintitle{\sphinxupquote{fill\_betweenx}}} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:interpolation-in-fill-betweenx}} The \sphinxcode{\sphinxupquote{interpolate}} parameter now exists for the method {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.fill_betweenx:matplotlib.axes.Axes.fill_betweenx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill\_betweenx()}}}}}. This allows a user to interpolate the data and fill the areas in the crossover points, similarly to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.fill_between:matplotlib.axes.Axes.fill_between}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill\_between()}}}}}. \paragraph{New keyword argument \sphinxstyleliteralintitle{\sphinxupquote{sep}} for EngFormatter} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:new-keyword-argument-sep-for-engformatter}} A new \sphinxcode{\sphinxupquote{sep}} keyword argument has been added to {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.EngFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{EngFormatter}}}}} and provides a means to define the string that will be used between the value and its unit. The default string is \sphinxcode{\sphinxupquote{" "}}, which preserves the former behavior. Additionally, the separator is now present between the value and its unit even in the absence of SI prefix. There was formerly a bug that was causing strings like \sphinxcode{\sphinxupquote{"3.14V"}} to be returned instead of the expected \sphinxcode{\sphinxupquote{"3.14 V"}} (with the default behavior). \paragraph{Extend \sphinxstyleliteralintitle{\sphinxupquote{MATPLOTLIBRC}} behavior} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:extend-matplotlibrc-behavior}} The environmental variable can now specify the full file path or the path to a directory containing a \sphinxcode{\sphinxupquote{matplotlibrc}} file. \paragraph{\sphinxstyleliteralintitle{\sphinxupquote{density}} kwarg to hist} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:density-kwarg-to-hist}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hist:matplotlib.axes.Axes.hist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hist()}}}}} method now prefers \sphinxcode{\sphinxupquote{density}} to \sphinxcode{\sphinxupquote{normed}} to control if the histogram should be normalized, following a change upstream to NumPy. This will reduce confusion as the behavior has always been that the integral of the histogram is 1 (rather than sum or maximum value). \subsubsection{Internals} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:internals}} \paragraph{New TransformedPatchPath caching object} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:new-transformedpatchpath-caching-object}} A newly added {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformedPatchPath}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformedPatchPath}}}}} provides a means to transform a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} into a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} via a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} while caching the resulting path. If neither the patch nor the transform have changed, a cached copy of the path is returned. This class differs from the older {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformedPath}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformedPath}}}}} in that it is able to refresh itself based on the underlying patch while the older class uses an immutable path. \paragraph{Abstract base class for movie writers} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:abstract-base-class-for-movie-writers}} The new {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.AbstractMovieWriter:matplotlib.animation.AbstractMovieWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractMovieWriter}}}}} class defines the API required by a class that is to be used as the \sphinxcode{\sphinxupquote{writer}} in the {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.save}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.animation.Animation.save()}}}}} method. The existing {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MovieWriter}}}}} class now derives from the new abstract base class. \paragraph{Stricter validation of line style rcParams} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:stricter-validation-of-line-style-rcparams}} The validation of rcParams that are related to line styles (\sphinxcode{\sphinxupquote{lines.linestyle}}, \sphinxcode{\sphinxupquote{boxplot.*.linestyle}}, \sphinxcode{\sphinxupquote{grid.linestyle}} and \sphinxcode{\sphinxupquote{contour.negative\_linestyle}}) now effectively checks that the values are valid line styles. Strings like \sphinxcode{\sphinxupquote{'dashed'}} or \sphinxcode{\sphinxupquote{'-{-}'}} are accepted, as well as even-length sequences of on-off ink like \sphinxcode{\sphinxupquote{{[}1, 1.65{]}}}. In this latter case, the offset value is handled internally and should \sphinxstyleemphasis{not} be provided by the user. The new validation scheme replaces the former one used for the \sphinxcode{\sphinxupquote{contour.negative\_linestyle}} rcParams, that was limited to \sphinxcode{\sphinxupquote{'solid'}} and \sphinxcode{\sphinxupquote{'dashed'}} line styles. The validation is case-insensitive. The following are now valid: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{grid}\PYG{o}{.}\PYG{n}{linestyle} \PYG{p}{:} \PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} loosely dotted grid lines} \PYG{n}{contour}\PYG{o}{.}\PYG{n}{negative\PYGZus{}linestyle} \PYG{p}{:} \PYG{n}{dashdot} \PYG{c+c1}{\PYGZsh{} previously only solid or dashed} \end{sphinxVerbatim} \paragraph{pytest} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:pytest}} The automated tests have been switched from \sphinxcode{\sphinxupquote{nose}} to \sphinxcode{\sphinxupquote{pytest}}. \subsubsection{Performance} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:performance}} \paragraph{Path simplification updates} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:path-simplification-updates}} Line simplification controlled by the \sphinxcode{\sphinxupquote{path.simplify}} and \sphinxcode{\sphinxupquote{path.simplify\_threshold}} parameters has been improved. You should notice better rendering performance when plotting large amounts of data (as long as the above parameters are set accordingly). Only the line segment portion of paths will be simplified \textendash{} if you are also drawing markers and experiencing problems with rendering speed, you should consider using the \sphinxcode{\sphinxupquote{markevery}} option to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}. See the {\hyperref[\detokenize{tutorials/introductory/usage:performance}]{\sphinxcrossref{\DUrole{std,std-ref}{Performance}}}} section in the usage tutorial for more information. The simplification works by iteratively merging line segments into a single vector until the next line segment’s perpendicular distance to the vector (measured in display-coordinate space) is greater than the \sphinxcode{\sphinxupquote{path.simplify\_threshold}} parameter. Thus, higher values of \sphinxcode{\sphinxupquote{path.simplify\_threshold}} result in quicker rendering times. If you are plotting just to explore data and not for publication quality, pixel perfect plots, then a value of \sphinxcode{\sphinxupquote{1.0}} can be safely used. If you want to make sure your plot reflects your data \sphinxstyleemphasis{exactly}, then you should set \sphinxcode{\sphinxupquote{path.simplify}} to false and/or \sphinxcode{\sphinxupquote{path.simplify\_threshold}} to \sphinxcode{\sphinxupquote{0}}. Matplotlib currently defaults to a conservative value of \sphinxcode{\sphinxupquote{1/9}}, smaller values are unlikely to cause any visible differences in your plots. \paragraph{Implement intersects\_bbox in c++} \label{\detokenize{users/prev_whats_new/whats_new_2.1.0:implement-intersects-bbox-in-c}} {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.intersects_bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{intersects\_bbox()}}}}} has been implemented in c++ which improves the performance of automatically placing the legend. \chapter{GitHub Stats} \label{\detokenize{users/github_stats:github-stats}}\label{\detokenize{users/github_stats:id1}}\label{\detokenize{users/github_stats::doc}} GitHub stats for 2017/10/03 - 2018/03/16 (tag: v2.1.0) These lists are automatically generated, and may be incomplete or contain duplicates. We closed 422 issues and merged 625 pull requests. The following 125 authors contributed 2458 commits. \begin{itemize} \item {} Adrien F. Vincent \item {} ahed87 \item {} akrherz \item {} Alexander Harnisch \item {} AlexCav \item {} Allan Haldane \item {} Andy Mastbaum \item {} Antony Lee \item {} apodemus \item {} Arthur Paulino \item {} as691454 \item {} ash13 \item {} Atharva Khare \item {} Ben Root \item {} Blaise Thompson \item {} Boaz Mohar \item {} Brendan Zhang \item {} Brennan Magee \item {} cclauss \item {} cgohlke \item {} ch3rn0v \item {} Chris Holdgraf \item {} Christoph Gohlke \item {} clintval \item {} Dakota Blair \item {} David Stansby \item {} deepyaman \item {} Derek Kim \item {} Derek Tropf \item {} Dietmar Schwertberger \item {} DietmarSchwertberger \item {} Divyam Madaan \item {} Doug Blank \item {} Duncan Macleod \item {} Elliott Sales de Andrade \item {} Emlyn Price \item {} Eric Firing \item {} Eric Wieser \item {} Erik M. Bray \item {} et2010 \item {} Fabian Kloosterman \item {} Federico Ariza \item {} Filip Dimitrovski \item {} Franco Vaccari \item {} fuzzythecat \item {} gregorybchris \item {} Hajoon Choi \item {} hannah \item {} Helder \item {} Importance of Being Ernest \item {} Jake Vanderplas \item {} Jamie Nunez \item {} JelsB \item {} Jody Klymak \item {} John Hoffman \item {} Johnny Gill \item {} Joseph Albert \item {} Jouni K. Seppänen \item {} Juan Nunez-Iglesias \item {} Justin Cai \item {} Kevin Ji \item {} Kexuan Sun \item {} Kjell Le \item {} Leo Singer \item {} Lionel Miller \item {} Luca Verginer \item {} luz.paz \item {} Matthew Brett \item {} Matthias Bussonnier \item {} Matti Picus \item {} mattip \item {} Maximilian Nöthe \item {} mcquin \item {} Michael Seifert \item {} Mudit Surana \item {} Nathan Goldbaum \item {} navdeep rana \item {} Nelle Varoquaux \item {} nemanja \item {} Nick Papior \item {} Nik Quibin \item {} Nikita Kniazev \item {} Nis Martensen \item {} nmartensen \item {} Norman Fomferra \item {} Osarumwense \item {} Pastafarianist \item {} Paul Ganssle \item {} Paul Hobson \item {} Paul Seyfert \item {} Phil Ruffwind \item {} Richard Gowers \item {} Rob Harrigan \item {} Robin Dunn \item {} roonjoot \item {} Roy Smith \item {} Ryan May \item {} Saket Choudhary \item {} Salinder Sidhu \item {} Sean Farley \item {} Sergey B Kirpichev \item {} settheory \item {} simonpf \item {} stone \item {} stonebig \item {} TD22057 \item {} tdpetrou \item {} Ted Petrou \item {} Thomas A Caswell \item {} Thomas Mansencal \item {} Thomas Robitaille \item {} Thomas Spura \item {} Thomas VINCENT \item {} thuvejan \item {} Tim Hoffmann \item {} Tom \item {} Tom Augspurger \item {} Tom Dupré la Tour \item {} TomDonoghue \item {} WANG Aiyong \item {} William Mallard \item {} Yao-Yuan Mao \item {} Yuval Langer \item {} Zac-HD \item {} ZWL \end{itemize} GitHub issues and pull requests: Pull Requests (625): \begin{itemize} \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10815/}{PR \#10815}: API: shift deprecation of TempCache class to 3.0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10725/}{PR \#10725}: FIX/TST constrained\_layout remove test8 duplication \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10805/}{PR \#10805}: FIX: properties and setp on Table instances \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10806/}{PR \#10806}: MNT: catch more illegal ‘’ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10296/}{PR \#10296}: Improve docstrings of pyplot axis-related functions \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10278/}{PR \#10278}: improve docstring of Axes.loglog, Axes.semilogx, Axes.semilogy \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10705/}{PR \#10705}: FIX: enable extend kwargs with log scale colorbar \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10400/}{PR \#10400}: numpydoc-ify art3d docstrings \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10723/}{PR \#10723}: repr style fixes. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10592/}{PR \#10592}: Rely on generalized * and ** unpackings where possible. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10787/}{PR \#10787}: Fix offsetbox expand mode \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9475/}{PR \#9475}: Declare property aliases in a single place \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10793/}{PR \#10793}: A hodgepodge of Py3 \& style fixes. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10781/}{PR \#10781}: Mention Jupyter in matplotlib usage \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10794/}{PR \#10794}: fixed comment typo \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10768/}{PR \#10768}: Fix crash when imshow encounters longdouble data \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10774/}{PR \#10774}: Remove dead wx testing code. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10756/}{PR \#10756}: Fixes png showing inconsistent inset\_axes position \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10773/}{PR \#10773}: Consider alpha channel from RGBA color of text for SVG backend text opacity rendering \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10772/}{PR \#10772}: API: check locator and formatter args when passed \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10713/}{PR \#10713}: Implemented support for ‘markevery’ in prop\_cycle \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10751/}{PR \#10751}: make centre\_baseline legal for Text.set\_verticalalignment \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10771/}{PR \#10771}: FIX/TST OS X builds \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10754/}{PR \#10754}: Fix image fmt detection for Path input. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10739/}{PR \#10739}: FIX: ffmpeg logging level \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10726/}{PR \#10726}: FIX: re-instate verbose alias \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10752/}{PR \#10752}: Update copyright date to 2018 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10742/}{PR \#10742}: FIX: reorder linewidth setting before linestyle \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10714/}{PR \#10714}: sys.platform is normalized to “linux” on Py3. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10542/}{PR \#10542}: Minor cleanup: PEP8, PEP257 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10636/}{PR \#10636}: Remove some wx version checks. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10736/}{PR \#10736}: Avoid narrowing conversion in image\_wrapper on 32-bit. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10731/}{PR \#10731}: Corrected mistitling on the annotation tutorial page \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10734/}{PR \#10734}: Fix logging level type \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10728/}{PR \#10728}: Set data limits for Axes3DSubplot.plot when zdir=y or zdir=x \#5742 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10721/}{PR \#10721}: sanitize norm extrema to be floats \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10710/}{PR \#10710}: BUG: Fix UnboundLocalError in contour labelling \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10703/}{PR \#10703}: Fix signature docstring in \_png extension. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10683/}{PR \#10683}: Convert Tick attributes to numpydoc \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10690/}{PR \#10690}: Improve lazy-ticks realization. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10697/}{PR \#10697}: Remove special-casing of \_remove\_method when pickling. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10701/}{PR \#10701}: Autoadd removal version to deprecation message. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10699/}{PR \#10699}: Remove incorrect warning in gca(). \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10564/}{PR \#10564}: Nested classes and instancemethods are directly picklable on Py3.5+. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10107/}{PR \#10107}: Fix stay\_span to reset onclick in SpanSelector. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10480/}{PR \#10480}: Filter out invalid value warnings in log scaling \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10596/}{PR \#10596}: Switch to per-file locking. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10681/}{PR \#10681}: Fix tk icon loading. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10532/}{PR \#10532}: Py3fy backend\_pgf. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10618/}{PR \#10618}: Fixes \#10501. python3 support and pep8 in jpl\_units \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10652/}{PR \#10652}: Some py3fication for matplotlib/\_\_init\_\_, setupext. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10522/}{PR \#10522}: Py3fy font\_manager. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10666/}{PR \#10666}: More figure-related doc updates \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10507/}{PR \#10507}: Remove Python 2 code from C extensions \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10426/}{PR \#10426}: Delete deprecated backends \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9814/}{PR \#9814}: figure\_enter\_event uses now LocationEvent instead of Event. Fix issue \#9812. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10658/}{PR \#10658}: FIX Speed up constrained layout \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9918/}{PR \#9918}: Remove old nose testing code \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10672/}{PR \#10672}: Deprecation fixes. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10608/}{PR \#10608}: Remove most APIs deprecated in 2.1. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10599/}{PR \#10599}: Axes doc updates \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10665/}{PR \#10665}: Highlight deprecations in the docs \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10653/}{PR \#10653}: Mock is in stdlib in Py3. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10603/}{PR \#10603}: Remove workarounds for numpy\textless{}1.10. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10660/}{PR \#10660}: Work towards removing reuse-of-axes-on-collision. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10364/}{PR \#10364}: Workaround property list indent \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10661/}{PR \#10661}: Homebrew python is now python 3 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10613/}{PR \#10613}: FIX: resolution of imshow for floats and 2-D greyscale PIL images \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10638/}{PR \#10638}: WIP: ENH: autodecode pandas timestamps \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10595/}{PR \#10595}: Improve Figure docstrings \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10656/}{PR \#10656}: Minor fixes to event handling docs. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10629/}{PR \#10629}: FIX/ENH CL: Allow single parent colorbar w/ gridspec layout \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10635/}{PR \#10635}: Simplify setupext by using globs. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10632/}{PR \#10632}: Support markers from Paths that consist of one line segment \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10558/}{PR \#10558}: Remove if six.PY2 code paths from boilerplate.py \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10645/}{PR \#10645}: Add mplcairo to 3rdparty docs. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10640/}{PR \#10640}: Fix extra and missing spaces in constrainedlayout warning. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10631/}{PR \#10631}: Convert NaT to nan in date2num \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10623/}{PR \#10623}: Fix for failing bar plot w/ units \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10622/}{PR \#10622}: make seaborn great again on Matplotlib-2.2 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10624/}{PR \#10624}: Some trivial py3fications. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10548/}{PR \#10548}: Implement PdfPages for backend pgf \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10625/}{PR \#10625}: Fixes to constrainedlayout tutorial markup. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10614/}{PR \#10614}: Use np.stack instead of list(zip()) in colorbar.py. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10621/}{PR \#10621}: Cleanup and py3fy backend\_gtk3. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10568/}{PR \#10568}: Prevent ZeroDivisionError when devicePixelRatio() returns 0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10615/}{PR \#10615}: More style fixes. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10604/}{PR \#10604}: Minor style fixes. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10531/}{PR \#10531}: Update matplotlibrc.template \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10565/}{PR \#10565}: Strip python 2 code from subprocess.py \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10605/}{PR \#10605}: Bump a tolerance in test\_axisartist\_floating\_axes. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10554/}{PR \#10554}: Make ax3d.get\_xlim() return a tuple, as 2D axes do. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/7853/}{PR \#7853}: Use exact types for Py\_BuildValue. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10594/}{PR \#10594}: FIX: colorbar check for constrained layout \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10570/}{PR \#10570}: Fix check\_shared in test\_subplots. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10581/}{PR \#10581}: Might be \sphinxcode{\sphinxupquote{figure.constrained\_layout.use}} \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10569/}{PR \#10569}: Various style fixes. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10593/}{PR \#10593}: Use ‘yield from’ where appropriate. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10563/}{PR \#10563}: Add some mlab alternatives \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10588/}{PR \#10588}: Bugfix in axes3d not raising an exception \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10518/}{PR \#10518}: Fix Wx inconsistencies \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10428/}{PR \#10428}: Fix wx canvas type injection. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10577/}{PR \#10577}: Minor simplification to Figure.\_\_getstate\_\_ logic. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10578/}{PR \#10578}: Fix eventplot exception due to uninitiliazed \sphinxcode{\sphinxupquote{\_is\_horizontal}} attribute \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10552/}{PR \#10552}: Fix issue with clf not clearing constrainedlayout \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10549/}{PR \#10549}: Source typos \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10525/}{PR \#10525}: Convert six.moves.xrange() to range() for Python 3 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10551/}{PR \#10551}: Simplify rst cross references by omitting the shortener \textasciitilde{} when not needed \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10538/}{PR \#10538}: FIX: TypeError when using offset box in expand mode with tightlayout \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10541/}{PR \#10541}: More argumentless (py3) super() \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10539/}{PR \#10539}: TST: Replace assert\_equal with plain asserts. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10534/}{PR \#10534}: Modernize cbook.get\_realpath\_and\_stat. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10524/}{PR \#10524}: Remove unused private \_StringFuncParser. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10470/}{PR \#10470}: Remove Python 2 code from setup \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10429/}{PR \#10429}: Fix wxcairo byteorder. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10462/}{PR \#10462}: Fix add\_subplot documentation regarding args \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10484/}{PR \#10484}: Add libm when building Qhull. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10509/}{PR \#10509}: Move some logging calls down to DEBUG level. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10528/}{PR \#10528}: py3fy examples \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10520/}{PR \#10520}: Py3fy mathtext.py. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10527/}{PR \#10527}: Switch to argumentless (py3) super(). \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10523/}{PR \#10523}: The current master branch is now python 3 only. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10519/}{PR \#10519}: \_macosx.m fails to compile on Mac OS 10.6.8 Snow Leopard - Issue \#10516 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10432/}{PR \#10432}: Use some new Python3 types \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10475/}{PR \#10475}: Use HTTP Secure for matplotlib.org \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10383/}{PR \#10383}: Fix some C++ warnings \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10478/}{PR \#10478}: Separate plots using \#\#\#\# in xkcd.py \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10505/}{PR \#10505}: Remove backport of which() \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10486/}{PR \#10486}: BUG: sscanf did not parse arguments in \_tkagg.cpp \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10469/}{PR \#10469}: FIX: DPI inconsistency of draggable legend \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10483/}{PR \#10483}: Remove backports.functools\_lru\_cache \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10451/}{PR \#10451}: renaming duplicated file names \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10492/}{PR \#10492}: Avoid UnboundLocalError in drag\_pan. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10473/}{PR \#10473}: DOC: Expending a bit about the “tableau-colorblind10” entry in What’s new \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10491/}{PR \#10491}: Simplify Mac builds on Travis \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10490/}{PR \#10490}: DOC: added bounds and more description to margins \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10481/}{PR \#10481}: Remove python 2 compatibility code from dviread \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10447/}{PR \#10447}: Remove Python 2 compatibility code from backend\_pdf.py \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10468/}{PR \#10468}: Replace is\_numlike by isinstance(…, numbers.Number). \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10454/}{PR \#10454}: Set packet\_ends = None before using in dviread.py \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10439/}{PR \#10439}: mkdir is in the stdlib in Py3. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10431/}{PR \#10431}: Some font-related numpydoc changes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10467/}{PR \#10467}: update example docstring of afm.py \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10460/}{PR \#10460}: DOC: remove sphinx markup that confsed SG \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10461/}{PR \#10461}: fix broken link in lib/matplotlib/dates.py comment \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10463/}{PR \#10463}: DOC: Add cividis to the tutorial about colormaps \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10392/}{PR \#10392}: FIX: make set\_text(None) keep string empty instead of “None” \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10450/}{PR \#10450}: DOC: add active state to install docs \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10425/}{PR \#10425}: API: only support python 3.5+ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10440/}{PR \#10440}: Add canonical link to webpages \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10444/}{PR \#10444}: DOC: s/xasis/xaxis/ in whats\_new.rst \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10441/}{PR \#10441}: Fix doc build error. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10422/}{PR \#10422}: Define RecursionError for Python versions \textless{} 3.5 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10437/}{PR \#10437}: Add docstring to set\_interpolation \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10427/}{PR \#10427}: Cleanup old print statements \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10414/}{PR \#10414}: Doc merge up api whats new \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10416/}{PR \#10416}: Update some wx examples \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10423/}{PR \#10423}: DOC/STY: whitespace and docstring fixes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10208/}{PR \#10208}: Add some wx specific tools for ToolManager \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9114/}{PR \#9114}: Fix PdfPages+cairo. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9074/}{PR \#9074}: Don’t abort on FT2Font weakref. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10274/}{PR \#10274}: doc: fix layout of tables within parameter lists \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10421/}{PR \#10421}: remove string escapes from matplotlibrc.template \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9783/}{PR \#9783}: Categorical: Unsorted, String only, fix overwrite bug \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10420/}{PR \#10420}: Fix some broken links \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10395/}{PR \#10395}: WxCairo backend. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10415/}{PR \#10415}: fix bug \#3690: don’t call evt.Skip() when window has just been destroyed \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10352/}{PR \#10352}: Explicitely destroy created wx PaintDC \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10377/}{PR \#10377}: FigureCanvasWx/Agg fixed size \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10399/}{PR \#10399}: Avoid double draw in qt5cairo. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9871/}{PR \#9871}: Cividis colormap added with short description in whats\_new \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10413/}{PR \#10413}: DOC: Fix typos in section names. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10407/}{PR \#10407}: TST/FIX twinx and twiny w/ constrainedlayout \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10409/}{PR \#10409}: Remove unused \_is\_list\_like. Move six import up. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10412/}{PR \#10412}: GTK backend deprecations \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10385/}{PR \#10385}: Fix deprecations in examples \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10389/}{PR \#10389}: import six \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10405/}{PR \#10405}: Minor updates to unit doc \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10366/}{PR \#10366}: Axes doc datanotes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10402/}{PR \#10402}: MNT: remove example based on Enthought Traits package \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/7545/}{PR \#7545}: Axisartist testing + bugfixes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10390/}{PR \#10390}: file() was removed in Python 3 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10394/}{PR \#10394}: Wrong explanation in docstring for add\_subplot fixed \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10393/}{PR \#10393}: OOification of the new examples from \#10306 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10306/}{PR \#10306}: Add ytick label right/left properties in matplotlibrc \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9081/}{PR \#9081}: cell returned when added to Table \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10387/}{PR \#10387}: TST: Small fix to constrainedlayout7 test (removed image) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9708/}{PR \#9708}: Cleanup doc/conf.py \& local sphinx extensions \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10370/}{PR \#10370}: Clean up units.py \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9934/}{PR \#9934}: MEP22 implementation for QT backend \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9151/}{PR \#9151}: Deprecate mlab functions \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10210/}{PR \#10210}: qt\{4,5\}cairo backend: the minimal version. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10379/}{PR \#10379}: FIX: re-jigger deprecation of rcParams using machinery in \_\_init\_\_ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10276/}{PR \#10276}: improve docstring of Axes.step \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10371/}{PR \#10371}: Fix constrainedlayout uneven grid specs \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10220/}{PR \#10220}: Clip RGB data to valid range for imshow \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9991/}{PR \#9991}: MAINT: Use vectorization in plot\_trisurf, simplifying greatly \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10363/}{PR \#10363}: Fix to allow both old and new style wx versions \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10309/}{PR \#10309}: Improve code generated by boilerplate.py \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10367/}{PR \#10367}: constrained layout guide typos \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9082/}{PR \#9082}: {[}MRG{]} Constrained\_layout (geometry manager) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10359/}{PR \#10359}: Add attributes section to ColorbarBase doc \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10362/}{PR \#10362}: Switch to using StrictVersion in wx\_compat.py \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10353/}{PR \#10353}: Fix syntax highlighting of sample bash and bibtex in rst markup. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10354/}{PR \#10354}: DOC: clarify that clim is not a valid kwarg if vmin/vmax are used \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10355/}{PR \#10355}: Fix typo in tutorial; \& change mention of Qt4 to Qt5 (new default). \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10351/}{PR \#10351}: FIX: deprecate qt4/5 rcparams \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10347/}{PR \#10347}: Hide the backend.qt4/5 rcparam deprecation warning in test suite. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10348/}{PR \#10348}: When latex fails, make sure it does not write a dvi. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10226/}{PR \#10226}: Custom :rcparam: role. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10335/}{PR \#10335}: Update some image\_comparison tests. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10282/}{PR \#10282}: Deprecate the backend.qt\{4,5\} rcParams. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10281/}{PR \#10281}: Move down logging levels in mpl/\_\_init\_\_ to DEBUG. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10337/}{PR \#10337}: Deprecate backend\_tkagg.AxisMenu. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10242/}{PR \#10242}: Fix InvertedLog10Transform.inverted() \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10331/}{PR \#10331}: Remove unnecessary calls to float() before division. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10327/}{PR \#10327}: Don’t call np.identity() in transforms. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10325/}{PR \#10325}: Minor improvements to quadmesh\_demo. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10340/}{PR \#10340}: update set\_drawstyle \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10333/}{PR \#10333}: Remove some commented out debug prints. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10301/}{PR \#10301}: Deprecate truncating saved unsized anims to 100 frames. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10332/}{PR \#10332}: Join strings instead of adding them. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10330/}{PR \#10330}: Shorten a long and now outdated comment. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10326/}{PR \#10326}: Various examples updates. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10328/}{PR \#10328}: Use deg2rad/rad2deg where appropriate. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10324/}{PR \#10324}: Linewrap backend\_pgf to 79 characters. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10033/}{PR \#10033}: Improve handling of shared axes with specified aspect ratio \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10310/}{PR \#10310}: Add libdl on Unix-like systems. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10320/}{PR \#10320}: DOC: Tiny fixes, and possible overhaul, of the two scales example in the gallery \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10313/}{PR \#10313}: Make commented ACCEPTS statements inline comments \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10316/}{PR \#10316}: TST FIX pyqt5 5.9 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10302/}{PR \#10302}: Alternate implementation of lazy ticks. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9652/}{PR \#9652}: Align x and y labels between axes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10292/}{PR \#10292}: Unset the canvas manager when saving the figure. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10303/}{PR \#10303}: Simplify Axis.get\_\{major,minor\}\_ticks. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10295/}{PR \#10295}: Pass options to ps2pdf using \sphinxcode{\sphinxupquote{-foo\#bar}} instead of \sphinxcode{\sphinxupquote{-foo=bar}}. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10311/}{PR \#10311}: Clean up next what’s new files \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10224/}{PR \#10224}: improve docstring of Axes.errorbar \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10308/}{PR \#10308}: Switch the lasso selector to use mpl event handling, not input(). \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10206/}{PR \#10206}: Don’t convert numbers plotted on an axis with units \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10305/}{PR \#10305}: Make the horizontal bar appear in AnchoredArtists example. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10289/}{PR \#10289}: Ensure image scale factors are scalars \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10284/}{PR \#10284}: Allow ACCEPTS as ReST comment in docstrings \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10266/}{PR \#10266}: More misc. typos \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10283/}{PR \#10283}: Deprecate obsolete ‘plugins.directory’ rcparam. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10286/}{PR \#10286}: Update multi\_image example. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10240/}{PR \#10240}: Pillow animation writer. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10279/}{PR \#10279}: Add ‘val’ attribute to slider doc \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10280/}{PR \#10280}: Update writing docs concerning explicit parameter lists \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10231/}{PR \#10231}: Support PathLike inputs. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9952/}{PR \#9952}: Errorbars accept marker\_options and follow prop\_cycle \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10271/}{PR \#10271}: whats\_new.rst: “C” must be capitalized in “CreationDate” \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9911/}{PR \#9911}: Make \_get\_rgba\_face actually always return a RGBA. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10200/}{PR \#10200}: Catch normed warning in tests \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10219/}{PR \#10219}: Improve transform docstrings \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10076/}{PR \#10076}: improve sub-second datetime plotting and documentation \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/8512/}{PR \#8512}: DOC: add quickstart section to the gridspec tutorial \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10168/}{PR \#10168}: Minor update to multiprocessing example. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10154/}{PR \#10154}: improve Axes.stem docstring \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10203/}{PR \#10203}: Update docs, in particular for backends. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9884/}{PR \#9884}: DOC: re-organize devel/documenting\_mpl.rst \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10243/}{PR \#10243}: improve docstring of Axes.scatter \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10250/}{PR \#10250}: Minor refactor of backend\_ps. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10261/}{PR \#10261}: Some comment typo fixes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10125/}{PR \#10125}: Cleanup animation examples \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10197/}{PR \#10197}: AFM fonts don’t have .postscript\_name, but .get\_fontname(). \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10263/}{PR \#10263}: FIX: (re-allow) legend OrderedDict handles and labels… \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10257/}{PR \#10257}: BLD: use correct method to get installation hints \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10259/}{PR \#10259}: Clean up example section titles \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10254/}{PR \#10254}: Quick and dirty revert of busy cursor for 2.1.2. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9570/}{PR \#9570}: Allow setting MATPLOTLIBRC by process substitution. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10247/}{PR \#10247}: Simplify \_get\_xdg\_cache\_dir in setupext. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10256/}{PR \#10256}: Remove reference to ignored rcParam, nbagg.transparent \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10133/}{PR \#10133}: FIX: Image scaling for large dynamic range ints \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10077/}{PR \#10077}: Use fuzzy comparison for stroke join determination. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10246/}{PR \#10246}: improve docstring of Axes.plot\_date \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10233/}{PR \#10233}: Move unrendered docstrings to private attributes. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10010/}{PR \#10010}: FIX: Check for fontsize smaller than 1 pt and round up \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10248/}{PR \#10248}: Minor cleanups. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9356/}{PR \#9356}: COMPAT: use tkagg backend on PyPy \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10188/}{PR \#10188}: Doc timer docs \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10232/}{PR \#10232}: Unify “blank space” and “white space” to “space”. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10138/}{PR \#10138}: Clean up \_axes.py docstrings \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10228/}{PR \#10228}: Add closing quotes to embedded python in rst markup. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10217/}{PR \#10217}: TST: Don’t use set -e. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10214/}{PR \#10214}: DOC: fix ‘’ markup for sphinx and py37 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10213/}{PR \#10213}: Add missing import to backend\_tkagg. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9275/}{PR \#9275}: Tkagg fixes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10204/}{PR \#10204}: Cleanup backend\_cairo. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10195/}{PR \#10195}: Wrap a few overly long lines. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10190/}{PR \#10190}: improve docstring of Axes.plot \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10086/}{PR \#10086}: Deprecate support for “svg fonts” font embedding. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10119/}{PR \#10119}: Simplify gridspec.py. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10193/}{PR \#10193}: Handle Tick gridline properties like other Tick properties \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10182/}{PR \#10182}: improve docstrings for Axes.bar, Axes.barh, Axes.stackplot \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10186/}{PR \#10186}: improve docstrings of Axes.fill\_between and Axes.fill\_betweenx \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10181/}{PR \#10181}: Cleanup texmanager. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10192/}{PR \#10192}: remove evt.Skip() from EVT\_PAINT handler \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10191/}{PR \#10191}: Minor refactoring of docstring formatting in preprocess\_data \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10196/}{PR \#10196}: Remove most instances of pep8 E502 (redundant backslashes). \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10139/}{PR \#10139}: Improve legend\_handler docstrings \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10198/}{PR \#10198}: Improve hist2d returns doc \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10146/}{PR \#10146}: Updated what’s new entry for color comparision method \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10184/}{PR \#10184}: Remove executable bit from example. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10180/}{PR \#10180}: Rebase of \#8504 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10178/}{PR \#10178}: Simplify pandas fixture. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10124/}{PR \#10124}: TST: centralize and standardize pandas imports \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10175/}{PR \#10175}: Agg: When a single Text uses usetex, don’t pass it through mathtext parser \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10166/}{PR \#10166}: Hide fully transparent text in PS output. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10150/}{PR \#10150}: Docstring updates for \sphinxcode{\sphinxupquote{Axes.fill}} and \sphinxcode{\sphinxupquote{Axes.pie}} \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10172/}{PR \#10172}: Slight improvements to contour.py doc \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10159/}{PR \#10159}: improve Axes.broken\_barh docstring \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10169/}{PR \#10169}: Make relim() take images into account too. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10171/}{PR \#10171}: Replace normed with density in examples \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10046/}{PR \#10046}: Add missing decode() in svg font embedding path. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9317/}{PR \#9317}: On 2.7, run tests on oldest documented supported pytest and pytest-cov. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10091/}{PR \#10091}: Replace “True \textbar{} False” by “bool” in the docs. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10129/}{PR \#10129}: Fix multiple zero labels when using SymLogNorm \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10085/}{PR \#10085}: Move missing font message to debug level \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10155/}{PR \#10155}: Use keyword arguments for setp() in examples \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10152/}{PR \#10152}: DOC: update the datetime64 HowTo \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9645/}{PR \#9645}: expose Path.contains\_points as a method of Patch \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10093/}{PR \#10093}: Some docstring fixes and change a raise type \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10141/}{PR \#10141}: Zoom out to rectangle is not experimental anymore. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10087/}{PR \#10087}: Update docs on installing GUI toolkits in virtualenvs. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10137/}{PR \#10137}: Remove gen rst \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10126/}{PR \#10126}: Move axisartist examples to their folder. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10131/}{PR \#10131}: cairo backends do not support blitting; mark them as such. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10134/}{PR \#10134}: Minor style cleanups. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10127/}{PR \#10127}: Use subplots() instead of axes\_grid in suitable examples. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9938/}{PR \#9938}: Cleanup imports. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10116/}{PR \#10116}: Add simple image test for 3D tricontour and tricontourf \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10090/}{PR \#10090}: Minor simplification to \_pylab\_helpers. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10089/}{PR \#10089}: Deprecate passing strings instead of booleans to control tick state (and other states). \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9975/}{PR \#9975}: Remove some test warnings \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10084/}{PR \#10084}: DOC: Better error when float on datetime axis \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10092/}{PR \#10092}: Minor cleanups to the cairo backend. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10120/}{PR \#10120}: Minor simplification to legend.py. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10101/}{PR \#10101}: Add origin as sticky point for radial axes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10104/}{PR \#10104}: Minor fixes to backend\_template. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9619/}{PR \#9619}: FIX: non-existing variable \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10020/}{PR \#10020}: Let Container reprs report the actual subtype. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9959/}{PR \#9959}: DOC: Update color tutorial to explain alpha \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10094/}{PR \#10094}: replace six.next -\textgreater{} next (available since Py2.6). \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10103/}{PR \#10103}: Simplify Colormap.\_\_call\_\_. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10102/}{PR \#10102}: Remove list(zip(…)) when unnecessary. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10106/}{PR \#10106}: Clean up some widget docstrings \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10108/}{PR \#10108}: Dedent docs in contributing.rst bullet/numbered lists. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10096/}{PR \#10096}: Logging and exception messages cleanup. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10095/}{PR \#10095}: Remove some debugging code. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10100/}{PR \#10100}: STY: fix line length \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9316/}{PR \#9316}: Removal of deprecated features for 2.2 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10098/}{PR \#10098}: Doc update: Explain what drawing a line does in RectangularSelector. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9997/}{PR \#9997}: Fix empty plot with drawstyle=”steps” \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10065/}{PR \#10065}: Add version to documentation header \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10028/}{PR \#10028}: Remove some deprecated rcParams. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10024/}{PR \#10024}: Deprecate nbagg.transparent rcParam. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10074/}{PR \#10074}: Prefer vendored qhull if sys-wide version can’t be determined. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10044/}{PR \#10044}: Remove some uses of unicode\_literals \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10055/}{PR \#10055}: Documentation mistake in pyplot.py corrected \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10064/}{PR \#10064}: FIX: remove repeated label legend logic \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10052/}{PR \#10052}: Use consistent float-to-str formatting for tests with units \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10032/}{PR \#10032}: Add method for comparing two colors \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10030/}{PR \#10030}: Fix using .get\_color() and friends in labels handling \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10031/}{PR \#10031}: Fix legend color comparisions \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10021/}{PR \#10021}: Cleanup issue template. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10026/}{PR \#10026}: Fix scatter docstring markup \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10043/}{PR \#10043}: Update FreeType hashes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10027/}{PR \#10027}: Improve errorbar returns doc \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10019/}{PR \#10019}: TST: test mlab cohere \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10025/}{PR \#10025}: Remove badges from website sidebar \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10000/}{PR \#10000}: Fix figure.colorbar() with axes keywords \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9999/}{PR \#9999}: improve legend docstring \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9514/}{PR \#9514}: Convert index.html and citing.html to rst. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10006/}{PR \#10006}: add mpl-template and plotnine to 3rd party doc \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/7945/}{PR \#7945}: fix StixSans mapping bug \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10014/}{PR \#10014}: FIX: pass nonposx/y args through loglog etc \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/10004/}{PR \#10004}: Fixed critical typo in mlab.cohere \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9989/}{PR \#9989}: FIX: clabel manual spacing was incorrect \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9998/}{PR \#9998}: Fix scatter\_piecharts example \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9956/}{PR \#9956}: BUG: clear events before destroying windows in tkagg \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9949/}{PR \#9949}: fix docstring in ToolManager \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9641/}{PR \#9641}: Implement Qt4 backend by fully reexporting Qt5 backend. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9932/}{PR \#9932}: Support pgi as alternative gobject bindings. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9986/}{PR \#9986}: Remove unused import in toolmanager example \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9968/}{PR \#9968}: Deprecate pyplot.axes with an Axes argument \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9962/}{PR \#9962}: toolbar checkbutton fix bug in tkinter python3.6 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9981/}{PR \#9981}: DOC: Add alpha compositing note to “matplotlib.pyplot.imshow” definition. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9969/}{PR \#9969}: Numpydoc conversion and clarification of some AxesBase docstrings \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9946/}{PR \#9946}: Clean up legend docstrings \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9951/}{PR \#9951}: Improve documentation on Axes position \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9964/}{PR \#9964}: Update Axes docs on aspect-related methods \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9385/}{PR \#9385}: Bump test coverage of Qt5 UI. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9958/}{PR \#9958}: FIX: put Nav Home view back inside pan/zoom \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9945/}{PR \#9945}: Only label vertical lines in acorr \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9930/}{PR \#9930}: Cleanup pyplot.axes() \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9942/}{PR \#9942}: Minor doc formatting cleanups in pyplot \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9933/}{PR \#9933}: Fix Rectange.get\_bbox() \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9929/}{PR \#9929}: In tests, remove unused imports and sort some remaining imports. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9928/}{PR \#9928}: Cleanup delaxes() \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9750/}{PR \#9750}: Use command keys for window shortcuts in Qt on OSX \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9072/}{PR \#9072}: Use left/right top/bottom instead of width/height in Rectangle \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9917/}{PR \#9917}: Unify (parametrize) test\_composite across backends. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9919/}{PR \#9919}: In unit/memleak, write to in-memory buffer instead of file. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9916/}{PR \#9916}: backend\_agg cleanup. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9915/}{PR \#9915}: Deprecate unused FigureManagerBase.show\_popup. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9825/}{PR \#9825}: Deprecate Artist.onRemove, Artist.hitlist. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9513/}{PR \#9513}: Switch to makefile-based doc build. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9865/}{PR \#9865}: less\_simple\_linear\_interpolation can be replaced by np.interp. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9904/}{PR \#9904}: Deprecate unused ContourLabeler.get\_real\_label\_width. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9881/}{PR \#9881}: Polar tick fixes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9028/}{PR \#9028}: Modified rrulewraper to handle timezone-aware datetimes. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9900/}{PR \#9900}: DOC: Updates multiprocessing example. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9907/}{PR \#9907}: DOC: (subjectively) nicer annotated barchart example \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9448/}{PR \#9448}: Fix instance of ‘RendererPS’ has no ‘tex’ member \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9899/}{PR \#9899}: make SubplotTool into a modal dialog, keep ref to SubplotTool \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9889/}{PR \#9889}: Deprecate ‘normed’ kwarg to hist \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9421/}{PR \#9421}: Improve reprs of transforms. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9897/}{PR \#9897}: changed line to ‘alias for set\_multialignment’ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9875/}{PR \#9875}: Additions to the documentation guide \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9878/}{PR \#9878}: TST: Lock pytest to 3.2.5 until 3.3.1 released \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9805/}{PR \#9805}: Update documentation guide \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9836/}{PR \#9836}: ENH/MacOS Allow shift modifiers to key events \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9860/}{PR \#9860}: Vectorize and document simple\_linear\_interpolation. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9869/}{PR \#9869}: Clean tmpdir at exit. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9781/}{PR \#9781}: Convert LineCollection docstring to numpydoc \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9862/}{PR \#9862}: PRF: Don’t used MaskedArray in Aitoff transform. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9854/}{PR \#9854}: Exclude dviread.Text from the documentation. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9861/}{PR \#9861}: Remove some unused imports; reword/remarkup some docstrings. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9857/}{PR \#9857}: documentation: fix url for pillow \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9811/}{PR \#9811}: dynamically finding the backend preferred format for button images \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9841/}{PR \#9841}: ENH: make interval\_multiples work for years \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9826/}{PR \#9826}: Deprecate column cycling when plot() inputs have nonmatching shapes. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9852/}{PR \#9852}: Simplify the pyplot animation demo. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9853/}{PR \#9853}: Move image\_slices\_viewer example from animation to event\_handling. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9848/}{PR \#9848}: Fix typo in axis api doc \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9846/}{PR \#9846}: Move enumeration of text tutorial into table. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9827/}{PR \#9827}: DOC: add more tutorial to text/text\_intro \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9773/}{PR \#9773}: MNT: Make sure AppVeyor fails if tests fail \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9806/}{PR \#9806}: Remove call to nonexistent FT2Font.get\_fontsize. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9816/}{PR \#9816}: ENH: add pad kwarg to set\_title \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9817/}{PR \#9817}: API: do not truncate svg size to integer points \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9599/}{PR \#9599}: Unify the three Qt5 embedding examples. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9803/}{PR \#9803}: Add links to python’s strftime method \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9807/}{PR \#9807}: Simplify test\_tinypages. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9790/}{PR \#9790}: Link GridSpec docs to SubplotParams paramter descriptions \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9311/}{PR \#9311}: Update docs on docs. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9794/}{PR \#9794}: DOC: for datetime64 support \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9779/}{PR \#9779}: ENH: support np.datenum64 in dates.py \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9654/}{PR \#9654}: Correctly convert units for a stacked histogram \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9670/}{PR \#9670}: Make tick\_left/right keep labels off if they are already off \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9723/}{PR \#9723}: ENH: Catch masked array and invalid x, y to pcolormesh \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9766/}{PR \#9766}: Fix mixed\_subplots example \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9255/}{PR \#9255}: New color blind-friendly color cycle \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9756/}{PR \#9756}: DOC removing pyplot\_annotate.py \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9759/}{PR \#9759}: blocking\_input: Fix “manager” attr check \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9313/}{PR \#9313}: {[}MRG{]} Replace verbose class with standard logging library \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9743/}{PR \#9743}: FIX: check if contour level in format dictionary, or return a default \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9753/}{PR \#9753}: FIX: Detrending before windowing \_spectral\_helper \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9752/}{PR \#9752}: DOC: example demo\_parasite\_axes2.py broken on 2.1.0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9587/}{PR \#9587}: Remove unused example with no plot \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9715/}{PR \#9715}: Change set\_figwidth/height to be consistent w/ set\_size\_inches \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9657/}{PR \#9657}: Add API note about MovieWriterRegistry exception \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9748/}{PR \#9748}: Reword subplot() doc. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9379/}{PR \#9379}: ENH: Added \_\_repr\_\_ for Figure \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9724/}{PR \#9724}: Fix PDFpages bug \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9726/}{PR \#9726}: FIX/TST: update tests for pandas 0.21 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9677/}{PR \#9677}: Rely more on lru\_cache rather than custom caching. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9698/}{PR \#9698}: Set widget background color to white. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9733/}{PR \#9733}: Allow \_BackendNbAgg.show() to take keyword “block” \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9732/}{PR \#9732}: Added mention of WCSAxes in the third-party packages page \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9711/}{PR \#9711}: Minor markup fix. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9718/}{PR \#9718}: Revert “Axes.\_\_init\_\_ speedup” \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/8626/}{PR \#8626}: Axes.\_\_init\_\_ speedup \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9662/}{PR \#9662}: Fix crash when restarting OSX single shot timer \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9461/}{PR \#9461}: Property tables \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9684/}{PR \#9684}: Make some more of figure.py numpydoc \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9703/}{PR \#9703}: Deprecate Artist.is\_figure\_set. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9697/}{PR \#9697}: Raise minimum WX version to 2.9. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9705/}{PR \#9705}: Fix scatterplot categorical support \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9687/}{PR \#9687}: Fix callbackregistry docstring. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9689/}{PR \#9689}: Updates to font-related examples. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9690/}{PR \#9690}: Move example in wrong folder \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9678/}{PR \#9678}: Remove a few unnecessary global statements. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9685/}{PR \#9685}: Trivial aliases. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9566/}{PR \#9566}: Update API examples \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9680/}{PR \#9680}: Actually install the deps on Appveyor. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9481/}{PR \#9481}: Apply hinting factor rcParam in all cases. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9676/}{PR \#9676}: FIX: Catch IOError on font-cache write \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9673/}{PR \#9673}: On CI, just let pip resolve most dependencies. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9649/}{PR \#9649}: Reoder Axes API docs. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9658/}{PR \#9658}: Pin pandas on appveyor too \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9665/}{PR \#9665}: Update agg\_oo\_sgskip.py \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9661/}{PR \#9661}: Fix arcs with very large width/height. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9510/}{PR \#9510}: BLD: Fix some bugs in \sphinxcode{\sphinxupquote{setupext.py}} \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9646/}{PR \#9646}: Convert dviread to use lru\_cache. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9648/}{PR \#9648}: Correct https git URIs in documentation \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9614/}{PR \#9614}: Added an entry for mpl-scatter-density in the third-party tools page \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9640/}{PR \#9640}: Remove unused global cmd\_split variable. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9532/}{PR \#9532}: Further improve colormap discussion. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9324/}{PR \#9324}: {[}MRG{]} Allow kwarg handles and labels figure.legend and make doc for kwargs the same \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9643/}{PR \#9643}: More helpful error if requested MovieWriter not available \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9359/}{PR \#9359}: Keep track of axes in interactive navigation. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9389/}{PR \#9389}: Assign event to later Axes if zorders are tied. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9612/}{PR \#9612}: Only set view/data intervals if axis is set in AutoDateLocator \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9627/}{PR \#9627}: Move old logo to history page. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9624/}{PR \#9624}: DOC: move whats\_new entry to next\_whats\_new folder \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9625/}{PR \#9625}: STY: remove trailing whitespace \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9600/}{PR \#9600}: Fix some widget docstrings. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9617/}{PR \#9617}: Pin pandas\textless{}0.21 to unbreak the build. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9515/}{PR \#9515}: Attribute users/intro to JDH and rename to history. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9615/}{PR \#9615}: Do not hardcode fill=False in mark\_inset \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9262/}{PR \#9262}: Minor doc markup fixes. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9603/}{PR \#9603}: Fix xkcd() not resetting context anymore. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9604/}{PR \#9604}: Gridspec doc fixes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9008/}{PR \#9008}: adding webagg.address parameter to rcParams \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9519/}{PR \#9519}: Increase patch test coverage \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9497/}{PR \#9497}: Test simplifications. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9536/}{PR \#9536}: Simplify declaration of install\_requires. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9601/}{PR \#9601}: Fix PEP8 in stackplot \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9595/}{PR \#9595}: Convert stackplot docstring to numpydoc \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9589/}{PR \#9589}: Fix typo in isinstance \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9523/}{PR \#9523}: Add capstyle and joinstyle attributes to Collection class (Issue \#8277) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9584/}{PR \#9584}: Add returns documentation to fill\_between methods \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9575/}{PR \#9575}: Add some legend handler documentation \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9477/}{PR \#9477}: In LogTransform, clip after log, not before. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9568/}{PR \#9568}: Add a proper docstring to AutoLocator \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9569/}{PR \#9569}: Docstring fix. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9564/}{PR \#9564}: TST: add test of normed histogram with unequal bins \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9552/}{PR \#9552}: animation: Remove examples keyword \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9555/}{PR \#9555}: MRG: expand docstring for \sphinxcode{\sphinxupquote{hist}} \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9469/}{PR \#9469}: FIX: PyQt versions where showing the Qt versions \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9549/}{PR \#9549}: Fix stale draws on MacOSX backend \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9544/}{PR \#9544}: adding links to color examples and tutorials in the api page \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9540/}{PR \#9540}: DOC fix set\_xticklabels docstring \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9442/}{PR \#9442}: BUG: Fix \sphinxcode{\sphinxupquote{\_extent}} not set in PcolorImage \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9363/}{PR \#9363}: Allow invalid limits when panning \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9292/}{PR \#9292}: Fix TypeError: a bytes-like object is required, not ‘str’ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9530/}{PR \#9530}: DOC Added the colormap references back \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9517/}{PR \#9517}: Convert slider docstrings to numpydoc \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9516/}{PR \#9516}: Make colorbar docstring numpydoc \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9504/}{PR \#9504}: Truncate windows registry entries after null byte. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9484/}{PR \#9484}: Force installation of wx from whl, not from pypi. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9300/}{PR \#9300}: Simplify mpl.testing.\_copy\_metadata. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9508/}{PR \#9508}: CI: do not run pushes to the auto-backport branches \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9506/}{PR \#9506}: fix typo in rst markup \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/7739/}{PR \#7739}: WIP: Fix artifact upload \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9396/}{PR \#9396}: Fix minor bug in vertex insert \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9478/}{PR \#9478}: Added description to widget example programs except Cursor and Menu \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9164/}{PR \#9164}: include overspilling axes legends in ax.get\_tightbbox \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9495/}{PR \#9495}: Macosx fixes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9465/}{PR \#9465}: Avoid dividing by zero in AutoMinorLocator (fixes \#8804) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9425/}{PR \#9425}: Minor fixes to plot\_directive. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9486/}{PR \#9486}: Don’t leak test.jpeg into cwd while testing. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9490/}{PR \#9490}: No need to fake sets with dicts anymore. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9487/}{PR \#9487}: Improve test\_backend\_svg.test\_determinism. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9483/}{PR \#9483}: DOC Demote container headings one level Artist tutorial (minor) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9447/}{PR \#9447}: Update examples for axisgrid1 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9121/}{PR \#9121}: Remove old normalising code from plt.hist \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9293/}{PR \#9293}: minor (unrelated) cleanups \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9459/}{PR \#9459}: Modified restrictions on \sphinxcode{\sphinxupquote{margins}} method \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9473/}{PR \#9473}: Changes to better highlight development-workflow in docs \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9423/}{PR \#9423}: Mark the interactive backend test as flaky. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9476/}{PR \#9476}: Get rid of a few unnecessary line continuations in strings. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9435/}{PR \#9435}: Shadow patch now initializes zorder behind argument patch \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9472/}{PR \#9472}: documentation fix regarding contour and tricontour (\#9088) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9456/}{PR \#9456}: Documented the incompatibility of shrink and cax kwargs in colorbar. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9378/}{PR \#9378}: DOC: fill out dev docs \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9464/}{PR \#9464}: Fix multiple unreferenced local variable warnings \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9463/}{PR \#9463}: DOC: Re-enable next what’s new entries. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9451/}{PR \#9451}: custom legends example \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9137/}{PR \#9137}: Adds option for Slider to snap to discrete values \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9441/}{PR \#9441}: STY: fix bad indentation \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9449/}{PR \#9449}: TST: Enable xdist on Appveyor \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9444/}{PR \#9444}: STY: Remove explicit return in \_\_init\_\_ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9452/}{PR \#9452}: FIX: Always update tick labels (fixes \#9397) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9438/}{PR \#9438}: Remove unused variable ‘sign’ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9418/}{PR \#9418}: TST: Disable faulthandler on Windows if CPython 3.6-3.6.3 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9440/}{PR \#9440}: Remove reimport of modules \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9439/}{PR \#9439}: Fix undefined variable ‘warnings’ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9437/}{PR \#9437}: Fix Undefined variable ‘symbol’ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9424/}{PR \#9424}: Minor fixes to gallery build. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9432/}{PR \#9432}: Correct minor typo \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9420/}{PR \#9420}: Trivial doc fixes. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9427/}{PR \#9427}: Fix NameError: name ‘exc’ is not defined \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9428/}{PR \#9428}: Fix NameError: name ‘ArgumentError’ is not defined \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9409/}{PR \#9409}: TST: Fix flaky tests order \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9408/}{PR \#9408}: updating color cycle tutorial \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9415/}{PR \#9415}: Import time module so that pyplot.pause works \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9410/}{PR \#9410}: BUG: Fix savefig GUI in GTK backend \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9254/}{PR \#9254}: imshow transparency blend example \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9403/}{PR \#9403}: MAINT Documentation on doc is outdated \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9367/}{PR \#9367}: Tell user to try installing pkg-config if packages not found \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9383/}{PR \#9383}: Increase axes test coverage \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9401/}{PR \#9401}: FIX scipy is not a requirement \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9392/}{PR \#9392}: Add examples for subplots\_axes\_and\_figures \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9394/}{PR \#9394}: {[}Doc{]} Add pcolor, contour, imshow to and other small changes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9395/}{PR \#9395}: TST: Unblock Appveyor build by patching \sphinxcode{\sphinxupquote{subprocess}} \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9347/}{PR \#9347}: Fix backend refactor \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9365/}{PR \#9365}: If PIL.image is missing, tell user to install pillow \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9381/}{PR \#9381}: Add tutorials to the Users Guide. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9343/}{PR \#9343}: Fix broken link to proxy artists documentation \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9368/}{PR \#9368}: Add link to Matplotlib paper on citing page \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9375/}{PR \#9375}: Document get\_\{x,y\}axis\_transform more prominently. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9376/}{PR \#9376}: Fix docstring typo in Rectangle, Ellipse, and Spine. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9353/}{PR \#9353}: Fix edgecolor being only applied to first bar. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9335/}{PR \#9335}: Fix poorly done deprecations in image.py. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9341/}{PR \#9341}: Update descriptions for images\_contours\_and\_fields \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9342/}{PR \#9342}: Fix typo of pixels in legend\_handler.py \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9333/}{PR \#9333}: Add descriptions for remaining event handling examples \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9279/}{PR \#9279}: Update doc strings \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9242/}{PR \#9242}: Errorbar bugfix \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9323/}{PR \#9323}: Axis user guide \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9328/}{PR \#9328}: Fix NameError: name ‘os’ is not defined \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9309/}{PR \#9309}: DOC: Update docstring to numpy format for last few functions in transforms \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9291/}{PR \#9291}: Doc updates \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9299/}{PR \#9299}: Restore better error message on std::runtime\_error. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9295/}{PR \#9295}: In text, warn and return instead of raise exception for non-finite x, y \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9303/}{PR \#9303}: Don’t use pytest.filterwarings, which needs pytest\textgreater{}=3.2. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9289/}{PR \#9289}: Throw std::runtime\_exception instead of char*. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9268/}{PR \#9268}: Fix documents of semilogx and semilogy. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9286/}{PR \#9286}: Ask Appveyor to ignore certain branches. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9277/}{PR \#9277}: plot\_surface docstring + edge case fix \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9278/}{PR \#9278}: Remove scatter\_profile example. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/pull/9272/}{PR \#9272}: Include the default of “plot\_pre\_code” of the plot directive in the documentation \end{itemize} Issues (422): \begin{itemize} \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10740/}{\#10740}: table.table fails with KeyError (legacy python and mpl 2.2.0 only) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10722/}{\#10722}: Duplicated test name in test\_constrainedlayout \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10732/}{\#10732}: Calling \sphinxcode{\sphinxupquote{properties()}} on \sphinxcode{\sphinxupquote{Table}} raises exception \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10784/}{\#10784}: axes.legend TypeError in v2.2.0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10410/}{\#10410}: eventplot alters data in some cases \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10786/}{\#10786}: ImportError, library not loaded for libc++abi.1.dylib \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10419/}{\#10419}: svg backend does not respect alpha channel of text \sphinxstyleemphasis{when passed as rgba} \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10785/}{\#10785}: TkAgg reports bad option ‘foobar’ for icon with \sphinxcode{\sphinxupquote{logging}} set to INFO level \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10783/}{\#10783}: Adding an empty matplotlibrc in cwd changes the rcparams \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10769/}{\#10769}: DOC: set\_major\_locator could check that its getting a Locator (was EngFormatter broken?) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10770/}{\#10770}: subplots with qt5agg backend flashes frame on windows desktop \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10753/}{\#10753}: PDF saved as raster graphic when plt.savefig is given a Path object \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10729/}{\#10729}: Animation saving via ffmpeg stops after some 300 frames \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10716/}{\#10716}: Removal of verbose not documented: AttributeError: module ‘matplotlib’ has no attribute ‘verbose’ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10758/}{\#10758}: {[}PyInstaller{]} Failed import of cbook due to upgrade to matplolib 2.2.0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10755/}{\#10755}: AttributeError: module ‘matplotlib’ has no attribute ‘verbose’ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10727/}{\#10727}: Doc issue: ConnectorPatch -\textgreater{} ConnectionPatch \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10719/}{\#10719}: Need better type error checking for linewidth in ax.grid \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10749/}{\#10749}: When I saved graph in JPG format it’s outer axis are no longer present. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10750/}{\#10750}: Are there any methods to stop the moving point showing again in python package matplotlib \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10644/}{\#10644}: autoscaling only one side of an axis \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10698/}{\#10698}: Build fails in clang i386 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10738/}{\#10738}: Suggestion: improve mark\_inset by letting user choose all four corners (locs) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5742/}{\#5742}: \sphinxcode{\sphinxupquote{Axes3DSubplot.plot}} not setting data limits correctly when \sphinxcode{\sphinxupquote{zdir='x'}} or \sphinxcode{\sphinxupquote{zdir='y'}} \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/4413/}{\#4413}: Long axis title alters xaxis length and direction with \sphinxcode{\sphinxupquote{plt.tight\_layout()}} \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/3926/}{\#3926}: Feature request: place axes relative to other axes, with automatic updating \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10709/}{\#10709}: How .\_cntr should be imported on Matplotlib (LTS) 2.2.0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10654/}{\#10654}: PySmithPlot/Polar Plot update broken in 2.1.2 (works in 2.0.2) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/7776/}{\#7776}: tex cache lockfile retries should be configurable \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10556/}{\#10556}: Special conversions of xrange() \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10060/}{\#10060}: Dragged legend moves upon resizing figure window \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10501/}{\#10501}: cmp() is an undefined name in Python 3 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10655/}{\#10655}: constrainedlayout is very slow for large number of subplots \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/4749/}{\#4749}: Incorrect dependency handling from local pip \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9812/}{\#9812}: figure\_enter\_event generates base Event and not LocationEvent \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10677/}{\#10677}: Bug: Example from matplotlib.afm not working \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10673/}{\#10673}: Creating a 6 DoF plot of a quadcopter. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10671/}{\#10671}: \%gui wx crashes jupyter notebook kernel \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10670/}{\#10670}: matplotlib power spectral density (PSD) normalize \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10567/}{\#10567}: imshow in 2.1: color resolution depends on outliers? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10616/}{\#10616}: get error when show a picture(image) : ‘numpy.ndarray’ object has no attribute ‘mask’ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10627/}{\#10627}: Surprising alignment of (multiple) colorbars with constrained layout active \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10647/}{\#10647}: matplotlib with joblib with requests hangs \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10617/}{\#10617}: Can’t save pgfs with text and dates \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10630/}{\#10630}: Adding NCL colortables to default matplotlib colormaps \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10641/}{\#10641}: Take too much memory and too long to save into figure \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10619/}{\#10619}: bar plot fails with units \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10637/}{\#10637}: I have already installed matplotlib function using the command : sudo apt-get install python3-matplotlib. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10585/}{\#10585}: searborn adaptation need for Matptotlib-2.2.0rc1 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10620/}{\#10620}: Error comparing label colors on duplicated labels \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10494/}{\#10494}: Keeping matplotlibrc.templace up to date \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10382/}{\#10382}: More documentation \sphinxcode{\sphinxupquote{mlab}} deprecation. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10555/}{\#10555}: Initial plot window ignoring rcParams figure.figsize \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10611/}{\#10611}: issue with matplotlib.add\_subplot documentation \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10602/}{\#10602}: Random image failures with test\_curvelinear4 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10496/}{\#10496}: exception after clicking ok when editing axis curve info on 3d plot \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10582/}{\#10582}: Creating colorbar for manual axes broken \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/6412/}{\#6412}: EventCollection.\_is\_horizontal remains uninitialized, causing eventplot error \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10583/}{\#10583}: I have problems with display Arabic words in the plots, the words became backward, how can I solve it \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10580/}{\#10580}: Figures plotting in local display \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10576/}{\#10576}: legend in wrong place with wrong labels \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10560/}{\#10560}: fig.savefig alters the dimensions of the figure \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10526/}{\#10526}: In Axes.hist, ‘range’ kwarg shadows builtin ‘range’ needed for Py3 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10398/}{\#10398}: plt.hist density argument does not function as described. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10547/}{\#10547}: set\_xticks does not work with x data type str \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10543/}{\#10543}: pyqt error while importing pyqt5 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10476/}{\#10476}: Version 2.2.0rc1 triggers TypeError \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10516/}{\#10516}: \_macosx.m fails to compile on Mac OS 10.6.8 Snow Leopard \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10458/}{\#10458}: Draggable legend changes position when saving figure with DPI value different from display \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10517/}{\#10517}: overlapping lines in matplotlib library \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10500/}{\#10500}: show() is an undefined name in backend\_webagg.py \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10479/}{\#10479}: TclError in TkAgg with version 2.2.0rc1 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10397/}{\#10397}: wxPython Phoenix release 4.0.0 will not plot \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9972/}{\#9972}: drag/pan error when mouse click is not 1 or 3 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9222/}{\#9222}: Anaconda python spyder systematically crash when multiple plot savefig \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/6269/}{\#6269}: MemoryError In copy\_from\_bbox \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/7795/}{\#7795}: Incorrect uses of is\_numlike \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10453/}{\#10453}: broken link in lib/matplotlib/dates.py comment \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/4319/}{\#4319}: Documentation table of contents doesn’t go deep enough \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5731/}{\#5731}: Move from numpydoc to sphinxcontrib-napoleon \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/3187/}{\#3187}: moderize? boxplot demo \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/7978/}{\#7978}: Warnings in doc build \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10457/}{\#10457}: Navigation history broken in matplotlib 2.1.0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9065/}{\#9065}: google indexes dev-docs \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10391/}{\#10391}: ax.get\_legend().get\_title().get\_visible() does not work \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9876/}{\#9876}: Outlining of devel/documenting\_matplotlib \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10358/}{\#10358}: Clarify documentation for fig.add\_subplot() \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10016/}{\#10016}: Example of radar chart (matplotlib v.2.1.1) doesn’t work \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9642/}{\#9642}: contour\_doc not rendered properly \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/1109/}{\#1109}: MEP for a matplotlib geometry manager \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10202/}{\#10202}: error in construction of inverted log transforms \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10434/}{\#10434}: \sphinxcode{\sphinxupquote{pip install matplotlib}} when Matplotlib is already installed fails because it tries to get unnecessary dependencies \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/6078/}{\#6078}: mpl\_event \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9543/}{\#9543}: Image interpolation gives slightly different result on 32-bit Python \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10430/}{\#10430}: find points which lies strictly inside the polygon \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9312/}{\#9312}: categorical axis sorts its keys \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10424/}{\#10424}: Confusing log message from GridSpec \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9336/}{\#9336}: Integer Categorical Values Not Getting Mapped Correctly \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9350/}{\#9350}: Data types not preserved in categoricals \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9843/}{\#9843}: Are categorical plots with single letter strings limited to show 10 categories? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9112/}{\#9112}: PDFPages Errors on savefig (missing encode) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10418/}{\#10418}: wxagg is broken as of master \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10406/}{\#10406}: Matplotlib stylesheet warnings: Key boxplot.medianprops.color: ‘C1’ does not look like a color arg{}`{}` \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9147/}{\#9147}: broken links in docs \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/4974/}{\#4974}: make color abbrivations configurable \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/3690/}{\#3690}: Using Ctrl-W to close a matplotlib window opened by exec-ing a script in wxpython causes a segfault under linux \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10386/}{\#10386}: Make kiwisolver an optional dependency? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10174/}{\#10174}: Rendering problems with FigureCanvasWxAgg on OSX \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9035/}{\#9035}: savefig does put the correct dpi in the metadata of jpeg \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5750/}{\#5750}: whish for 2016: matplotlib can use only Pillow 3.0+ to create animated GIF \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9717/}{\#9717}: gtk3agg not working with python 3.6.3 \& cairocffi 1.10.0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/6973/}{\#6973}: Running pytest against non develop install fails \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/6836/}{\#6836}: DOC: missing second y-axis in \sphinxcode{\sphinxupquote{demo\_parasite\_axes2}} \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5428/}{\#5428}: Change \sphinxcode{\sphinxupquote{setup.py install}} recommendation to \sphinxcode{\sphinxupquote{pip install .}} \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/4978/}{\#4978}: Use higher-resolution icons on HiDPI-friendly backends \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/4907/}{\#4907}: mpl\_toolkits not installed with \sphinxcode{\sphinxupquote{pip install -e .}} \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/3446/}{\#3446}: Add note about CHM security issues \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/3267/}{\#3267}: Why does rec2csv ignore float precision? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10343/}{\#10343}: Missing keys in matplotlibrc.template to move x-axis labels to top \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10267/}{\#10267}: matplotlibrc: new entry for placing y-axis tick label on Right or Left hand side. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10384/}{\#10384}: maybe bugs in ax.annotate when get bbox coordinates(matplot-2.1.0)? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/7155/}{\#7155}: use categorical in demos \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/6802/}{\#6802}: Discrete scatter? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9974/}{\#9974}: toolbar.update() breaks history \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10373/}{\#10373}: cannot import matplotlib.pyplot \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10368/}{\#10368}: constrained layout uneven gridspec layouts… \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9391/}{\#9391}: imshow doesn’t normalize the color range in RGB images \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5382/}{\#5382}: imsave and imshow ignore vmin/vmax \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10372/}{\#10372}: Floating point image RGB values must be in the 0..1 range \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10349/}{\#10349}: Rectangle patch added to a datetime x-axis is plotted with the wrong width \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10344/}{\#10344}: matplotlib can not handle pandas dataframe correctly when the label of the columns/index is strings but the actual data are float. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8308/}{\#8308}: Too many open files: ‘/usr/lib/python3.6/site-packages/matplotlib/backends/web\_backend/mpl.js’ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10341/}{\#10341}: syntax error without a space \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10338/}{\#10338}: line.set\_drawstyle fails to produce step-like line \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8852/}{\#8852}: Rolling image if the FFMpegWriter dpi setting does not match that specified when a figure is created \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10287/}{\#10287}: \_tkinter.TclError: can’t invoke “wm” command: application has been destroyed \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/7640/}{\#7640}: Some properties are set lazily and behaved inconsistently \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/4346/}{\#4346}: Tick label padding on first y-axis changes when adding a second y-axis \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5560/}{\#5560}: Secondary\_y axis default limit (top) \& bound (upper) not matching ticks \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8823/}{\#8823}: colorbar might shrink plots if used with twinx \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10318/}{\#10318}: Matplotlib Sample Outdated? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8736/}{\#8736}: Figure resize when saving a plot \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10216/}{\#10216}: TST: gdb has been removed from Travis \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10290/}{\#10290}: Figure rotation using Axes.text () with eps backend \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10300/}{\#10300}: How to use triplot to make a multi-color line of the triangular \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8820/}{\#8820}: Regression with numpy \textasciitilde{}\textasciitilde{}1.13\textasciitilde{}\textasciitilde{} 1.14 for colorbars of boolean data \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5968/}{\#5968}: Accepting pathlib.Path as path inputs? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10285/}{\#10285}: Picture in online documentation for multi\_image.py is cut off at bottom \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10229/}{\#10229}: ENH: Add imageio as an option for saving animated gifs \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10288/}{\#10288}: issue with version of six \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10151/}{\#10151}: Question on docstring and signature of Axes.stem() \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10073/}{\#10073}: datetime and sub-second resolution plotting \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10277/}{\#10277}: error import matplotlib.pyplot as plt \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10265/}{\#10265}: ENH tripcolor with explicit RGB colors \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10262/}{\#10262}: OrderedDict legends no longer work 2.1 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10162/}{\#10162}: Increase of Computation time from 2.1.0 to 2.1.1 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/6884/}{\#6884}: MPLRC environment variable to set rcparams \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10252/}{\#10252}: Can’t Import Matplotlib.pyplot - Anaconda 4.4, Python 3.6 \& Windows 10 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10072/}{\#10072}: imshow doesn’t properly display some images \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/7797/}{\#7797}: Quiver barb size not correct on some arches (ppc64, ppc64le…) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5873/}{\#5873}: Useless Dvi dispatch docs in dvi\_read api docs \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10251/}{\#10251}: I have determined a color for each data point pragmatically and I have 11 set of x(time) and y(subjects) and I want to make plots for these values(x values) and these colors will be used for the data points on the plots. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5568/}{\#5568}: Latin Modern support? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5208/}{\#5208}: MathTex Font error \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5250/}{\#5250}: Font-weight range seems wrong \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/3531/}{\#3531}: sundry documentation issues \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/6716/}{\#6716}: \sphinxcode{\sphinxupquote{cleanup}} decorator implemented in an obfuscated way \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9160/}{\#9160}: blank space vs. white space \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/524/}{\#524}: improving mpl docs and accessibility for API users \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/4313/}{\#4313}: Document installation with pip for Python3 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/6626/}{\#6626}: Error in example \sphinxurl{http://matplotlib.org/examples/misc/multiprocess.html} \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8152/}{\#8152}: test\_fontconfig\_fonts error on Linux wheel testing \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/7917/}{\#7917}: Docstring of EventCollection cuts mid-sentence. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9906/}{\#9906}: Incorrect alpha compositing using “matplotlib.pyplot.imshow”. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10069/}{\#10069}: Add what’s new entry for new color comparision method \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10221/}{\#10221}: savefig() does not support PosixPath object for file name \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10205/}{\#10205}: matplotlib. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9040/}{\#9040}: ‘Figure’ object has no attribute ‘\_original\_dpi’ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5703/}{\#5703}: Python 2.6 string format syntax errors in matplotlib 1.4.3 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10163/}{\#10163}: savefig with eps draws a hidden axis \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/2508/}{\#2508}: Relim not working correctly with images \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10140/}{\#10140}: Qt5Agg eats 100\% CPU when plotting with block=True in interactive mode \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10122/}{\#10122}: Color bar has multiple labels for 0 if matplotlib.colors.SymLogNorm is used \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10130/}{\#10130}: Bar plot does not work \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10135/}{\#10135}: matplotlib installation from source and numpy incompatibility \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10123/}{\#10123}: memory leak with histograms \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9887/}{\#9887}: polar limits not snapping to 0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9429/}{\#9429}: Undefined name \sphinxcode{\sphinxupquote{baseline}}? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8547/}{\#8547}: Allow scalar \sphinxcode{\sphinxupquote{weights}} parameter to \sphinxcode{\sphinxupquote{hist}} method \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10115/}{\#10115}: pcolor vs pcolorfast: unexpected white edgecolors using RGBA-alike colormaps \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9200/}{\#9200}: Documentation: File doc/users/whats\_new/README does not exist \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10078/}{\#10078}: updating to release 2.1.1 causes pip to stop working \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9597/}{\#9597}: Plot with \sphinxcode{\sphinxupquote{drawstyle="steps"}} fails if x and y are empty \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8390/}{\#8390}: Can’t install matplotlib from source due to recent addition of QHULL\_LIB\_CHECK to src/qhull\_wrap.c \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8872/}{\#8872}: Build errors with existing qhull \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10053/}{\#10053}: Duplicate legend labels with different colors can often result in an error. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10056/}{\#10056}: Only one legend entry is rendered for items with the same label and color \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10037/}{\#10037}: Documentation mistake in the pyplot introductory tutorial \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9973/}{\#9973}: Slightly misleading errorbar docs that interferes with attempt to animate errorbar \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10012/}{\#10012}: TST: \sphinxcode{\sphinxupquote{mlab.cohere}} needs a test \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9996/}{\#9996}: Remove badges from website side bar \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8493/}{\#8493}: Colorbar documentation: \sphinxcode{\sphinxupquote{anchor}} not recognized as possible argument to plt.colorbar \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8668/}{\#8668}: handles keyword argument not documented in the help of legend \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10015/}{\#10015}: TKWindow unrecognized selector error \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5507/}{\#5507}: DLL load failed: cannot find specified procedure when importing matplotlib.pyplot \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/7939/}{\#7939}: Mathtext.py glyph mapping fails for StixFonts (UnicodeFonts subclass) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/4167/}{\#4167}: No SVG/PDF export when useing latex package cmbrigth \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/4109/}{\#4109}: WXAgg embedded navigation zoom, home, back not working \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/3848/}{\#3848}: PGF Backend with LuaLaTeX: Permission denied error \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10007/}{\#10007}: nonposx and nonposy \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9940/}{\#9940}: Deprecate Axes as a valid pyplot.axes() argument type \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10005/}{\#10005}: matplotlib.pyplot.figlegend not working with Patches \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/10003/}{\#10003}: Typo in mlab.cohere \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9988/}{\#9988}: Contours are not removed correctly when using clabel with manual \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9185/}{\#9185}: Problem in Scatter-Piecharts example \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9856/}{\#9856}: Python crashes when closing figures using TkAgg on Mac OS \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9977/}{\#9977}: Error shows when I import matplotlib after installation \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9935/}{\#9935}: QT5 AttributeError pixelDelta \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9943/}{\#9943}: toolmanager\_sgskip + tkagg example couples “GroupHide” toggle with Pan and (second) Zoom \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8347/}{\#8347}: font\_manager.py Bug \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/4575/}{\#4575}: nbagg canvas size \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9983/}{\#9983}: ImportError: ZLIB\_1.2.9 not found \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9982/}{\#9982}: \sphinxcode{\sphinxupquote{{}`{}`}}’module’ object has no attribute ‘subplots’\sphinxcode{\sphinxupquote{{}`{}`}} when importing with \sphinxcode{\sphinxupquote{{}`{}`{}`{}`\_\_import\_\_{}`{}`{}`{}`}} \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9954/}{\#9954}: import matplotlib.pyplot as plt, ImportError: libGL.so.1: cannot open shared object file: No such file or directory \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9980/}{\#9980}: Cannot update to MPL v2.1.1 on Anaconda \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/7502/}{\#7502}: Rely on Sphinx’ “any” role to make docstrings more legible \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9976/}{\#9976}: ax.set\_aspect triggers useless warnings \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9965/}{\#9965}: subplots ignores figsize argument \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9863/}{\#9863}: Y-axis value of a seaborn heatmap is reversed when home icon or H button is pushed \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9944/}{\#9944}: Acorr() creates two labels \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9939/}{\#9939}: Matplotlib scatterplot does not work with pandas timestamp/datetime format \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/2140/}{\#2140}: Make Cmd-W close the window using QT4 on OS X \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/4916/}{\#4916}: Cannot use a timedelta Rectangle width with a datetime axis \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5798/}{\#5798}: Use Makefile for sphinx build \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9739/}{\#9739}: doc inconsistency: definition of “aspect” \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9018/}{\#9018}: DayLocator is returning incorrect times around daylights switch over \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/7388/}{\#7388}: Example examples/misc/multiprocess.py may not be python3 compatible? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9898/}{\#9898}: using \sphinxcode{\sphinxupquote{xs=..., ys=...}} on ax.scatter 2D raises error \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9864/}{\#9864}: Missing \sphinxcode{\sphinxupquote{normed}} parameter description in matplotlib.pyplot.hist \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9896/}{\#9896}: Simple documentation typo \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9895/}{\#9895}: Sequential colormaps doesn’t reach 100 lightness (pure white) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9893/}{\#9893}: Bug with setting minor tick marks on plots \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9890/}{\#9890}: how to autoscale y axis in different {[}x1,x2{]} range? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9835/}{\#9835}: Shift+Arrow key events not detected in osx backend \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9879/}{\#9879}: Usage FAQ section missing in 2.1.0 documentation \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9786/}{\#9786}: Consistent Documentation Guide for Docstrings \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/2259/}{\#2259}: dates.date2num no longer works with numpy.datetime64 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9868/}{\#9868}: Infinite number of /tmp/matplotlib-* dirs on machine without HOME env variable \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8039/}{\#8039}: “savefig” bug with unicode characters (version 2.0.0) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9834/}{\#9834}: console gets stuck when creating figure \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9866/}{\#9866}: ValueError: ordinal must be \textgreater{}= 1 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9130/}{\#9130}: axes.get\_tightbbox doesn’t include legends… \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9302/}{\#9302}: ENH: Switch from verbose to logging for warnings and logging \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9531/}{\#9531}: Improve Colormap example. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9838/}{\#9838}: YearLocator should prefer ticks at the turn of the decade \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9784/}{\#9784}: plot(2D, 2D) will cycle through the input columns even with non-matching shapes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9719/}{\#9719}: Appveyor passing, even when tests are failing \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9849/}{\#9849}: Crash when scroll on figure \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/1257/}{\#1257}: Support for hierarchical labeling of bar-plots \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9833/}{\#9833}: Visibility of pane edges in 3d figures \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9840/}{\#9840}: quiver angles array UnboundLocalError: local variable ‘lengths’ referenced before assignment \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9828/}{\#9828}: Can’t pickle plots with date axes (from pandas) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9823/}{\#9823}: Missing \_\_init\_\_.py file in mpl\_toolkits \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9822/}{\#9822}: Cloud any one experience the below error while installing ‘pyplot’ package \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9788/}{\#9788}: font\_manager calls nonexistent method FT2Font.get\_fontsize \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9436/}{\#9436}: Instance of ‘TextBox’ has no ‘observers’ member? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9820/}{\#9820}: Borders appear only for the first bar in the bar plot. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9744/}{\#9744}: \sphinxstyleemphasis{frac} in set\_thetagrids() doesn’t work \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9819/}{\#9819}: Multi-page PDF file size jumps since 2.0.0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9818/}{\#9818}: edgecolor arg set to scalar applies to the first bar in bar() method \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9610/}{\#9610}: provide converters for datetime64 types \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9815/}{\#9815}: svg backend truncates output size to integer, which it doesn’t need to (and pdf backend doesn’t) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9785/}{\#9785}: \sphinxcode{\sphinxupquote{zorder=None}} not properly handled \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9735/}{\#9735}: 2.1.0 sdist does not allow building docs \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9809/}{\#9809}: legend() fails when data set with empty error bars has been plotted \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9808/}{\#9808}: inconsistent hatch and border color in barh in matplotlib 2.1.0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/7200/}{\#7200}: Default locator for log-scale messes up minor ticks sometimes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9798/}{\#9798}: PdfPages and PdfFile closing error \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5541/}{\#5541}: errorbar of (x,y) data on semilogx plot with NaN in x throws ValueError if errorbar() command initializes the axes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9791/}{\#9791}: Contour plot doesn’t show if setting “manual=True” in plt.clabel() \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9780/}{\#9780}: Dotted grid lines have different individual dot sizes in pdf files \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5898/}{\#5898}: Error on datetime data in stacked histogram plot \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8982/}{\#8982}: Backend MacOSX keyboard not working \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9771/}{\#9771}: Error in matplotlib with datetime64 with pandas 0.21.0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9256/}{\#9256}: reading truncated png can segfault python \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9664/}{\#9664}: Change in behavior of axis.tick\_left() with shared axes from 2.0 to 2.1 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9358/}{\#9358}: zoom/pan stack bug in 2.1.0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9720/}{\#9720}: plt.pcolormesh stopped working with Masked Arrays \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/1668/}{\#1668}: Support .otf fonts \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9758/}{\#9758}: plt.ginput broken on 2.1.0: plot does not appear \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/2203/}{\#2203}: Allow negative radial grid values in polar.py \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/6026/}{\#6026}: bad behaviour on DateFormatter on y-axis \textendash{}\textgreater{} polar vs normal plot \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9742/}{\#9742}: clabel raises KeyError with level on boundary since matplotlib 2.1.0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9669/}{\#9669}: Make forward=True default consistent across size changing methods \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9751/}{\#9751}: inconsistency in the algorithm for calculating cross spectral densities \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5837/}{\#5837}: Cannot start tkinter-based example on Python 3.5.1 using Mac Homebrew for Python and Tk \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/2422/}{\#2422}: PDF backend on OS X 10.8 creates PDFs that are viewable in Adobe Reader, but not in Preview or QuickLook \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9740/}{\#9740}: doc infelicities on subaxes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9651/}{\#9651}: “block” keyword unrecognized in 2.1 in notebook backend \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9716/}{\#9716}: Large size of plots saved as pdf \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9741/}{\#9741}: Missing arguments in call to exception\_handler \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9729/}{\#9729}: plt.pause() with notebook backend causes error \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8122/}{\#8122}: keyword labelrotation is not recognized \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9655/}{\#9655}: Segmentation fault when starting a timer a second time (MacOS X backend) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9699/}{\#9699}: IndexError thrown by pyplot.legend() \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9494/}{\#9494}: Categorical not hitting update path on fill\_between \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9700/}{\#9700}: Subsequent calls to plt.scatter with different categories raise ValueError \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9702/}{\#9702}: Broken pdf export when using genuine TeX (Missing encode) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9701/}{\#9701}: Bars are not visible in bar plot when log scale is enabled \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9688/}{\#9688}: ValueError: Invalid RGBA argument: nan \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9548/}{\#9548}: failure on import due to IOError writing font cache \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9674/}{\#9674}: is FigureCanvas\textless{}Backend\textgreater{}.blit(… bbox=box) ever used? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9671/}{\#9671}: Style configuration changing behavior of savefig \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9663/}{\#9663}: Spelling error in gallery (agg\_oo\_sgskip.html) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9659/}{\#9659}: patches.Arc objects randomly drawing the full ellipse \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9380/}{\#9380}: Cannot import pyplot. NameError: ‘FigureManagerWebAgg’ is not defined \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/3476/}{\#3476}: File save dialog output goes to python terminal on OS X \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8623/}{\#8623}: fill\_between incorrect with log y-axis and value 0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/4450/}{\#4450}: shared axes switch to log scale \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9320/}{\#9320}: 2.1 figure.legend broken \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9635/}{\#9635}: matplotlib spline adjustment changes tick label visibility \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9388/}{\#9388}: Mouse events have incorrect inaxes/data properties when axes overlap (matplotlib 2.1.0) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9457/}{\#9457}: ax.fill\_between broken for log scale and values below zero \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9558/}{\#9558}: Inconsistency between AutoLocator and AutoDateLocator \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9288/}{\#9288}: Histograms disappear with logarithmic y-axis \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9628/}{\#9628}: Histogram missing in Matplotlib 2.1.0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9609/}{\#9609}: matplotlib color not equal to the setting \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9611/}{\#9611}: Unexpected behaviour with string input to .plot and .fill\_between \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9626/}{\#9626}: Categorical plot example not working in 2.02. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9348/}{\#9348}: Matplotlib introduction is unattributed \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/7158/}{\#7158}: Arrays are not equal in 2.0.0b4 testsuite on Fedora rawhide/aarch64 (ARM v8 64bit) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9520/}{\#9520}: XKCD context manager not resetting anymore in 2.1 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/3491/}{\#3491}: What’s the best way to make a matplotlib colormap mutable? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9541/}{\#9541}: Broken Basemap rotpole projection \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9591/}{\#9591}: Unable to draw horizontal arrow using annotation \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9592/}{\#9592}: Scientific notation digits on figure \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9590/}{\#9590}: Scientific format digits on figure \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9557/}{\#9557}: Behavior of hist() with normed=True changes from v2.0 to v2.1 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9585/}{\#9585}: Cannot write JPG images anymore with Pillow 4.2 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9581/}{\#9581}: pixel sizes uneven with ImageGrid \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9577/}{\#9577}: Plotting pcolor with datetime along coordinate fails with TypeError: invalid type promotion \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9578/}{\#9578}: matplotlib 2.1.0 “stable” \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9467/}{\#9467}: Error on updating to matplotlib 2.1.0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9249/}{\#9249}: basemap pcolormesh warning with matplotlib 2.0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9443/}{\#9443}: Cartopy Border Plotting Fails on 2.1 Only \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9567/}{\#9567}: Possible bug in tight\_layout? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9560/}{\#9560}: Can you add some speed speed to matplotlib.pyplot.stem? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9537/}{\#9537}: No Bugs at all \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8282/}{\#8282}: changing facecolor to ‘none’ prevents updating canvas \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/3708/}{\#3708}: examples/cursor.py gives RuntimeError on mac osx \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8090/}{\#8090}: Spectrogram of large arrays behaves badly on MacOSX backend \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/6538/}{\#6538}: On armv7hl, some get\_cursor\_data calls return 0 instead of None. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9545/}{\#9545}: plot\_surface gives blank figure with log scale for axes \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8426/}{\#8426}: PcolorImage does not set \sphinxcode{\sphinxupquote{\_extent}} \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9538/}{\#9538}: How to avoid override pie \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9406/}{\#9406}: 2.1.0 serious regression in Qt5 backend \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9361/}{\#9361}: 2.1 change - Axis Limit Error \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9390/}{\#9390}: Save to .pdf doesn’t work in 2.1.0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9485/}{\#9485}: FileNotFoundError while import matplotlib (maybe pyplot) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9332/}{\#9332}: Qt backend figureoptions.py does not work due to change in image.py \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/6516/}{\#6516}: savefig to pdf: ‘str’ object has no attribute ‘decode’ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9499/}{\#9499}: A 3D object appears in front of another object, even though it is physically behind it. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5474/}{\#5474}: tight\_layout puts axes title below twiny xlabel \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9183/}{\#9183}: X-axis doesn’t show entirely \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8814/}{\#8814}: 3D plot camera-rotation does not update with mouse movement when using the MacOS backend \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9491/}{\#9491}: TextBox widget on MacOSX fails with RuntimeError: Cannot get window extent w/o renderer \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9496/}{\#9496}: barh edgecolor and hatch are not applied to all bars \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8804/}{\#8804}: Division by zero in AutoMinorLocator \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9480/}{\#9480}: QWidget raise above canvas \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9489/}{\#9489}: Opening an interactive figure doesn’t work on MacOSX backend with matplotlib v2.1 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/7092/}{\#7092}: pyplot.scatter method is not working with Iterator types of an input arguments \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8131/}{\#8131}: bad error message from pyplot.plot \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8333/}{\#8333}: Rely on numpy to properly normalize histograms with unequal bin widths \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9334/}{\#9334}: Remove restriction in \sphinxcode{\sphinxupquote{plt.margins(m)}} to 0 \textless{}= m \textless{}= 1 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9474/}{\#9474}: {[}TST{]} qt5 backend test sometimes failing \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9377/}{\#9377}: Shadow applied to a simple patch does not show \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9355/}{\#9355}: DOC: developer tips guide incomplete (for complete newbie) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/2539/}{\#2539}: boxplot treats iterables differently by type \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5630/}{\#5630}: Ipe backend \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9455/}{\#9455}: ticklabel and gridlines in polar projection in v2.1.0 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9088/}{\#9088}: Number of levels in contour can be larger than the requested number \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9471/}{\#9471}: AttributeError: ‘str’ object has no attribute ‘zorder’ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8941/}{\#8941}: Colorbar: ‘shrink’ not recognized at argument to colorbar when cax is specified \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9466/}{\#9466}: Plot window crashes when the ‘Edit axes’ button is pressed’ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8411/}{\#8411}: Saving figures as PDF miss aligns rotated labels \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9397/}{\#9397}: Incorrect labels returned with custom formatter and locator \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9453/}{\#9453}: how to remove the black bounding box of legend? \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8193/}{\#8193}: eventplot throws exception when using color different than one of \{‘b’, ‘g’, ‘r’, ‘c’, ‘m’, ‘y’, ‘k’, ‘w’\} \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8883/}{\#8883}: Incorrect example for interactive plotting in Matplotlib Usage FAQ \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/7527/}{\#7527}: Locators raise unclear exceptions on MappingView input \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8769/}{\#8769}: seeing issue on six.py import name in matplotlib on python3.4 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9182/}{\#9182}: Text bug \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9326/}{\#9326}: Non-reproducible line in Image tutorial \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8796/}{\#8796}: Varying results depending on freetype version \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9412/}{\#9412}: pyplot.pause doesn’t import the time module but uses it (v2.1.0) \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9407/}{\#9407}: 2.1.0: Cannot save figures in GTK backend \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9176/}{\#9176}: Appveyor build failing \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9331/}{\#9331}: \sphinxcode{\sphinxupquote{matplotlib.pyplot}} is missing from intersphinx \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9280/}{\#9280}: imshow errors when plotting completely masked array \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9349/}{\#9349}: user’s guide seriously denuded… \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9369/}{\#9369}: 2.1 - new problem with log ax.transData \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9371/}{\#9371}: Toolbar issue: Python3, wx4, windows only \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9366/}{\#9366}: MPL 2.1 cannot construct figure with figsize \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9351/}{\#9351}: mpl 2.1 barcharts edgecolor and linewidth only apply to first bar \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9360/}{\#9360}: When use a large data to draw a graph, It shows abnormal.. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9357/}{\#9357}: ENH: Pickle backend \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9345/}{\#9345}: matplotlib 2.1.0, backend macosx: need \_BackendMac, got FigureManagerMac \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9344/}{\#9344}: ImportError: No module named functools\_lru\_cache \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9241/}{\#9241}: Errorbar plot with first value masked raises TypeError \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9322/}{\#9322}: Usage Guide has description “circled in green” for Axis from v 1.5 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/4728/}{\#4728}: Sort out how to auto-nbconvert notebooks as part of doc build \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/3707/}{\#3707}: re-write release guide \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9315/}{\#9315}: Can’t exit the Drawing board process on Ubuntu \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/7422/}{\#7422}: Document that python setup.py develop add the symlink to easy-install.pth \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/5256/}{\#5256}: 1.5.0\textasciitilde{}rc2: unittest failures/errors on (debian) arm64 \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9301/}{\#9301}: Panning with mouse using Axes3d in plt.show() is laggy \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9267/}{\#9267}: NaN positional argument to \sphinxcode{\sphinxupquote{ax.text}} fails silently notebook backend. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9294/}{\#9294}: Segmentation fault (core dumped) when import matplotlib.pyplot \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9235/}{\#9235}: Incorrect fill\_betweenx interpolation \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/8706/}{\#8706}: Bug with 3D graphing \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9276/}{\#9276}: Discrepancy between svg and png plots \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9273/}{\#9273}: plot() mfc doesn’t accept RGBA color \end{itemize} \chapter{License} \label{\detokenize{users/license:license}}\label{\detokenize{users/license:id1}}\label{\detokenize{users/license::doc}} Matplotlib only uses BSD compatible code, and its license is based on the \sphinxhref{https://python.org/psf/license}{PSF} license. See the Open Source Initiative \sphinxhref{https://www.opensource.org/licenses}{licenses page} for details on individual licenses. Non-BSD compatible licenses (e.g., LGPL) are acceptable in matplotlib toolkits. For a discussion of the motivations behind the licencing choice, see {\hyperref[\detokenize{devel/license:license-discussion}]{\sphinxcrossref{\DUrole{std,std-ref}{Licenses}}}}. \section{Copyright Policy} \label{\detokenize{users/license:copyright-policy}} John Hunter began matplotlib around 2003. Since shortly before his passing in 2012, Michael Droettboom has been the lead maintainer of matplotlib, but, as has always been the case, matplotlib is the work of many. Prior to July of 2013, and the 1.3.0 release, the copyright of the source code was held by John Hunter. As of July 2013, and the 1.3.0 release, matplotlib has moved to a shared copyright model. matplotlib uses a shared copyright model. Each contributor maintains copyright over their contributions to matplotlib. But, it is important to note that these contributions are typically only changes to the repositories. Thus, the matplotlib source code, in its entirety, is not the copyright of any single person or institution. Instead, it is the collective copyright of the entire matplotlib Development Team. If individual contributors want to maintain a record of what changes/contributions they have specific copyright on, they should indicate their copyright in the commit message of the change, when they commit the change to one of the matplotlib repositories. The Matplotlib Development Team is the set of all contributors to the matplotlib project. A full list can be obtained from the git version control logs. \section{License agreement for matplotlib 2.2.2} \label{\detokenize{users/license:license-agreement-for-matplotlib-version}} 1. This LICENSE AGREEMENT is between the Matplotlib Development Team (“MDT”), and the Individual or Organization (“Licensee”) accessing and otherwise using matplotlib software in source or binary form and its associated documentation. 2. Subject to the terms and conditions of this License Agreement, MDT hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use matplotlib 2.2.2 alone or in any derivative version, provided, however, that MDT’s License Agreement and MDT’s notice of copyright, i.e., “Copyright (c) 2012-2013 Matplotlib Development Team; All Rights Reserved” are retained in matplotlib 2.2.2 alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates matplotlib 2.2.2 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to matplotlib 2.2.2. 4. MDT is making matplotlib 2.2.2 available to Licensee on an “AS IS” basis. MDT MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, MDT MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 2.2.2 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. MDT SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB 2.2.2 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING MATPLOTLIB 2.2.2, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. 7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between MDT and Licensee. This License Agreement does not grant permission to use MDT trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. 8. By copying, installing or otherwise using matplotlib 2.2.2, Licensee agrees to be bound by the terms and conditions of this License Agreement. \section{License agreement for matplotlib versions prior to 1.3.0} \label{\detokenize{users/license:license-agreement-for-matplotlib-versions-prior-to-1-3-0}} 1. This LICENSE AGREEMENT is between John D. Hunter (“JDH”), and the Individual or Organization (“Licensee”) accessing and otherwise using matplotlib software in source or binary form and its associated documentation. 2. Subject to the terms and conditions of this License Agreement, JDH hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use matplotlib 2.2.2 alone or in any derivative version, provided, however, that JDH’s License Agreement and JDH’s notice of copyright, i.e., “Copyright (c) 2002-2009 John D. Hunter; All Rights Reserved” are retained in matplotlib 2.2.2 alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates matplotlib 2.2.2 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to matplotlib 2.2.2. 4. JDH is making matplotlib 2.2.2 available to Licensee on an “AS IS” basis. JDH MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, JDH MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 2.2.2 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. JDH SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB 2.2.2 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING MATPLOTLIB 2.2.2, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. 7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between JDH and Licensee. This License Agreement does not grant permission to use JDH trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. 8. By copying, installing or otherwise using matplotlib 2.2.2, Licensee agrees to be bound by the terms and conditions of this License Agreement. \chapter{Credits} \label{\detokenize{users/credits:credits}}\label{\detokenize{users/credits:id1}}\label{\detokenize{users/credits::doc}} Matplotlib was written by John D. Hunter, with contributions from an ever-increasing number of users and developers. The current co-lead developers are Michael Droettboom and Thomas A. Caswell; they are assisted by many \sphinxhref{https://www.openhub.net/p/matplotlib/contributors}{active} developers. The following is a list of contributors extracted from the git revision control history of the project: 4over7, Aaron Boushley, Acanthostega, Adam Ginsburg, Adam Heck, Adam Ortiz, Adrian Price-Whelan, Adrien F. Vincent, Ahmet Bakan, Alan Du, Alejandro Dubrovsky, Alex C. Szatmary, Alex Loew, Alexander Taylor, Alexei Colin, Ali Mehdi, Alistair Muldal, Allan Haldane, Amit Aronovitch, Amy, AmyTeegarden, Andrea Bedini, Andreas Hilboll, Andreas Wallner, Andrew Dawson, Andrew Merrill, Andrew Straw, Andy Zhu, Anton Akhmerov, Antony Lee, Arie, Ariel Hernán Curiale, Arnaud Gardelein, Arpad Horvath, Aseem Bansal, Behram Mistree, Ben Cohen, Ben Gamari, Ben Keller, Ben Root, Benjamin Reedlunn, Binglin Chang, Bradley M. Froehle, Brandon Liu, Brett Cannon, Brett Graham, Brian Mattern, Brian McLaughlin, Bruno Beltran, CJ Carey, Cameron Bates, Cameron Davidson-Pilon, Carissa Brittain, Carl Michal, Carwyn Pelley, Casey Webster, Casper van der Wel, Charles Moad, Chris Beaumont, Chris G, Christian Brueffer, Christian Stade-Schuldt, Christoph Dann, Christoph Gohlke, Christoph Hoffmann, Cimarron Mittelsteadt, Corey Farwell, Craig M, Craig Tenney, Damon McDougall, Dan Hickstein, Daniel Hyams, Daniel O’Connor, Dara Adib, Darren Dale, David Anderson, David Haberthür, David Huard, David Kaplan, David Kua, David Trémouilles, Dean Malmgren, Dmitry Lupyan, DonaldSeo, Dora Fraeman, Duncan Macleod, Edin Salkovic, Elena Glassman, Elias Pipping, Elliott Sales de Andrade, Emil Mikulic, Eric Dill, Eric Firing, Eric Ma, Eric O. LEBIGOT (EOL), Erik Bray, Eugen Beck, Eugene Yurtsev, Evan Davey, Ezra Peisach, Fabien Maussion, Fabio Zanini, Federico Ariza, Felipe, Fernando Perez, Filipe Fernandes, Florian Rhiem, Francesco Montesano, Francis Colas, François Magimel, Gaute Hope, Gellule Xg, Geoffroy Billotey, Gerald Storer, Giovanni, Graham Poulter, Gregory Ashton, Gregory R. Lee, Grégory Lielens, Guillaume Gay, Gustavo Braganca, Hans Dembinski, Hans Meine, Hans Moritz Günther, Hassan Kibirige, Holger Peters, Hubert Holin, Ian Thomas, Ignas Anikevicius (gns\_ank), Ilia Kurenkov, Ioannis Filippidis, Ismo Toijala, J. Goutin, Jack Kelly, Jae-Joon Lee, Jaime Fernandez, Jake Vanderplas, James A. Bednar, James Pallister, James R. Evans, JamesMakela, Jan Schulz, Jan-Philip Gehrcke, Jan-willem De Bleser, Jarrod Millman, Jascha Ulrich, Jason Grout, Jason Liw Yan Chong, Jason Miller, JayP16, Jeff Lutgen, Jeff Whitaker, Jeffrey Bingham, Jens Hedegaard Nielsen, Jeremy Fix, Jeremy O’Donoghue, Jeremy Thurgood, Jessica B. Hamrick, Jim Radford, Jochen Voss, Jody Klymak, Joe Kington, Joel B. Mohler, John Hunter, Jonathan Waltman, Jorrit Wronski, Josef Heinen, Joseph Jon Booker, José Ricardo, Jouni K. Seppänen, Julian Mehne, Julian Taylor, JulianCienfuegos, Julien Lhermitte, Julien Schueller, Julien Woillez, Julien-Charles Lévesque, Kanwar245, Katy Huff, Ken McIvor, Kevin Chan, Kevin Davies, Kevin Keating, Kimmo Palin, Konrad Förstner, Konstantin Tretyakov, Kristen M. Thyng, Lance Hepler, Larry Bradley, Leeonadoh, Lennart Fricke, Leo Singer, Levi Kilcher, Lion Krischer, Lodato Luciano, Lori J, Loïc Estève, Loïc Séguin-C, Magnus Nord, Majid alDosari, Maksym P, Manuel GOACOLOU, Manuel Metz, Marc Abramowitz, Marcos Duarte, Marek Rudnicki, Marianne Corvellec, Marin Gilles, Markus Roth, Markus Rothe, Martin Dengler, Martin Fitzpatrick, Martin Spacek, Martin Teichmann, Martin Thoma, Martin Ueding, Masud Rahman, Mathieu Duponchelle, Matt Giuca, Matt Klein, Matt Li, Matt Newville, Matt Shen, Matt Terry, Matthew Brett, Matthew Emmett, Matthias Bussonnier, Matthieu Caneill, Matěj Týč, Maximilian Albert, Maximilian Trescher, Mellissa Cross, Michael, Michael Droettboom, Michael Sarahan, Michael Welter, Michiel de Hoon, Michka Popoff, Mike Kaufman, Mikhail Korobov, MinRK, Minty Zhang, MirandaXM, Miriam Sierig, Muhammad Mehdi, Neil, Neil Crighton, Nelle Varoquaux, Niall Robinson, Nic Eggert, Nicholas Devenish, Nick Semenkovich, Nicolas P. Rougier, Nicolas Pinto, Nikita Kniazev, Niklas Koep, Nikolay Vyahhi, Norbert Nemec, OceanWolf, Oleg Selivanov, Olga Botvinnik, Oliver Willekens, Parfenov Sergey, Pascal Bugnion, Patrick Chen, Patrick Marsh, Paul, Paul Barret, Paul G, Paul Hobson, Paul Ivanov, Pauli Virtanen, Per Parker, Perry Greenfield, Pete Bachant, Peter Iannucci, Peter St. John, Peter Würtz, Phil Elson, Pierre Haessig, Pim Schellart, Piti Ongmongkolkul, Puneeth Chaganti, Ramiro Gómez, Randy Olson, Reinier Heeres, Remi Rampin, Richard Hattersley, Richard Trieu, Ricky, Robert Johansson, Robin Dunn, Rohan Walker, Roland Wirth, Russell Owen, RutgerK, Ryan Blomberg, Ryan D’Souza, Ryan Dale, Ryan May, Ryan Nelson, RyanPan, Salil Vanvari, Sameer D’Costa, Sandro Tosi, Scott Lasley, Scott Lawrence, Scott Stevenson, Sebastian Pinnau, Sebastian Raschka, Sergey Kholodilov, Sergey Koposov, Silviu Tantos, Simon Cross, Simon Gibbons, Skelpdar, Skipper Seabold, Slav Basharov, Spencer McIntyre, Stanley, Simon, Stefan Lehmann, Stefan van der Walt, Stefano Rivera, Stephen Horst, Sterling Smith, Steve Chaplin, Steven Silvester, Stuart Mumford, Takafumi Arakaki, Takeshi Kanmae, Tamas Gal, Thomas A Caswell, Thomas Hisch, Thomas Kluyver, Thomas Lake, Thomas Robitaille, Thomas Spura, Till Stensitzki, Timo Vanwynsberghe, Tobias Hoppe, Tobias Megies, Todd Jennings, Todd Miller, Tomas Kazmar, Tony S Yu, Tor Colvin, Travis Oliphant, Trevor Bekolay, Ulrich Dobramysl, Umair Idris, Vadim Markovtsev, Valentin Haenel, Victor Zabalza, Viktor Kerkez, Vlad Seghete, Víctor Terrón, Víctor Zabalza, Wen Li, Wendell Smith, Werner F Bruhin, Wes Campaigne, Wieland Hoffmann, William Manley, Wouter Overmeire, Xiaowen Tang, Yann Tambouret, Yaron de Leeuw, Yu Feng, Yunfei Yang, Yuri D’Elia, Yuval Langer, Zac Hatfield-Dodds, Zach Pincus, Zair Mubashar, alex, anykraus, arokem, aseagram, aszilagyi, bblay, bev-a-tron, blackw1ng, blah blah, burrbull, butterw, cammil, captainwhippet, chadawagner, chebee7i, danielballan, davidovitch, daydreamt, domspad, donald, drevicko, e-q, elpres, endolith, fardal, ffteja, fgb, fibersnet, frenchwr, fvgoto, gitj, gluap, goir, hugadams, insertroar, itziakos, jbbrokaw, juan.gonzalez, kcrisman, kelsiegr, khyox, kikocorreoso, kramer65, kshramt, lichri12, limtaesu, marky, masamson, mbyt, mcelrath, mdipierro, mrkrd, nickystringer, nwin, pkienzle, profholzer, pupssman, rahiel, rhoef, rsnape, s9w, sdementen, sfroid, sohero, spiessbuerger, stahlous, switham, syngron, torfbolt, u55, ugurthemaster, vbr, xbtsw, and xuanyuansen. Some earlier contributors not included above are (with apologies to any we have missed): Charles Twardy, Gary Ruben, John Gill, David Moore, Paul Barrett, Jared Wahlstrand, Jim Benson, Paul Mcguire, Andrew Dalke, Nadia Dencheva, Baptiste Carvello, Sigve Tjoraand, Ted Drain, James Amundson, Daishi Harada, Nicolas Young, Paul Kienzle, John Porter, and Jonathon Taylor. We also thank all who have reported bugs, commented on proposed changes, or otherwise contributed to Matplotlib’s development and usefulness. \part{The Matplotlib FAQ} \label{\detokenize{faq/index:the-matplotlib-faq}}\label{\detokenize{faq/index:faq-index}}\label{\detokenize{faq/index::doc}} \chapter{Installation} \label{\detokenize{faq/installing_faq:installation}}\label{\detokenize{faq/installing_faq:installing-faq}}\label{\detokenize{faq/installing_faq::doc}} \begin{sphinxShadowBox} \sphinxstyletopictitle{Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/installing_faq:id2}}{\hyperref[\detokenize{faq/installing_faq:installation}]{\sphinxcrossref{Installation}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/installing_faq:id3}}{\hyperref[\detokenize{faq/installing_faq:report-a-compilation-problem}]{\sphinxcrossref{Report a compilation problem}}} \item {} \phantomsection\label{\detokenize{faq/installing_faq:id4}}{\hyperref[\detokenize{faq/installing_faq:matplotlib-compiled-fine-but-nothing-shows-up-when-i-use-it}]{\sphinxcrossref{matplotlib compiled fine, but nothing shows up when I use it}}} \item {} \phantomsection\label{\detokenize{faq/installing_faq:id5}}{\hyperref[\detokenize{faq/installing_faq:how-to-completely-remove-matplotlib}]{\sphinxcrossref{How to completely remove Matplotlib}}} \item {} \phantomsection\label{\detokenize{faq/installing_faq:id6}}{\hyperref[\detokenize{faq/installing_faq:linux-notes}]{\sphinxcrossref{Linux Notes}}} \item {} \phantomsection\label{\detokenize{faq/installing_faq:id7}}{\hyperref[\detokenize{faq/installing_faq:osx-notes}]{\sphinxcrossref{OSX Notes}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/installing_faq:id8}}{\hyperref[\detokenize{faq/installing_faq:which-python-for-osx}]{\sphinxcrossref{Which python for OSX?}}} \item {} \phantomsection\label{\detokenize{faq/installing_faq:id9}}{\hyperref[\detokenize{faq/installing_faq:installing-osx-binary-wheels}]{\sphinxcrossref{Installing OSX binary wheels}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/installing_faq:id10}}{\hyperref[\detokenize{faq/installing_faq:python-org-python}]{\sphinxcrossref{Python.org Python}}} \item {} \phantomsection\label{\detokenize{faq/installing_faq:id11}}{\hyperref[\detokenize{faq/installing_faq:macports-python}]{\sphinxcrossref{Macports Python}}} \item {} \phantomsection\label{\detokenize{faq/installing_faq:id12}}{\hyperref[\detokenize{faq/installing_faq:homebrew-python}]{\sphinxcrossref{Homebrew Python}}} \item {} \phantomsection\label{\detokenize{faq/installing_faq:id13}}{\hyperref[\detokenize{faq/installing_faq:pip-problems}]{\sphinxcrossref{pip problems}}} \end{itemize} \item {} \phantomsection\label{\detokenize{faq/installing_faq:id14}}{\hyperref[\detokenize{faq/installing_faq:checking-your-installation}]{\sphinxcrossref{Checking your installation}}} \end{itemize} \item {} \phantomsection\label{\detokenize{faq/installing_faq:id15}}{\hyperref[\detokenize{faq/installing_faq:windows-notes}]{\sphinxcrossref{Windows Notes}}} \item {} \phantomsection\label{\detokenize{faq/installing_faq:id16}}{\hyperref[\detokenize{faq/installing_faq:install-from-source}]{\sphinxcrossref{Install from source}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \section{Report a compilation problem} \label{\detokenize{faq/installing_faq:report-a-compilation-problem}} See {\hyperref[\detokenize{faq/troubleshooting_faq:reporting-problems}]{\sphinxcrossref{\DUrole{std,std-ref}{Getting help}}}}. \section{matplotlib compiled fine, but nothing shows up when I use it} \label{\detokenize{faq/installing_faq:matplotlib-compiled-fine-but-nothing-shows-up-when-i-use-it}} The first thing to try is a {\hyperref[\detokenize{faq/installing_faq:clean-install}]{\sphinxcrossref{\DUrole{std,std-ref}{clean install}}}} and see if that helps. If not, the best way to test your install is by running a script, rather than working interactively from a python shell or an integrated development environment such as \sphinxstyleliteralstrong{\sphinxupquote{IDLE}} which add additional complexities. Open up a UNIX shell or a DOS command prompt and run, for example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{c} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{from pylab import *; plot(); show()}\PYG{l+s+s2}{\PYGZdq{}} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{verbose}\PYG{o}{\PYGZhy{}}\PYG{n}{helpful} \end{sphinxVerbatim} This will give you additional information about which backends matplotlib is loading, version information, and more. At this point you might want to make sure you understand matplotlib’s {\hyperref[\detokenize{tutorials/introductory/customizing:sphx-glr-tutorials-introductory-customizing-py}]{\sphinxcrossref{\DUrole{std,std-ref}{configuration}}}} process, governed by the \sphinxcode{\sphinxupquote{matplotlibrc}} configuration file which contains instructions within and the concept of the matplotlib backend. If you are still having trouble, see {\hyperref[\detokenize{faq/troubleshooting_faq:reporting-problems}]{\sphinxcrossref{\DUrole{std,std-ref}{Getting help}}}}. \section{How to completely remove Matplotlib} \label{\detokenize{faq/installing_faq:how-to-completely-remove-matplotlib}}\label{\detokenize{faq/installing_faq:clean-install}} Occasionally, problems with Matplotlib can be solved with a clean installation of the package. In order to fully remove an installed Matplotlib: \begin{enumerate} \item {} Delete the caches from your {\hyperref[\detokenize{faq/troubleshooting_faq:locating-matplotlib-config-dir}]{\sphinxcrossref{\DUrole{std,std-ref}{Matplotlib configuration directory}}}}. \item {} Delete any Matplotlib directories or eggs from your {\hyperref[\detokenize{faq/troubleshooting_faq:locating-matplotlib-install}]{\sphinxcrossref{\DUrole{std,std-ref}{installation directory}}}}. \end{enumerate} \section{Linux Notes} \label{\detokenize{faq/installing_faq:linux-notes}} To install Matplotlib at the system-level, we recommend that you use your distribution’s package manager. This will guarantee that Matplotlib’s dependencies will be installed as well. If, for some reason, you cannot use the package manager, you may use the wheels available on PyPI: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{n}{matplotlib} \end{sphinxVerbatim} or {\hyperref[\detokenize{faq/installing_faq:install-from-git}]{\sphinxcrossref{\DUrole{std,std-ref}{build Matplotlib from source}}}}. \section{OSX Notes} \label{\detokenize{faq/installing_faq:osx-notes}} \subsection{Which python for OSX?} \label{\detokenize{faq/installing_faq:which-python-for-osx}}\label{\detokenize{faq/installing_faq:id1}} Apple ships OSX with its own Python, in \sphinxcode{\sphinxupquote{/usr/bin/python}}, and its own copy of Matplotlib. Unfortunately, the way Apple currently installs its own copies of NumPy, Scipy and Matplotlib means that these packages are difficult to upgrade (see \sphinxhref{https://github.com/MacPython/wiki/wiki/Which-Python\#system-python-and-extra-python-packages}{system python packages}). For that reason we strongly suggest that you install a fresh version of Python and use that as the basis for installing libraries such as NumPy and Matplotlib. One convenient way to install matplotlib with other useful Python software is to use one of the excellent Python scientific software collections that are now available: \begin{itemize} \item {} \sphinxhref{https://www.continuum.io/downloads}{Anaconda} from \sphinxhref{https://www.continuum.io}{Continuum Analytics} \item {} \sphinxhref{https://www.enthought.com/products/canopy/}{Canopy} from \sphinxhref{https://www.enthought.com}{Enthought} \end{itemize} These collections include Python itself and a wide range of libraries; if you need a library that is not available from the collection, you can install it yourself using standard methods such as \sphinxstyleemphasis{pip}. Continuum and Enthought offer their own installation support for these collections; see the Ananconda and Canopy web pages for more information. Other options for a fresh Python install are the standard installer from \sphinxhref{https://www.python.org/downloads/mac-osx/}{python.org}, or installing Python using a general OSX package management system such as \sphinxhref{http://brew.sh}{homebrew} or \sphinxhref{https://www.macports.org}{macports}. Power users on OSX will likely want one of homebrew or macports on their system to install open source software packages, but it is perfectly possible to use these systems with another source for your Python binary, such as Anaconda, Canopy or Python.org Python. \subsection{Installing OSX binary wheels} \label{\detokenize{faq/installing_faq:installing-osx-binary-wheels}}\label{\detokenize{faq/installing_faq:install-osx-binaries}} If you are using recent Python from \sphinxurl{https://www.python.org}, Macports or Homebrew, then you can use the standard pip installer to install Matplotlib binaries in the form of wheels. \subsubsection{Python.org Python} \label{\detokenize{faq/installing_faq:python-org-python}} Install pip following the \sphinxhref{https://pip.readthedocs.io/en/latest/installing/}{standard pip install instructions}. For the impatient, open a new Terminal.app window and: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{curl} \PYG{o}{\PYGZhy{}}\PYG{n}{O} \PYG{n}{https}\PYG{p}{:}\PYG{o}{/}\PYG{o}{/}\PYG{n}{bootstrap}\PYG{o}{.}\PYG{n}{pypa}\PYG{o}{.}\PYG{n}{io}\PYG{o}{/}\PYG{n}{get}\PYG{o}{\PYGZhy{}}\PYG{n}{pip}\PYG{o}{.}\PYG{n}{py} \end{sphinxVerbatim} Then (Python 2): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{n}{get}\PYG{o}{\PYGZhy{}}\PYG{n}{pip}\PYG{o}{.}\PYG{n}{py} \end{sphinxVerbatim} or (Python 3): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python3} \PYG{n}{get}\PYG{o}{\PYGZhy{}}\PYG{n}{pip}\PYG{o}{.}\PYG{n}{py} \end{sphinxVerbatim} You can now install matplotlib and all its dependencies with \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{n}{matplotlib} \end{sphinxVerbatim} or \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python3} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{n}{matplotlib} \end{sphinxVerbatim} \subsubsection{Macports Python} \label{\detokenize{faq/installing_faq:macports-python}} For Python 2: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{sudo} \PYG{n}{port} \PYG{n}{install} \PYG{n}{py27}\PYG{o}{\PYGZhy{}}\PYG{n}{pip} \PYG{n}{sudo} \PYG{n}{python2} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{n}{matplotlib} \end{sphinxVerbatim} For Python 3: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{sudo} \PYG{n}{port} \PYG{n}{install} \PYG{n}{py36}\PYG{o}{\PYGZhy{}}\PYG{n}{pip} \PYG{n}{sudo} \PYG{n}{python3}\PYG{o}{.}\PYG{l+m+mi}{6} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{n}{matplotlib} \end{sphinxVerbatim} \subsubsection{Homebrew Python} \label{\detokenize{faq/installing_faq:homebrew-python}} For Python 2: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python2} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{n}{matplotlib} \end{sphinxVerbatim} For Python 3: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python3} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{n}{matplotlib} \end{sphinxVerbatim} You might also want to install IPython or the Jupyter notebook (\sphinxcode{\sphinxupquote{pythonX -mpip install ipython}}, \sphinxcode{\sphinxupquote{pythonX -mpip install notebook}}, where \sphinxcode{\sphinxupquote{pythonX}} is set as above). \subsubsection{pip problems} \label{\detokenize{faq/installing_faq:pip-problems}} If you get errors with pip trying to run a compiler like \sphinxcode{\sphinxupquote{gcc}} or \sphinxcode{\sphinxupquote{clang}}, then the first thing to try is to \sphinxhref{https://guide.macports.org/chunked/installing.html\#installing.xcode}{install xcode} and retry the install. If that does not work, then check {\hyperref[\detokenize{faq/troubleshooting_faq:reporting-problems}]{\sphinxcrossref{\DUrole{std,std-ref}{Getting help}}}}. \subsection{Checking your installation} \label{\detokenize{faq/installing_faq:checking-your-installation}} The new version of Matplotlib should now be on your Python “path”. Check this with one of these commands at the Terminal.app command line: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python2} \PYG{o}{\PYGZhy{}}\PYG{n}{c} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{import matplotlib; print matplotlib.\PYGZus{}\PYGZus{}version\PYGZus{}\PYGZus{}, matplotlib.\PYGZus{}\PYGZus{}file\PYGZus{}\PYGZus{}}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} (Python 2) or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python3} \PYG{o}{\PYGZhy{}}\PYG{n}{c} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{import matplotlib; print(matplotlib.\PYGZus{}\PYGZus{}version\PYGZus{}\PYGZus{}, matplotlib.\PYGZus{}\PYGZus{}file\PYGZus{}\PYGZus{})}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} (Python 3). You should see something like this: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+m+mf}{2.1}\PYG{o}{.}\PYG{l+m+mi}{0} \PYG{o}{/}\PYG{n}{Library}\PYG{o}{/}\PYG{n}{Frameworks}\PYG{o}{/}\PYG{n}{Python}\PYG{o}{.}\PYG{n}{framework}\PYG{o}{/}\PYG{n}{Versions}\PYG{o}{/}\PYG{l+m+mf}{3.6}\PYG{o}{/}\PYG{n}{lib}\PYG{o}{/}\PYG{n}{python3}\PYG{o}{.}\PYG{l+m+mi}{6}\PYG{o}{/}\PYG{n}{site}\PYG{o}{\PYGZhy{}}\PYG{n}{packages}\PYG{o}{/}\PYG{n}{matplotlib}\PYG{o}{/}\PYG{n+nf+fm}{\PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{}}\PYG{o}{.}\PYG{n}{pyc} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{2.1.0}} is the Matplotlib version you just installed, and the path following depends on whether you are using Python.org Python, Homebrew or Macports. If you see another version, or you get an error like this: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{Traceback} \PYG{p}{(}\PYG{n}{most} \PYG{n}{recent} \PYG{n}{call} \PYG{n}{last}\PYG{p}{)}\PYG{p}{:} \PYG{n}{File} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZlt{}string\PYGZgt{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{line} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{o+ow}{in} \PYG{o}{\PYGZlt{}}\PYG{n}{module}\PYG{o}{\PYGZgt{}} \PYG{n+ne}{ImportError}\PYG{p}{:} \PYG{n}{No} \PYG{n}{module} \PYG{n}{named} \PYG{n}{matplotlib} \end{sphinxVerbatim} then check that the Python binary is the one you expected by doing one of these commands in Terminal.app: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{which} \PYG{n}{python2} \end{sphinxVerbatim} or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{which} \PYG{n}{python3} \end{sphinxVerbatim} If you get the result \sphinxcode{\sphinxupquote{/usr/bin/python2.7}}, then you are getting the Python installed with OSX, which is probably not what you want. Try closing and restarting Terminal.app before running the check again. If that doesn’t fix the problem, depending on which Python you wanted to use, consider reinstalling Python.org Python, or check your homebrew or macports setup. Remember that the disk image installer only works for Python.org Python, and will not get picked up by other Pythons. If all these fail, please {\hyperref[\detokenize{faq/troubleshooting_faq:reporting-problems}]{\sphinxcrossref{\DUrole{std,std-ref}{let us know}}}}. \section{Windows Notes} \label{\detokenize{faq/installing_faq:windows-notes}} See {\hyperref[\detokenize{users/installing:installing-windows}]{\sphinxcrossref{\DUrole{std,std-ref}{Windows}}}}. \section{Install from source} \label{\detokenize{faq/installing_faq:install-from-source}}\label{\detokenize{faq/installing_faq:install-from-git}} Clone the main source using one of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{git} \PYG{n}{clone} \PYG{n}{git}\PYG{n+nd}{@github}\PYG{o}{.}\PYG{n}{com}\PYG{p}{:}\PYG{n}{matplotlib}\PYG{o}{/}\PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{git} \end{sphinxVerbatim} or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{git} \PYG{n}{clone} \PYG{n}{git}\PYG{p}{:}\PYG{o}{/}\PYG{o}{/}\PYG{n}{github}\PYG{o}{.}\PYG{n}{com}\PYG{o}{/}\PYG{n}{matplotlib}\PYG{o}{/}\PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{git} \end{sphinxVerbatim} and build and install as usual with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{cd} \PYG{n}{matplotlib} \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{o}{.} \end{sphinxVerbatim} \begin{sphinxadmonition}{note}{Note:} If you are on Debian/Ubuntu, you can get all the dependencies required to build Matplotlib with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{sudo} \PYG{n}{apt}\PYG{o}{\PYGZhy{}}\PYG{n}{get} \PYG{n}{build}\PYG{o}{\PYGZhy{}}\PYG{n}{dep} \PYG{n}{python}\PYG{o}{\PYGZhy{}}\PYG{n}{matplotlib} \end{sphinxVerbatim} If you are on Fedora/RedHat, you can get all the dependencies required to build matplotlib by first installing \sphinxcode{\sphinxupquote{yum-builddep}} and then running: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{su} \PYG{o}{\PYGZhy{}}\PYG{n}{c} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{yum\PYGZhy{}builddep python\PYGZhy{}matplotlib}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} This does not build Matplotlib, but it does get all of the build dependencies, which will make building from source easier. \end{sphinxadmonition} If you want to be able to follow the development branch as it changes just replace the last step with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{o}{\PYGZhy{}}\PYG{n}{e} \PYG{o}{.} \end{sphinxVerbatim} This creates links and installs the command line script in the appropriate places. \begin{sphinxadmonition}{note}{Note:} OSX users please see the {\hyperref[\detokenize{users/installing:build-osx}]{\sphinxcrossref{\DUrole{std,std-ref}{Building on macOS}}}} guide. Windows users please see the {\hyperref[\detokenize{users/installing:build-windows}]{\sphinxcrossref{\DUrole{std,std-ref}{Building on Windows}}}} guide. \end{sphinxadmonition} Then, if you want to update your matplotlib at any time, just do: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{git} \PYG{n}{pull} \end{sphinxVerbatim} When you run \sphinxcode{\sphinxupquote{git pull}}, if the output shows that only Python files have been updated, you are all set. If C files have changed, you need to run \sphinxcode{\sphinxupquote{pip install -e .}} again to compile them. There is more information on {\hyperref[\detokenize{devel/gitwash/index:using-git}]{\sphinxcrossref{\DUrole{std,std-ref}{using git}}}} in the developer docs. \chapter{How-To} \label{\detokenize{faq/howto_faq:how-to}}\label{\detokenize{faq/howto_faq:howto-faq}}\label{\detokenize{faq/howto_faq::doc}} \begin{sphinxShadowBox} \sphinxstyletopictitle{Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id4}}{\hyperref[\detokenize{faq/howto_faq:how-to}]{\sphinxcrossref{How-To}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id5}}{\hyperref[\detokenize{faq/howto_faq:plotting-howto}]{\sphinxcrossref{Plotting: howto}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id6}}{\hyperref[\detokenize{faq/howto_faq:plot-numpy-datetime64-values}]{\sphinxcrossref{Plot \sphinxcode{\sphinxupquote{numpy.datetime64}} values}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id7}}{\hyperref[\detokenize{faq/howto_faq:find-all-objects-in-a-figure-of-a-certain-type}]{\sphinxcrossref{Find all objects in a figure of a certain type}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id8}}{\hyperref[\detokenize{faq/howto_faq:how-to-prevent-ticklabels-from-having-an-offset}]{\sphinxcrossref{How to prevent ticklabels from having an offset}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id9}}{\hyperref[\detokenize{faq/howto_faq:save-transparent-figures}]{\sphinxcrossref{Save transparent figures}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id10}}{\hyperref[\detokenize{faq/howto_faq:save-multiple-plots-to-one-pdf-file}]{\sphinxcrossref{Save multiple plots to one pdf file}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id11}}{\hyperref[\detokenize{faq/howto_faq:move-the-edge-of-an-axes-to-make-room-for-tick-labels}]{\sphinxcrossref{Move the edge of an axes to make room for tick labels}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id12}}{\hyperref[\detokenize{faq/howto_faq:automatically-make-room-for-tick-labels}]{\sphinxcrossref{Automatically make room for tick labels}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id13}}{\hyperref[\detokenize{faq/howto_faq:configure-the-tick-widths}]{\sphinxcrossref{Configure the tick widths}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id14}}{\hyperref[\detokenize{faq/howto_faq:align-my-ylabels-across-multiple-subplots}]{\sphinxcrossref{Align my ylabels across multiple subplots}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id15}}{\hyperref[\detokenize{faq/howto_faq:skip-dates-where-there-is-no-data}]{\sphinxcrossref{Skip dates where there is no data}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id16}}{\hyperref[\detokenize{faq/howto_faq:control-the-depth-of-plot-elements}]{\sphinxcrossref{Control the depth of plot elements}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id17}}{\hyperref[\detokenize{faq/howto_faq:make-the-aspect-ratio-for-plots-equal}]{\sphinxcrossref{Make the aspect ratio for plots equal}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id18}}{\hyperref[\detokenize{faq/howto_faq:multiple-y-axis-scales}]{\sphinxcrossref{Multiple y-axis scales}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id19}}{\hyperref[\detokenize{faq/howto_faq:generate-images-without-having-a-window-appear}]{\sphinxcrossref{Generate images without having a window appear}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id20}}{\hyperref[\detokenize{faq/howto_faq:use-show}]{\sphinxcrossref{Use {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.show:matplotlib.pyplot.show}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{show()}}}}}}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id21}}{\hyperref[\detokenize{faq/howto_faq:interpreting-box-plots-and-violin-plots}]{\sphinxcrossref{Interpreting box plots and violin plots}}} \end{itemize} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id22}}{\hyperref[\detokenize{faq/howto_faq:contributing-howto}]{\sphinxcrossref{Contributing: howto}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id23}}{\hyperref[\detokenize{faq/howto_faq:request-a-new-feature}]{\sphinxcrossref{Request a new feature}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id24}}{\hyperref[\detokenize{faq/howto_faq:reporting-a-bug-or-submitting-a-patch}]{\sphinxcrossref{Reporting a bug or submitting a patch}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id25}}{\hyperref[\detokenize{faq/howto_faq:contribute-to-matplotlib-documentation}]{\sphinxcrossref{Contribute to Matplotlib documentation}}} \end{itemize} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id26}}{\hyperref[\detokenize{faq/howto_faq:matplotlib-in-a-web-application-server}]{\sphinxcrossref{Matplotlib in a web application server}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id27}}{\hyperref[\detokenize{faq/howto_faq:matplotlib-with-apache}]{\sphinxcrossref{Matplotlib with apache}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id28}}{\hyperref[\detokenize{faq/howto_faq:matplotlib-with-django}]{\sphinxcrossref{Matplotlib with django}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id29}}{\hyperref[\detokenize{faq/howto_faq:matplotlib-with-zope}]{\sphinxcrossref{Matplotlib with zope}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id30}}{\hyperref[\detokenize{faq/howto_faq:clickable-images-for-html}]{\sphinxcrossref{Clickable images for HTML}}} \end{itemize} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id31}}{\hyperref[\detokenize{faq/howto_faq:search-examples}]{\sphinxcrossref{Search examples}}} \item {} \phantomsection\label{\detokenize{faq/howto_faq:id32}}{\hyperref[\detokenize{faq/howto_faq:cite-matplotlib}]{\sphinxcrossref{Cite Matplotlib}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \section{Plotting: howto} \label{\detokenize{faq/howto_faq:plotting-howto}}\label{\detokenize{faq/howto_faq:howto-plotting}} \subsection{Plot \sphinxstyleliteralintitle{\sphinxupquote{numpy.datetime64}} values} \label{\detokenize{faq/howto_faq:plot-numpy-datetime64-values}}\label{\detokenize{faq/howto_faq:howto-datetime64}} As of Matplotlib 2.2, \sphinxcode{\sphinxupquote{numpy.datetime64}} objects are handled the same way as \sphinxhref{https://docs.python.org/3/library/datetime.html\#datetime.datetime}{\sphinxcode{\sphinxupquote{datetime.datetime}}} objects. If you prefer the pandas converters and locators, you can register their converter with the \sphinxcode{\sphinxupquote{matplolib.units}} module: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{pandas}\PYG{n+nn}{.}\PYG{n+nn}{tseries} \PYG{k}{import} \PYG{n}{converter} \PYG{k}{as} \PYG{n}{pdtc} \PYG{n}{pdtc}\PYG{o}{.}\PYG{n}{register}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} If you only want to use the \sphinxhref{https://pandas.pydata.org/pandas-docs/stable/index.html\#module-pandas}{\sphinxcode{\sphinxupquote{pandas}}} converter for \sphinxcode{\sphinxupquote{datetime64}} values \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{pandas}\PYG{n+nn}{.}\PYG{n+nn}{tseries} \PYG{k}{import} \PYG{n}{converter} \PYG{k}{as} \PYG{n}{pdtc} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{units} \PYG{k}{as} \PYG{n+nn}{munits} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{n}{munits}\PYG{o}{.}\PYG{n}{registry}\PYG{p}{[}\PYG{n}{np}\PYG{o}{.}\PYG{n}{datetime64}\PYG{p}{]} \PYG{o}{=} \PYG{n}{pdtc}\PYG{o}{.}\PYG{n}{DatetimeConverter}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Find all objects in a figure of a certain type} \label{\detokenize{faq/howto_faq:find-all-objects-in-a-figure-of-a-certain-type}}\label{\detokenize{faq/howto_faq:howto-findobj}} Every Matplotlib artist (see {\hyperref[\detokenize{tutorials/intermediate/artists:sphx-glr-tutorials-intermediate-artists-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Artist tutorial}}}}) has a method called {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.findobj:matplotlib.artist.Artist.findobj}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{findobj()}}}}} that can be used to recursively search the artist for any artists it may contain that meet some criteria (e.g., match all {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instances or match some arbitrary filter function). For example, the following snippet finds every object in the figure which has a \sphinxcode{\sphinxupquote{set\_color}} property and makes the object blue: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{myfunc}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)}\PYG{p}{:} \PYG{k}{return} \PYG{n+nb}{hasattr}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{set\PYGZus{}color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k}{for} \PYG{n}{o} \PYG{o+ow}{in} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{findobj}\PYG{p}{(}\PYG{n}{myfunc}\PYG{p}{)}\PYG{p}{:} \PYG{n}{o}\PYG{o}{.}\PYG{n}{set\PYGZus{}color}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{blue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} You can also filter on class instances: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{text} \PYG{k}{as} \PYG{n+nn}{text} \PYG{k}{for} \PYG{n}{o} \PYG{o+ow}{in} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{findobj}\PYG{p}{(}\PYG{n}{text}\PYG{o}{.}\PYG{n}{Text}\PYG{p}{)}\PYG{p}{:} \PYG{n}{o}\PYG{o}{.}\PYG{n}{set\PYGZus{}fontstyle}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{italic}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \subsection{How to prevent ticklabels from having an offset} \label{\detokenize{faq/howto_faq:how-to-prevent-ticklabels-from-having-an-offset}}\label{\detokenize{faq/howto_faq:howto-supress-offset}} The default formatter will use an offset to reduce the length of the ticklabels. To turn this feature off on a per-axis basis: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}xaxis}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{get\PYGZus{}major\PYGZus{}formatter}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{set\PYGZus{}useOffset}\PYG{p}{(}\PYG{k+kc}{False}\PYG{p}{)} \end{sphinxVerbatim} set the rcParam \sphinxcode{\sphinxupquote{axes.formatter.useoffset}}, or use a different formatter. See {\hyperref[\detokenize{api/ticker_api:module-matplotlib.ticker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ticker}}}}} for details. \subsection{Save transparent figures} \label{\detokenize{faq/howto_faq:save-transparent-figures}}\label{\detokenize{faq/howto_faq:howto-transparent}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.savefig:matplotlib.pyplot.savefig}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{savefig()}}}}} command has a keyword argument \sphinxstyleemphasis{transparent} which, if ‘True’, will make the figure and axes backgrounds transparent when saving, but will not affect the displayed image on the screen. If you need finer grained control, e.g., you do not want full transparency or you want to affect the screen displayed version as well, you can set the alpha properties directly. The figure has a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}} instance called \sphinxstyleemphasis{patch} and the axes has a Rectangle instance called \sphinxstyleemphasis{patch}. You can set any property on them directly (\sphinxstyleemphasis{facecolor}, \sphinxstyleemphasis{edgecolor}, \sphinxstyleemphasis{linewidth}, \sphinxstyleemphasis{linestyle}, \sphinxstyleemphasis{alpha}). e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{patch}\PYG{o}{.}\PYG{n}{set\PYGZus{}alpha}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{patch}\PYG{o}{.}\PYG{n}{set\PYGZus{}alpha}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{)} \end{sphinxVerbatim} If you need \sphinxstyleemphasis{all} the figure elements to be transparent, there is currently no global alpha setting, but you can set the alpha channel on individual elements, e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{volts}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Save multiple plots to one pdf file} \label{\detokenize{faq/howto_faq:save-multiple-plots-to-one-pdf-file}}\label{\detokenize{faq/howto_faq:howto-multipage}} Many image file formats can only have one image per file, but some formats support multi-page files. Currently only the pdf backend has support for this. To make a multi-page pdf file, first initialize the file: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{backends}\PYG{n+nn}{.}\PYG{n+nn}{backend\PYGZus{}pdf} \PYG{k}{import} \PYG{n}{PdfPages} \PYG{n}{pp} \PYG{o}{=} \PYG{n}{PdfPages}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{multipage.pdf}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} You can give the {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfPages}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PdfPages}}}}} object to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.savefig:matplotlib.pyplot.savefig}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{savefig()}}}}}, but you have to specify the format: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{savefig}\PYG{p}{(}\PYG{n}{pp}\PYG{p}{,} \PYG{n+nb}{format}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{pdf}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} An easier way is to call {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfPages.savefig}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PdfPages.savefig}}}}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{pp}\PYG{o}{.}\PYG{n}{savefig}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} Finally, the multipage pdf object has to be closed: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{pp}\PYG{o}{.}\PYG{n}{close}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Move the edge of an axes to make room for tick labels} \label{\detokenize{faq/howto_faq:move-the-edge-of-an-axes-to-make-room-for-tick-labels}}\label{\detokenize{faq/howto_faq:howto-subplots-adjust}} For subplots, you can control the default spacing on the left, right, bottom, and top as well as the horizontal and vertical spacing between multiple rows and columns using the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.subplots_adjust}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure.subplots\_adjust()}}}}} method (in pyplot it is {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots_adjust:matplotlib.pyplot.subplots_adjust}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots\_adjust()}}}}}). For example, to move the bottom of the subplots up to make room for some rotated x tick labels: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{subplots\PYGZus{}adjust}\PYG{p}{(}\PYG{n}{bottom}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \end{sphinxVerbatim} You can control the defaults for these parameters in your \sphinxcode{\sphinxupquote{matplotlibrc}} file; see {\hyperref[\detokenize{tutorials/introductory/customizing:sphx-glr-tutorials-introductory-customizing-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Matplotlib with style sheets and rcParams}}}}. For example, to make the above setting permanent, you would set: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{figure}\PYG{o}{.}\PYG{n}{subplot}\PYG{o}{.}\PYG{n}{bottom} \PYG{p}{:} \PYG{l+m+mf}{0.2} \PYG{c+c1}{\PYGZsh{} the bottom of the subplots of the figure} \end{sphinxVerbatim} The other parameters you can configure are, with their defaults \begin{description} \item[{\sphinxstyleemphasis{left} = 0.125}] \leavevmode the left side of the subplots of the figure \item[{\sphinxstyleemphasis{right} = 0.9}] \leavevmode the right side of the subplots of the figure \item[{\sphinxstyleemphasis{bottom} = 0.1}] \leavevmode the bottom of the subplots of the figure \item[{\sphinxstyleemphasis{top} = 0.9}] \leavevmode the top of the subplots of the figure \item[{\sphinxstyleemphasis{wspace} = 0.2}] \leavevmode the amount of width reserved for space between subplots, expressed as a fraction of the average axis width \item[{\sphinxstyleemphasis{hspace} = 0.2}] \leavevmode the amount of height reserved for space between subplots, expressed as a fraction of the average axis height \end{description} If you want additional control, you can create an {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} using the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axes:matplotlib.pyplot.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axes()}}}}} command (or equivalently the figure {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_axes()}}}}} method), which allows you to specify the location explicitly: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{p}{[}\PYG{n}{left}\PYG{p}{,} \PYG{n}{bottom}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{n}{height}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} where all values are in fractional (0 to 1) coordinates. See \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_demo.py} for an example of placing axes manually. \subsection{Automatically make room for tick labels} \label{\detokenize{faq/howto_faq:automatically-make-room-for-tick-labels}}\label{\detokenize{faq/howto_faq:howto-auto-adjust}} \begin{sphinxadmonition}{note}{Note:} This is now easier to handle than ever before. Calling {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tight_layout:matplotlib.pyplot.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout()}}}}} can fix many common layout issues. See the {\hyperref[\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-tutorials-intermediate-tight-layout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Tight Layout guide}}}}. The information below is kept here in case it is useful for other purposes. \end{sphinxadmonition} In most use cases, it is enough to simply change the subplots adjust parameters as described in {\hyperref[\detokenize{faq/howto_faq:howto-subplots-adjust}]{\sphinxcrossref{\DUrole{std,std-ref}{Move the edge of an axes to make room for tick labels}}}}. But in some cases, you don’t know ahead of time what your tick labels will be, or how large they will be (data and labels outside your control may be being fed into your graphing application), and you may need to automatically adjust your subplot parameters based on the size of the tick labels. Any {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instance can report its extent in window coordinates (a negative x coordinate is outside the window), but there is a rub. The {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RendererBase}}}}} instance, which is used to calculate the text size, is not known until the figure is drawn ({\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw()}}}}}). After the window is drawn and the text instance knows its renderer, you can call {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_window\_extent()}}}}}. One way to solve this chicken and egg problem is to wait until the figure is draw by connecting ({\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.mpl_connect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mpl\_connect()}}}}}) to the “on\_draw” signal ({\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.DrawEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{DrawEvent}}}}}) and get the window extent there, and then do something with it, e.g., move the left of the canvas over; see {\hyperref[\detokenize{users/event_handling:event-handling-tutorial}]{\sphinxcrossref{\DUrole{std,std-ref}{Event handling and picking}}}}. Here is an example that gets a bounding box in relative figure coordinates (0..1) of each of the labels and uses it to move the left of the subplots over so that the tick labels fit in the figure: \begin{figure}[htbp] \centering \capstart \sphinxhref{../gallery/pyplots/auto\_subplots\_adjust.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_auto_subplots_adjust_001}.png}}\caption{Auto Subplots Adjust}\label{\detokenize{faq/howto_faq:id2}}\end{figure} \subsection{Configure the tick widths} \label{\detokenize{faq/howto_faq:configure-the-tick-widths}}\label{\detokenize{faq/howto_faq:howto-ticks}} Wherever possible, it is recommended to use the \sphinxcode{\sphinxupquote{tick\_params()}} or \sphinxcode{\sphinxupquote{set\_tick\_params()}} methods to modify tick properties: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{tick\PYGZus{}params}\PYG{p}{(}\PYG{n}{width}\PYG{o}{=}\PYG{l+m+mi}{10}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} For more control of tick properties that are not provided by the above methods, it is important to know that in Matplotlib, the ticks are \sphinxstyleemphasis{markers}. All {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} objects support a line (solid, dashed, etc) and a marker (circle, square, tick). The tick width is controlled by the \sphinxcode{\sphinxupquote{"markeredgewidth"}} property, so the above effect can also be achieved by: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{)} \PYG{k}{for} \PYG{n}{line} \PYG{o+ow}{in} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}xticklines}\PYG{p}{(}\PYG{p}{)} \PYG{o}{+} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}yticklines}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}markeredgewidth}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} The other properties that control the tick marker, and all markers, are \sphinxcode{\sphinxupquote{markerfacecolor}}, \sphinxcode{\sphinxupquote{markeredgecolor}}, \sphinxcode{\sphinxupquote{markeredgewidth}}, \sphinxcode{\sphinxupquote{markersize}}. For more information on configuring ticks, see {\hyperref[\detokenize{tutorials/intermediate/artists:axis-container}]{\sphinxcrossref{\DUrole{std,std-ref}{Axis containers}}}} and {\hyperref[\detokenize{tutorials/intermediate/artists:tick-container}]{\sphinxcrossref{\DUrole{std,std-ref}{Tick containers}}}}. \subsection{Align my ylabels across multiple subplots} \label{\detokenize{faq/howto_faq:align-my-ylabels-across-multiple-subplots}}\label{\detokenize{faq/howto_faq:howto-align-label}} If you have multiple subplots over one another, and the y data have different scales, you can often get ylabels that do not align vertically across the multiple subplots, which can be unattractive. By default, Matplotlib positions the x location of the ylabel so that it does not overlap any of the y ticks. You can override this default behavior by specifying the coordinates of the label. The example below shows the default behavior in the left subplots, and the manual setting in the right subplots. \begin{figure}[htbp] \centering \capstart \sphinxhref{../gallery/pyplots/align\_ylabels.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_align_ylabels_001}.png}}\caption{Align Ylabels}\label{\detokenize{faq/howto_faq:id3}}\end{figure} \subsection{Skip dates where there is no data} \label{\detokenize{faq/howto_faq:skip-dates-where-there-is-no-data}}\label{\detokenize{faq/howto_faq:date-index-plots}} When plotting time series, e.g., financial time series, one often wants to leave out days on which there is no data, e.g., weekends. By passing in dates on the x-xaxis, you get large horizontal gaps on periods when there is not data. The solution is to pass in some proxy x-data, e.g., evenly sampled indices, and then use a custom formatter to format these as dates. The example below shows how to use an ‘index formatter’ to achieve the desired plot: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{mlab} \PYG{k}{as} \PYG{n+nn}{mlab} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{ticker} \PYG{k}{as} \PYG{n+nn}{ticker} \PYG{n}{r} \PYG{o}{=} \PYG{n}{mlab}\PYG{o}{.}\PYG{n}{csv2rec}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{../data/aapl.csv}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{r}\PYG{o}{.}\PYG{n}{sort}\PYG{p}{(}\PYG{p}{)} \PYG{n}{r} \PYG{o}{=} \PYG{n}{r}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{30}\PYG{p}{:}\PYG{p}{]} \PYG{c+c1}{\PYGZsh{} get the last 30 days} \PYG{n}{N} \PYG{o}{=} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{r}\PYG{p}{)} \PYG{n}{ind} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{n}{N}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} the evenly spaced plot indices} \PYG{k}{def} \PYG{n+nf}{format\PYGZus{}date}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{pos}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)}\PYG{p}{:} \PYG{n}{thisind} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{clip}\PYG{p}{(}\PYG{n+nb}{int}\PYG{p}{(}\PYG{n}{x}\PYG{o}{+}\PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{N}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{k}{return} \PYG{n}{r}\PYG{o}{.}\PYG{n}{date}\PYG{p}{[}\PYG{n}{thisind}\PYG{p}{]}\PYG{o}{.}\PYG{n}{strftime}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{Y\PYGZhy{}}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{m\PYGZhy{}}\PYG{l+s+si}{\PYGZpc{}d}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{ind}\PYG{p}{,} \PYG{n}{r}\PYG{o}{.}\PYG{n}{adj\PYGZus{}close}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{o\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}formatter}\PYG{p}{(}\PYG{n}{ticker}\PYG{o}{.}\PYG{n}{FuncFormatter}\PYG{p}{(}\PYG{n}{format\PYGZus{}date}\PYG{p}{)}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{autofmt\PYGZus{}xdate}\PYG{p}{(}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Control the depth of plot elements} \label{\detokenize{faq/howto_faq:control-the-depth-of-plot-elements}}\label{\detokenize{faq/howto_faq:howto-set-zorder}} Within an axes, the order that the various lines, markers, text, collections, etc appear is determined by the {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_zorder()}}}}} property. The default order is patches, lines, text, with collections of lines and collections of patches appearing at the same level as regular lines and patches, respectively: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{zorder}\PYG{o}{=}\PYG{l+m+mi}{10}\PYG{p}{)} \end{sphinxVerbatim} You can also use the Axes property {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_axisbelow:matplotlib.axes.Axes.set_axisbelow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_axisbelow()}}}}} to control whether the grid lines are placed above or below your other plot elements. \subsection{Make the aspect ratio for plots equal} \label{\detokenize{faq/howto_faq:make-the-aspect-ratio-for-plots-equal}}\label{\detokenize{faq/howto_faq:howto-axis-equal}} The Axes property {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_aspect:matplotlib.axes.Axes.set_aspect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_aspect()}}}}} controls the aspect ratio of the axes. You can set it to be ‘auto’, ‘equal’, or some ratio which controls the ratio: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{,} \PYG{n}{aspect}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{equal}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Multiple y-axis scales} \label{\detokenize{faq/howto_faq:multiple-y-axis-scales}}\label{\detokenize{faq/howto_faq:howto-twoscale}} A frequent request is to have two scales for the left and right y-axis, which is possible using {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.twinx:matplotlib.pyplot.twinx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{twinx()}}}}} (more than two scales are not currently supported, though it is on the wish list). This works pretty well, though there are some quirks when you are trying to interactively pan and zoom, because both scales do not get the signals. The approach uses {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.twinx:matplotlib.pyplot.twinx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{twinx()}}}}} (and its sister {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.twiny:matplotlib.pyplot.twiny}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{twiny()}}}}}) to use \sphinxstyleemphasis{2 different axes}, turning the axes rectangular frame off on the 2nd axes to keep it from obscuring the first, and manually setting the tick locs and labels as desired. You can use separate \sphinxcode{\sphinxupquote{matplotlib.ticker}} formatters and locators as desired because the two axes are independent. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{howto_faq-1}.pdf} \end{figure} \subsection{Generate images without having a window appear} \label{\detokenize{faq/howto_faq:generate-images-without-having-a-window-appear}}\label{\detokenize{faq/howto_faq:howto-batch}} The easiest way to do this is use a non-interactive backend (see {\hyperref[\detokenize{tutorials/introductory/usage:what-is-a-backend}]{\sphinxcrossref{\DUrole{std,std-ref}{What is a backend?}}}}) such as Agg (for PNGs), PDF, SVG or PS. In your figure-generating script, just call the {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.use}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.use()}}}}} directive before importing pylab or pyplot: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Agg}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{savefig}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{myfig}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \sphinxstrong{See also:} {\hyperref[\detokenize{faq/howto_faq:howto-webapp}]{\sphinxcrossref{\DUrole{std,std-ref}{Matplotlib in a web application server}}}} for information about running matplotlib inside of a web application. \subsection{Use \sphinxstyleliteralintitle{\sphinxupquote{show()}}} \label{\detokenize{faq/howto_faq:use-show}}\label{\detokenize{faq/howto_faq:howto-show}} When you want to view your plots on your display, the user interface backend will need to start the GUI mainloop. This is what {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.show:matplotlib.pyplot.show}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{show()}}}}} does. It tells Matplotlib to raise all of the figure windows created so far and start the mainloop. Because this mainloop is blocking by default (i.e., script execution is paused), you should only call this once per script, at the end. Script execution is resumed after the last window is closed. Therefore, if you are using Matplotlib to generate only images and do not want a user interface window, you do not need to call \sphinxcode{\sphinxupquote{show}} (see {\hyperref[\detokenize{faq/howto_faq:howto-batch}]{\sphinxcrossref{\DUrole{std,std-ref}{Generate images without having a window appear}}}} and {\hyperref[\detokenize{tutorials/introductory/usage:what-is-a-backend}]{\sphinxcrossref{\DUrole{std,std-ref}{What is a backend?}}}}). \begin{sphinxadmonition}{note}{Note:} Because closing a figure window invokes the destruction of its plotting elements, you should call {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.savefig:matplotlib.pyplot.savefig}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{savefig()}}}}} \sphinxstyleemphasis{before} calling \sphinxcode{\sphinxupquote{show}} if you wish to save the figure as well as view it. \end{sphinxadmonition} \DUrole{versionmodified}{New in version v1.0.0: }\sphinxcode{\sphinxupquote{show}} now starts the GUI mainloop only if it isn’t already running. Therefore, multiple calls to \sphinxcode{\sphinxupquote{show}} are now allowed. Having \sphinxcode{\sphinxupquote{show}} block further execution of the script or the python interpreter depends on whether Matplotlib is set for interactive mode or not. In non-interactive mode (the default setting), execution is paused until the last figure window is closed. In interactive mode, the execution is not paused, which allows you to create additional figures (but the script won’t finish until the last figure window is closed). \begin{sphinxadmonition}{note}{Note:} Support for interactive/non-interactive mode depends upon the backend. Until version 1.0.0 (and subsequent fixes for 1.0.1), the behavior of the interactive mode was not consistent across backends. As of v1.0.1, only the macosx backend differs from other backends because it does not support non-interactive mode. \end{sphinxadmonition} Because it is expensive to draw, you typically will not want Matplotlib to redraw a figure many times in a script such as the following: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} draw here ?} \PYG{n}{xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{time}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} and here ?} \PYG{n}{ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{volts}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} and here ?} \PYG{n}{title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{a simple plot}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} and here ?} \PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} However, it is \sphinxstyleemphasis{possible} to force Matplotlib to draw after every command, which might be what you want when working interactively at the python console (see {\hyperref[\detokenize{users/shell:mpl-shell}]{\sphinxcrossref{\DUrole{std,std-ref}{Using matplotlib in a python shell}}}}), but in a script you want to defer all drawing until the call to \sphinxcode{\sphinxupquote{show}}. This is especially important for complex figures that take some time to draw. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.show:matplotlib.pyplot.show}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{show()}}}}} is designed to tell Matplotlib that you’re all done issuing commands and you want to draw the figure now. \begin{sphinxadmonition}{note}{Note:} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.show:matplotlib.pyplot.show}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{show()}}}}} should typically only be called at most once per script and it should be the last line of your script. At that point, the GUI takes control of the interpreter. If you want to force a figure draw, use {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.draw:matplotlib.pyplot.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw()}}}}} instead. \end{sphinxadmonition} Many users are frustrated by \sphinxcode{\sphinxupquote{show}} because they want it to be a blocking call that raises the figure, pauses the script until they close the figure, and then allow the script to continue running until the next figure is created and the next show is made. Something like this: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} WARNING : illustrating how NOT to use show} \PYG{k}{for} \PYG{n}{i} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} make figure i} \PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} This is not what show does and unfortunately, because doing blocking calls across user interfaces can be tricky, is currently unsupported, though we have made significant progress towards supporting blocking events. \DUrole{versionmodified}{New in version v1.0.0: }As noted earlier, this restriction has been relaxed to allow multiple calls to \sphinxcode{\sphinxupquote{show}}. In \sphinxstyleemphasis{most} backends, you can now expect to be able to create new figures and raise them in a subsequent call to \sphinxcode{\sphinxupquote{show}} after closing the figures from a previous call to \sphinxcode{\sphinxupquote{show}}. \subsection{Interpreting box plots and violin plots} \label{\detokenize{faq/howto_faq:interpreting-box-plots-and-violin-plots}}\label{\detokenize{faq/howto_faq:howto-boxplot-violinplot}} Tukey’s \sphinxhref{http://matplotlib.org/examples/pylab\_examples/boxplot\_demo.html}{box plots} (Robert McGill, John W. Tukey and Wayne A. Larsen: “The American Statistician” Vol. 32, No. 1, Feb., 1978, pp. 12-16) are statistical plots that provide useful information about the data distribution such as skewness. However, bar plots with error bars are still the common standard in most scientific literature, and thus, the interpretation of box plots can be challenging for the unfamiliar reader. The figure below illustrates the different visual features of a box plot. \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{boxplot_explanation}.png} \end{figure} \sphinxhref{http://matplotlib.org/examples/statistics/violinplot\_demo.html}{Violin plots} are closely related to box plots but add useful information such as the distribution of the sample data (density trace). Violin plots were added in Matplotlib 1.4. \section{Contributing: howto} \label{\detokenize{faq/howto_faq:contributing-howto}}\label{\detokenize{faq/howto_faq:howto-contribute}} \subsection{Request a new feature} \label{\detokenize{faq/howto_faq:request-a-new-feature}}\label{\detokenize{faq/howto_faq:how-to-request-feature}} Is there a feature you wish Matplotlib had? Then ask! The best way to get started is to email the developer \sphinxhref{mailto:matplotlib-devel@python.org}{mailing list} for discussion. This is an open source project developed primarily in the contributors free time, so there is no guarantee that your feature will be added. The \sphinxstyleemphasis{best} way to get the feature you need added is to contribute it your self. \subsection{Reporting a bug or submitting a patch} \label{\detokenize{faq/howto_faq:reporting-a-bug-or-submitting-a-patch}}\label{\detokenize{faq/howto_faq:how-to-submit-patch}} The development of Matplotlib is organized through \sphinxhref{https://github.com/matplotlib/matplotlib}{github}. If you would like to report a bug or submit a patch please use that interface. To report a bug \sphinxhref{https://github.com/matplotlib/matplotlib/issues/new}{create an issue} on github (this requires having a github account). Please include a \sphinxhref{http://sscce.org}{Short, Self Contained, Correct (Compilable), Example} demonstrating what the bug is. Including a clear, easy to test example makes it easy for the developers to evaluate the bug. Expect that the bug reports will be a conversation. If you do not want to register with github, please email bug reports to the \sphinxhref{mailto:matplotlib-devel@python.org}{mailing list}. The easiest way to submit patches to Matplotlib is through pull requests on github. Please see the {\hyperref[\detokenize{devel/index:developers-guide-index}]{\sphinxcrossref{\DUrole{std,std-ref}{The Matplotlib Developers’ Guide}}}} for the details. \subsection{Contribute to Matplotlib documentation} \label{\detokenize{faq/howto_faq:contribute-to-matplotlib-documentation}}\label{\detokenize{faq/howto_faq:how-to-contribute-docs}} Matplotlib is a big library, which is used in many ways, and the documentation has only scratched the surface of everything it can do. So far, the place most people have learned all these features are through studying the examples ({\hyperref[\detokenize{faq/howto_faq:how-to-search-examples}]{\sphinxcrossref{\DUrole{std,std-ref}{Search examples}}}}), which is a recommended and great way to learn, but it would be nice to have more official narrative documentation guiding people through all the dark corners. This is where you come in. There is a good chance you know more about Matplotlib usage in some areas, the stuff you do every day, than many of the core developers who wrote most of the documentation. Just pulled your hair out compiling Matplotlib for windows? Write a FAQ or a section for the {\hyperref[\detokenize{faq/installing_faq:installing-faq}]{\sphinxcrossref{\DUrole{std,std-ref}{Installation}}}} page. Are you a digital signal processing wizard? Write a tutorial on the signal analysis plotting functions like {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xcorr:matplotlib.pyplot.xcorr}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xcorr()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.psd:matplotlib.pyplot.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.specgram:matplotlib.pyplot.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}}. Do you use Matplotlib with \sphinxhref{https://www.djangoproject.com/}{django} or other popular web application servers? Write a FAQ or tutorial and we’ll find a place for it in the {\hyperref[\detokenize{users/index:users-guide-index}]{\sphinxcrossref{\DUrole{std,std-ref}{User’s Guide}}}}. Bundle Matplotlib in a \sphinxhref{http://www.py2exe.org/}{py2exe} app? … I think you get the idea. Matplotlib is documented using the \sphinxhref{http://www.sphinx-doc.org/index.html}{sphinx} extensions to restructured text \sphinxhref{http://docutils.sourceforge.net/rst.html}{(ReST)}. sphinx is an extensible python framework for documentation projects which generates HTML and PDF, and is pretty easy to write; you can see the source for this document or any page on this site by clicking on the \sphinxstyleemphasis{Show Source} link at the end of the page in the sidebar. The sphinx website is a good resource for learning sphinx, but we have put together a cheat-sheet at {\hyperref[\detokenize{devel/documenting_mpl:documenting-matplotlib}]{\sphinxcrossref{\DUrole{std,std-ref}{Writing documentation}}}} which shows you how to get started, and outlines the Matplotlib conventions and extensions, e.g., for including plots directly from external code in your documents. Once your documentation contributions are working (and hopefully tested by actually \sphinxstyleemphasis{building} the docs) you can submit them as a patch against git. See {\hyperref[\detokenize{devel/gitwash/git_install:install-git}]{\sphinxcrossref{\DUrole{std,std-ref}{Install git}}}} and {\hyperref[\detokenize{faq/howto_faq:how-to-submit-patch}]{\sphinxcrossref{\DUrole{std,std-ref}{Reporting a bug or submitting a patch}}}}. Looking for something to do? Search for \sphinxhref{../search.html?q=todo}{TODO} or look at the open issues on github. \section{Matplotlib in a web application server} \label{\detokenize{faq/howto_faq:matplotlib-in-a-web-application-server}}\label{\detokenize{faq/howto_faq:howto-webapp}} Many users report initial problems trying to use maptlotlib in web application servers, because by default Matplotlib ships configured to work with a graphical user interface which may require an X11 connection. Since many barebones application servers do not have X11 enabled, you may get errors if you don’t configure Matplotlib for use in these environments. Most importantly, you need to decide what kinds of images you want to generate (PNG, PDF, SVG) and configure the appropriate default backend. For 99\% of users, this will be the Agg backend, which uses the C++ \sphinxhref{http://antigrain.com}{antigrain} rendering engine to make nice PNGs. The Agg backend is also configured to recognize requests to generate other output formats (PDF, PS, EPS, SVG). The easiest way to configure Matplotlib to use Agg is to call: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} do this before importing pylab or pyplot} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Agg}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \end{sphinxVerbatim} For more on configuring your backend, see {\hyperref[\detokenize{tutorials/introductory/usage:what-is-a-backend}]{\sphinxcrossref{\DUrole{std,std-ref}{What is a backend?}}}}. Alternatively, you can avoid pylab/pyplot altogether, which will give you a little more control, by calling the API directly as shown in \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_agg\_oo\_sgskip.py}. You can either generate hardcopy on the filesystem by calling savefig: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} do this before importing pylab or pyplot} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Agg}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{savefig}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{test.png}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} or by saving to a file handle: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{sys} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{savefig}\PYG{p}{(}\PYG{n}{sys}\PYG{o}{.}\PYG{n}{stdout}\PYG{p}{)} \end{sphinxVerbatim} Here is an example using \sphinxhref{https://pillow.readthedocs.io/en/latest/}{Pillow}. First, the figure is saved to a BytesIO object which is then fed to Pillow for further processing: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{io} \PYG{k}{import} \PYG{n}{BytesIO} \PYG{k+kn}{from} \PYG{n+nn}{PIL} \PYG{k}{import} \PYG{n}{Image} \PYG{n}{imgdata} \PYG{o}{=} \PYG{n}{BytesIO}\PYG{p}{(}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{savefig}\PYG{p}{(}\PYG{n}{imgdata}\PYG{p}{,} \PYG{n+nb}{format}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{png}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{imgdata}\PYG{o}{.}\PYG{n}{seek}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} rewind the data} \PYG{n}{im} \PYG{o}{=} \PYG{n}{Image}\PYG{o}{.}\PYG{n}{open}\PYG{p}{(}\PYG{n}{imgdata}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Matplotlib with apache} \label{\detokenize{faq/howto_faq:matplotlib-with-apache}} TODO; see {\hyperref[\detokenize{faq/howto_faq:how-to-contribute-docs}]{\sphinxcrossref{\DUrole{std,std-ref}{Contribute to Matplotlib documentation}}}}. \subsection{Matplotlib with django} \label{\detokenize{faq/howto_faq:matplotlib-with-django}} TODO; see {\hyperref[\detokenize{faq/howto_faq:how-to-contribute-docs}]{\sphinxcrossref{\DUrole{std,std-ref}{Contribute to Matplotlib documentation}}}}. \subsection{Matplotlib with zope} \label{\detokenize{faq/howto_faq:matplotlib-with-zope}} TODO; see {\hyperref[\detokenize{faq/howto_faq:how-to-contribute-docs}]{\sphinxcrossref{\DUrole{std,std-ref}{Contribute to Matplotlib documentation}}}}. \subsection{Clickable images for HTML} \label{\detokenize{faq/howto_faq:clickable-images-for-html}}\label{\detokenize{faq/howto_faq:howto-click-maps}} Andrew Dalke of \sphinxhref{http://www.dalkescientific.com}{Dalke Scientific} has written a nice \sphinxhref{http://www.dalkescientific.com/writings/diary/archive/2005/04/24/interactive\_html.html}{article} on how to make html click maps with Matplotlib agg PNGs. We would also like to add this functionality to SVG. If you are interested in contributing to these efforts that would be great. \section{Search examples} \label{\detokenize{faq/howto_faq:search-examples}}\label{\detokenize{faq/howto_faq:how-to-search-examples}} The nearly 300 code \DUrole{xref,std,std-ref}{examples-index} included with the Matplotlib source distribution are full-text searchable from the \DUrole{xref,std,std-ref}{search} page, but sometimes when you search, you get a lot of results from the {\hyperref[\detokenize{api/index:api-index}]{\sphinxcrossref{\DUrole{std,std-ref}{The Matplotlib API}}}} or other documentation that you may not be interested in if you just want to find a complete, free-standing, working piece of example code. To facilitate example searches, we have tagged every code example page with the keyword \sphinxcode{\sphinxupquote{codex}} for \sphinxstyleemphasis{code example} which shouldn’t appear anywhere else on this site except in the FAQ. So if you want to search for an example that uses an ellipse, \DUrole{xref,std,std-ref}{search} for \sphinxcode{\sphinxupquote{codex ellipse}}. \section{Cite Matplotlib} \label{\detokenize{faq/howto_faq:cite-matplotlib}}\label{\detokenize{faq/howto_faq:how-to-cite-mpl}} If you want to refer to Matplotlib in a publication, you can use “Matplotlib: A 2D Graphics Environment” by J. D. Hunter In Computing in Science \& Engineering, Vol. 9, No. 3. (2007), pp. 90-95 (see \sphinxhref{https://doi.org/10.1109/MCSE.2007.55}{this reference page}): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] @article\PYGZob{}Hunter:2007, Address = \PYGZob{}10662 LOS VAQUEROS CIRCLE, PO BOX 3014, LOS ALAMITOS, CA 90720\PYGZhy{}1314 USA\PYGZcb{}, Author = \PYGZob{}Hunter, John D.\PYGZcb{}, Date\PYGZhy{}Added = \PYGZob{}2010\PYGZhy{}09\PYGZhy{}23 12:22:10 \PYGZhy{}0700\PYGZcb{}, Date\PYGZhy{}Modified = \PYGZob{}2010\PYGZhy{}09\PYGZhy{}23 12:22:10 \PYGZhy{}0700\PYGZcb{}, Isi = \PYGZob{}000245668100019\PYGZcb{}, Isi\PYGZhy{}Recid = \PYGZob{}155389429\PYGZcb{}, Journal = \PYGZob{}Computing In Science \PYGZbs{}\PYGZam{} Engineering\PYGZcb{}, Month = \PYGZob{}May\PYGZhy{}Jun\PYGZcb{}, Number = \PYGZob{}3\PYGZcb{}, Pages = \PYGZob{}90\PYGZhy{}\PYGZhy{}95\PYGZcb{}, Publisher = \PYGZob{}IEEE COMPUTER SOC\PYGZcb{}, Times\PYGZhy{}Cited = \PYGZob{}21\PYGZcb{}, Title = \PYGZob{}Matplotlib: A 2D graphics environment\PYGZcb{}, Type = \PYGZob{}Editorial Material\PYGZcb{}, Volume = \PYGZob{}9\PYGZcb{}, Year = \PYGZob{}2007\PYGZcb{}, Abstract = \PYGZob{}Matplotlib is a 2D graphics package used for Python for application development, interactive scripting, and publication\PYGZhy{}quality image generation across user interfaces and operating systems.\PYGZcb{}, Bdsk\PYGZhy{}Url\PYGZhy{}1 = \PYGZob{}http://gateway.isiknowledge.com/gateway/Gateway.cgi?GWVersion=2\PYGZam{}SrcAuth=Alerting\PYGZam{}SrcApp=Alerting\PYGZam{}DestApp=WOS\PYGZam{}DestLinkType=FullRecord;KeyUT=000245668100019\PYGZcb{}\PYGZcb{} \end{sphinxVerbatim} \chapter{Troubleshooting} \label{\detokenize{faq/troubleshooting_faq:troubleshooting}}\label{\detokenize{faq/troubleshooting_faq:troubleshooting-faq}}\label{\detokenize{faq/troubleshooting_faq::doc}} \begin{sphinxShadowBox} \sphinxstyletopictitle{Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/troubleshooting_faq:id1}}{\hyperref[\detokenize{faq/troubleshooting_faq:troubleshooting}]{\sphinxcrossref{Troubleshooting}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/troubleshooting_faq:id2}}{\hyperref[\detokenize{faq/troubleshooting_faq:obtaining-matplotlib-version}]{\sphinxcrossref{Obtaining Matplotlib version}}} \item {} \phantomsection\label{\detokenize{faq/troubleshooting_faq:id3}}{\hyperref[\detokenize{faq/troubleshooting_faq:matplotlib-install-location}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib}} install location}}} \item {} \phantomsection\label{\detokenize{faq/troubleshooting_faq:id4}}{\hyperref[\detokenize{faq/troubleshooting_faq:matplotlib-configuration-and-cache-directory-locations}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib}} configuration and cache directory locations}}} \item {} \phantomsection\label{\detokenize{faq/troubleshooting_faq:id5}}{\hyperref[\detokenize{faq/troubleshooting_faq:getting-help}]{\sphinxcrossref{Getting help}}} \item {} \phantomsection\label{\detokenize{faq/troubleshooting_faq:id6}}{\hyperref[\detokenize{faq/troubleshooting_faq:problems-with-recent-git-versions}]{\sphinxcrossref{Problems with recent git versions}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \section{Obtaining Matplotlib version} \label{\detokenize{faq/troubleshooting_faq:obtaining-matplotlib-version}}\label{\detokenize{faq/troubleshooting_faq:matplotlib-version}} To find out your Matplotlib version number, import it and print the \sphinxcode{\sphinxupquote{\_\_version\_\_}} attribute: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{\PYGZus{}\PYGZus{}version\PYGZus{}\PYGZus{}} \PYG{g+go}{\PYGZsq{}0.98.0\PYGZsq{}} \end{sphinxVerbatim} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib}} install location} \label{\detokenize{faq/troubleshooting_faq:matplotlib-install-location}}\label{\detokenize{faq/troubleshooting_faq:locating-matplotlib-install}} You can find what directory Matplotlib is installed in by importing it and printing the \sphinxcode{\sphinxupquote{\_\_file\_\_}} attribute: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{matplotlib}\PYG{o}{.}\PYG{n+nv+vm}{\PYGZus{}\PYGZus{}file\PYGZus{}\PYGZus{}} \PYG{g+go}{\PYGZsq{}/home/jdhunter/dev/lib64/python2.5/site\PYGZhy{}packages/matplotlib/\PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{}.pyc\PYGZsq{}} \end{sphinxVerbatim} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib}} configuration and cache directory locations} \label{\detokenize{faq/troubleshooting_faq:matplotlib-configuration-and-cache-directory-locations}}\label{\detokenize{faq/troubleshooting_faq:locating-matplotlib-config-dir}} Each user has a Matplotlib configuration directory which may contain a {\hyperref[\detokenize{tutorials/introductory/customizing:customizing-with-matplotlibrc-files}]{\sphinxcrossref{\DUrole{std,std-ref}{matplotlibrc}}}} file. To locate your \sphinxcode{\sphinxupquote{matplotlib/}} configuration directory, use \sphinxcode{\sphinxupquote{matplotlib.get\_configdir()}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{k}{as} \PYG{n+nn}{mpl} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{mpl}\PYG{o}{.}\PYG{n}{get\PYGZus{}configdir}\PYG{p}{(}\PYG{p}{)} \PYG{g+go}{\PYGZsq{}/home/darren/.config/matplotlib\PYGZsq{}} \end{sphinxVerbatim} On unix-like systems, this directory is generally located in your \index{HOME}\index{environment variable!HOME}{\hyperref[\detokenize{faq/environment_variables_faq:envvar-HOME}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{HOME}}}}} directory under the \sphinxcode{\sphinxupquote{.config/}} directory. In addition, users have a cache directory. On unix-like systems, this is separate from the configuration directory by default. To locate your \sphinxcode{\sphinxupquote{.cache/}} directory, use \sphinxcode{\sphinxupquote{matplotlib.get\_cachedir()}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{k}{as} \PYG{n+nn}{mpl} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{mpl}\PYG{o}{.}\PYG{n}{get\PYGZus{}cachedir}\PYG{p}{(}\PYG{p}{)} \PYG{g+go}{\PYGZsq{}/home/darren/.cache/matplotlib\PYGZsq{}} \end{sphinxVerbatim} On windows, both the config directory and the cache directory are the same and are in your \sphinxcode{\sphinxupquote{Documents and Settings}} or \sphinxcode{\sphinxupquote{Users}} directory by default: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{k}{as} \PYG{n+nn}{mpl} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{mpl}\PYG{o}{.}\PYG{n}{get\PYGZus{}configdir}\PYG{p}{(}\PYG{p}{)} \PYG{g+go}{\PYGZsq{}C:\PYGZbs{}\PYGZbs{}Documents and Settings\PYGZbs{}\PYGZbs{}jdhunter\PYGZbs{}\PYGZbs{}.matplotlib\PYGZsq{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{mpl}\PYG{o}{.}\PYG{n}{get\PYGZus{}cachedir}\PYG{p}{(}\PYG{p}{)} \PYG{g+go}{\PYGZsq{}C:\PYGZbs{}\PYGZbs{}Documents and Settings\PYGZbs{}\PYGZbs{}jdhunter\PYGZbs{}\PYGZbs{}.matplotlib\PYGZsq{}} \end{sphinxVerbatim} If you would like to use a different configuration directory, you can do so by specifying the location in your \index{MPLCONFIGDIR}\index{environment variable!MPLCONFIGDIR}{\hyperref[\detokenize{faq/environment_variables_faq:envvar-MPLCONFIGDIR}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MPLCONFIGDIR}}}}} environment variable \textendash{} see {\hyperref[\detokenize{faq/environment_variables_faq:setting-linux-osx-environment-variables}]{\sphinxcrossref{\DUrole{std,std-ref}{Setting environment variables in Linux and OS-X}}}}. Note that \index{MPLCONFIGDIR}\index{environment variable!MPLCONFIGDIR}{\hyperref[\detokenize{faq/environment_variables_faq:envvar-MPLCONFIGDIR}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MPLCONFIGDIR}}}}} sets the location of both the configuration directory and the cache directory. \section{Getting help} \label{\detokenize{faq/troubleshooting_faq:getting-help}}\label{\detokenize{faq/troubleshooting_faq:reporting-problems}} There are a number of good resources for getting help with Matplotlib. There is a good chance your question has already been asked: \begin{itemize} \item {} The \sphinxhref{http://matplotlib.1069221.n5.nabble.com/}{mailing list archive}. \item {} \sphinxhref{https://github.com/matplotlib/matplotlib/issues}{Github issues}. \item {} Stackoverflow questions tagged \sphinxhref{http://stackoverflow.com/questions/tagged/matplotlib}{matplotlib}. \end{itemize} If you are unable to find an answer to your question through search, please provide the following information in your e-mail to the \sphinxhref{https://mail.python.org/mailman/listinfo/matplotlib-users}{mailing list}: \begin{itemize} \item {} Your operating system (Linux/UNIX users: post the output of \sphinxcode{\sphinxupquote{uname -a}}). \item {} Matplotlib version: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{c} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{import matplotlib; print matplotlib.\PYGZus{}\PYGZus{}version\PYGZus{}\PYGZus{}}\PYG{l+s+s2}{\PYGZdq{}} \end{sphinxVerbatim} \item {} Where you obtained Matplotlib (e.g., your Linux distribution’s packages, Github, PyPi, or \sphinxhref{https://www.continuum.io/downloads}{Anaconda} or \sphinxhref{https://www.enthought.com/products/canopy/}{Enthought Canopy}). \item {} Any customizations to your \sphinxcode{\sphinxupquote{matplotlibrc}} file (see {\hyperref[\detokenize{tutorials/introductory/customizing:sphx-glr-tutorials-introductory-customizing-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Matplotlib with style sheets and rcParams}}}}). \item {} If the problem is reproducible, please try to provide a \sphinxstyleemphasis{minimal}, standalone Python script that demonstrates the problem. This is \sphinxstyleemphasis{the} critical step. If you can’t post a piece of code that we can run and reproduce your error, the chances of getting help are significantly diminished. Very often, the mere act of trying to minimize your code to the smallest bit that produces the error will help you find a bug in \sphinxstyleemphasis{your} code that is causing the problem. \item {} You can get helpful debugging output from Matlotlib by using the \sphinxhref{https://docs.python.org/3/library/logging.html\#module-logging}{\sphinxcode{\sphinxupquote{logging}}} library in your code and posting the verbose output to the lists. For a command-line version of this, try: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{c} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{from logging import *; basicConfig(level=DEBUG); from pylab import *; plot(); show()}\PYG{l+s+s2}{\PYGZdq{}} \end{sphinxVerbatim} If you want to put the debugging hooks in your own code, then the most simple way to do so is to insert the following \sphinxstyleemphasis{before} any calls to \sphinxcode{\sphinxupquote{import matplotlib}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{logging} \PYG{n}{logging}\PYG{o}{.}\PYG{n}{basicConfig}\PYG{p}{(}\PYG{n}{level}\PYG{o}{=}\PYG{n}{logging}\PYG{o}{.}\PYG{n}{DEBUG}\PYG{p}{)} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \end{sphinxVerbatim} Note that if you want to use \sphinxhref{https://docs.python.org/3/library/logging.html\#module-logging}{\sphinxcode{\sphinxupquote{logging}}} in your own code, but do not want verbose Matplotlib output, you can set the logging level for Matplotlib independently: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{logging} \PYG{c+c1}{\PYGZsh{} set DEBUG for everything} \PYG{n}{logging}\PYG{o}{.}\PYG{n}{basicConfig}\PYG{p}{(}\PYG{n}{level}\PYG{o}{=}\PYG{n}{logging}\PYG{o}{.}\PYG{n}{DEBUG}\PYG{p}{)} \PYG{n}{logger} \PYG{o}{=} \PYG{n}{logging}\PYG{o}{.}\PYG{n}{getLogger}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{matplotlib}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} set WARNING for Matplotlib} \PYG{n}{logger}\PYG{o}{.}\PYG{n}{setLevel}\PYG{p}{(}\PYG{n}{logging}\PYG{o}{.}\PYG{n}{WARNING}\PYG{p}{)} \end{sphinxVerbatim} The \sphinxhref{https://docs.python.org/3/library/logging.html\#module-logging}{\sphinxcode{\sphinxupquote{logging}}} module is very flexible, and can be a valuable tool in chasing down errors. \end{itemize} If you compiled Matplotlib yourself, please also provide: \begin{itemize} \item {} any changes you have made to \sphinxcode{\sphinxupquote{setup.py}} or \sphinxcode{\sphinxupquote{setupext.py}}. \item {} the output of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{rm} \PYG{o}{\PYGZhy{}}\PYG{n}{rf} \PYG{n}{build} \PYG{n}{python} \PYG{n}{setup}\PYG{o}{.}\PYG{n}{py} \PYG{n}{build} \end{sphinxVerbatim} The beginning of the build output contains lots of details about your platform that are useful for the Matplotlib developers to diagnose your problem. \item {} your compiler version \textendash{} e.g., \sphinxcode{\sphinxupquote{gcc -{-}version}}. \end{itemize} Including this information in your first e-mail to the mailing list will save a lot of time. You will likely get a faster response writing to the mailing list than filing a bug in the bug tracker. Most developers check the bug tracker only periodically. If your problem has been determined to be a bug and can not be quickly solved, you may be asked to file a bug in the tracker so the issue doesn’t get lost. \section{Problems with recent git versions} \label{\detokenize{faq/troubleshooting_faq:problems-with-recent-git-versions}}\label{\detokenize{faq/troubleshooting_faq:git-trouble}} First make sure you have a clean build and install (see {\hyperref[\detokenize{faq/installing_faq:clean-install}]{\sphinxcrossref{\DUrole{std,std-ref}{How to completely remove Matplotlib}}}}), get the latest git update, install it and run a simple test script in debug mode: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{rm} \PYG{o}{\PYGZhy{}}\PYG{n}{rf} \PYG{o}{/}\PYG{n}{path}\PYG{o}{/}\PYG{n}{to}\PYG{o}{/}\PYG{n}{site}\PYG{o}{\PYGZhy{}}\PYG{n}{packages}\PYG{o}{/}\PYG{n}{matplotlib}\PYG{o}{*} \PYG{n}{git} \PYG{n}{clean} \PYG{o}{\PYGZhy{}}\PYG{n}{xdf} \PYG{n}{git} \PYG{n}{pull} \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{o}{\PYGZhy{}}\PYG{n}{v} \PYG{o}{.} \PYG{o}{\PYGZgt{}} \PYG{n}{build}\PYG{o}{.}\PYG{n}{out} \PYG{n}{python} \PYG{n}{examples}\PYG{o}{/}\PYG{n}{pylab\PYGZus{}examples}\PYG{o}{/}\PYG{n}{simple\PYGZus{}plot}\PYG{o}{.}\PYG{n}{py} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{verbose}\PYG{o}{\PYGZhy{}}\PYG{n}{debug} \PYG{o}{\PYGZgt{}} \PYG{n}{run}\PYG{o}{.}\PYG{n}{out} \end{sphinxVerbatim} and post \sphinxcode{\sphinxupquote{build.out}} and \sphinxcode{\sphinxupquote{run.out}} to the \sphinxhref{https://mail.python.org/mailman/listinfo/matplotlib-devel}{matplotlib-devel} mailing list (please do not post git problems to the \sphinxhref{https://mail.python.org/mailman/listinfo/matplotlib-users}{users list}). Of course, you will want to clearly describe your problem, what you are expecting and what you are getting, but often a clean build and install will help. See also {\hyperref[\detokenize{faq/troubleshooting_faq:reporting-problems}]{\sphinxcrossref{\DUrole{std,std-ref}{Getting help}}}}. \chapter{Environment Variables} \label{\detokenize{faq/environment_variables_faq:environment-variables}}\label{\detokenize{faq/environment_variables_faq:id1}}\label{\detokenize{faq/environment_variables_faq::doc}} \begin{sphinxShadowBox} \sphinxstyletopictitle{Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/environment_variables_faq:id2}}{\hyperref[\detokenize{faq/environment_variables_faq:environment-variables}]{\sphinxcrossref{Environment Variables}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/environment_variables_faq:id3}}{\hyperref[\detokenize{faq/environment_variables_faq:setting-environment-variables-in-linux-and-os-x}]{\sphinxcrossref{Setting environment variables in Linux and OS-X}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/environment_variables_faq:id4}}{\hyperref[\detokenize{faq/environment_variables_faq:bash-ksh}]{\sphinxcrossref{BASH/KSH}}} \item {} \phantomsection\label{\detokenize{faq/environment_variables_faq:id5}}{\hyperref[\detokenize{faq/environment_variables_faq:csh-tcsh}]{\sphinxcrossref{CSH/TCSH}}} \end{itemize} \item {} \phantomsection\label{\detokenize{faq/environment_variables_faq:id6}}{\hyperref[\detokenize{faq/environment_variables_faq:setting-environment-variables-in-windows}]{\sphinxcrossref{Setting environment variables in windows}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \index{environment variable!HOME} \begin{fulllineitems} \phantomsection\label{\detokenize{faq/environment_variables_faq:envvar-HOME}}\pysigline{\sphinxbfcode{\sphinxupquote{HOME}}} The user’s home directory. On linux, \index{HOME}\index{environment variable!HOME}{\hyperref[\detokenize{faq/environment_variables_faq:envvar-HOME}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{\textasciitilde{}}}}}} is shorthand for \index{HOME}\index{environment variable!HOME}{\hyperref[\detokenize{faq/environment_variables_faq:envvar-HOME}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{HOME}}}}}. \end{fulllineitems} \index{environment variable!PATH} \begin{fulllineitems} \phantomsection\label{\detokenize{faq/environment_variables_faq:envvar-PATH}}\pysigline{\sphinxbfcode{\sphinxupquote{PATH}}} The list of directories searched to find executable programs \end{fulllineitems} \index{environment variable!PYTHONPATH} \begin{fulllineitems} \phantomsection\label{\detokenize{faq/environment_variables_faq:envvar-PYTHONPATH}}\pysigline{\sphinxbfcode{\sphinxupquote{PYTHONPATH}}} The list of directories that is added to Python’s standard search list when importing packages and modules \end{fulllineitems} \index{environment variable!MPLCONFIGDIR} \begin{fulllineitems} \phantomsection\label{\detokenize{faq/environment_variables_faq:envvar-MPLCONFIGDIR}}\pysigline{\sphinxbfcode{\sphinxupquote{MPLCONFIGDIR}}} This is the directory used to store user customizations to matplotlib, as well as some caches to improve performance. If \index{MPLCONFIGDIR}\index{environment variable!MPLCONFIGDIR}{\hyperref[\detokenize{faq/environment_variables_faq:envvar-MPLCONFIGDIR}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MPLCONFIGDIR}}}}} is not defined, \sphinxcode{\sphinxupquote{\sphinxstyleemphasis{HOME}/.config/matplotlib}} is generally used on unix-like systems and \sphinxcode{\sphinxupquote{\sphinxstyleemphasis{HOME}/.matplotlib}} is used on other platforms, if they are writable. Otherwise, the python standard library \sphinxhref{https://docs.python.org/3/library/tempfile.html\#tempfile.gettempdir}{\sphinxcode{\sphinxupquote{tempfile.gettempdir()}}} is used to find a base directory in which the \sphinxcode{\sphinxupquote{matplotlib}} subdirectory is created. \end{fulllineitems} \index{environment variable!MPLBACKEND} \begin{fulllineitems} \phantomsection\label{\detokenize{faq/environment_variables_faq:envvar-MPLBACKEND}}\pysigline{\sphinxbfcode{\sphinxupquote{MPLBACKEND}}} This optional variable can be set to choose the matplotlib backend. See {\hyperref[\detokenize{tutorials/introductory/usage:what-is-a-backend}]{\sphinxcrossref{\DUrole{std,std-ref}{What is a backend?}}}}. \end{fulllineitems} \section{Setting environment variables in Linux and OS-X} \label{\detokenize{faq/environment_variables_faq:setting-environment-variables-in-linux-and-os-x}}\label{\detokenize{faq/environment_variables_faq:setting-linux-osx-environment-variables}} To list the current value of \index{PYTHONPATH}\index{environment variable!PYTHONPATH}{\hyperref[\detokenize{faq/environment_variables_faq:envvar-PYTHONPATH}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PYTHONPATH}}}}}, which may be empty, try: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] echo \PYGZdl{}PYTHONPATH \end{sphinxVerbatim} The procedure for setting environment variables in depends on what your default shell is. \sphinxstyleliteralstrong{\sphinxupquote{BASH}} seems to be the most common, but \sphinxstyleliteralstrong{\sphinxupquote{CSH}} is also common. You should be able to determine which by running at the command prompt: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] echo \PYGZdl{}SHELL \end{sphinxVerbatim} \subsection{BASH/KSH} \label{\detokenize{faq/environment_variables_faq:bash-ksh}} To create a new environment variable: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{export} \PYG{n}{PYTHONPATH}\PYG{o}{=}\PYG{o}{\PYGZti{}}\PYG{o}{/}\PYG{n}{Python} \end{sphinxVerbatim} To prepend to an existing environment variable: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] export PATH=\PYGZti{}/bin:\PYGZdl{}\PYGZob{}PATH\PYGZcb{} \end{sphinxVerbatim} The search order may be important to you, do you want \sphinxcode{\sphinxupquote{\textasciitilde{}/bin}} to be searched first or last? To append to an existing environment variable: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] export PATH=\PYGZdl{}\PYGZob{}PATH\PYGZcb{}:\PYGZti{}/bin \end{sphinxVerbatim} To make your changes available in the future, add the commands to your \sphinxcode{\sphinxupquote{\textasciitilde{}/.bashrc}} file. \subsection{CSH/TCSH} \label{\detokenize{faq/environment_variables_faq:csh-tcsh}} To create a new environment variable: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{setenv} \PYG{n}{PYTHONPATH} \PYG{o}{\PYGZti{}}\PYG{o}{/}\PYG{n}{Python} \end{sphinxVerbatim} To prepend to an existing environment variable: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] setenv PATH \PYGZti{}/bin:\PYGZdl{}\PYGZob{}PATH\PYGZcb{} \end{sphinxVerbatim} The search order may be important to you, do you want \sphinxcode{\sphinxupquote{\textasciitilde{}/bin}} to be searched first or last? To append to an existing environment variable: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] setenv PATH \PYGZdl{}\PYGZob{}PATH\PYGZcb{}:\PYGZti{}/bin \end{sphinxVerbatim} To make your changes available in the future, add the commands to your \sphinxcode{\sphinxupquote{\textasciitilde{}/.cshrc}} file. \section{Setting environment variables in windows} \label{\detokenize{faq/environment_variables_faq:setting-environment-variables-in-windows}}\label{\detokenize{faq/environment_variables_faq:setting-windows-environment-variables}} Open the \sphinxstyleliteralstrong{\sphinxupquote{Control Panel}} (\sphinxmenuselection{Start \(\rightarrow\) Control Panel}), start the \sphinxstyleliteralstrong{\sphinxupquote{System}} program. Click the \sphinxmenuselection{Advanced} tab and select the \sphinxmenuselection{Environment Variables} button. You can edit or add to the \sphinxmenuselection{User Variables}. \chapter{Working with Matplotlib in Virtual environments} \label{\detokenize{faq/virtualenv_faq:working-with-matplotlib-in-virtual-environments}}\label{\detokenize{faq/virtualenv_faq:virtualenv-faq}}\label{\detokenize{faq/virtualenv_faq::doc}} When running Matplotlib in a \sphinxhref{https://virtualenv.pypa.io/en/latest/}{virtual environment} you may discover a few issues. Matplotlib itself has no issue with virtual environments. However, some of the external GUI frameworks that Matplotlib uses for interactive figures may be tricky to install in a virtual environment. Everything below assumes some familiarity with the Matplotlib backends as found in {\hyperref[\detokenize{tutorials/introductory/usage:what-is-a-backend}]{\sphinxcrossref{\DUrole{std,std-ref}{What is a backend?}}}}. If you only use the IPython and Jupyter Notebook’s \sphinxcode{\sphinxupquote{inline}} and \sphinxcode{\sphinxupquote{notebook}} backends, or non-interactive backends, you should not have any issues and can ignore everything below. Likewise, the \sphinxcode{\sphinxupquote{Tk}} framework (\sphinxcode{\sphinxupquote{TkAgg}} backend) does not require any external dependencies and is normally always available. On certain Linux distributions, a package named \sphinxcode{\sphinxupquote{python-tk}} (or similar) needs to be installed. Otherwise, the situation (at the time of writing) is as follows: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily GUI framework &\sphinxstyletheadfamily pip-installable? &\sphinxstyletheadfamily conda or conda-forge-installable? \\ \hline PyQt5 & on Python\textgreater{}=3.5 & yes \\ \hline PyQt4 & PySide: on Windows and OSX & yes \\ \hline PyGObject & no & on Linux \\ \hline PyGTK & no & no \\ \hline wxPython & yes % \begin{footnote}[1]\sphinxAtStartFootnote OSX and Windows wheels available on PyPI. Linux wheels available but not on PyPI, see \sphinxurl{https://wxpython.org/pages/downloads/}. % \end{footnote} & yes \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} In other cases, you need to install the package in the global (system) site-packages, and somehow make it available from within the virtual environment. This can be achieved by any of the following methods (in all cases, the system-wide Python and the virtualenv Python must be of the same version): \begin{itemize} \item {} Using \sphinxcode{\sphinxupquote{virtualenv}}’s \sphinxcode{\sphinxupquote{-{-}system-site-packages}} option when creating an environment adds all system-wide packages to the virtual environment. However, this breaks the isolation between the virtual environment and the system install. Among other issues it results in hard to debug problems with system packages shadowing the environment packages. If you use \sphinxhref{https://virtualenvwrapper.readthedocs.io/}{virtualenvwrapper}, this can be toggled with the \sphinxcode{\sphinxupquote{toggleglobalsitepackages}} command. \item {} \sphinxhref{https://pypi.python.org/pypi/vext}{vext} allows controlled access from within the virtualenv to specific system-wide packages without the overall shadowing issue. A specific package needs to be installed for each framework, e.g. \sphinxhref{https://pypi.python.org/pypi/vext.pyqt5}{vext.pyqt5}, etc. It is recommended to use \sphinxcode{\sphinxupquote{vext\textgreater{}=0.7.0}} as earlier versions misconfigure the logging system. \end{itemize} If you are using Matplotlib on OSX, you may also want to consider the {\hyperref[\detokenize{faq/osx_framework:osxframework-faq}]{\sphinxcrossref{\DUrole{std,std-ref}{OSX framework FAQ}}}}. \chapter{Working with Matplotlib on OSX} \label{\detokenize{faq/osx_framework:working-with-matplotlib-on-osx}}\label{\detokenize{faq/osx_framework:osxframework-faq}}\label{\detokenize{faq/osx_framework::doc}} \begin{sphinxShadowBox} \sphinxstyletopictitle{Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/osx_framework:id2}}{\hyperref[\detokenize{faq/osx_framework:working-with-matplotlib-on-osx}]{\sphinxcrossref{Working with Matplotlib on OSX}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/osx_framework:id3}}{\hyperref[\detokenize{faq/osx_framework:introduction}]{\sphinxcrossref{Introduction}}} \item {} \phantomsection\label{\detokenize{faq/osx_framework:id4}}{\hyperref[\detokenize{faq/osx_framework:short-version}]{\sphinxcrossref{Short version}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/osx_framework:id5}}{\hyperref[\detokenize{faq/osx_framework:virtualenv}]{\sphinxcrossref{VirtualEnv}}} \item {} \phantomsection\label{\detokenize{faq/osx_framework:id6}}{\hyperref[\detokenize{faq/osx_framework:pyenv}]{\sphinxcrossref{Pyenv}}} \item {} \phantomsection\label{\detokenize{faq/osx_framework:id7}}{\hyperref[\detokenize{faq/osx_framework:conda}]{\sphinxcrossref{Conda}}} \end{itemize} \item {} \phantomsection\label{\detokenize{faq/osx_framework:id8}}{\hyperref[\detokenize{faq/osx_framework:long-version}]{\sphinxcrossref{Long version}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/osx_framework:id9}}{\hyperref[\detokenize{faq/osx_framework:pythonhome-function}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PYTHONHOME}} Function}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{faq/osx_framework:id10}}{\hyperref[\detokenize{faq/osx_framework:pythonhome-and-jupyter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PYTHONHOME}} and Jupyter}}} \item {} \phantomsection\label{\detokenize{faq/osx_framework:id11}}{\hyperref[\detokenize{faq/osx_framework:pythonhome-script}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PYTHONHOME}} Script}}} \end{itemize} \item {} \phantomsection\label{\detokenize{faq/osx_framework:id12}}{\hyperref[\detokenize{faq/osx_framework:pythonw-compiler}]{\sphinxcrossref{PythonW Compiler}}} \end{itemize} \end{itemize} \end{itemize} \end{sphinxShadowBox} \section{Introduction} \label{\detokenize{faq/osx_framework:introduction}}\label{\detokenize{faq/osx_framework:osxframework-introduction}} On OSX, two different types of Python builds exist: a regular build and a framework build. In order to interact correctly with OSX through the native GUI frameworks you need a framework build of Python. At the time of writing the \sphinxcode{\sphinxupquote{macosx}} and \sphinxcode{\sphinxupquote{WXAgg}} backends require a framework build to function correctly. This can result in issues for a Python installation not build as a framework and may also happen in virtual envs and when using (Ana)Conda. From Matplotlib 1.5 onwards, both backends check that a framework build is available and fail if a non framework build is found. Without this check a partially functional figure is created. Among the issues with it is that it is produced in the background and cannot be put in front of any other window. Several solutions and work arounds exist see below. \section{Short version} \label{\detokenize{faq/osx_framework:short-version}} \subsection{VirtualEnv} \label{\detokenize{faq/osx_framework:virtualenv}} If you are on Python 3, use \sphinxhref{https://docs.python.org/3/library/venv.html}{venv} instead of \sphinxhref{https://virtualenv.pypa.io/en/latest/}{virtualenv}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] python \PYGZhy{}m venv my\PYGZhy{}virtualenv \PYG{n+nb}{source} my\PYGZhy{}virtualenv/bin/activate \end{sphinxVerbatim} Otherwise you will need one of the workarounds below. \subsection{Pyenv} \label{\detokenize{faq/osx_framework:pyenv}} If you are using pyenv and virtualenv you can enable your python version to be installed as a framework: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n+nv}{PYTHON\PYGZus{}CONFIGURE\PYGZus{}OPTS}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}\PYGZhy{}\PYGZhy{}enable\PYGZhy{}framework\PYGZdq{}} pyenv install x.x.x \end{sphinxVerbatim} \subsection{Conda} \label{\detokenize{faq/osx_framework:conda}} The default python provided in (Ana)Conda is not a framework build. However, the Conda developers have made it easy to install a framework build in both the main environment and in Conda envs. To use this install python.app \sphinxcode{\sphinxupquote{conda install python.app}} and use \sphinxcode{\sphinxupquote{pythonw}} rather than \sphinxcode{\sphinxupquote{python}} \section{Long version} \label{\detokenize{faq/osx_framework:long-version}} Unfortunately virtualenv creates a non framework build even if created from a framework build of Python. As documented above you can use venv as an alternative on Python 3. The issue has been reported on the virtualenv bug tracker \sphinxhref{https://github.com/pypa/virtualenv/issues/54}{here} and \sphinxhref{https://github.com/pypa/virtualenv/issues/609}{here} Until this is fixed, one of the following workarounds can be used: \subsection{\sphinxstyleliteralintitle{\sphinxupquote{PYTHONHOME}} Function} \label{\detokenize{faq/osx_framework:pythonhome-function}} The best known work around is to use the non virtualenv python along with the PYTHONHOME environment variable. This can be done by defining a function in your \sphinxcode{\sphinxupquote{.bashrc}} using \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{function} frameworkpython \PYG{o}{\PYGZob{}} \PYG{k}{if} \PYG{o}{[}\PYG{o}{[} ! \PYGZhy{}z \PYG{l+s+s2}{\PYGZdq{}}\PYG{n+nv}{\PYGZdl{}VIRTUAL\PYGZus{}ENV}\PYG{l+s+s2}{\PYGZdq{}} \PYG{o}{]}\PYG{o}{]}\PYG{p}{;} \PYG{k}{then} \PYG{n+nv}{PYTHONHOME}\PYG{o}{=}\PYG{n+nv}{\PYGZdl{}VIRTUAL\PYGZus{}ENV} /usr/local/bin/python \PYG{l+s+s2}{\PYGZdq{}}\PYG{n+nv}{\PYGZdl{}@}\PYG{l+s+s2}{\PYGZdq{}} \PYG{k}{else} /usr/local/bin/python \PYG{l+s+s2}{\PYGZdq{}}\PYG{n+nv}{\PYGZdl{}@}\PYG{l+s+s2}{\PYGZdq{}} \PYG{k}{fi} \PYG{o}{\PYGZcb{}} \end{sphinxVerbatim} This function can then be used in all of your virtualenvs without having to fix every single one of them. With this in place you can run \sphinxcode{\sphinxupquote{frameworkpython}} to get an interactive framework build within the virtualenv. To run a script you can do \sphinxcode{\sphinxupquote{frameworkpython test.py}} where \sphinxcode{\sphinxupquote{test.py}} is a script that requires a framework build. To run an interactive \sphinxcode{\sphinxupquote{IPython}} session with the framework build within the virtual environment you can do \sphinxcode{\sphinxupquote{frameworkpython -m IPython}} \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{PYTHONHOME}} and Jupyter} \label{\detokenize{faq/osx_framework:pythonhome-and-jupyter}} This approach can be followed even if using \sphinxhref{https://jupyter.org/}{Jupyter} notebooks: you just need to setup a kernel with the suitable \sphinxcode{\sphinxupquote{PYTHONHOME}} definition. The \sphinxhref{https://github.com/mapio/jupyter-virtualenv-osx}{jupyter-virtualenv-osx} script automates the creation of such a kernel. \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{PYTHONHOME}} Script} \label{\detokenize{faq/osx_framework:pythonhome-script}} An alternative work around borrowed from the \sphinxhref{https://wiki.wxpython.org/wxPythonVirtualenvOnMac}{WX wiki}, is to use the non virtualenv python along with the PYTHONHOME environment variable. This can be implemented in a script as below. To use this modify \sphinxcode{\sphinxupquote{PYVER}} and \sphinxcode{\sphinxupquote{PATHTOPYTHON}} and put the script in the virtualenv bin directory i.e. \sphinxcode{\sphinxupquote{PATHTOVENV/bin/frameworkpython}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+ch}{\PYGZsh{}!/bin/bash} \PYG{c+c1}{\PYGZsh{} what real Python executable to use} \PYG{n+nv}{PYVER}\PYG{o}{=}\PYG{l+m}{2}.7 \PYG{n+nv}{PATHTOPYTHON}\PYG{o}{=}/usr/local/bin/ \PYG{n+nv}{PYTHON}\PYG{o}{=}\PYG{l+s+si}{\PYGZdl{}\PYGZob{}}\PYG{n+nv}{PATHTOPYTHON}\PYG{l+s+si}{\PYGZcb{}}python\PYG{l+s+si}{\PYGZdl{}\PYGZob{}}\PYG{n+nv}{PYVER}\PYG{l+s+si}{\PYGZcb{}} \PYG{c+c1}{\PYGZsh{} find the root of the virtualenv, it should be the parent of the dir this script is in} \PYG{n+nv}{ENV}\PYG{o}{=}\PYG{l+s+sb}{{}`}\PYG{n+nv}{\PYGZdl{}PYTHON} \PYGZhy{}c \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{import os; print(os.path.abspath(os.path.join(os.path.dirname(\PYGZbs{}\PYGZdq{}}\PYG{n+nv}{\PYGZdl{}0}\PYG{l+s+s2}{\PYGZbs{}\PYGZdq{}), \PYGZsq{}..\PYGZsq{})))}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+sb}{{}`} \PYG{c+c1}{\PYGZsh{} now run Python with the virtualenv set as Python\PYGZsq{}s HOME} \PYG{n+nb}{export} \PYG{n+nv}{PYTHONHOME}\PYG{o}{=}\PYG{n+nv}{\PYGZdl{}ENV} \PYG{n+nb}{exec} \PYG{n+nv}{\PYGZdl{}PYTHON} \PYG{l+s+s2}{\PYGZdq{}}\PYG{n+nv}{\PYGZdl{}@}\PYG{l+s+s2}{\PYGZdq{}} \end{sphinxVerbatim} With this in place you can run \sphinxcode{\sphinxupquote{frameworkpython}} as above but will need to add this script to every virtualenv \subsection{PythonW Compiler} \label{\detokenize{faq/osx_framework:pythonw-compiler}} In addition \sphinxhref{https://github.com/gldnspud/virtualenv-pythonw-osx}{virtualenv-pythonw-osx} provides an alternative workaround which may be used to solve the issue. \phantomsection\label{\detokenize{mpl_toolkits/index:toolkits-index}} \part{Toolkits} \label{\detokenize{mpl_toolkits/index:toolkits}}\label{\detokenize{mpl_toolkits/index:toolkits-index}}\label{\detokenize{mpl_toolkits/index:id1}}\label{\detokenize{mpl_toolkits/index::doc}} Toolkits are collections of application-specific functions that extend Matplotlib. \chapter{mplot3d} \label{\detokenize{mpl_toolkits/index:mplot3d}}\label{\detokenize{mpl_toolkits/index:toolkit-mplot3d}} \sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d}} provides some basic 3D plotting (scatter, surf, line, mesh) tools. Not the fastest or most feature complete 3D library out there, but it ships with Matplotlib and thus may be a lighter weight solution for some use cases. Check out the {\hyperref[\detokenize{tutorials/toolkits/mplot3d:sphx-glr-tutorials-toolkits-mplot3d-py}]{\sphinxcrossref{\DUrole{std,std-ref}{mplot3d tutorial}}}} for more information. \begin{figure}[htbp] \centering \capstart \sphinxhref{../gallery/mplot3d/contourf3d\_2.html}{\sphinxincludegraphics[scale=0.5]{{sphx_glr_contourf3d_2_0011}.png}}\caption{Contourf3d 2}\label{\detokenize{mpl_toolkits/index:id2}}\end{figure} \section{mplot3d} \label{\detokenize{mpl_toolkits/mplot3d/index:mplot3d}}\label{\detokenize{mpl_toolkits/mplot3d/index:toolkit-mplot3d-index}}\label{\detokenize{mpl_toolkits/mplot3d/index::doc}} \subsection{Matplotlib mplot3d toolkit} \label{\detokenize{mpl_toolkits/mplot3d/index:matplotlib-mplot3d-toolkit}} The mplot3d toolkit adds simple 3D plotting capabilities to matplotlib by supplying an axes object that can create a 2D projection of a 3D scene. The resulting graph will have the same look and feel as regular 2D plots. See the {\hyperref[\detokenize{tutorials/toolkits/mplot3d:sphx-glr-tutorials-toolkits-mplot3d-py}]{\sphinxcrossref{\DUrole{std,std-ref}{mplot3d tutorial}}}} for more information on how to use this toolkit. \noindent\sphinxincludegraphics{{demo_mplot3d}.png} The interactive backends also provide the ability to rotate and zoom the 3D scene. One can rotate the 3D scene by simply clicking-and-dragging the scene. Zooming is done by right-clicking the scene and dragging the mouse up and down. Note that one does not use the zoom button like one would use for regular 2D plots. \subsubsection{mplot3d FAQ} \label{\detokenize{mpl_toolkits/mplot3d/faq:mplot3d-faq}}\label{\detokenize{mpl_toolkits/mplot3d/faq:toolkit-mplot3d-faq}}\label{\detokenize{mpl_toolkits/mplot3d/faq::doc}} \paragraph{How is mplot3d different from MayaVi?} \label{\detokenize{mpl_toolkits/mplot3d/faq:how-is-mplot3d-different-from-mayavi}} \sphinxhref{http://code.enthought.com/projects/mayavi/documentation.php}{MayaVi2} is a very powerful and featureful 3D graphing library. For advanced 3D scenes and excellent rendering capabilities, it is highly recommended to use MayaVi2. mplot3d was intended to allow users to create simple 3D graphs with the same “look-and-feel” as matplotlib’s 2D plots. Furthermore, users can use the same toolkit that they are already familiar with to generate both their 2D and 3D plots. \paragraph{My 3D plot doesn’t look right at certain viewing angles} \label{\detokenize{mpl_toolkits/mplot3d/faq:my-3d-plot-doesn-t-look-right-at-certain-viewing-angles}} This is probably the most commonly reported issue with mplot3d. The problem is that \textendash{} from some viewing angles \textendash{} a 3D object would appear in front of another object, even though it is physically behind it. This can result in plots that do not look “physically correct.” Unfortunately, while some work is being done to reduce the occurrence of this artifact, it is currently an intractable problem, and can not be fully solved until matplotlib supports 3D graphics rendering at its core. The problem occurs due to the reduction of 3D data down to 2D + z-order scalar. A single value represents the 3rd dimension for all parts of 3D objects in a collection. Therefore, when the bounding boxes of two collections intersect, it becomes possible for this artifact to occur. Furthermore, the intersection of two 3D objects (such as polygons or patches) can not be rendered properly in matplotlib’s 2D rendering engine. This problem will likely not be solved until OpenGL support is added to all of the backends (patches are greatly welcomed). Until then, if you need complex 3D scenes, we recommend using \sphinxhref{http://code.enthought.com/projects/mayavi/documentation.php}{MayaVi}. \paragraph{I don’t like how the 3D plot is laid out, how do I change that?} \label{\detokenize{mpl_toolkits/mplot3d/faq:i-don-t-like-how-the-3d-plot-is-laid-out-how-do-i-change-that}} Historically, mplot3d has suffered from a hard-coding of parameters used to control visuals such as label spacing, tick length, and grid line width. Work is being done to eliminate this issue. For matplotlib v1.1.0, there is a semi-official manner to modify these parameters. See the note in the {\hyperref[\detokenize{api/toolkits/mplot3d:toolkit-mplot3d-axisapi}]{\sphinxcrossref{\DUrole{std,std-ref}{axis3d}}}} section of the mplot3d API documentation for more information. \section{Links} \label{\detokenize{mpl_toolkits/index:links}}\begin{itemize} \item {} mpl3d API: {\hyperref[\detokenize{api/toolkits/mplot3d:toolkit-mplot3d-api}]{\sphinxcrossref{\DUrole{std,std-ref}{mplot3d API}}}} \end{itemize} \chapter{axes\_grid1} \label{\detokenize{mpl_toolkits/index:axes-grid1}}\label{\detokenize{mpl_toolkits/index:toolkit-axes-grid1}} The {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.axes_grid1:module-mpl_toolkits.axes_grid1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mpl\_toolkits.axes\_grid1}}}}} toolkit is a collection of helper classes for displaying multiple axes in Matplotlib. \noindent\sphinxincludegraphics{{demo_axes_grid1}.png} \section{Matplotlib axes\_grid1 Toolkit} \label{\detokenize{mpl_toolkits/axes_grid1/index:matplotlib-axes-grid1-toolkit}}\label{\detokenize{mpl_toolkits/axes_grid1/index:toolkit-axesgrid1-index}}\label{\detokenize{mpl_toolkits/axes_grid1/index::doc}} The matplotlib {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.axes_grid1:module-mpl_toolkits.axes_grid1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mpl\_toolkits.axes\_grid1}}}}} toolkit is a collection of helper classes to ease displaying multiple images in matplotlib. While the aspect parameter in matplotlib adjust the position of the single axes, axesgrid1 toolkit provides a framework to adjust the position of multiple axes according to their aspects. See {\hyperref[\detokenize{tutorials/toolkits/axes_grid:axes-grid1-users-guide-index}]{\sphinxcrossref{\DUrole{std,std-ref}{What is axes\_grid1 toolkit?}}}} for a guide on the usage of axes\_grid1. \noindent\sphinxincludegraphics{{demo_axes_grid}.png} \begin{sphinxadmonition}{note}{Note:} AxesGrid toolkit has been a part of matplotlib since v 0.99. Originally, the toolkit had a single namespace of \sphinxstyleemphasis{axes\_grid}. In more recent version, the toolkit has divided into two separate namespace (\sphinxstyleemphasis{axes\_grid1} and \sphinxstyleemphasis{axisartist}). While \sphinxstyleemphasis{axes\_grid} namespace is maintained for the backward compatibility, use of \sphinxstyleemphasis{axes\_grid1} and \sphinxstyleemphasis{axisartist} is recommended. \end{sphinxadmonition} \chapter{axisartist} \label{\detokenize{mpl_toolkits/index:axisartist}}\label{\detokenize{mpl_toolkits/index:toolkit-axisartist}} The {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.axisartist:module-mpl_toolkits.axisartist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mpl\_toolkits.axisartist}}}}} toolkit contains a custom Axes class that is meant to support curvilinear grids. \section{Matplotlib axisartist Toolkit} \label{\detokenize{mpl_toolkits/axisartist/index:matplotlib-axisartist-toolkit}}\label{\detokenize{mpl_toolkits/axisartist/index:toolkit-axisartist-index}}\label{\detokenize{mpl_toolkits/axisartist/index::doc}} The \sphinxstyleemphasis{axisartist} namespace includes a derived Axes implementation ( \sphinxcode{\sphinxupquote{mpl\_toolkits.axisartist.Axes}}). The biggest difference is that the artists that are responsible for drawing axis lines, ticks, ticklabels, and axis labels are separated out from the mpl’s Axis class. This change was strongly motivated to support curvilinear grid. You can find a tutorial describing usage of axisartist at {\hyperref[\detokenize{tutorials/toolkits/axisartist:axisartist-users-guide-index}]{\sphinxcrossref{\DUrole{std,std-ref}{axisartist}}}}. \section{API} \label{\detokenize{mpl_toolkits/index:api}}\begin{itemize} \item {} Axes Grid and Axis Artist API: {\hyperref[\detokenize{api/toolkits/axes_grid:axes-grid-api-index}]{\sphinxcrossref{\DUrole{std,std-ref}{The Matplotlib axes\_grid Toolkit API}}}} \end{itemize} \part{External Resources} \label{\detokenize{resources/index:external-resources}}\label{\detokenize{resources/index:resources-index}}\label{\detokenize{resources/index::doc}} \chapter{Books, Chapters and Articles} \label{\detokenize{resources/index:books-chapters-and-articles}}\begin{itemize} \item {} \sphinxhref{https://www.packtpub.com/big-data-and-business-intelligence/mastering-matplotlib}{Mastering matplotlib} by Duncan M. McGreggor \item {} \sphinxhref{https://www.packtpub.com/application-development/interactive-applications-using-matplotlib}{Interactive Applications Using Matplotlib} by Benjamin Root \item {} \sphinxhref{https://www.packtpub.com/application-development/matplotlib-python-developers}{Matplotlib for Python Developers} by Sandro Tosi \item {} \sphinxhref{http://www.aosabook.org/en/matplotlib.html}{Matplotlib chapter} by John Hunter and Michael Droettboom in The Architecture of Open Source Applications \item {} \sphinxhref{http://kestrel.nmt.edu/~raymond/software/python\_notes/paper004.html}{Graphics with Matplotlib} by David J. Raymond \item {} \sphinxhref{http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1003833}{Ten Simple Rules for Better Figures} by Nicolas P. Rougier, Michael Droettboom and Philip E. Bourne \item {} \sphinxhref{http://scipython.com/book/chapter-7-matplotlib/}{Learning Scientific Programming with Python chapter 7} by Christian Hill \end{itemize} \chapter{Videos} \label{\detokenize{resources/index:videos}}\begin{itemize} \item {} \sphinxhref{https://www.youtube.com/watch?v=P7SVi0YTIuE}{Plotting with matplotlib} by Mike Müller \item {} \sphinxhref{https://www.youtube.com/watch?v=3Fp1zn5ao2M\&feature=plcp}{Introduction to NumPy and Matplotlib} by Eric Jones \item {} \sphinxhref{https://conference.scipy.org/scipy2013/tutorial\_detail.php?id=103}{Anatomy of Matplotlib} by Benjamin Root \item {} \sphinxhref{http://shop.oreilly.com/product/0636920046592.do}{Data Visualization Basics with Python (O’Reilly)} by Randal S. Olson \end{itemize} \chapter{Tutorials} \label{\detokenize{resources/index:tutorials}}\begin{itemize} \item {} \sphinxhref{http://www.labri.fr/perso/nrougier/teaching/matplotlib/}{Matplotlib tutorial} by Nicolas P. Rougier \item {} \sphinxhref{https://github.com/WeatherGod/AnatomyOfMatplotlib}{Anatomy of Matplotlib - IPython Notebooks} by Benjamin Root \end{itemize} \part{Third party packages} \label{\detokenize{thirdpartypackages/index:third-party-packages}}\label{\detokenize{thirdpartypackages/index:thirdparty-index}}\label{\detokenize{thirdpartypackages/index::doc}} Several external packages that extend or build on Matplotlib functionality are listed below. They are maintained and distributed separately from Matplotlib and thus need to be installed individually. Please submit an issue or pull request on Github if you have created a package that you would like to have included. We are also happy to host third party packages within the \sphinxhref{https://github.com/matplotlib}{Matplotlib Github Organization}. \chapter{Mapping toolkits} \label{\detokenize{thirdpartypackages/index:mapping-toolkits}} \section{Basemap} \label{\detokenize{thirdpartypackages/index:basemap}} \sphinxhref{http://matplotlib.org/basemap}{Basemap} plots data on map projections, with continental and political boundaries. \noindent\sphinxincludegraphics[height=400\sphinxpxdimen]{{basemap_contour1}.png} \section{Cartopy} \label{\detokenize{thirdpartypackages/index:cartopy}} \sphinxhref{http://scitools.org.uk/cartopy/docs/latest}{Cartopy} builds on top of Matplotlib to provide object oriented map projection definitions and close integration with Shapely for powerful yet easy-to-use vector data processing tools. An example plot from the \sphinxhref{http://scitools.org.uk/cartopy/docs/latest/gallery.html}{Cartopy gallery}: \noindent\sphinxincludegraphics[height=400\sphinxpxdimen]{{cartopy_hurricane_katrina_01_00}.png} \chapter{Declarative libraries} \label{\detokenize{thirdpartypackages/index:declarative-libraries}} \section{ggplot} \label{\detokenize{thirdpartypackages/index:ggplot}} \sphinxhref{https://github.com/yhat/ggplot}{ggplot} is a port of the R ggplot2 package to python based on Matplotlib. \noindent\sphinxincludegraphics[height=195\sphinxpxdimen]{{ggplot}.png} \section{holoviews} \label{\detokenize{thirdpartypackages/index:holoviews}} \sphinxhref{http://holoviews.org}{holoviews} makes it easier to visualize data interactively, especially in a \sphinxhref{http://jupyter.org}{Jupyter notebook}, by providing a set of declarative plotting objects that store your data and associated metadata. Your data is then immediately visualizable alongside or overlaid with other data, either statically or with automatically provided widgets for parameter exploration. \noindent\sphinxincludegraphics[height=354\sphinxpxdimen]{{holoviews}.png} \section{plotnine} \label{\detokenize{thirdpartypackages/index:plotnine}} \sphinxhref{https://plotnine.readthedocs.io/en/stable/}{plotnine} implements a grammar of graphics, similar to R’s \sphinxhref{http://ggplot2.org/}{ggplot2}. The grammar allows users to compose plots by explicitly mapping data to the visual objects that make up the plot. \noindent\sphinxincludegraphics{{plotnine}.png} \chapter{Specialty plots} \label{\detokenize{thirdpartypackages/index:specialty-plots}} \section{DeCiDa} \label{\detokenize{thirdpartypackages/index:decida}} \sphinxhref{https://pypi.python.org/pypi/DeCiDa}{DeCiDa} is a library of functions and classes for electron device characterization, electronic circuit design and general data visualization and analysis. \section{Matplotlib-Venn} \label{\detokenize{thirdpartypackages/index:matplotlib-venn}} \sphinxhref{https://github.com/konstantint/matplotlib-venn}{Matplotlib-Venn} provides a set of functions for plotting 2- and 3-set area-weighted (or unweighted) Venn diagrams. \section{mpl-probscale} \label{\detokenize{thirdpartypackages/index:mpl-probscale}} \sphinxhref{http://matplotlib.org/mpl-probscale/}{mpl-probscale} is a small extension that allows Matplotlib users to specify probabilty scales. Simply importing the \sphinxcode{\sphinxupquote{probscale}} module registers the scale with Matplotlib, making it accessible via e.g., \sphinxcode{\sphinxupquote{ax.set\_xscale('prob')}} or \sphinxcode{\sphinxupquote{plt.yscale('prob')}}. \noindent\sphinxincludegraphics{{probscale_demo}.png} \section{mpl-scatter-density} \label{\detokenize{thirdpartypackages/index:mpl-scatter-density}} \sphinxhref{https://github.com/astrofrog/mpl-scatter-density}{mpl-scatter-density} is a small package that makes it easy to make scatter plots of large numbers of points using a density map. The following example contains around 13 million points and the plotting (excluding reading in the data) took less than a second on an average laptop: \noindent\sphinxincludegraphics[height=400\sphinxpxdimen]{{mpl-scatter-density}.png} When used in interactive mode, the density map is downsampled on-the-fly while panning/zooming in order to provide a smooth interactive experience. \section{mplstereonet} \label{\detokenize{thirdpartypackages/index:mplstereonet}} \sphinxhref{https://github.com/joferkington/mplstereonet}{mplstereonet} provides stereonets for plotting and analyzing orientation data in Matplotlib. \section{Natgrid} \label{\detokenize{thirdpartypackages/index:natgrid}} \sphinxhref{https://github.com/matplotlib/natgrid}{mpl\_toolkits.natgrid} is an interface to the natgrid C library for gridding irregularly spaced data. \section{pyUpSet} \label{\detokenize{thirdpartypackages/index:pyupset}} \sphinxhref{https://github.com/ImSoErgodic/py-upset}{pyUpSet} is a static Python implementation of the \sphinxhref{http://www.caleydo.org/tools/upset/}{UpSet suite by Lex et al.} to explore complex intersections of sets and data frames. \section{seaborn} \label{\detokenize{thirdpartypackages/index:seaborn}} \sphinxhref{http://seaborn.pydata.org/}{seaborn} is a high level interface for drawing statistical graphics with Matplotlib. It aims to make visualization a central part of exploring and understanding complex datasets. \noindent\sphinxincludegraphics[height=157\sphinxpxdimen]{{seaborn}.png} \section{WCSAxes} \label{\detokenize{thirdpartypackages/index:wcsaxes}} The \sphinxhref{http://www.astropy.org}{Astropy} core package includes a submodule called WCSAxes (available at \sphinxhref{http://docs.astropy.org/en/stable/visualization/wcsaxes/index.html}{astropy.visualization.wcsaxes}) which adds Matplotlib projections for Astronomical image data. The following is an example of a plot made with WCSAxes which includes the original coordinate system of the image and an overlay of a different coordinate system: \noindent\sphinxincludegraphics[height=400\sphinxpxdimen]{{wcsaxes}.jpg} \section{Windrose} \label{\detokenize{thirdpartypackages/index:windrose}} \sphinxhref{https://github.com/scls19fr/windrose}{Windrose} is a Python Matplotlib, Numpy library to manage wind data, draw windroses (also known as polar rose plots), draw probability density functions and fit Weibull distributions. \chapter{Interactivity} \label{\detokenize{thirdpartypackages/index:interactivity}} \section{mplcursors} \label{\detokenize{thirdpartypackages/index:mplcursors}} \sphinxhref{https://mplcursors.readthedocs.io}{mplcursors} provides interactive data cursors for Matplotlib. \section{MplDataCursor} \label{\detokenize{thirdpartypackages/index:mpldatacursor}} \sphinxhref{https://github.com/joferkington/mpldatacursor}{MplDataCursor} is a toolkit written by Joe Kington to provide interactive “data cursors” (clickable annotation boxes) for Matplotlib. \chapter{Miscellaneous} \label{\detokenize{thirdpartypackages/index:miscellaneous}} \section{adjustText} \label{\detokenize{thirdpartypackages/index:adjusttext}} \sphinxhref{https://github.com/Phlya/adjustText}{adjustText} is a small library for automatically adjusting text position in Matplotlib plots to minimize overlaps between them, specified points and other objects. \noindent\sphinxincludegraphics{{adjustText}.png} \section{iTerm2 terminal backend} \label{\detokenize{thirdpartypackages/index:iterm2-terminal-backend}} \sphinxhref{https://github.com/oselivanov/matplotlib\_iterm2}{matplotlib\_iterm2} is an external Matplotlib backend using the iTerm2 nightly build inline image display feature. \noindent\sphinxincludegraphics{{matplotlib_iterm2_demo}.png} \section{mplcairo} \label{\detokenize{thirdpartypackages/index:mplcairo}} \sphinxhref{https://github.com/anntzer/mplcairo}{mplcairo} is a cairo backend for Matplotlib, with faster and more accurate marker drawing, support for a wider selection of font formats and complex text layout, and various other features. \section{mpl-template} \label{\detokenize{thirdpartypackages/index:mpl-template}} \sphinxhref{https://austinorr.github.io/mpl-template/index.html}{mpl-template} provides a customizable way to add engineering figure elements such as a title block, border, and logo. \noindent\sphinxincludegraphics[height=330\sphinxpxdimen]{{mpl_template_example}.png} \part{The Matplotlib API} \label{\detokenize{api/index:the-matplotlib-api}}\label{\detokenize{api/index:api-index}}\label{\detokenize{api/index::doc}} Below we describe several common approaches to plotting with Matplotlib. \begin{sphinxShadowBox} \sphinxstyletopictitle{Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{api/pyplot_summary:id11}}{\hyperref[\detokenize{api/pyplot_summary:the-pyplot-api}]{\sphinxcrossref{The Pyplot API}}} \item {} \phantomsection\label{\detokenize{api/pyplot_summary:id12}}{\hyperref[\detokenize{api/pyplot_summary:the-object-oriented-api}]{\sphinxcrossref{The Object-Oriented API}}} \item {} \phantomsection\label{\detokenize{api/pyplot_summary:id13}}{\hyperref[\detokenize{api/pyplot_summary:colors-in-matplotlib}]{\sphinxcrossref{Colors in Matplotlib}}} \end{itemize} \end{sphinxShadowBox} \chapter{The Pyplot API} \label{\detokenize{api/pyplot_summary:the-pyplot-api}}\label{\detokenize{api/pyplot_summary::doc}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot}}}}} module contains functions that allow you to generate many kinds of plots quickly. For examples that showcase the use of the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot}}}}} module, see the {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} or the \DUrole{xref,std,std-ref}{pyplots\_examples}. We also recommend that you look into the object-oriented approach to plotting, described below. \index{plotting() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/pyplot_summary:matplotlib.pyplot.plotting}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{plotting}}}{}{}~ \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Function &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Function &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.acorr:matplotlib.pyplot.acorr}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{acorr}}}}} & Plot the autocorrelation of \sphinxstyleemphasis{x}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.angle_spectrum:matplotlib.pyplot.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum}}}}} & Plot the angle spectrum. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.annotate:matplotlib.pyplot.annotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{annotate}}}}} & Annotate the point \sphinxcode{\sphinxupquote{xy}} with text \sphinxcode{\sphinxupquote{s}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.arrow:matplotlib.pyplot.arrow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{arrow}}}}} & Add an arrow to the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.autoscale:matplotlib.pyplot.autoscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{autoscale}}}}} & Autoscale the axis view to the data (toggle). \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axes:matplotlib.pyplot.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axes}}}}} & Add an axes to the current figure and make it the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axhline:matplotlib.pyplot.axhline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axhline}}}}} & Add a horizontal line across the axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axhspan:matplotlib.pyplot.axhspan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axhspan}}}}} & Add a horizontal span (rectangle) across the axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axis:matplotlib.pyplot.axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axis}}}}} & Convenience method to get or set axis properties. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axvline:matplotlib.pyplot.axvline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axvline}}}}} & Add a vertical line across the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axvspan:matplotlib.pyplot.axvspan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axvspan}}}}} & Add a vertical span (rectangle) across the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.bar:matplotlib.pyplot.bar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bar}}}}} & Make a bar plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.barbs:matplotlib.pyplot.barbs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{barbs}}}}} & Plot a 2-D field of barbs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.barh:matplotlib.pyplot.barh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{barh}}}}} & Make a horizontal bar plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.box:matplotlib.pyplot.box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{box}}}}} & Turn the axes box on or off. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.boxplot:matplotlib.pyplot.boxplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{boxplot}}}}} & Make a box and whisker plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.broken_barh:matplotlib.pyplot.broken_barh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{broken\_barh}}}}} & Plot a horizontal sequence of rectangles. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.cla:matplotlib.pyplot.cla}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cla}}}}} & Clear the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.clabel:matplotlib.pyplot.clabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clabel}}}}} & Label a contour plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.clf:matplotlib.pyplot.clf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clf}}}}} & Clear the current figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.clim:matplotlib.pyplot.clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}} & Set the color limits of the current image. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.close:matplotlib.pyplot.close}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{close}}}}} & Close a figure window. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.cohere:matplotlib.pyplot.cohere}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cohere}}}}} & Plot the coherence between \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.colorbar:matplotlib.pyplot.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar}}}}} & Add a colorbar to a plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour}}}}} & Plot contours. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf}}}}} & Plot contours. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.csd:matplotlib.pyplot.csd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{csd}}}}} & Plot the cross-spectral density. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.delaxes:matplotlib.pyplot.delaxes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{delaxes}}}}} & Remove the given \sphinxcode{\sphinxupquote{Axes}} \sphinxstyleemphasis{ax} from the current figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.draw:matplotlib.pyplot.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw}}}}} & Redraw the current figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.errorbar:matplotlib.pyplot.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar}}}}} & Plot y versus x as lines and/or markers with attached errorbars. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.eventplot:matplotlib.pyplot.eventplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{eventplot}}}}} & Plot identical parallel lines at the given positions. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figimage:matplotlib.pyplot.figimage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figimage}}}}} & Adds a non-resampled image to the figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figlegend:matplotlib.pyplot.figlegend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figlegend}}}}} & Place a legend in the figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.fignum_exists:matplotlib.pyplot.fignum_exists}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fignum\_exists}}}}} &\\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figtext:matplotlib.pyplot.figtext}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figtext}}}}} & Add text to figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figure:matplotlib.pyplot.figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & Creates a new figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.fill:matplotlib.pyplot.fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & Plot filled polygons. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.fill_between:matplotlib.pyplot.fill_between}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill\_between}}}}} & Fill the area between two horizontal curves. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.fill_betweenx:matplotlib.pyplot.fill_betweenx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill\_betweenx}}}}} & Fill the area between two vertical curves. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.findobj:matplotlib.pyplot.findobj}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{findobj}}}}} & Find artist objects. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.gca:matplotlib.pyplot.gca}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gca}}}}} & Get the current {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance on the current figure matching the given keyword args, or create one. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.gcf:matplotlib.pyplot.gcf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gcf}}}}} & Get a reference to the current figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.gci:matplotlib.pyplot.gci}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gci}}}}} & Get the current colorable artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.get_figlabels:matplotlib.pyplot.get_figlabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_figlabels}}}}} & Return a list of existing figure labels. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.get_fignums:matplotlib.pyplot.get_fignums}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_fignums}}}}} & Return a list of existing figure numbers. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.grid:matplotlib.pyplot.grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{grid}}}}} & Turn the axes grids on or off. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hexbin:matplotlib.pyplot.hexbin}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hexbin}}}}} & Make a hexagonal binning plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hist:matplotlib.pyplot.hist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hist}}}}} & Plot a histogram. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hist2d:matplotlib.pyplot.hist2d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hist2d}}}}} & Make a 2D histogram plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hlines:matplotlib.pyplot.hlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hlines}}}}} & Plot horizontal lines at each \sphinxstyleemphasis{y} from \sphinxstyleemphasis{xmin} to \sphinxstyleemphasis{xmax}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hold:matplotlib.pyplot.hold}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hold}}}}} &\\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imread:matplotlib.pyplot.imread}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imread}}}}} & Read an image from a file into an array. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imsave:matplotlib.pyplot.imsave}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imsave}}}}} & Save an array as in image file. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow}}}}} & Display an image on the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.install_repl_displayhook:matplotlib.pyplot.install_repl_displayhook}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{install\_repl\_displayhook}}}}} & Install a repl display hook so that any stale figure are automatically redrawn when control is returned to the repl. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ioff:matplotlib.pyplot.ioff}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ioff}}}}} & Turn interactive mode off. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ion:matplotlib.pyplot.ion}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ion}}}}} & Turn interactive mode on. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ishold:matplotlib.pyplot.ishold}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ishold}}}}} &\\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.isinteractive:matplotlib.pyplot.isinteractive}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{isinteractive}}}}} & Return status of interactive mode. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.legend:matplotlib.pyplot.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend}}}}} & Places a legend on the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.locator_params:matplotlib.pyplot.locator_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{locator\_params}}}}} & Control behavior of tick locators. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.loglog:matplotlib.pyplot.loglog}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{loglog}}}}} & Make a plot with log scaling on both the x and y axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.magnitude_spectrum:matplotlib.pyplot.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum}}}}} & Plot the magnitude spectrum. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.margins:matplotlib.pyplot.margins}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{margins}}}}} & Set or retrieve autoscaling margins. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.matshow:matplotlib.pyplot.matshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matshow}}}}} & Display an array as a matrix in a new figure window. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.minorticks_off:matplotlib.pyplot.minorticks_off}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{minorticks\_off}}}}} & Remove minor ticks from the current plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.minorticks_on:matplotlib.pyplot.minorticks_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{minorticks\_on}}}}} & Display minor ticks on the current plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.over:matplotlib.pyplot.over}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{over}}}}} &\\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pause:matplotlib.pyplot.pause}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pause}}}}} & Pause for \sphinxstyleemphasis{interval} seconds. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:matplotlib.pyplot.pcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolor}}}}} & Create a pseudocolor plot of a 2-D array. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolormesh:matplotlib.pyplot.pcolormesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolormesh}}}}} & Plot a quadrilateral mesh. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.phase_spectrum:matplotlib.pyplot.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum}}}}} & Plot the phase spectrum. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pie:matplotlib.pyplot.pie}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pie}}}}} & Plot a pie chart. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} & Plot y versus x as lines and/or markers. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot_date:matplotlib.pyplot.plot_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot\_date}}}}} & Plot data that contains dates. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plotfile:matplotlib.pyplot.plotfile}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plotfile}}}}} & Plot the data in a file. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.polar:matplotlib.pyplot.polar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{polar}}}}} & Make a polar plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.psd:matplotlib.pyplot.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd}}}}} & Plot the power spectral density. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.quiver:matplotlib.pyplot.quiver}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{quiver}}}}} & Plot a 2-D field of arrows. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.quiverkey:matplotlib.pyplot.quiverkey}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{quiverkey}}}}} & Add a key to a quiver plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.rc:matplotlib.pyplot.rc}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rc}}}}} & Set the current rc params. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.rc_context:matplotlib.pyplot.rc_context}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rc\_context}}}}} & Return a context manager for managing rc settings. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.rcdefaults:matplotlib.pyplot.rcdefaults}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rcdefaults}}}}} & Restore the rc params from Matplotlib’s internal defaults. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.rgrids:matplotlib.pyplot.rgrids}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rgrids}}}}} & Get or set the radial gridlines on a polar plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.savefig:matplotlib.pyplot.savefig}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{savefig}}}}} & Save the current figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.sca:matplotlib.pyplot.sca}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sca}}}}} & Set the current Axes instance to \sphinxstyleemphasis{ax}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.scatter:matplotlib.pyplot.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter}}}}} & A scatter plot of \sphinxstyleemphasis{y} vs \sphinxstyleemphasis{x} with varying marker size and/or color. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.sci:matplotlib.pyplot.sci}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sci}}}}} & Set the current image. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.semilogx:matplotlib.pyplot.semilogx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{semilogx}}}}} & Make a plot with log scaling on the x axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.semilogy:matplotlib.pyplot.semilogy}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{semilogy}}}}} & Make a plot with log scaling on the y axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.set_cmap:matplotlib.pyplot.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_cmap}}}}} & Set the default colormap. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.setp:matplotlib.pyplot.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setp}}}}} & Set a property on an artist object. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.show:matplotlib.pyplot.show}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{show}}}}} & Display a figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.specgram:matplotlib.pyplot.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram}}}}} & Plot a spectrogram. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.spectral:matplotlib.pyplot.spectral}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{spectral}}}}} & Set the colormap to “spectral”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.spy:matplotlib.pyplot.spy}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{spy}}}}} & Plot the sparsity pattern on a 2-D array. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.stackplot:matplotlib.pyplot.stackplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stackplot}}}}} & Draws a stacked area plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.stem:matplotlib.pyplot.stem}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stem}}}}} & Create a stem plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.step:matplotlib.pyplot.step}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step}}}}} & Make a step plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.streamplot:matplotlib.pyplot.streamplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{streamplot}}}}} & Draws streamlines of a vector flow. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot:matplotlib.pyplot.subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot}}}}} & Return a subplot axes at the given grid position. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot2grid:matplotlib.pyplot.subplot2grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot2grid}}}}} & Create an axis at specific location inside a regular grid. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot_tool:matplotlib.pyplot.subplot_tool}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot\_tool}}}}} & Launch a subplot tool window for a figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots:matplotlib.pyplot.subplots}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots}}}}} & Create a figure and a set of subplots This utility wrapper makes it convenient to create common layouts of subplots, including the enclosing figure object, in a single call. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots_adjust:matplotlib.pyplot.subplots_adjust}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots\_adjust}}}}} & Tune the subplot layout. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.suptitle:matplotlib.pyplot.suptitle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{suptitle}}}}} & Add a centered title to the figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.switch_backend:matplotlib.pyplot.switch_backend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{switch\_backend}}}}} & Switch the default backend. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.table:matplotlib.pyplot.table}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{table}}}}} & Add a table to the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.text:matplotlib.pyplot.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text}}}}} & Add text to the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.thetagrids:matplotlib.pyplot.thetagrids}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{thetagrids}}}}} & Get or set the theta locations of the gridlines in a polar plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tick_params:matplotlib.pyplot.tick_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tick\_params}}}}} & Change the appearance of ticks, tick labels, and gridlines. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ticklabel_format:matplotlib.pyplot.ticklabel_format}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ticklabel\_format}}}}} & Change the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarFormatter}}}}} used by default for linear axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tight_layout:matplotlib.pyplot.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout}}}}} & Automatically adjust subplot parameters to give specified padding. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.title:matplotlib.pyplot.title}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{title}}}}} & Set a title of the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tricontour:matplotlib.pyplot.tricontour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tricontour}}}}} & Draw contours on an unstructured triangular grid. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tricontourf:matplotlib.pyplot.tricontourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tricontourf}}}}} & Draw contours on an unstructured triangular grid. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tripcolor:matplotlib.pyplot.tripcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tripcolor}}}}} & Create a pseudocolor plot of an unstructured triangular grid. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.triplot:matplotlib.pyplot.triplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{triplot}}}}} & Draw a unstructured triangular grid as lines and/or markers. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.twinx:matplotlib.pyplot.twinx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{twinx}}}}} & Make a second axes that shares the \sphinxstyleemphasis{x}-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.twiny:matplotlib.pyplot.twiny}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{twiny}}}}} & Make a second axes that shares the \sphinxstyleemphasis{y}-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.uninstall_repl_displayhook:matplotlib.pyplot.uninstall_repl_displayhook}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{uninstall\_repl\_displayhook}}}}} & Uninstalls the matplotlib display hook. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.violinplot:matplotlib.pyplot.violinplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{violinplot}}}}} & Make a violin plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.vlines:matplotlib.pyplot.vlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{vlines}}}}} & Plot vertical lines. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xcorr:matplotlib.pyplot.xcorr}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xcorr}}}}} & Plot the cross correlation between \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xkcd:matplotlib.pyplot.xkcd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xkcd}}}}} & Turns on \sphinxhref{https://xkcd.com/}{xkcd} sketch-style drawing mode. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xlabel:matplotlib.pyplot.xlabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xlabel}}}}} & Set the x-axis label of the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xlim:matplotlib.pyplot.xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xlim}}}}} & Get or set the x limits of the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xscale:matplotlib.pyplot.xscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xscale}}}}} & Set the scaling of the x-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xticks:matplotlib.pyplot.xticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xticks}}}}} & Get or set the current tick locations and labels of the x-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ylabel:matplotlib.pyplot.ylabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ylabel}}}}} & Set the y-axis label of the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ylim:matplotlib.pyplot.ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ylim}}}}} & Get or set the y-limits of the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.yscale:matplotlib.pyplot.yscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{yscale}}}}} & Set the scaling of the y-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.yticks:matplotlib.pyplot.yticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{yticks}}}}} & Get or set the current tick locations and labels of the y-axis. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{fulllineitems} \chapter{The Object-Oriented API} \label{\detokenize{api/pyplot_summary:the-object-oriented-api}} Most of these functions also exist as methods in the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} class. You can use them with the “Object Oriented” approach to Matplotlib. While it is easy to quickly generate plots with the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot}}}}} module, we recommend using the object-oriented approach for more control and customization of your plots. See the methods in the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes()}}}}} class for many of the same plotting functions. For examples of the OO approach to Matplotlib, see the \DUrole{xref,std,std-ref}{API Examples}. \chapter{Colors in Matplotlib} \label{\detokenize{api/pyplot_summary:colors-in-matplotlib}} There are many colormaps you can use to map data onto color values. Below we list several ways in which color can be utilized in Matplotlib. For a more in-depth look at colormaps, see the {\hyperref[\detokenize{tutorials/colors/colormaps:sphx-glr-tutorials-colors-colormaps-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Colormaps in Matplotlib}}}} tutorial. \index{colormaps() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/pyplot_summary:matplotlib.pyplot.colormaps}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{colormaps}}}{}{} Matplotlib provides a number of colormaps, and others can be added using {\hyperref[\detokenize{api/cm_api:matplotlib.cm.register_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{register\_cmap()}}}}}. This function documents the built-in colormaps, and will also return a list of all registered colormaps if called. You can set the colormap for an image, pcolor, scatter, etc, using a keyword argument: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{imshow}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{n}{cm}\PYG{o}{.}\PYG{n}{hot}\PYG{p}{)} \end{sphinxVerbatim} or using the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.set_cmap:matplotlib.pyplot.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_cmap()}}}}} function: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{imshow}\PYG{p}{(}\PYG{n}{X}\PYG{p}{)} \PYG{n}{pyplot}\PYG{o}{.}\PYG{n}{set\PYGZus{}cmap}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{hot}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{pyplot}\PYG{o}{.}\PYG{n}{set\PYGZus{}cmap}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{jet}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} In interactive mode, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.set_cmap:matplotlib.pyplot.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_cmap()}}}}} will update the colormap post-hoc, allowing you to see which one works best for your data. All built-in colormaps can be reversed by appending \sphinxcode{\sphinxupquote{\_r}}: For instance, \sphinxcode{\sphinxupquote{gray\_r}} is the reverse of \sphinxcode{\sphinxupquote{gray}}. There are several common color schemes used in visualization: \begin{description} \item[{Sequential schemes}] \leavevmode for unipolar data that progresses from low to high \item[{Diverging schemes}] \leavevmode for bipolar data that emphasizes positive or negative deviations from a central value \item[{Cyclic schemes}] \leavevmode meant for plotting values that wrap around at the endpoints, such as phase angle, wind direction, or time of day \item[{Qualitative schemes}] \leavevmode for nominal data that has no inherent ordering, where color is used only to distinguish categories \end{description} Matplotlib ships with 4 perceptually uniform color maps which are the recommended color maps for sequential data: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Colormap &\sphinxstyletheadfamily Description \\ \hline inferno & perceptually uniform shades of black-red-yellow \\ \hline magma & perceptually uniform shades of black-red-white \\ \hline plasma & perceptually uniform shades of blue-red-yellow \\ \hline viridis & perceptually uniform shades of blue-green-yellow \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} The following colormaps are based on the \sphinxhref{http://colorbrewer2.org}{ColorBrewer} color specifications and designs developed by Cynthia Brewer: ColorBrewer Diverging (luminance is highest at the midpoint, and decreases towards differently-colored endpoints): \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Colormap &\sphinxstyletheadfamily Description \\ \hline BrBG & brown, white, blue-green \\ \hline PiYG & pink, white, yellow-green \\ \hline PRGn & purple, white, green \\ \hline PuOr & orange, white, purple \\ \hline RdBu & red, white, blue \\ \hline RdGy & red, white, gray \\ \hline RdYlBu & red, yellow, blue \\ \hline RdYlGn & red, yellow, green \\ \hline Spectral & red, orange, yellow, green, blue \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} ColorBrewer Sequential (luminance decreases monotonically): \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Colormap &\sphinxstyletheadfamily Description \\ \hline Blues & white to dark blue \\ \hline BuGn & white, light blue, dark green \\ \hline BuPu & white, light blue, dark purple \\ \hline GnBu & white, light green, dark blue \\ \hline Greens & white to dark green \\ \hline Greys & white to black (not linear) \\ \hline Oranges & white, orange, dark brown \\ \hline OrRd & white, orange, dark red \\ \hline PuBu & white, light purple, dark blue \\ \hline PuBuGn & white, light purple, dark green \\ \hline PuRd & white, light purple, dark red \\ \hline Purples & white to dark purple \\ \hline RdPu & white, pink, dark purple \\ \hline Reds & white to dark red \\ \hline YlGn & light yellow, dark green \\ \hline YlGnBu & light yellow, light green, dark blue \\ \hline YlOrBr & light yellow, orange, dark brown \\ \hline YlOrRd & light yellow, orange, dark red \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} ColorBrewer Qualitative: (For plotting nominal data, \sphinxcode{\sphinxupquote{ListedColormap}} is used, not \sphinxcode{\sphinxupquote{LinearSegmentedColormap}}. Different sets of colors are recommended for different numbers of categories.) \begin{itemize} \item {} Accent \item {} Dark2 \item {} Paired \item {} Pastel1 \item {} Pastel2 \item {} Set1 \item {} Set2 \item {} Set3 \end{itemize} A set of colormaps derived from those of the same name provided with Matlab are also included: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Colormap &\sphinxstyletheadfamily Description \\ \hline autumn & sequential linearly-increasing shades of red-orange-yellow \\ \hline bone & sequential increasing black-white color map with a tinge of blue, to emulate X-ray film \\ \hline cool & linearly-decreasing shades of cyan-magenta \\ \hline copper & sequential increasing shades of black-copper \\ \hline flag & repetitive red-white-blue-black pattern (not cyclic at endpoints) \\ \hline gray & sequential linearly-increasing black-to-white grayscale \\ \hline hot & sequential black-red-yellow-white, to emulate blackbody radiation from an object at increasing temperatures \\ \hline hsv & cyclic red-yellow-green-cyan-blue-magenta-red, formed by changing the hue component in the HSV color space \\ \hline jet & a spectral map with dark endpoints, blue-cyan-yellow-red; based on a fluid-jet simulation by NCSA % \begin{footnote}[1]\sphinxAtStartFootnote Rainbow colormaps, \sphinxcode{\sphinxupquote{jet}} in particular, are considered a poor choice for scientific visualization by many researchers: \sphinxhref{http://ieeexplore.ieee.org/document/4118486/?arnumber=4118486}{Rainbow Color Map (Still) Considered Harmful} % \end{footnote} \\ \hline pink & sequential increasing pastel black-pink-white, meant for sepia tone colorization of photographs \\ \hline prism & repetitive red-yellow-green-blue-purple-…-green pattern (not cyclic at endpoints) \\ \hline spring & linearly-increasing shades of magenta-yellow \\ \hline summer & sequential linearly-increasing shades of green-yellow \\ \hline winter & linearly-increasing shades of blue-green \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} A set of palettes from the \sphinxhref{https://dhmunro.github.io/yorick-doc/}{Yorick scientific visualisation package}, an evolution of the GIST package, both by David H. Munro are included: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Colormap &\sphinxstyletheadfamily Description \\ \hline gist\_earth & mapmaker’s colors from dark blue deep ocean to green lowlands to brown highlands to white mountains \\ \hline gist\_heat & sequential increasing black-red-orange-white, to emulate blackbody radiation from an iron bar as it grows hotter \\ \hline gist\_ncar & pseudo-spectral black-blue-green-yellow-red-purple-white colormap from National Center for Atmospheric Research % \begin{footnote}[2]\sphinxAtStartFootnote Resembles “BkBlAqGrYeOrReViWh200” from NCAR Command Language. See \sphinxhref{https://www.ncl.ucar.edu/Document/Graphics/color\_table\_gallery.shtml}{Color Table Gallery} % \end{footnote} \\ \hline gist\_rainbow & runs through the colors in spectral order from red to violet at full saturation (like \sphinxstyleemphasis{hsv} but not cyclic) \\ \hline gist\_stern & “Stern special” color table from Interactive Data Language software \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} Other miscellaneous schemes: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Colormap &\sphinxstyletheadfamily Description \\ \hline afmhot & sequential black-orange-yellow-white blackbody spectrum, commonly used in atomic force microscopy \\ \hline brg & blue-red-green \\ \hline bwr & diverging blue-white-red \\ \hline coolwarm & diverging blue-gray-red, meant to avoid issues with 3D shading, color blindness, and ordering of colors % \begin{footnote}[3]\sphinxAtStartFootnote See \sphinxhref{http://www.kennethmoreland.com/color-maps/}{Diverging Color Maps for Scientific Visualization} by Kenneth Moreland. % \end{footnote} \\ \hline CMRmap & “Default colormaps on color images often reproduce to confusing grayscale images. The proposed colormap maintains an aesthetically pleasing color image that automatically reproduces to a monotonic grayscale with discrete, quantifiable saturation levels.” % \begin{footnote}[4]\sphinxAtStartFootnote See \sphinxhref{https://www.mathworks.com/matlabcentral/fileexchange/2662-cmrmap-m}{A Color Map for Effective Black-and-White Rendering of Color-Scale Images} by Carey Rappaport % \end{footnote} \\ \hline cubehelix & Unlike most other color schemes cubehelix was designed by D.A. Green to be monotonically increasing in terms of perceived brightness. Also, when printed on a black and white postscript printer, the scheme results in a greyscale with monotonically increasing brightness. This color scheme is named cubehelix because the r,g,b values produced can be visualised as a squashed helix around the diagonal in the r,g,b color cube. \\ \hline gnuplot & gnuplot’s traditional pm3d scheme (black-blue-red-yellow) \\ \hline gnuplot2 & sequential color printable as gray (black-blue-violet-yellow-white) \\ \hline ocean & green-blue-white \\ \hline rainbow & spectral purple-blue-green-yellow-orange-red colormap with diverging luminance \\ \hline seismic & diverging blue-white-red \\ \hline nipy\_spectral & black-purple-blue-green-yellow-red-white spectrum, originally from the Neuroimaging in Python project \\ \hline terrain & mapmaker’s colors, blue-green-yellow-brown-white, originally from IGOR Pro \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} The following colormaps are redundant and may be removed in future versions. It’s recommended to use the names in the descriptions instead, which produce identical output: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Colormap &\sphinxstyletheadfamily Description \\ \hline gist\_gray & identical to \sphinxstyleemphasis{gray} \\ \hline gist\_yarg & identical to \sphinxstyleemphasis{gray\_r} \\ \hline binary & identical to \sphinxstyleemphasis{gray\_r} \\ \hline spectral & identical to \sphinxstyleemphasis{nipy\_spectral} % \begin{footnote}[5]\sphinxAtStartFootnote Changed to distinguish from ColorBrewer’s \sphinxstyleemphasis{Spectral} map. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.spectral:matplotlib.pyplot.spectral}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{spectral()}}}}} still works, but \sphinxcode{\sphinxupquote{set\_cmap('nipy\_spectral')}} is recommended for clarity. % \end{footnote} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \end{fulllineitems} \chapter{API Changes} \label{\detokenize{api/api_changes:api-changes}}\label{\detokenize{api/api_changes::doc}} Log of changes to Matplotlib that affect the outward-facing API. If updating Matplotlib breaks your scripts, this list may help you figure out what caused the breakage and how to fix it by updating your code. For new features that were added to Matplotlib, please see {\hyperref[\detokenize{users/whats_new:whats-new}]{\sphinxcrossref{\DUrole{std,std-ref}{What’s new in Matplotlib}}}}. \section{API Changes in 2.2.0} \label{\detokenize{api/api_changes:api-changes-in-2-2-0}} \subsection{New dependency} \label{\detokenize{api/api_changes:new-dependency}} \sphinxhref{https://github.com/nucleic/kiwi}{kiwisolver} is now a required dependency to support the new constrained\_layout, see {\hyperref[\detokenize{tutorials/intermediate/constrainedlayout_guide:sphx-glr-tutorials-intermediate-constrainedlayout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Constrained Layout Guide}}}} for more details. \subsection{Deprecations} \label{\detokenize{api/api_changes:deprecations}} \subsubsection{Classes, functions, and methods} \label{\detokenize{api/api_changes:classes-functions-and-methods}} The unused and untested \sphinxcode{\sphinxupquote{Artist.onRemove}} and \sphinxcode{\sphinxupquote{Artist.hitlist}} methods have been deprecated. The now unused \sphinxcode{\sphinxupquote{mlab.less\_simple\_linear\_interpolation}} function is deprecated. The unused \sphinxcode{\sphinxupquote{ContourLabeler.get\_real\_label\_width}} method is deprecated. The unused \sphinxcode{\sphinxupquote{FigureManagerBase.show\_popup}} method is deprecated. This introduced in e945059b327d42a99938b939a1be867fa023e7ba in 2005 but never built out into any of the backends. \sphinxcode{\sphinxupquote{backend\_tkagg.AxisMenu}} is deprecated, as it has become unused since the removal of “classic” toolbars. \subsubsection{Changed function signatures} \label{\detokenize{api/api_changes:changed-function-signatures}} kwarg \sphinxcode{\sphinxupquote{fig}} to {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec.get_subplot_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpec.get\_subplot\_params}}}}} is deprecated, use \sphinxcode{\sphinxupquote{figure}} instead. Using {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axes:matplotlib.pyplot.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pyplot.axes}}}}} with an {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} as argument is deprecated. This sets the current axes, i.e. it has the same effect as {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.sca:matplotlib.pyplot.sca}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pyplot.sca}}}}}. For clarity \sphinxcode{\sphinxupquote{plt.sca(ax)}} should be preferred over \sphinxcode{\sphinxupquote{plt.axes(ax)}}. Using strings instead of booleans to control grid and tick visibility is deprecated. Using \sphinxcode{\sphinxupquote{"on"}}, \sphinxcode{\sphinxupquote{"off"}}, \sphinxcode{\sphinxupquote{"true"}}, or \sphinxcode{\sphinxupquote{"false"}} to control grid and tick visibility has been deprecated. Instead, use normal booleans (\sphinxcode{\sphinxupquote{True}}/\sphinxcode{\sphinxupquote{False}}) or boolean-likes. In the future, all non-empty strings may be interpreted as \sphinxcode{\sphinxupquote{True}}. When given 2D inputs with non-matching numbers of columns, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} currently cycles through the columns of the narrower input, until all the columns of the wider input have been plotted. This behavior is deprecated; in the future, only broadcasting (1 column to \sphinxstyleemphasis{n} columns) will be performed. \subsubsection{rcparams} \label{\detokenize{api/api_changes:rcparams}} The \sphinxcode{\sphinxupquote{rcParams{[}"backend.qt4"{]}}} and \sphinxcode{\sphinxupquote{rcParams{[}"backend.qt5"{]}}} rcParams were deprecated in version 2.2. In order to force the use of a specific Qt binding, either import that binding first, or set the \sphinxcode{\sphinxupquote{QT\_API}} environment variable. Deprecation of the \sphinxcode{\sphinxupquote{nbagg.transparent}} rcParam. To control transparency of figure patches in the nbagg (or any other) backend, directly set \sphinxcode{\sphinxupquote{figure.patch.facecolor}}, or the \sphinxcode{\sphinxupquote{figure.facecolor}} rcParam. \subsubsection{Deprecated \sphinxstyleliteralintitle{\sphinxupquote{Axis.unit\_data}}} \label{\detokenize{api/api_changes:deprecated-axis-unit-data}} Use \sphinxcode{\sphinxupquote{Axis.units}} (which has long existed) instead. \subsection{Removals} \label{\detokenize{api/api_changes:removals}} \subsubsection{Function Signatures} \label{\detokenize{api/api_changes:function-signatures}} Contouring no longer supports \sphinxcode{\sphinxupquote{legacy}} corner masking. The deprecated \sphinxcode{\sphinxupquote{ContourSet.vmin}} and \sphinxcode{\sphinxupquote{ContourSet.vmax}} properties have been removed. Passing \sphinxcode{\sphinxupquote{None}} instead of \sphinxcode{\sphinxupquote{"none"}} as format to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.errorbar:matplotlib.axes.Axes.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar}}}}} is no longer supported. The \sphinxcode{\sphinxupquote{bgcolor}} keyword argument to \sphinxcode{\sphinxupquote{Axes}} has been removed. \subsubsection{Modules, methods, and functions} \label{\detokenize{api/api_changes:modules-methods-and-functions}} The \sphinxcode{\sphinxupquote{matplotlib.finance}}, \sphinxcode{\sphinxupquote{mpl\_toolkits.exceltools}} and \sphinxcode{\sphinxupquote{mpl\_toolkits.gtktools}} modules have been removed. \sphinxcode{\sphinxupquote{matplotlib.finance}} remains available at \sphinxurl{https://github.com/matplotlib/mpl\_finance}. The \sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.iscolor}} function has been removed. The \sphinxcode{\sphinxupquote{Axes.get\_axis\_bgcolor}}, \sphinxcode{\sphinxupquote{Axes.set\_axis\_bgcolor}}, \sphinxcode{\sphinxupquote{Bbox.update\_from\_data}}, \sphinxcode{\sphinxupquote{Bbox.update\_datalim\_numerix}}, \sphinxcode{\sphinxupquote{MaxNLocator.bin\_boundaries}} methods have been removed. \sphinxcode{\sphinxupquote{mencoder}} can no longer be used to encode animations. The unused \sphinxcode{\sphinxupquote{FONT\_SCALE}} and \sphinxcode{\sphinxupquote{fontd}} attributes of the \sphinxcode{\sphinxupquote{RendererSVG}} class have been removed. \subsubsection{color maps} \label{\detokenize{api/api_changes:color-maps}} The \sphinxcode{\sphinxupquote{spectral}} colormap has been removed. The \sphinxcode{\sphinxupquote{Vega*}} colormaps, which were aliases for the \sphinxcode{\sphinxupquote{tab*}} colormaps, have been removed. \subsubsection{rcparams} \label{\detokenize{api/api_changes:id1}} The following deprecated rcParams have been removed: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{axes.color\_cycle}} (see \sphinxcode{\sphinxupquote{axes.prop\_cycle}}), \item {} \sphinxcode{\sphinxupquote{legend.isaxes}}, \item {} \sphinxcode{\sphinxupquote{svg.embed\_char\_paths}} (see \sphinxcode{\sphinxupquote{svg.fonttype}}), \item {} \sphinxcode{\sphinxupquote{text.fontstyle}}, \sphinxcode{\sphinxupquote{text.fontangle}}, \sphinxcode{\sphinxupquote{text.fontvariant}}, \sphinxcode{\sphinxupquote{text.fontweight}}, \sphinxcode{\sphinxupquote{text.fontsize}} (renamed to \sphinxcode{\sphinxupquote{text.style}}, etc.), \item {} \sphinxcode{\sphinxupquote{tick.size}} (renamed to \sphinxcode{\sphinxupquote{tick.major.size}}). \end{itemize} \subsection{Only accept string-like for Categorical input} \label{\detokenize{api/api_changes:only-accept-string-like-for-categorical-input}} Do not accept mixed string / float / int input, only strings are valid categoricals. \subsection{Removal of unused imports} \label{\detokenize{api/api_changes:removal-of-unused-imports}} Many unused imports were removed from the codebase. As a result, trying to import certain classes or functions from the “wrong” module (e.g. {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} from {\hyperref[\detokenize{api/backend_agg_api:module-matplotlib.backends.backend_agg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_agg}}}}} instead of {\hyperref[\detokenize{api/figure_api:module-matplotlib.figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure}}}}}) will now raise an \sphinxhref{https://docs.python.org/3/library/exceptions.html\#ImportError}{\sphinxcode{\sphinxupquote{ImportError}}}. \subsection{\sphinxstyleliteralintitle{\sphinxupquote{Axes3D.get\_xlim}}, \sphinxstyleliteralintitle{\sphinxupquote{get\_ylim}} and \sphinxstyleliteralintitle{\sphinxupquote{get\_zlim}} now return a tuple} \label{\detokenize{api/api_changes:axes3d-get-xlim-get-ylim-and-get-zlim-now-return-a-tuple}} They previously returned an array. Returning a tuple is consistent with the behavior for 2D axes. \subsection{Exception type changes} \label{\detokenize{api/api_changes:exception-type-changes}} If \sphinxcode{\sphinxupquote{MovieWriterRegistry}} can’t find the requested \sphinxcode{\sphinxupquote{MovieWriter}}, a more helpful \sphinxhref{https://docs.python.org/3/library/exceptions.html\#RuntimeError}{\sphinxcode{\sphinxupquote{RuntimeError}}} message is now raised instead of the previously raised \sphinxhref{https://docs.python.org/3/library/exceptions.html\#KeyError}{\sphinxcode{\sphinxupquote{KeyError}}}. {\hyperref[\detokenize{api/tight_layout_api:matplotlib.tight_layout.auto_adjust_subplotpars}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{auto\_adjust\_subplotpars}}}}} now raises \sphinxhref{https://docs.python.org/3/library/exceptions.html\#ValueError}{\sphinxcode{\sphinxupquote{ValueError}}} instead of \sphinxhref{https://docs.python.org/3/library/exceptions.html\#RuntimeError}{\sphinxcode{\sphinxupquote{RuntimeError}}} when sizes of input lists don’t match \subsection{\sphinxstyleliteralintitle{\sphinxupquote{Figure.set\_figwidth}} and \sphinxstyleliteralintitle{\sphinxupquote{Figure.set\_figheight}} default forward to True} \label{\detokenize{api/api_changes:figure-set-figwidth-and-figure-set-figheight-default-forward-to-true}} \sphinxcode{\sphinxupquote{matplotlib.Figure.set\_figwidth}} and \sphinxcode{\sphinxupquote{matplotlib.Figure.set\_figheight}} had the kwarg \sphinxcode{\sphinxupquote{forward=False}} by default, but \sphinxcode{\sphinxupquote{Figure.set\_size\_inches}} now defaults to \sphinxcode{\sphinxupquote{forward=True}}. This makes these functions conistent. \subsection{Do not truncate svg sizes to nearest point} \label{\detokenize{api/api_changes:do-not-truncate-svg-sizes-to-nearest-point}} There is no reason to size the SVG out put in integer points, change to out putting floats for the \sphinxstyleemphasis{height}, \sphinxstyleemphasis{width}, and \sphinxstyleemphasis{viewBox} attributes of the \sphinxstyleemphasis{svg} element. \subsection{Fontsizes less than 1 pt are clipped to be 1 pt.} \label{\detokenize{api/api_changes:fontsizes-less-than-1-pt-are-clipped-to-be-1-pt}} FreeType doesn’t allow fonts to get smaller than 1 pt, so all Agg backends were silently rounding up to 1 pt. PDF (other vector backends?) were letting us write fonts that were less than 1 pt, but they could not be placed properly because position information comes from FreeType. This change makes it so no backends can use fonts smaller than 1 pt, consistent with FreeType and ensuring more consistent results across backends. \subsection{Changes to Qt backend class MRO} \label{\detokenize{api/api_changes:changes-to-qt-backend-class-mro}} To support both Agg and cairo rendering for Qt backends all of the non-Agg specific code previously in {\hyperref[\detokenize{api/backend_qt5agg_api:matplotlib.backends.backend_qt5agg.FigureCanvasQTAggBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{backend\_qt5agg.FigureCanvasQTAggBase}}}}} has been moved to \sphinxcode{\sphinxupquote{backend\_qt5.FigureCanvasQT}} so it can be shared with the cairo implementation. The \sphinxcode{\sphinxupquote{FigureCanvasQTAggBase.paintEvent()}}, \sphinxcode{\sphinxupquote{FigureCanvasQTAggBase.blit()}}, and \sphinxcode{\sphinxupquote{FigureCanvasQTAggBase.print\_figure()}} methods have moved to {\hyperref[\detokenize{api/backend_qt5agg_api:matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.paintEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FigureCanvasQTAgg.paintEvent()}}}}}, {\hyperref[\detokenize{api/backend_qt5agg_api:matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.blit}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FigureCanvasQTAgg.blit()}}}}}, and {\hyperref[\detokenize{api/backend_qt5agg_api:matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.print_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FigureCanvasQTAgg.print\_figure()}}}}}. The first two methods assume that the instance is also a \sphinxcode{\sphinxupquote{QWidget}} so to use \sphinxcode{\sphinxupquote{FigureCanvasQTAggBase}} it was required to multiple inherit from a \sphinxcode{\sphinxupquote{QWidget}} sub-class. Having moved all of its methods either up or down the class hierarchy \sphinxcode{\sphinxupquote{FigureCanvasQTAggBase}} has been deprecated. To do this with out warning and to preserve as much API as possible, \sphinxcode{\sphinxupquote{backend\_qt5.FigureCanvasQTAggBase}} now inherits from \sphinxcode{\sphinxupquote{backend\_qt5.FigureCanvasQTAgg}}. The MRO for \sphinxcode{\sphinxupquote{FigureCanvasQTAgg}} and \sphinxcode{\sphinxupquote{FigureCanvasQTAggBase}} used to be \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{[}\PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backends}\PYG{o}{.}\PYG{n}{backend\PYGZus{}qt5agg}\PYG{o}{.}\PYG{n}{FigureCanvasQTAgg}\PYG{p}{,} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backends}\PYG{o}{.}\PYG{n}{backend\PYGZus{}qt5agg}\PYG{o}{.}\PYG{n}{FigureCanvasQTAggBase}\PYG{p}{,} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backends}\PYG{o}{.}\PYG{n}{backend\PYGZus{}agg}\PYG{o}{.}\PYG{n}{FigureCanvasAgg}\PYG{p}{,} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backends}\PYG{o}{.}\PYG{n}{backend\PYGZus{}qt5}\PYG{o}{.}\PYG{n}{FigureCanvasQT}\PYG{p}{,} \PYG{n}{PyQt5}\PYG{o}{.}\PYG{n}{QtWidgets}\PYG{o}{.}\PYG{n}{QWidget}\PYG{p}{,} \PYG{n}{PyQt5}\PYG{o}{.}\PYG{n}{QtCore}\PYG{o}{.}\PYG{n}{QObject}\PYG{p}{,} \PYG{n}{sip}\PYG{o}{.}\PYG{n}{wrapper}\PYG{p}{,} \PYG{n}{PyQt5}\PYG{o}{.}\PYG{n}{QtGui}\PYG{o}{.}\PYG{n}{QPaintDevice}\PYG{p}{,} \PYG{n}{sip}\PYG{o}{.}\PYG{n}{simplewrapper}\PYG{p}{,} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backend\PYGZus{}bases}\PYG{o}{.}\PYG{n}{FigureCanvasBase}\PYG{p}{,} \PYG{n+nb}{object}\PYG{p}{]} \end{sphinxVerbatim} and \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{[}\PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backends}\PYG{o}{.}\PYG{n}{backend\PYGZus{}qt5agg}\PYG{o}{.}\PYG{n}{FigureCanvasQTAggBase}\PYG{p}{,} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backends}\PYG{o}{.}\PYG{n}{backend\PYGZus{}agg}\PYG{o}{.}\PYG{n}{FigureCanvasAgg}\PYG{p}{,} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backend\PYGZus{}bases}\PYG{o}{.}\PYG{n}{FigureCanvasBase}\PYG{p}{,} \PYG{n+nb}{object}\PYG{p}{]} \end{sphinxVerbatim} respectively. They are now \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{[}\PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backends}\PYG{o}{.}\PYG{n}{backend\PYGZus{}qt5agg}\PYG{o}{.}\PYG{n}{FigureCanvasQTAgg}\PYG{p}{,} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backends}\PYG{o}{.}\PYG{n}{backend\PYGZus{}agg}\PYG{o}{.}\PYG{n}{FigureCanvasAgg}\PYG{p}{,} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backends}\PYG{o}{.}\PYG{n}{backend\PYGZus{}qt5}\PYG{o}{.}\PYG{n}{FigureCanvasQT}\PYG{p}{,} \PYG{n}{PyQt5}\PYG{o}{.}\PYG{n}{QtWidgets}\PYG{o}{.}\PYG{n}{QWidget}\PYG{p}{,} \PYG{n}{PyQt5}\PYG{o}{.}\PYG{n}{QtCore}\PYG{o}{.}\PYG{n}{QObject}\PYG{p}{,} \PYG{n}{sip}\PYG{o}{.}\PYG{n}{wrapper}\PYG{p}{,} \PYG{n}{PyQt5}\PYG{o}{.}\PYG{n}{QtGui}\PYG{o}{.}\PYG{n}{QPaintDevice}\PYG{p}{,} \PYG{n}{sip}\PYG{o}{.}\PYG{n}{simplewrapper}\PYG{p}{,} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backend\PYGZus{}bases}\PYG{o}{.}\PYG{n}{FigureCanvasBase}\PYG{p}{,} \PYG{n+nb}{object}\PYG{p}{]} \end{sphinxVerbatim} and \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{[}\PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backends}\PYG{o}{.}\PYG{n}{backend\PYGZus{}qt5agg}\PYG{o}{.}\PYG{n}{FigureCanvasQTAggBase}\PYG{p}{,} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backends}\PYG{o}{.}\PYG{n}{backend\PYGZus{}qt5agg}\PYG{o}{.}\PYG{n}{FigureCanvasQTAgg}\PYG{p}{,} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backends}\PYG{o}{.}\PYG{n}{backend\PYGZus{}agg}\PYG{o}{.}\PYG{n}{FigureCanvasAgg}\PYG{p}{,} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backends}\PYG{o}{.}\PYG{n}{backend\PYGZus{}qt5}\PYG{o}{.}\PYG{n}{FigureCanvasQT}\PYG{p}{,} \PYG{n}{PyQt5}\PYG{o}{.}\PYG{n}{QtWidgets}\PYG{o}{.}\PYG{n}{QWidget}\PYG{p}{,} \PYG{n}{PyQt5}\PYG{o}{.}\PYG{n}{QtCore}\PYG{o}{.}\PYG{n}{QObject}\PYG{p}{,} \PYG{n}{sip}\PYG{o}{.}\PYG{n}{wrapper}\PYG{p}{,} \PYG{n}{PyQt5}\PYG{o}{.}\PYG{n}{QtGui}\PYG{o}{.}\PYG{n}{QPaintDevice}\PYG{p}{,} \PYG{n}{sip}\PYG{o}{.}\PYG{n}{simplewrapper}\PYG{p}{,} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backend\PYGZus{}bases}\PYG{o}{.}\PYG{n}{FigureCanvasBase}\PYG{p}{,} \PYG{n+nb}{object}\PYG{p}{]} \end{sphinxVerbatim} \subsection{\sphinxstyleliteralintitle{\sphinxupquote{Axes.imshow}} clips RGB values to the valid range} \label{\detokenize{api/api_changes:axes-imshow-clips-rgb-values-to-the-valid-range}} When \sphinxcode{\sphinxupquote{Axes.imshow}} is passed an RGB or RGBA value with out-of-range values, it now logs a warning and clips them to the valid range. The old behaviour, wrapping back in to the range, often hid outliers and made interpreting RGB images unreliable. \subsection{GTKAgg and GTKCairo backends deprecated} \label{\detokenize{api/api_changes:gtkagg-and-gtkcairo-backends-deprecated}} The GTKAgg and GTKCairo backends have been deprecated. These obsolete backends allow figures to be rendered via the GTK+ 2 toolkit. They are untested, known to be broken, will not work with Python 3, and their use has been discouraged for some time. Instead, use the \sphinxcode{\sphinxupquote{GTK3Agg}} and \sphinxcode{\sphinxupquote{GTK3Cairo}} backends for rendering to GTK+ 3 windows. \section{API Changes in 2.1.2} \label{\detokenize{api/api_changes:api-changes-in-2-1-2}} \subsection{\sphinxstyleliteralintitle{\sphinxupquote{Figure.legend}} no longer checks for repeated lines to ignore} \label{\detokenize{api/api_changes:figure-legend-no-longer-checks-for-repeated-lines-to-ignore}} \sphinxcode{\sphinxupquote{matplotlib.Figure.legend}} used to check if a line had the same label as an existing legend entry. If it also had the same line color or marker color legend didn’t add a new entry for that line. However, the list of conditions was incomplete, didn’t handle RGB tuples, didn’t handle linewidths or linestyles etc. This logic did not exist in \sphinxcode{\sphinxupquote{Axes.legend}}. It was included (erroneously) in Matplotlib 2.1.1 when the legend argument parsing was unified {[}\#9324{]}(\sphinxurl{https://github.com/matplotlib/matplotlib/pull/9324}). This change removes that check in \sphinxcode{\sphinxupquote{Axes.legend}} again to restore the old behavior. This logic has also been dropped from {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure.legend}}}}}, where it was previously undocumented. Repeated lines with the same label will now each have an entry in the legend. If you do not want the duplicate entries, don’t add a label to the line, or prepend the label with an underscore. \section{API Changes in 2.1.1} \label{\detokenize{api/api_changes:api-changes-in-2-1-1}} \subsection{Default behavior of log scales reverted to clip \textless{}= 0 values} \label{\detokenize{api/api_changes:default-behavior-of-log-scales-reverted-to-clip-0-values}} The change it 2.1.0 to mask in logscale by default had more disruptive changes than anticipated and has been reverted, however the clipping is now done in a way that fixes the issues that motivated changing the default behavior to \sphinxcode{\sphinxupquote{'mask'}}. As a side effect of this change, error bars which go negative now work as expected on log scales. \section{API Changes in 2.1.0} \label{\detokenize{api/api_changes:api-changes-in-2-1-0}} \subsection{Default behavior of log scales changed to mask \textless{}= 0 values} \label{\detokenize{api/api_changes:default-behavior-of-log-scales-changed-to-mask-0-values}} Calling {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xscale:matplotlib.axes.Axes.set_xscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_xscale}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yscale:matplotlib.axes.Axes.set_yscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_yscale}}}}} now uses ‘mask’ as the default method to handle invalid values (as opposed to ‘clip’). This means that any values \textless{}= 0 on a log scale will not be shown. Previously they were clipped to a very small number and shown. \subsection{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.cbook.CallbackRegistry.process()}} suppresses exceptions by default} \label{\detokenize{api/api_changes:matplotlib-cbook-callbackregistry-process-suppresses-exceptions-by-default}} Matplotlib uses instances of {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.CallbackRegistry}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CallbackRegistry}}}}} as a bridge between user input event from the GUI and user callbacks. Previously, any exceptions raised in a user call back would bubble out of of the \sphinxcode{\sphinxupquote{process}} method, which is typically in the GUI event loop. Most GUI frameworks simple print the traceback to the screen and continue as there is not always a clear method of getting the exception back to the user. However PyQt5 now exits the process when it receives an un-handled python exception in the event loop. Thus, {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.CallbackRegistry.process}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{process()}}}}} now suppresses and prints tracebacks to stderr by default. What {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.CallbackRegistry.process}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{process()}}}}} does with exceptions is now user configurable via the \sphinxcode{\sphinxupquote{exception\_handler}} attribute and kwarg. To restore the previous behavior pass \sphinxcode{\sphinxupquote{None}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{cb} \PYG{o}{=} \PYG{n}{CallbackRegistry}\PYG{p}{(}\PYG{n}{exception\PYGZus{}handler}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)} \end{sphinxVerbatim} A function which take and \sphinxcode{\sphinxupquote{Exception}} as its only argument may also be passed \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{maybe\PYGZus{}reraise}\PYG{p}{(}\PYG{n}{exc}\PYG{p}{)}\PYG{p}{:} \PYG{k}{if} \PYG{n+nb}{isinstance}\PYG{p}{(}\PYG{n}{exc}\PYG{p}{,} \PYG{n+ne}{RuntimeError}\PYG{p}{)}\PYG{p}{:} \PYG{k}{pass} \PYG{k}{else}\PYG{p}{:} \PYG{k}{raise} \PYG{n}{exc} \PYG{n}{cb} \PYG{o}{=} \PYG{n}{CallbackRegistry}\PYG{p}{(}\PYG{n}{exception\PYGZus{}handler}\PYG{o}{=}\PYG{n}{maybe\PYGZus{}reraise}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Improved toggling of the axes grids} \label{\detokenize{api/api_changes:improved-toggling-of-the-axes-grids}} The \sphinxcode{\sphinxupquote{g}} key binding now switches the states of the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} grids independently (by cycling through all four on/off combinations). The new \sphinxcode{\sphinxupquote{G}} key binding switches the states of the minor grids. Both bindings are disabled if only a subset of the grid lines (in either direction) is visible, to avoid making irreversible changes to the figure. \subsection{Removal of warning on empty legends} \label{\detokenize{api/api_changes:removal-of-warning-on-empty-legends}} \sphinxcode{\sphinxupquote{plt.legend}} used to issue a warning when no labeled artist could be found. This warning has been removed. \subsection{More accurate legend autopositioning} \label{\detokenize{api/api_changes:more-accurate-legend-autopositioning}} Automatic positioning of legends now prefers using the area surrounded by a \sphinxcode{\sphinxupquote{Line2D}} rather than placing the legend over the line itself. \subsection{Cleanup of stock sample data} \label{\detokenize{api/api_changes:cleanup-of-stock-sample-data}} The sample data of stocks has been cleaned up to remove redundancies and increase portability. The \sphinxcode{\sphinxupquote{AAPL.dat.gz}}, \sphinxcode{\sphinxupquote{INTC.dat.gz}} and \sphinxcode{\sphinxupquote{aapl.csv}} files have been removed entirely and will also no longer be available from {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.get_sample_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cbook.get\_sample\_data}}}}}. If a CSV file is required, we suggest using the \sphinxcode{\sphinxupquote{msft.csv}} that continues to be shipped in the sample data. If a NumPy binary file is acceptable, we suggest using one of the following two new files. The \sphinxcode{\sphinxupquote{aapl.npy.gz}} and \sphinxcode{\sphinxupquote{goog.npy}} files have been replaced by \sphinxcode{\sphinxupquote{aapl.npz}} and \sphinxcode{\sphinxupquote{goog.npz}}, wherein the first column’s type has changed from \sphinxhref{https://docs.python.org/3/library/datetime.html\#datetime.date}{\sphinxcode{\sphinxupquote{datetime.date}}} to \sphinxcode{\sphinxupquote{np.datetime64}} for better portability across Python versions. Note that Matplotlib does not fully support \sphinxcode{\sphinxupquote{np.datetime64}} as yet. \subsection{Updated qhull to 2015.2} \label{\detokenize{api/api_changes:updated-qhull-to-2015-2}} The version of qhull shipped with Matplotlib, which is used for Delaunay triangulation, has been updated from version 2012.1 to 2015.2. \subsection{Improved Delaunay triangulations with large offsets} \label{\detokenize{api/api_changes:improved-delaunay-triangulations-with-large-offsets}} Delaunay triangulations now deal with large x,y offsets in a better way. This can cause minor changes to any triangulations calculated using Matplotlib, i.e. any use of {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.tri.Triangulation}}}}} that requests that a Delaunay triangulation is calculated, which includes {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tricontour:matplotlib.pyplot.tricontour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.tricontour}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tricontourf:matplotlib.pyplot.tricontourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.tricontourf}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tripcolor:matplotlib.pyplot.tripcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.tripcolor}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.triplot:matplotlib.pyplot.triplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.triplot}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.griddata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.griddata}}}}} and {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.plot_trisurf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.axes3d.Axes3D.plot\_trisurf}}}}}. \subsection{Use \sphinxstyleliteralintitle{\sphinxupquote{backports.functools\_lru\_cache}} instead of \sphinxstyleliteralintitle{\sphinxupquote{functools32}}} \label{\detokenize{api/api_changes:use-backports-functools-lru-cache-instead-of-functools32}} It’s better maintained and more widely used (by pylint, jaraco, etc). \subsection{\sphinxstyleliteralintitle{\sphinxupquote{cbook.is\_numlike}} only performs an instance check} \label{\detokenize{api/api_changes:cbook-is-numlike-only-performs-an-instance-check}} {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.is_numlike}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{is\_numlike()}}}}} now only checks that its argument is an instance of \sphinxcode{\sphinxupquote{(numbers.Number, np.Number)}}. In particular, this means that arrays are now not num-like. \subsection{Elliptical arcs now drawn between correct angles} \label{\detokenize{api/api_changes:elliptical-arcs-now-drawn-between-correct-angles}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Arc:matplotlib.patches.Arc}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.Arc}}}}} patch is now correctly drawn between the given angles. Previously a circular arc was drawn and then stretched into an ellipse, so the resulting arc did not lie between \sphinxstyleemphasis{theta1} and \sphinxstyleemphasis{theta2}. \subsection{\sphinxstyleliteralintitle{\sphinxupquote{-d\$backend}} no longer sets the backend} \label{\detokenize{api/api_changes:d-backend-no-longer-sets-the-backend}} It is no longer possible to set the backend by passing \sphinxcode{\sphinxupquote{-d\$backend}} at the command line. Use the \sphinxcode{\sphinxupquote{MPLBACKEND}} environment variable instead. \subsection{Path.intersects\_bbox always treats the bounding box as filled} \label{\detokenize{api/api_changes:path-intersects-bbox-always-treats-the-bounding-box-as-filled}} Previously, when \sphinxcode{\sphinxupquote{Path.intersects\_bbox}} was called with \sphinxcode{\sphinxupquote{filled}} set to \sphinxcode{\sphinxupquote{False}}, it would treat both the path and the bounding box as unfilled. This behavior was not well documented and it is usually not the desired behavior, since bounding boxes are used to represent more complex shapes located inside the bounding box. This behavior has now been changed: when \sphinxcode{\sphinxupquote{filled}} is \sphinxcode{\sphinxupquote{False}}, the path will be treated as unfilled, but the bounding box is still treated as filled. The old behavior was arguably an implementation bug. When \sphinxcode{\sphinxupquote{Path.intersects\_bbox}} is called with \sphinxcode{\sphinxupquote{filled}} set to \sphinxcode{\sphinxupquote{True}} (the default value), there is no change in behavior. For those rare cases where \sphinxcode{\sphinxupquote{Path.intersects\_bbox}} was called with \sphinxcode{\sphinxupquote{filled}} set to \sphinxcode{\sphinxupquote{False}} and where the old behavior is actually desired, the suggested workaround is to call \sphinxcode{\sphinxupquote{Path.intersects\_path}} with a rectangle as the path: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{path} \PYG{k}{import} \PYG{n}{Path} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{transforms} \PYG{k}{import} \PYG{n}{Bbox}\PYG{p}{,} \PYG{n}{BboxTransformTo} \PYG{n}{rect} \PYG{o}{=} \PYG{n}{Path}\PYG{o}{.}\PYG{n}{unit\PYGZus{}rectangle}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{transformed}\PYG{p}{(}\PYG{n}{BboxTransformTo}\PYG{p}{(}\PYG{n}{bbox}\PYG{p}{)}\PYG{p}{)} \PYG{n}{result} \PYG{o}{=} \PYG{n}{path}\PYG{o}{.}\PYG{n}{intersects\PYGZus{}path}\PYG{p}{(}\PYG{n}{rect}\PYG{p}{,} \PYG{n}{filled}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{)} \end{sphinxVerbatim} \subsection{WX no longer calls generates \sphinxstyleliteralintitle{\sphinxupquote{IdleEvent}} events or calls \sphinxstyleliteralintitle{\sphinxupquote{idle\_event}}} \label{\detokenize{api/api_changes:wx-no-longer-calls-generates-idleevent-events-or-calls-idle-event}} Removed unused private method \sphinxcode{\sphinxupquote{\_onIdle}} from \sphinxcode{\sphinxupquote{FigureCanvasWx}}. The \sphinxcode{\sphinxupquote{IdleEvent}} class and \sphinxcode{\sphinxupquote{FigureCanvasBase.idle\_event}} method will be removed in 2.2 \subsection{Correct scaling of \sphinxstyleliteralintitle{\sphinxupquote{magnitude\_spectrum()}}} \label{\detokenize{api/api_changes:correct-scaling-of-magnitude-spectrum}} The functions {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.magnitude\_spectrum()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.magnitude_spectrum:matplotlib.pyplot.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.magnitude\_spectrum()}}}}} implicitly assumed the sum of windowing function values to be one. In Matplotlib and Numpy the standard windowing functions are scaled to have maximum value of one, which usually results in a sum of the order of n/2 for a n-point signal. Thus the amplitude scaling \sphinxcode{\sphinxupquote{magnitude\_spectrum()}} was off by that amount when using standard windowing functions (\sphinxhref{https://github.com/matplotlib/matplotlib/issues/8417}{Bug 8417} ). Now the behavior is consistent with {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.psd:matplotlib.pyplot.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.psd()}}}}} and \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.welch.html\#scipy.signal.welch}{\sphinxcode{\sphinxupquote{scipy.signal.welch()}}}. The following example demonstrates the new and old scaling: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{n}{tau}\PYG{p}{,} \PYG{n}{n} \PYG{o}{=} \PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mi}{1024} \PYG{c+c1}{\PYGZsh{} 10 second signal with 1024 points} \PYG{n}{T} \PYG{o}{=} \PYG{n}{tau}\PYG{o}{/}\PYG{n}{n} \PYG{c+c1}{\PYGZsh{} sampling interval} \PYG{n}{t} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{n}{n}\PYG{p}{)}\PYG{o}{*}\PYG{n}{T} \PYG{n}{a} \PYG{o}{=} \PYG{l+m+mi}{4} \PYG{c+c1}{\PYGZsh{} amplitude} \PYG{n}{x} \PYG{o}{=} \PYG{n}{a}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{l+m+mi}{40}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{t}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} 20 Hz sine with amplitude a} \PYG{c+c1}{\PYGZsh{} New correct behavior: Amplitude at 20 Hz is a/2} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{magnitude\PYGZus{}spectrum}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{Fs}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{o}{/}\PYG{n}{T}\PYG{p}{,} \PYG{n}{sides}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{onesided}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{scale}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linear}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Original behavior: Amplitude at 20 Hz is (a/2)*(n/2) for a Hanning window} \PYG{n}{w} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{hanning}\PYG{p}{(}\PYG{n}{n}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} default window is a Hanning window} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{magnitude\PYGZus{}spectrum}\PYG{p}{(}\PYG{n}{x}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{sum}\PYG{p}{(}\PYG{n}{w}\PYG{p}{)}\PYG{p}{,} \PYG{n}{Fs}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{o}{/}\PYG{n}{T}\PYG{p}{,} \PYG{n}{sides}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{onesided}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{scale}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linear}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Change to signatures of \sphinxstyleliteralintitle{\sphinxupquote{bar()}} \& \sphinxstyleliteralintitle{\sphinxupquote{barh()}}} \label{\detokenize{api/api_changes:change-to-signatures-of-bar-barh}} For 2.0 the {\hyperref[\detokenize{users/dflt_style_changes:barbarh-align}]{\sphinxcrossref{\DUrole{std,std-ref}{default value of *align*}}}} changed to \sphinxcode{\sphinxupquote{'center'}}. However this caused the signature of {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.bar:matplotlib.axes.Axes.bar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bar()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.barh:matplotlib.axes.Axes.barh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{barh()}}}}} to be misleading as the first parameters were still \sphinxstyleemphasis{left} and \sphinxstyleemphasis{bottom} respectively: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{bar}\PYG{p}{(}\PYG{n}{left}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{align}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{barh}\PYG{p}{(}\PYG{n}{bottom}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{align}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} despite behaving as the center in both cases. The methods now take \sphinxcode{\sphinxupquote{*args, **kwargs}} as input and are documented to have the primary signatures of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{bar}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{align}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{barh}\PYG{p}{(}\PYG{n}{y}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{align}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Passing \sphinxstyleemphasis{left} and \sphinxstyleemphasis{bottom} as keyword arguments to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.bar:matplotlib.axes.Axes.bar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bar()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.barh:matplotlib.axes.Axes.barh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{barh()}}}}} respectively will warn. Support will be removed in Matplotlib 3.0. \subsection{Font cache as json} \label{\detokenize{api/api_changes:font-cache-as-json}} The font cache is now saved as json, rather than a pickle. \subsection{Invalid (Non-finite) Axis Limit Error} \label{\detokenize{api/api_changes:invalid-non-finite-axis-limit-error}} When using {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim:matplotlib.axes.Axes.set_xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xlim()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:matplotlib.axes.Axes.set_ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_ylim()}}}}}, passing non-finite values now results in a \sphinxcode{\sphinxupquote{ValueError}}. The previous behavior resulted in the limits being erroneously reset to \sphinxcode{\sphinxupquote{(-0.001, 0.001)}}. \subsection{\sphinxstyleliteralintitle{\sphinxupquote{scatter}} and \sphinxstyleliteralintitle{\sphinxupquote{Collection}} offsets are no longer implicitly flattened} \label{\detokenize{api/api_changes:scatter-and-collection-offsets-are-no-longer-implicitly-flattened}} {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Collection}}}}} (and thus both 2D {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.scatter:matplotlib.axes.Axes.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter}}}}} and 3D {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter}}}}}) no longer implicitly flattens its offsets. As a consequence, \sphinxcode{\sphinxupquote{scatter}}’s \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} arguments can no longer be 2+-dimensional arrays. \subsection{Deprecations} \label{\detokenize{api/api_changes:id2}} \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{GraphicsContextBase}}’s \sphinxstyleliteralintitle{\sphinxupquote{linestyle}} property.} \label{\detokenize{api/api_changes:graphicscontextbase-s-linestyle-property}} The \sphinxcode{\sphinxupquote{GraphicsContextBase.get\_linestyle}} and \sphinxcode{\sphinxupquote{GraphicsContextBase.set\_linestyle}} methods, which had no effect, have been deprecated. All of the backends Matplotlib ships use \sphinxcode{\sphinxupquote{GraphicsContextBase.get\_dashes}} and \sphinxcode{\sphinxupquote{GraphicsContextBase.set\_dashes}} which are more general. Third-party backends should also migrate to the \sphinxcode{\sphinxupquote{*\_dashes}} methods. \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{NavigationToolbar2.dynamic\_update}}} \label{\detokenize{api/api_changes:navigationtoolbar2-dynamic-update}} Use \sphinxcode{\sphinxupquote{draw\_idle()}} method on the \sphinxcode{\sphinxupquote{Canvas}} instance instead. \subsubsection{Testing} \label{\detokenize{api/api_changes:testing}} \sphinxcode{\sphinxupquote{matplotlib.testing.noseclasses}} is deprecated and will be removed in 2.3 \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{EngFormatter}} \sphinxstyleemphasis{num} arg as string} \label{\detokenize{api/api_changes:engformatter-num-arg-as-string}} Passing a string as \sphinxstyleemphasis{num} argument when calling an instance of {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.EngFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.EngFormatter}}}}} is deprecated and will be removed in 2.3. \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{mpl\_toolkits.axes\_grid}} module} \label{\detokenize{api/api_changes:mpl-toolkits-axes-grid-module}} All functionally from \sphinxcode{\sphinxupquote{mpl\_toolkits.axes\_grid}} can be found in either {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.axes_grid1:module-mpl_toolkits.axes_grid1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mpl\_toolkits.axes\_grid1}}}}} or {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.axisartist:module-mpl_toolkits.axisartist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mpl\_toolkits.axisartist}}}}}. Axes classes from \sphinxcode{\sphinxupquote{mpl\_toolkits.axes\_grid}} based on \sphinxcode{\sphinxupquote{Axis}} from {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.axisartist:module-mpl_toolkits.axisartist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mpl\_toolkits.axisartist}}}}} can be found in {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.axisartist:module-mpl_toolkits.axisartist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mpl\_toolkits.axisartist}}}}}. \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{Axes}} collision in \sphinxstyleliteralintitle{\sphinxupquote{Figure.add\_axes}}} \label{\detokenize{api/api_changes:axes-collision-in-figure-add-axes}} Adding an axes instance to a figure by using the same arguments as for a previous axes instance currently reuses the earlier instance. This behavior has been deprecated in Matplotlib 2.1. In a future version, a \sphinxstyleemphasis{new} instance will always be created and returned. Meanwhile, in such a situation, a deprecation warning is raised by {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.AxesStack:matplotlib.figure.AxesStack}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AxesStack}}}}}. This warning can be suppressed, and the future behavior ensured, by passing a \sphinxstyleemphasis{unique} label to each axes instance. See the docstring of {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_axes()}}}}} for more information. Additional details on the rationale behind this deprecation can be found in \sphinxhref{https://github.com/matplotlib/matplotlib/issues/7377/}{\#7377} and \sphinxhref{https://github.com/matplotlib/matplotlib/issues/9024/}{\#9024}. \subsubsection{Former validators for \sphinxstyleliteralintitle{\sphinxupquote{contour.negative\_linestyle}}} \label{\detokenize{api/api_changes:former-validators-for-contour-negative-linestyle}} The former public validation functions \sphinxcode{\sphinxupquote{validate\_negative\_linestyle}} and \sphinxcode{\sphinxupquote{validate\_negative\_linestyle\_legacy}} will be deprecated in 2.1 and may be removed in 2.3. There are no public functions to replace them. \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{cbook}}} \label{\detokenize{api/api_changes:cbook}} Many unused or near-unused {\hyperref[\detokenize{api/cbook_api:module-matplotlib.cbook}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cbook}}}}} functions and classes have been deprecated: \sphinxcode{\sphinxupquote{converter}}, \sphinxcode{\sphinxupquote{tostr}}, \sphinxcode{\sphinxupquote{todatetime}}, \sphinxcode{\sphinxupquote{todate}}, \sphinxcode{\sphinxupquote{tofloat}}, \sphinxcode{\sphinxupquote{toint}}, \sphinxcode{\sphinxupquote{unique}}, \sphinxcode{\sphinxupquote{is\_string\_like}}, \sphinxcode{\sphinxupquote{is\_sequence\_of\_strings}}, \sphinxcode{\sphinxupquote{is\_scalar}}, \sphinxcode{\sphinxupquote{Sorter}}, \sphinxcode{\sphinxupquote{Xlator}}, \sphinxcode{\sphinxupquote{soundex}}, \sphinxcode{\sphinxupquote{Null}}, \sphinxcode{\sphinxupquote{dict\_delall}}, \sphinxcode{\sphinxupquote{RingBuffer}}, \sphinxcode{\sphinxupquote{get\_split\_ind}}, \sphinxcode{\sphinxupquote{wrap}}, \sphinxcode{\sphinxupquote{get\_recursive\_filelist}}, \sphinxcode{\sphinxupquote{pieces}}, \sphinxcode{\sphinxupquote{exception\_to\_str}}, \sphinxcode{\sphinxupquote{allequal}}, \sphinxcode{\sphinxupquote{alltrue}}, \sphinxcode{\sphinxupquote{onetrue}}, \sphinxcode{\sphinxupquote{allpairs}}, \sphinxcode{\sphinxupquote{finddir}}, \sphinxcode{\sphinxupquote{reverse\_dict}}, \sphinxcode{\sphinxupquote{restrict\_dict}}, \sphinxcode{\sphinxupquote{issubclass\_safe}}, \sphinxcode{\sphinxupquote{recursive\_remove}}, \sphinxcode{\sphinxupquote{unmasked\_index\_ranges}}. \subsection{Code Removal} \label{\detokenize{api/api_changes:code-removal}} \subsubsection{qt4\_compat.py} \label{\detokenize{api/api_changes:qt4-compat-py}} Moved to \sphinxcode{\sphinxupquote{qt\_compat.py}}. Renamed because it now handles Qt5 as well. \subsubsection{Previously Deprecated methods} \label{\detokenize{api/api_changes:previously-deprecated-methods}} The \sphinxcode{\sphinxupquote{GraphicsContextBase.set\_graylevel}}, \sphinxcode{\sphinxupquote{FigureCanvasBase.onHilite}} and \sphinxcode{\sphinxupquote{mpl\_toolkits.axes\_grid1.mpl\_axes.Axes.toggle\_axisline}} methods have been removed. The \sphinxcode{\sphinxupquote{ArtistInspector.findobj}} method, which was never working due to the lack of a \sphinxcode{\sphinxupquote{get\_children}} method, has been removed. The deprecated \sphinxcode{\sphinxupquote{point\_in\_path}}, \sphinxcode{\sphinxupquote{get\_path\_extents}}, \sphinxcode{\sphinxupquote{point\_in\_path\_collection}}, \sphinxcode{\sphinxupquote{path\_intersects\_path}}, \sphinxcode{\sphinxupquote{convert\_path\_to\_polygons}}, \sphinxcode{\sphinxupquote{cleanup\_path}} and \sphinxcode{\sphinxupquote{clip\_path\_to\_rect}} functions in the \sphinxcode{\sphinxupquote{matplotlib.path}} module have been removed. Their functionality remains exposed as methods on the \sphinxcode{\sphinxupquote{Path}} class. The deprecated \sphinxcode{\sphinxupquote{Artist.get\_axes}} and \sphinxcode{\sphinxupquote{Artist.set\_axes}} methods have been removed The \sphinxcode{\sphinxupquote{matplotlib.backends.backend\_ps.seq\_allequal}} function has been removed. Use \sphinxcode{\sphinxupquote{np.array\_equal}} instead. The deprecated \sphinxcode{\sphinxupquote{matplotlib.rcsetup.validate\_maskedarray}}, \sphinxcode{\sphinxupquote{matplotlib.rcsetup.deprecate\_savefig\_extension}} and \sphinxcode{\sphinxupquote{matplotlib.rcsetup.validate\_tkpythoninspect}} functions, and associated \sphinxcode{\sphinxupquote{savefig.extension}} and \sphinxcode{\sphinxupquote{tk.pythoninspect}} rcparams entries have been removed. The kwarg \sphinxcode{\sphinxupquote{resolution}} of {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.projections.polar.PolarAxes}}}}} has been removed. It has deprecation with no effect from version \sphinxcode{\sphinxupquote{0.98.x}}. \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{Axes.set\_aspect("normal")}}} \label{\detokenize{api/api_changes:axes-set-aspect-normal}} Support for setting an \sphinxcode{\sphinxupquote{Axes}}’s aspect to \sphinxcode{\sphinxupquote{"normal"}} has been removed, in favor of the synonym \sphinxcode{\sphinxupquote{"auto"}}. \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{shading}} kwarg to \sphinxstyleliteralintitle{\sphinxupquote{pcolor}}} \label{\detokenize{api/api_changes:shading-kwarg-to-pcolor}} The \sphinxcode{\sphinxupquote{shading}} kwarg to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolor:matplotlib.axes.Axes.pcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolor}}}}} has been removed. Set \sphinxcode{\sphinxupquote{edgecolors}} appropriately instead. \subsubsection{Functions removed from the \sphinxstyleliteralintitle{\sphinxupquote{lines}} module} \label{\detokenize{api/api_changes:functions-removed-from-the-lines-module}} The {\hyperref[\detokenize{api/lines_api:module-matplotlib.lines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.lines}}}}} module no longer imports the \sphinxcode{\sphinxupquote{pts\_to\_prestep}}, \sphinxcode{\sphinxupquote{pts\_to\_midstep}} and \sphinxcode{\sphinxupquote{pts\_to\_poststep}} functions from {\hyperref[\detokenize{api/cbook_api:module-matplotlib.cbook}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cbook}}}}}. \subsubsection{PDF backend functions} \label{\detokenize{api/api_changes:pdf-backend-functions}} The methods \sphinxcode{\sphinxupquote{embedTeXFont}} and \sphinxcode{\sphinxupquote{tex\_font\_mapping}} of \sphinxcode{\sphinxupquote{matplotlib.backqend\_pdf.PdfFile}} have been removed. It is unlikely that external users would have called these methods, which are related to the font system internal to the PDF backend. \subsubsection{matplotlib.delaunay} \label{\detokenize{api/api_changes:matplotlib-delaunay}} Remove the delaunay triangulation code which is now handled by Qhull via {\hyperref[\detokenize{api/tri_api:module-matplotlib.tri}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.tri}}}}}. \section{API Changes in 2.0.1} \label{\detokenize{api/api_changes:api-changes-in-2-0-1}} \subsection{Extensions to \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backend\_bases.GraphicsContextBase}}} \label{\detokenize{api/api_changes:extensions-to-matplotlib-backend-bases-graphicscontextbase}} To better support controlling the color of hatches, the method {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_hatch_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.GraphicsContextBase.set\_hatch\_color}}}}} was added to the expected API of \sphinxcode{\sphinxupquote{GraphicsContext}} classes. Calls to this method are currently wrapped with a \sphinxcode{\sphinxupquote{try:...except Attribute:}} block to preserve back-compatibility with any third-party backends which do not extend {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GraphicsContextBase}}}}}. This value can be accessed in the backends via {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_hatch_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.GraphicsContextBase.get\_hatch\_color}}}}} (which was added in 2.0 see {\hyperref[\detokenize{users/prev_whats_new/whats_new_2.0.0:gc-get-hatch-color-wn}]{\sphinxcrossref{\DUrole{std,std-ref}{Extension to matplotlib.backend\_bases.GraphicsContextBase}}}}) and should be used to color the hatches. In the future there may also be \sphinxcode{\sphinxupquote{hatch\_linewidth}} and \sphinxcode{\sphinxupquote{hatch\_density}} related methods added. It is encouraged, but not required that third-party backends extend {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GraphicsContextBase}}}}} to make adapting to these changes easier. \subsection{\sphinxstyleliteralintitle{\sphinxupquote{afm.get\_fontconfig\_fonts}} returns a list of paths and does not check for existence} \label{\detokenize{api/api_changes:afm-get-fontconfig-fonts-returns-a-list-of-paths-and-does-not-check-for-existence}} \sphinxcode{\sphinxupquote{afm.get\_fontconfig\_fonts}} used to return a set of paths encoded as a \sphinxcode{\sphinxupquote{\{key: 1, ...\}}} dict, and checked for the existence of the paths. It now returns a list and dropped the existence check, as the same check is performed by the caller (\sphinxcode{\sphinxupquote{afm.findSystemFonts}}) as well. \subsection{\sphinxstyleliteralintitle{\sphinxupquote{bar}} now returns rectangles of negative height or width if the corresponding input is negative} \label{\detokenize{api/api_changes:bar-now-returns-rectangles-of-negative-height-or-width-if-the-corresponding-input-is-negative}} \sphinxcode{\sphinxupquote{plt.bar}} used to normalize the coordinates of the rectangles that it created, to keep their height and width positives, even if the corresponding input was negative. This normalization has been removed to permit a simpler computation of the correct \sphinxcode{\sphinxupquote{sticky\_edges}} to use. \subsection{Do not clip line width when scaling dashes} \label{\detokenize{api/api_changes:do-not-clip-line-width-when-scaling-dashes}} The algorithm to scale dashes was changed to no longer clip the scaling factor: the dash patterns now continue to shrink at thin line widths. If the line width is smaller than the effective pixel size, this may result in dashed lines turning into solid gray-ish lines. This also required slightly tweaking the default patterns for ‘\textendash{}’, ‘:’, and ‘.-‘ so that with the default line width the final patterns would not change. There is no way to restore the old behavior. \subsection{Deprecate ‘Vega’ color maps} \label{\detokenize{api/api_changes:deprecate-vega-color-maps}} The “Vega” colormaps are deprecated in Matplotlib 2.0.1 and will be removed in Matplotlib 2.2. Use the “tab” colormaps instead: “tab10”, “tab20”, “tab20b”, “tab20c”. \section{API Changes in 2.0.0} \label{\detokenize{api/api_changes:api-changes-in-2-0-0}} \subsection{Deprecation and removal} \label{\detokenize{api/api_changes:deprecation-and-removal}} \subsubsection{Color of Axes} \label{\detokenize{api/api_changes:color-of-axes}} The \sphinxcode{\sphinxupquote{axisbg}} and \sphinxcode{\sphinxupquote{axis\_bgcolor}} properties on \sphinxcode{\sphinxupquote{Axes}} have been deprecated in favor of \sphinxcode{\sphinxupquote{facecolor}}. \subsubsection{GTK and GDK backends deprecated} \label{\detokenize{api/api_changes:gtk-and-gdk-backends-deprecated}} The GDK and GTK backends have been deprecated. These obsolete backends allow figures to be rendered via the GDK API to files and GTK2 figures. They are untested and known to be broken, and their use has been discouraged for some time. Instead, use the \sphinxcode{\sphinxupquote{GTKAgg}} and \sphinxcode{\sphinxupquote{GTKCairo}} backends for rendering to GTK2 windows. \subsubsection{WX backend deprecated} \label{\detokenize{api/api_changes:wx-backend-deprecated}} The WX backend has been deprecated. It is untested, and its use has been discouraged for some time. Instead, use the \sphinxcode{\sphinxupquote{WXAgg}} backend for rendering figures to WX windows. \subsubsection{CocoaAgg backend removed} \label{\detokenize{api/api_changes:cocoaagg-backend-removed}} The deprecated and not fully functional CocoaAgg backend has been removed. \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{round}} removed from TkAgg Backend} \label{\detokenize{api/api_changes:round-removed-from-tkagg-backend}} The TkAgg backend had its own implementation of the \sphinxhref{https://docs.python.org/3/library/functions.html\#round}{\sphinxcode{\sphinxupquote{round}}} function. This was unused internally and has been removed. Instead, use either the \sphinxhref{https://docs.python.org/3/library/functions.html\#round}{\sphinxcode{\sphinxupquote{round}}} builtin function or \sphinxcode{\sphinxupquote{numpy.round}}. \subsubsection{‘hold’ functionality deprecated} \label{\detokenize{api/api_changes:hold-functionality-deprecated}} The ‘hold’ keyword argument and all functions and methods related to it are deprecated, along with the ‘axes.hold’ \sphinxcode{\sphinxupquote{rcParams}} entry. The behavior will remain consistent with the default \sphinxcode{\sphinxupquote{hold=True}} state that has long been in place. Instead of using a function or keyword argument (\sphinxcode{\sphinxupquote{hold=False}}) to change that behavior, explicitly clear the axes or figure as needed prior to subsequent plotting commands. \subsection{\sphinxstyleliteralintitle{\sphinxupquote{Artist.update}} has return value} \label{\detokenize{api/api_changes:artist-update-has-return-value}} The methods {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set:matplotlib.artist.Artist.set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.Artist.set}}}}}, \sphinxcode{\sphinxupquote{matplotlib.Artist.update}}, and the function {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.setp:matplotlib.artist.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.setp}}}}} now use a common codepath to look up how to update the given artist properties (either using the setter methods or an attribute/property). The behavior of \sphinxcode{\sphinxupquote{matplotlib.Artist.update}} is slightly changed to return a list of the values returned from the setter methods to avoid changing the API of \sphinxcode{\sphinxupquote{matplotlib.Artist.set}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.setp:matplotlib.artist.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.setp}}}}}. The keys passed into \sphinxcode{\sphinxupquote{matplotlib.Artist.update}} are now converted to lower case before being processed, to match the behavior of \sphinxcode{\sphinxupquote{matplotlib.Artist.set}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.setp:matplotlib.artist.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.setp}}}}}. This should not break any user code because there are no set methods with capitals in their names, but this puts a constraint on naming properties in the future. \subsection{\sphinxstyleliteralintitle{\sphinxupquote{Legend}} initializers gain edgecolor and facecolor kwargs} \label{\detokenize{api/api_changes:legend-initializers-gain-edgecolor-and-facecolor-kwargs}} The {\hyperref[\detokenize{api/legend_api:matplotlib.legend.Legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Legend}}}}} background patch (or ‘frame’) can have its \sphinxcode{\sphinxupquote{edgecolor}} and \sphinxcode{\sphinxupquote{facecolor}} determined by the corresponding keyword arguments to the {\hyperref[\detokenize{api/legend_api:matplotlib.legend.Legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.legend.Legend}}}}} initializer, or to any of the methods or functions that call that initializer. If left to their default values of \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, their values will be taken from \sphinxcode{\sphinxupquote{matplotlib.rcParams}}. The previously-existing \sphinxcode{\sphinxupquote{framealpha}} kwarg still controls the alpha transparency of the patch. \subsection{Qualitative colormaps} \label{\detokenize{api/api_changes:qualitative-colormaps}} Colorbrewer’s qualitative/discrete colormaps (“Accent”, “Dark2”, “Paired”, “Pastel1”, “Pastel2”, “Set1”, “Set2”, “Set3”) are now implemented as \sphinxcode{\sphinxupquote{ListedColormap}} instead of \sphinxcode{\sphinxupquote{LinearSegmentedColormap}}. To use these for images where categories are specified as integers, for instance, use: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Dark2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{norm}\PYG{o}{=}\PYG{n}{colors}\PYG{o}{.}\PYG{n}{NoNorm}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Change in the \sphinxstyleliteralintitle{\sphinxupquote{draw\_image}} backend API} \label{\detokenize{api/api_changes:change-in-the-draw-image-backend-api}} The \sphinxcode{\sphinxupquote{draw\_image}} method implemented by backends has changed its interface. This change is only relevant if the backend declares that it is able to transform images by returning \sphinxcode{\sphinxupquote{True}} from \sphinxcode{\sphinxupquote{option\_scale\_image}}. See the \sphinxcode{\sphinxupquote{draw\_image}} docstring for more information. \subsection{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.ticker.LinearLocator}} algorithm update} \label{\detokenize{api/api_changes:matplotlib-ticker-linearlocator-algorithm-update}} The \sphinxcode{\sphinxupquote{matplotlib.ticker.LinearLocator}} is used to define the range and location of axis ticks when the user wants an exact number of ticks. \sphinxcode{\sphinxupquote{LinearLocator}} thus differs from the default locator \sphinxcode{\sphinxupquote{MaxNLocator}}, for which the user specifies a maximum number of intervals rather than a precise number of ticks. The view range algorithm in \sphinxcode{\sphinxupquote{matplotlib.ticker.LinearLocator}} has been changed so that more convenient tick locations are chosen. The new algorithm returns a plot view range that is a multiple of the user-requested number of ticks. This ensures tick marks will be located at whole integers more consistently. For example, when both y-axes of a{}`{}`twinx{}`{}` plot use \sphinxcode{\sphinxupquote{matplotlib.ticker.LinearLocator}} with the same number of ticks, their y-tick locations and grid lines will coincide. \subsection{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.ticker.LogLocator}} gains numticks kwarg} \label{\detokenize{api/api_changes:matplotlib-ticker-loglocator-gains-numticks-kwarg}} The maximum number of ticks generated by the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogLocator}}}}} can now be controlled explicitly via setting the new ‘numticks’ kwarg to an integer. By default the kwarg is None which internally sets it to the ‘auto’ string, triggering a new algorithm for adjusting the maximum according to the axis length relative to the ticklabel font size. \subsection{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.ticker.LogFormatter}}: two new kwargs} \label{\detokenize{api/api_changes:matplotlib-ticker-logformatter-two-new-kwargs}} Previously, minor ticks on log-scaled axes were not labeled by default. An algorithm has been added to the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogFormatter}}}}} to control the labeling of ticks between integer powers of the base. The algorithm uses two parameters supplied in a kwarg tuple named ‘minor\_thresholds’. See the docstring for further explanation. To improve support for axes using \sphinxcode{\sphinxupquote{SymmetricLogLocator}}, a ‘linthresh’ kwarg was added. \subsection{New defaults for 3D quiver function in mpl\_toolkits.mplot3d.axes3d.py} \label{\detokenize{api/api_changes:new-defaults-for-3d-quiver-function-in-mpl-toolkits-mplot3d-axes3d-py}} Matplotlib has both a 2D and a 3D \sphinxcode{\sphinxupquote{quiver}} function. These changes affect only the 3D function and make the default behavior of the 3D function match the 2D version. There are two changes: \begin{enumerate} \item {} The 3D quiver function previously normalized the arrows to be the same length, which makes it unusable for situations where the arrows should be different lengths and does not match the behavior of the 2D function. This normalization behavior is now controlled with the \sphinxcode{\sphinxupquote{normalize}} keyword, which defaults to False. \item {} The \sphinxcode{\sphinxupquote{pivot}} keyword now defaults to \sphinxcode{\sphinxupquote{tail}} instead of \sphinxcode{\sphinxupquote{tip}}. This was done in order to match the default behavior of the 2D quiver function. \end{enumerate} To obtain the previous behavior with the 3D quiver function, one can call the function with \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{quiver}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{z}\PYG{p}{,} \PYG{n}{u}\PYG{p}{,} \PYG{n}{v}\PYG{p}{,} \PYG{n}{w}\PYG{p}{,} \PYG{n}{normalize}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{,} \PYG{n}{pivot}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{tip}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} where “ax” is an \sphinxcode{\sphinxupquote{Axes3d}} object created with something like \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{mpl\PYGZus{}toolkits}\PYG{n+nn}{.}\PYG{n+nn}{mplot3d}\PYG{n+nn}{.}\PYG{n+nn}{axes3d} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{sublot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{,} \PYG{n}{projection}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{3d}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Stale figure behavior} \label{\detokenize{api/api_changes:stale-figure-behavior}} Attempting to draw the figure will now mark it as not stale (independent if the draw succeeds). This change is to prevent repeatedly trying to re-draw a figure which is raising an error on draw. The previous behavior would only mark a figure as not stale after a full re-draw succeeded. \subsection{The spectral colormap is now nipy\_spectral} \label{\detokenize{api/api_changes:the-spectral-colormap-is-now-nipy-spectral}} The colormaps formerly known as \sphinxcode{\sphinxupquote{spectral}} and \sphinxcode{\sphinxupquote{spectral\_r}} have been replaced by \sphinxcode{\sphinxupquote{nipy\_spectral}} and \sphinxcode{\sphinxupquote{nipy\_spectral\_r}} since Matplotlib 1.3.0. Even though the colormap was deprecated in Matplotlib 1.3.0, it never raised a warning. As of Matplotlib 2.0.0, using the old names raises a deprecation warning. In the future, using the old names will raise an error. \subsection{Default install no longer includes test images} \label{\detokenize{api/api_changes:default-install-no-longer-includes-test-images}} To reduce the size of wheels and source installs, the tests and baseline images are no longer included by default. To restore installing the tests and images, use a \sphinxcode{\sphinxupquote{setup.cfg}} with \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{[}\PYG{n}{packages}\PYG{p}{]} \PYG{n}{tests} \PYG{o}{=} \PYG{k+kc}{True} \PYG{n}{toolkits\PYGZus{}tests} \PYG{o}{=} \PYG{k+kc}{True} \end{sphinxVerbatim} in the source directory at build/install time. \section{Changes in 1.5.3} \label{\detokenize{api/api_changes:changes-in-1-5-3}} \subsection{\sphinxstyleliteralintitle{\sphinxupquote{ax.plot(..., marker=None)}} gives default marker} \label{\detokenize{api/api_changes:ax-plot-marker-none-gives-default-marker}} Prior to 1.5.3 kwargs passed to \sphinxcode{\sphinxupquote{plot}} were handled in two parts \textendash{} default kwargs generated internal to \sphinxcode{\sphinxupquote{plot}} (such as the cycled styles) and user supplied kwargs. The internally generated kwargs were passed to the \sphinxcode{\sphinxupquote{matplotlib.lines.Line2D.\_\_init\_\_}} and the user kwargs were passed to \sphinxcode{\sphinxupquote{ln.set(**kwargs)}} to update the artist after it was created. Now both sets of kwargs are merged and passed to \sphinxcode{\sphinxupquote{\_\_init\_\_}}. This change was made to allow \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}} to be passed in via the user kwargs to mean ‘do the default thing’ as is the convention through out mpl rather than raising an exception. Unlike most {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} setter methods {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_marker}}}}} did accept \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}} as a valid input which was mapped to ‘no marker’. Thus, by routing this \sphinxcode{\sphinxupquote{marker=None}} through \sphinxcode{\sphinxupquote{\_\_init\_\_}} rather than \sphinxcode{\sphinxupquote{set(...)}} the meaning of \sphinxcode{\sphinxupquote{ax.plot(..., marker=None)}} changed from ‘no markers’ to ‘default markers from rcparams’. This is change is only evident if \sphinxcode{\sphinxupquote{mpl.rcParams{[}'lines.marker'{]}}} has a value other than \sphinxcode{\sphinxupquote{'None'}} (which is string \sphinxcode{\sphinxupquote{'None'}} which means ‘no marker’). \section{Changes in 1.5.2} \label{\detokenize{api/api_changes:changes-in-1-5-2}} \subsection{Default Behavior Changes} \label{\detokenize{api/api_changes:default-behavior-changes}} \subsubsection{Changed default \sphinxstyleliteralintitle{\sphinxupquote{autorange}} behavior in boxplots} \label{\detokenize{api/api_changes:changed-default-autorange-behavior-in-boxplots}} Prior to v1.5.2, the whiskers of boxplots would extend to the minimum and maximum values if the quartiles were all equal (i.e., Q1 = median = Q3). This behavior has been disabled by default to restore consistency with other plotting packages. To restore the old behavior, simply set \sphinxcode{\sphinxupquote{autorange=True}} when calling \sphinxcode{\sphinxupquote{plt.boxplot}}. \section{Changes in 1.5.0} \label{\detokenize{api/api_changes:changes-in-1-5-0}} \subsection{Code Changes} \label{\detokenize{api/api_changes:code-changes}} \subsubsection{Reversed \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.cbook.ls\_mapper}}, added \sphinxstyleliteralintitle{\sphinxupquote{ls\_mapper\_r}}} \label{\detokenize{api/api_changes:reversed-matplotlib-cbook-ls-mapper-added-ls-mapper-r}} Formerly, \sphinxcode{\sphinxupquote{matplotlib.cbook.ls\_mapper}} was a dictionary with the long-form line-style names (\sphinxcode{\sphinxupquote{"solid"}}) as keys and the short forms (\sphinxcode{\sphinxupquote{"-"}}) as values. This long-to-short mapping is now done by \sphinxcode{\sphinxupquote{ls\_mapper\_r}}, and the short-to-long mapping is done by the \sphinxcode{\sphinxupquote{ls\_mapper}}. \subsubsection{Prevent moving artists between Axes, Property-ify Artist.axes, deprecate Artist.\{get,set\}\_axes} \label{\detokenize{api/api_changes:prevent-moving-artists-between-axes-property-ify-artist-axes-deprecate-artist-get-set-axes}} This was done to prevent an Artist that is already associated with an Axes from being moved/added to a different Axes. This was never supported as it causes havoc with the transform stack. The apparent support for this (as it did not raise an exception) was the source of multiple bug reports and questions on SO. For almost all use-cases, the assignment of the axes to an artist should be taken care of by the axes as part of the \sphinxcode{\sphinxupquote{Axes.add\_*}} method, hence the deprecation of \{get,set\}\_axes. Removing the \sphinxcode{\sphinxupquote{set\_axes}} method will also remove the ‘axes’ line from the ACCEPTS kwarg tables (assuming that the removal date gets here before that gets overhauled). \subsubsection{Tightened input validation on ‘pivot’ kwarg to quiver} \label{\detokenize{api/api_changes:tightened-input-validation-on-pivot-kwarg-to-quiver}} Tightened validation so that only \{‘tip’, ‘tail’, ‘mid’, and ‘middle’\} (but any capitalization) are valid values for the ‘pivot’ kwarg in the \sphinxcode{\sphinxupquote{Quiver.\_\_init\_\_}} (and hence \sphinxcode{\sphinxupquote{Axes.quiver}} and \sphinxcode{\sphinxupquote{plt.quiver}} which both fully delegate to \sphinxcode{\sphinxupquote{Quiver}}). Previously any input matching ‘mid.*’ would be interpreted as ‘middle’, ‘tip.*’ as ‘tip’ and any string not matching one of those patterns as ‘tail’. The value of \sphinxcode{\sphinxupquote{Quiver.pivot}} is normalized to be in the set \{‘tip’, ‘tail’, ‘middle’\} in \sphinxcode{\sphinxupquote{Quiver.\_\_init\_\_}}. \subsubsection{Reordered \sphinxstyleliteralintitle{\sphinxupquote{Axes.get\_children}}} \label{\detokenize{api/api_changes:reordered-axes-get-children}} The artist order returned by \sphinxcode{\sphinxupquote{Axes.get\_children}} did not match the one used by \sphinxcode{\sphinxupquote{Axes.draw}}. They now use the same order, as \sphinxcode{\sphinxupquote{Axes.draw}} now calls \sphinxcode{\sphinxupquote{Axes.get\_children}}. \subsubsection{Changed behaviour of contour plots} \label{\detokenize{api/api_changes:changed-behaviour-of-contour-plots}} The default behaviour of {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}} when using a masked array is now determined by the new keyword argument \sphinxcode{\sphinxupquote{corner\_mask}}, or if this is not specified then the new rcParam \sphinxcode{\sphinxupquote{contour.corner\_mask}} instead. The new default behaviour is equivalent to using \sphinxcode{\sphinxupquote{corner\_mask=True}}; the previous behaviour can be obtained using \sphinxcode{\sphinxupquote{corner\_mask=False}} or by changing the rcParam. The example \sphinxurl{http://matplotlib.org/examples/pylab\_examples/contour\_corner\_mask.html} demonstrates the difference. Use of the old contouring algorithm, which is obtained with \sphinxcode{\sphinxupquote{corner\_mask='legacy'}}, is now deprecated. Contour labels may now appear in different places than in earlier versions of Matplotlib. In addition, the keyword argument \sphinxcode{\sphinxupquote{nchunk}} now applies to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}} as well as {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}}, and it subdivides the domain into subdomains of exactly \sphinxcode{\sphinxupquote{nchunk}} by \sphinxcode{\sphinxupquote{nchunk}} quads, whereas previously it was only roughly \sphinxcode{\sphinxupquote{nchunk}} by \sphinxcode{\sphinxupquote{nchunk}} quads. The C/C++ object that performs contour calculations used to be stored in the public attribute QuadContourSet.Cntr, but is now stored in a private attribute and should not be accessed by end users. \subsubsection{Added set\_params function to all Locator types} \label{\detokenize{api/api_changes:added-set-params-function-to-all-locator-types}} This was a bug fix targeted at making the api for Locators more consistent. In the old behavior, only locators of type MaxNLocator have set\_params() defined, causing its use on any other Locator to raise an AttributeError \sphinxstyleemphasis{( aside: set\_params(args) is a function that sets the parameters of a Locator instance to be as specified within args)}. The fix involves moving set\_params() to the Locator class such that all subtypes will have this function defined. Since each of the Locator subtypes have their own modifiable parameters, a universal set\_params() in Locator isn’t ideal. Instead, a default no-operation function that raises a warning is implemented in Locator. Subtypes extending Locator will then override with their own implementations. Subtypes that do not have a need for set\_params() will fall back onto their parent’s implementation, which raises a warning as intended. In the new behavior, Locator instances will not raise an AttributeError when set\_params() is called. For Locators that do not implement set\_params(), the default implementation in Locator is used. \subsubsection{Disallow \sphinxstyleliteralintitle{\sphinxupquote{None}} as x or y value in ax.plot} \label{\detokenize{api/api_changes:disallow-none-as-x-or-y-value-in-ax-plot}} Do not allow \sphinxcode{\sphinxupquote{None}} as a valid input for the \sphinxcode{\sphinxupquote{x}} or \sphinxcode{\sphinxupquote{y}} args in \sphinxcode{\sphinxupquote{ax.plot}}. This may break some user code, but this was never officially supported (ex documented) and allowing \sphinxcode{\sphinxupquote{None}} objects through can lead to confusing exceptions downstream. To create an empty line use \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ln1}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{ln2}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} In either case to update the data in the \sphinxcode{\sphinxupquote{Line2D}} object you must update both the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} data. \subsubsection{Removed \sphinxstyleliteralintitle{\sphinxupquote{args}} and \sphinxstyleliteralintitle{\sphinxupquote{kwargs}} from \sphinxstyleliteralintitle{\sphinxupquote{MicrosecondLocator.\_\_call\_\_}}} \label{\detokenize{api/api_changes:removed-args-and-kwargs-from-microsecondlocator-call}} The call signature of \sphinxcode{\sphinxupquote{\_\_call\_\_()}} has changed from \sphinxcode{\sphinxupquote{\_\_call\_\_(self, *args, **kwargs)}} to \sphinxcode{\sphinxupquote{\_\_call\_\_(self)}}. This is consistent with the superclass {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Locator}}}}} and also all the other Locators derived from this superclass. \subsubsection{No \sphinxstyleliteralintitle{\sphinxupquote{ValueError}} for the MicrosecondLocator and YearLocator} \label{\detokenize{api/api_changes:no-valueerror-for-the-microsecondlocator-and-yearlocator}} The {\hyperref[\detokenize{api/dates_api:matplotlib.dates.MicrosecondLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MicrosecondLocator}}}}} and {\hyperref[\detokenize{api/dates_api:matplotlib.dates.YearLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YearLocator}}}}} objects when called will return an empty list if the axes have no data or the view has no interval. Previously, they raised a \sphinxhref{https://docs.python.org/3/library/exceptions.html\#ValueError}{\sphinxcode{\sphinxupquote{ValueError}}}. This is consistent with all the Date Locators. \subsubsection{‘OffsetBox.DrawingArea’ respects the ‘clip’ keyword argument} \label{\detokenize{api/api_changes:offsetbox-drawingarea-respects-the-clip-keyword-argument}} The call signature was \sphinxcode{\sphinxupquote{OffsetBox.DrawingArea(..., clip=True)}} but nothing was done with the \sphinxcode{\sphinxupquote{clip}} argument. The object did not do any clipping regardless of that parameter. Now the object can and does clip the child \sphinxcode{\sphinxupquote{Artists}} if they are set to be clipped. You can turn off the clipping on a per-child basis using \sphinxcode{\sphinxupquote{child.set\_clip\_on(False)}}. \subsubsection{Add salt to clipPath id} \label{\detokenize{api/api_changes:add-salt-to-clippath-id}} Add salt to the hash used to determine the id of the \sphinxcode{\sphinxupquote{clipPath}} nodes. This is to avoid conflicts when two svg documents with the same clip path are included in the same document (see \sphinxurl{https://github.com/ipython/ipython/issues/8133} and \sphinxurl{https://github.com/matplotlib/matplotlib/issues/4349} ), however this means that the svg output is no longer deterministic if the same figure is saved twice. It is not expected that this will affect any users as the current ids are generated from an md5 hash of properties of the clip path and any user would have a very difficult time anticipating the value of the id. \subsubsection{Changed snap threshold for circle markers to inf} \label{\detokenize{api/api_changes:changed-snap-threshold-for-circle-markers-to-inf}} When drawing circle markers above some marker size (previously 6.0) the path used to generate the marker was snapped to pixel centers. However, this ends up distorting the marker away from a circle. By setting the snap threshold to inf snapping is never done on circles. This change broke several tests, but is an improvement. \subsubsection{Preserve units with Text position} \label{\detokenize{api/api_changes:preserve-units-with-text-position}} Previously the ‘get\_position’ method on Text would strip away unit information even though the units were still present. There was no inherent need to do this, so it has been changed so that unit data (if present) will be preserved. Essentially a call to ‘get\_position’ will return the exact value from a call to ‘set\_position’. If you wish to get the old behaviour, then you can use the new method called ‘get\_unitless\_position’. \subsubsection{New API for custom Axes view changes} \label{\detokenize{api/api_changes:new-api-for-custom-axes-view-changes}} Interactive pan and zoom were previously implemented using a Cartesian-specific algorithm that was not necessarily applicable to custom Axes. Three new private methods, \sphinxcode{\sphinxupquote{\_get\_view()}}, \sphinxcode{\sphinxupquote{\_set\_view()}}, and \sphinxcode{\sphinxupquote{\_set\_view\_from\_bbox()}}, allow for custom \sphinxcode{\sphinxupquote{Axes}} classes to override the pan and zoom algorithms. Implementors of custom \sphinxcode{\sphinxupquote{Axes}} who override these methods may provide suitable behaviour for both pan and zoom as well as the view navigation buttons on the interactive toolbars. \subsection{MathTex visual changes} \label{\detokenize{api/api_changes:mathtex-visual-changes}} The spacing commands in mathtext have been changed to more closely match vanilla TeX. \subsubsection{Improved spacing in mathtext} \label{\detokenize{api/api_changes:improved-spacing-in-mathtext}} The extra space that appeared after subscripts and superscripts has been removed. \subsubsection{No annotation coordinates wrap} \label{\detokenize{api/api_changes:no-annotation-coordinates-wrap}} In \#2351 for 1.4.0 the behavior of {[}‘axes points’, ‘axes pixel’, ‘figure points’, ‘figure pixel’{]} as coordinates was change to no longer wrap for negative values. In 1.4.3 this change was reverted for ‘axes points’ and ‘axes pixel’ and in addition caused ‘axes fraction’ to wrap. For 1.5 the behavior has been reverted to as it was in 1.4.0-1.4.2, no wrapping for any type of coordinate. \subsection{Deprecation} \label{\detokenize{api/api_changes:deprecation}} \subsubsection{Deprecated \sphinxstyleliteralintitle{\sphinxupquote{GraphicsContextBase.set\_graylevel}}} \label{\detokenize{api/api_changes:deprecated-graphicscontextbase-set-graylevel}} The \sphinxcode{\sphinxupquote{GraphicsContextBase.set\_graylevel}} function has been deprecated in 1.5 and will be removed in 1.6. It has been unused. The \sphinxcode{\sphinxupquote{GraphicsContextBase.set\_foreground}} could be used instead. \subsubsection{deprecated idle\_event} \label{\detokenize{api/api_changes:deprecated-idle-event}} The \sphinxcode{\sphinxupquote{idle\_event}} was broken or missing in most backends and causes spurious warnings in some cases, and its use in creating animations is now obsolete due to the animations module. Therefore code involving it has been removed from all but the wx backend (where it partially works), and its use is deprecated. The animations module may be used instead to create animations. \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{color\_cycle}} deprecated} \label{\detokenize{api/api_changes:color-cycle-deprecated}} In light of the new property cycling feature, the Axes method \sphinxstyleemphasis{set\_color\_cycle} is now deprecated. Calling this method will replace the current property cycle with one that cycles just the given colors. Similarly, the rc parameter \sphinxstyleemphasis{axes.color\_cycle} is also deprecated in lieu of the new \sphinxstyleemphasis{axes.prop\_cycle} parameter. Having both parameters in the same rc file is not recommended as the result cannot be predicted. For compatibility, setting \sphinxstyleemphasis{axes.color\_cycle} will replace the cycler in \sphinxstyleemphasis{axes.prop\_cycle} with a color cycle. Accessing \sphinxstyleemphasis{axes.color\_cycle} will return just the color portion of the property cycle, if it exists. Timeline for removal has not been set. \subsection{Bundled jquery} \label{\detokenize{api/api_changes:bundled-jquery}} The version of jquery bundled with the webagg backend has been upgraded from 1.7.1 to 1.11.3. If you are using the version of jquery bundled with webagg you will need to update your html files as such \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gd}{\PYGZhy{} \PYGZlt{}script src=\PYGZdq{}\PYGZus{}static/jquery/js/jquery\PYGZhy{}1.7.1.min.js\PYGZdq{}\PYGZgt{}\PYGZlt{}/script\PYGZgt{}} \PYG{g+gi}{+ \PYGZlt{}script src=\PYGZdq{}\PYGZus{}static/jquery/js/jquery\PYGZhy{}1.11.3.min.js\PYGZdq{}\PYGZgt{}\PYGZlt{}/script\PYGZgt{}} \end{sphinxVerbatim} \subsection{Code Removed} \label{\detokenize{api/api_changes:code-removed}} \subsubsection{Removed \sphinxstyleliteralintitle{\sphinxupquote{Image}} from main namespace} \label{\detokenize{api/api_changes:removed-image-from-main-namespace}} \sphinxcode{\sphinxupquote{Image}} was imported from PIL/pillow to test if PIL is available, but there is no reason to keep \sphinxcode{\sphinxupquote{Image}} in the namespace once the availability has been determined. \subsubsection{Removed \sphinxstyleliteralintitle{\sphinxupquote{lod}} from Artist} \label{\detokenize{api/api_changes:removed-lod-from-artist}} Removed the method \sphinxstyleemphasis{set\_lod} and all references to the attribute \sphinxstyleemphasis{\_lod} as the are not used anywhere else in the code base. It appears to be a feature stub that was never built out. \subsubsection{Removed threading related classes from cbook} \label{\detokenize{api/api_changes:removed-threading-related-classes-from-cbook}} The classes \sphinxcode{\sphinxupquote{Scheduler}}, \sphinxcode{\sphinxupquote{Timeout}}, and \sphinxcode{\sphinxupquote{Idle}} were in cbook, but are not used internally. They appear to be a prototype for the idle event system which was not working and has recently been pulled out. \subsubsection{Removed \sphinxstyleliteralintitle{\sphinxupquote{Lena}} images from sample\_data} \label{\detokenize{api/api_changes:removed-lena-images-from-sample-data}} The \sphinxcode{\sphinxupquote{lena.png}} and \sphinxcode{\sphinxupquote{lena.jpg}} images have been removed from Matplotlib’s sample\_data directory. The images are also no longer available from {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.get_sample_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cbook.get\_sample\_data}}}}}. We suggest using \sphinxcode{\sphinxupquote{matplotlib.cbook.get\_sample\_data('grace\_hopper.png')}} or \sphinxcode{\sphinxupquote{matplotlib.cbook.get\_sample\_data('grace\_hopper.jpg')}} instead. \subsubsection{Legend} \label{\detokenize{api/api_changes:legend}} Removed handling of \sphinxcode{\sphinxupquote{loc}} as a positional argument to \sphinxcode{\sphinxupquote{Legend}} \subsubsection{Legend handlers} \label{\detokenize{api/api_changes:legend-handlers}} Remove code to allow legend handlers to be callable. They must now implement a method \sphinxcode{\sphinxupquote{legend\_artist}}. \subsubsection{Axis} \label{\detokenize{api/api_changes:axis}} Removed method \sphinxcode{\sphinxupquote{set\_scale}}. This is now handled via a private method which should not be used directly by users. It is called via \sphinxcode{\sphinxupquote{Axes.set\_\{x,y\}scale}} which takes care of ensuring the related changes are also made to the Axes object. \subsubsection{finance.py} \label{\detokenize{api/api_changes:finance-py}} Removed functions with ambiguous argument order from finance.py \subsubsection{Annotation} \label{\detokenize{api/api_changes:annotation}} Removed \sphinxcode{\sphinxupquote{textcoords}} and \sphinxcode{\sphinxupquote{xytext}} proprieties from Annotation objects. \subsubsection{spinxext.ipython\_*.py} \label{\detokenize{api/api_changes:spinxext-ipython-py}} Both \sphinxcode{\sphinxupquote{ipython\_console\_highlighting}} and \sphinxcode{\sphinxupquote{ipython\_directive}} have been moved to \sphinxcode{\sphinxupquote{IPython}}. Change your import from ‘matplotlib.sphinxext.ipython\_directive’ to ‘IPython.sphinxext.ipython\_directive’ and from ‘matplotlib.sphinxext.ipython\_directive’ to ‘IPython.sphinxext.ipython\_directive’ \subsubsection{LineCollection.color} \label{\detokenize{api/api_changes:linecollection-color}} Deprecated in 2005, use \sphinxcode{\sphinxupquote{set\_color}} \subsubsection{remove \sphinxstyleliteralintitle{\sphinxupquote{'faceted'}} as a valid value for \sphinxstyleliteralintitle{\sphinxupquote{shading}} in \sphinxstyleliteralintitle{\sphinxupquote{tri.tripcolor}}} \label{\detokenize{api/api_changes:remove-faceted-as-a-valid-value-for-shading-in-tri-tripcolor}} Use \sphinxcode{\sphinxupquote{edgecolor}} instead. Added validation on \sphinxcode{\sphinxupquote{shading}} to only be valid values. \subsubsection{Remove \sphinxstyleliteralintitle{\sphinxupquote{faceted}} kwarg from scatter} \label{\detokenize{api/api_changes:remove-faceted-kwarg-from-scatter}} Remove support for the \sphinxcode{\sphinxupquote{faceted}} kwarg. This was deprecated in d48b34288e9651ff95c3b8a071ef5ac5cf50bae7 (2008-04-18!) and replaced by \sphinxcode{\sphinxupquote{edgecolor}}. \subsubsection{Remove \sphinxstyleliteralintitle{\sphinxupquote{set\_colorbar}} method from \sphinxstyleliteralintitle{\sphinxupquote{ScalarMappable}}} \label{\detokenize{api/api_changes:remove-set-colorbar-method-from-scalarmappable}} Remove \sphinxcode{\sphinxupquote{set\_colorbar}} method, use \sphinxcode{\sphinxupquote{colorbar}} attribute directly. \subsubsection{patheffects.svg} \label{\detokenize{api/api_changes:patheffects-svg}}\begin{itemize} \item {} remove \sphinxcode{\sphinxupquote{get\_proxy\_renderer}} method from \sphinxcode{\sphinxupquote{AbstarctPathEffect}} class \item {} remove \sphinxcode{\sphinxupquote{patch\_alpha}} and \sphinxcode{\sphinxupquote{offset\_xy}} from \sphinxcode{\sphinxupquote{SimplePatchShadow}} \end{itemize} \subsubsection{Remove \sphinxstyleliteralintitle{\sphinxupquote{testing.image\_util.py}}} \label{\detokenize{api/api_changes:remove-testing-image-util-py}} Contained only a no-longer used port of functionality from PIL \subsubsection{Remove \sphinxstyleliteralintitle{\sphinxupquote{mlab.FIFOBuffer}}} \label{\detokenize{api/api_changes:remove-mlab-fifobuffer}} Not used internally and not part of core mission of mpl. \subsubsection{Remove \sphinxstyleliteralintitle{\sphinxupquote{mlab.prepca}}} \label{\detokenize{api/api_changes:remove-mlab-prepca}} Deprecated in 2009. \subsubsection{Remove \sphinxstyleliteralintitle{\sphinxupquote{NavigationToolbar2QTAgg}}} \label{\detokenize{api/api_changes:remove-navigationtoolbar2qtagg}} Added no functionality over the base \sphinxcode{\sphinxupquote{NavigationToolbar2Qt}} \subsubsection{mpl.py} \label{\detokenize{api/api_changes:mpl-py}} Remove the module \sphinxcode{\sphinxupquote{matplotlib.mpl}}. Deprecated in 1.3 by PR \#1670 and commit 78ce67d161625833cacff23cfe5d74920248c5b2 \section{Changes in 1.4.x} \label{\detokenize{api/api_changes:changes-in-1-4-x}} \subsection{Code changes} \label{\detokenize{api/api_changes:id3}}\begin{itemize} \item {} A major refactoring of the axes module was made. The axes module has been split into smaller modules: \begin{itemize} \item {} the \sphinxcode{\sphinxupquote{\_base}} module, which contains a new private \_AxesBase class. This class contains all methods except plotting and labelling methods. \item {} the \sphinxcode{\sphinxupquote{axes}} module, which contains the Axes class. This class inherits from \_AxesBase, and contains all plotting and labelling methods. \item {} the \sphinxcode{\sphinxupquote{\_subplot}} module, with all the classes concerning subplotting. \end{itemize} \end{itemize} There are a couple of things that do not exists in the \sphinxcode{\sphinxupquote{axes}} module’s namespace anymore. If you use them, you need to import them from their original location: \begin{itemize} \item {} math -\textgreater{} \sphinxcode{\sphinxupquote{import math}} \item {} ma -\textgreater{} \sphinxcode{\sphinxupquote{from numpy import ma}} \item {} cbook -\textgreater{} \sphinxcode{\sphinxupquote{from matplotlib import cbook}} \item {} docstring -\textgreater{} \sphinxcode{\sphinxupquote{from matplotlib import docstring}} \item {} is\_sequence\_of\_strings -\textgreater{} \sphinxcode{\sphinxupquote{from matplotlib.cbook import is\_sequence\_of\_strings}} \item {} is\_string\_like -\textgreater{} \sphinxcode{\sphinxupquote{from matplotlib.cbook import is\_string\_like}} \item {} iterable -\textgreater{} \sphinxcode{\sphinxupquote{from matplotlib.cbook import iterable}} \item {} itertools -\textgreater{} \sphinxcode{\sphinxupquote{import itertools}} \item {} martist -\textgreater{} \sphinxcode{\sphinxupquote{from matplotlib import artist as martist}} \item {} matplotlib -\textgreater{} \sphinxcode{\sphinxupquote{import matplotlib}} \item {} mcoll -\textgreater{} \sphinxcode{\sphinxupquote{from matplotlib import collections as mcoll}} \item {} mcolors -\textgreater{} \sphinxcode{\sphinxupquote{from matplotlib import colors as mcolors}} \item {} mcontour -\textgreater{} \sphinxcode{\sphinxupquote{from matplotlib import contour as mcontour}} \item {} mpatches -\textgreater{} \sphinxcode{\sphinxupquote{from matplotlib import patches as mpatches}} \item {} mpath -\textgreater{} \sphinxcode{\sphinxupquote{from matplotlib import path as mpath}} \item {} mquiver -\textgreater{} \sphinxcode{\sphinxupquote{from matplotlib import quiver as mquiver}} \item {} mstack -\textgreater{} \sphinxcode{\sphinxupquote{from matplotlib import stack as mstack}} \item {} mstream -\textgreater{} \sphinxcode{\sphinxupquote{from matplotlib import stream as mstream}} \item {} mtable -\textgreater{} \sphinxcode{\sphinxupquote{from matplotlib import table as mtable}} \end{itemize} \begin{itemize} \item {} As part of the refactoring to enable Qt5 support, the module \sphinxcode{\sphinxupquote{matplotlib.backends.qt4\_compat}} was renamed to \sphinxcode{\sphinxupquote{matplotlib.qt\_compat}}. \sphinxcode{\sphinxupquote{qt4\_compat}} is deprecated in 1.4 and will be removed in 1.5. \item {} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.errorbar:matplotlib.pyplot.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar()}}}}} method has been changed such that the upper and lower limits (\sphinxstyleemphasis{lolims}, \sphinxstyleemphasis{uplims}, \sphinxstyleemphasis{xlolims}, \sphinxstyleemphasis{xuplims}) now point in the correct direction. \item {} The \sphinxstyleemphasis{fmt} kwarg for \sphinxcode{\sphinxupquote{plot()}} defaults. \item {} A bug has been fixed in the path effects rendering of fonts, which now means that the font size is consistent with non-path effect fonts. See \sphinxurl{https://github.com/matplotlib/matplotlib/issues/2889} for more detail. \item {} The Sphinx extensions \sphinxcode{\sphinxupquote{ipython\_directive}} and \sphinxcode{\sphinxupquote{ipython\_console\_highlighting}} have been moved to the IPython project itself. While they remain in Matplotlib for this release, they have been deprecated. Update your extensions in \sphinxcode{\sphinxupquote{conf.py}} to point to \sphinxcode{\sphinxupquote{IPython.sphinxext.ipython\_directive}} instead of \sphinxcode{\sphinxupquote{matplotlib.sphinxext.ipython\_directive}}. \item {} In \sphinxcode{\sphinxupquote{finance}}, almost all functions have been deprecated and replaced with a pair of functions name \sphinxcode{\sphinxupquote{*\_ochl}} and \sphinxcode{\sphinxupquote{*\_ohlc}}. The former is the ‘open-close-high-low’ order of quotes used previously in this module, and the latter is the ‘open-high-low-close’ order that is standard in finance. \item {} For consistency the \sphinxcode{\sphinxupquote{face\_alpha}} keyword to {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.SimplePatchShadow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patheffects.SimplePatchShadow}}}}} has been deprecated in favour of the \sphinxcode{\sphinxupquote{alpha}} keyword. Similarly, the keyword \sphinxcode{\sphinxupquote{offset\_xy}} is now named \sphinxcode{\sphinxupquote{offset}} across all \sphinxcode{\sphinxupquote{\_Base{}`}} has been renamed to {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patheffects.AbstractPathEffect}}}}}. \sphinxcode{\sphinxupquote{matplotlib.patheffect.ProxyRenderer}} has been renamed to {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.PathEffectRenderer}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patheffects.PathEffectRenderer}}}}} and is now a full RendererBase subclass. \item {} The artist used to draw the outline of a \sphinxcode{\sphinxupquote{colorbar}} has been changed from a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.lines.Line2D}}}}} to {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.Polygon}}}}}, thus \sphinxcode{\sphinxupquote{colorbar.ColorbarBase.outline}} is now a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.Polygon}}}}} object. \item {} The legend handler interface has changed from a callable, to any object which implements the \sphinxcode{\sphinxupquote{legend\_artists}} method (a deprecation phase will see this interface be maintained for v1.4). See {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Legend guide}}}} for further details. Further legend changes include: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.\_get\_legend\_handles()}} now returns a generator of handles, rather than a list. \item {} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.legend:matplotlib.pyplot.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend()}}}}} function’s “loc” positional argument has been deprecated. Use the “loc” keyword instead. \end{itemize} \item {} The rcParams \sphinxcode{\sphinxupquote{savefig.transparent}} has been added to control default transparency when saving figures. \item {} Slightly refactored the \sphinxcode{\sphinxupquote{Annotation}} family. The text location in \sphinxcode{\sphinxupquote{Annotation}} is now handled entirely handled by the underlying \sphinxcode{\sphinxupquote{Text}} object so \sphinxcode{\sphinxupquote{set\_position}} works as expected. The attributes \sphinxcode{\sphinxupquote{xytext}} and \sphinxcode{\sphinxupquote{textcoords}} have been deprecated in favor of \sphinxcode{\sphinxupquote{xyann}} and \sphinxcode{\sphinxupquote{anncoords}} so that \sphinxcode{\sphinxupquote{Annotation}} and \sphinxcode{\sphinxupquote{AnnotaionBbox}} can share a common sensibly named api for getting/setting the location of the text or box. \begin{itemize} \item {} \sphinxcode{\sphinxupquote{xyann}} -\textgreater{} set the location of the annotation \item {} \sphinxcode{\sphinxupquote{xy}} -\textgreater{} set where the arrow points to \item {} \sphinxcode{\sphinxupquote{anncoords}} -\textgreater{} set the units of the annotation location \item {} \sphinxcode{\sphinxupquote{xycoords}} -\textgreater{} set the units of the point location \item {} \sphinxcode{\sphinxupquote{set\_position()}} -\textgreater{} \sphinxcode{\sphinxupquote{Annotation}} only set location of annotation \end{itemize} \item {} {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.specgram}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.psd}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.csd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.csd}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.cohere}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.cohere}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.cohere_pairs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.cohere\_pairs}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.specgram:matplotlib.pyplot.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.specgram}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.psd:matplotlib.pyplot.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.psd}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.csd:matplotlib.pyplot.csd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.csd}}}}}, and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.cohere:matplotlib.pyplot.cohere}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.cohere}}}}} now raise ValueError where they previously raised AssertionError. \item {} For {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.psd}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.csd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.csd}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.cohere}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.cohere}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.cohere_pairs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.cohere\_pairs}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.specgram:matplotlib.pyplot.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.specgram}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.psd:matplotlib.pyplot.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.psd}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.csd:matplotlib.pyplot.csd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.csd}}}}}, and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.cohere:matplotlib.pyplot.cohere}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.cohere}}}}}, in cases where a shape (n, 1) array is returned, this is now converted to a (n, ) array. Previously, (n, m) arrays were averaged to an (n, ) array, but (n, 1) arrays were returend unchanged. This change makes the dimensions consistent in both cases. \item {} Added the rcParam \sphinxcode{\sphinxupquote{axes.fromatter.useoffset}} to control the default value of \sphinxcode{\sphinxupquote{useOffset}} in \sphinxcode{\sphinxupquote{ticker.ScalarFormatter}} \item {} Added \sphinxcode{\sphinxupquote{Formatter}} sub-class \sphinxcode{\sphinxupquote{StrMethodFormatter}} which does the exact same thing as \sphinxcode{\sphinxupquote{FormatStrFormatter}}, but for new-style formatting strings. \item {} Deprecated \sphinxcode{\sphinxupquote{matplotlib.testing.image\_util}} and the only function within, \sphinxcode{\sphinxupquote{matplotlib.testing.image\_util.autocontrast}}. These will be removed completely in v1.5.0. \item {} The \sphinxcode{\sphinxupquote{fmt}} argument of {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot_date:matplotlib.axes.Axes.plot_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot\_date()}}}}} has been changed from \sphinxcode{\sphinxupquote{bo}} to just \sphinxcode{\sphinxupquote{o}}, so color cycling can happen by default. \item {} Removed the class \sphinxcode{\sphinxupquote{FigureManagerQTAgg}} and deprecated \sphinxcode{\sphinxupquote{NavigationToolbar2QTAgg}} which will be removed in 1.5. \item {} Removed formerly public (non-prefixed) attributes \sphinxcode{\sphinxupquote{rect}} and \sphinxcode{\sphinxupquote{drawRect}} from \sphinxcode{\sphinxupquote{FigureCanvasQTAgg}}; they were always an implementation detail of the (preserved) \sphinxcode{\sphinxupquote{drawRectangle()}} function. \item {} The function signatures of \sphinxcode{\sphinxupquote{tight\_bbox.adjust\_bbox}} and \sphinxcode{\sphinxupquote{tight\_bbox.process\_figure\_for\_rasterizing}} have been changed. A new \sphinxcode{\sphinxupquote{fixed\_dpi}} parameter allows for overriding the \sphinxcode{\sphinxupquote{figure.dpi}} setting instead of trying to deduce the intended behaviour from the file format. \item {} Added support for horizontal/vertical axes padding to \sphinxcode{\sphinxupquote{mpl\_toolkits.axes\_grid1.ImageGrid}} — argument \sphinxcode{\sphinxupquote{axes\_pad}} can now be tuple-like if separate axis padding is required. The original behavior is preserved. \item {} Added support for skewed transforms to {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Affine2D}}}}}, which can be created using the \sphinxcode{\sphinxupquote{skew}} and \sphinxcode{\sphinxupquote{skew\_deg}} methods. \item {} Added clockwise parameter to control sectors direction in \sphinxcode{\sphinxupquote{axes.pie}} \item {} In {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.lines.Line2D}}}}} the \sphinxcode{\sphinxupquote{markevery}} functionality has been extended. Previously an integer start-index and stride-length could be specified using either a two-element-list or a two-element-tuple. Now this can only be done using a two-element-tuple. If a two-element-list is used then it will be treated as numpy fancy indexing and only the two markers corresponding to the given indexes will be shown. \item {} removed prop kwarg from \sphinxcode{\sphinxupquote{mpl\_toolkits.axes\_grid1.anchored\_artists.AnchoredSizeBar}} call. It was passed through to the base-class \sphinxcode{\sphinxupquote{\_\_init\_\_}} and is only used for setting padding. Now \sphinxcode{\sphinxupquote{fontproperties}} (which is what is really used to set the font properties of \sphinxcode{\sphinxupquote{AnchoredSizeBar}}) is passed through in place of \sphinxcode{\sphinxupquote{prop}}. If \sphinxcode{\sphinxupquote{fontpropreties}} is not passed in, but \sphinxcode{\sphinxupquote{prop}} is, then \sphinxcode{\sphinxupquote{prop}} is used inplace of \sphinxcode{\sphinxupquote{fontpropreties}}. If both are passed in, \sphinxcode{\sphinxupquote{prop}} is silently ignored. \item {} The use of the index 0 in \sphinxcode{\sphinxupquote{plt.subplot}} and related commands is deprecated. Due to a lack of validation calling \sphinxcode{\sphinxupquote{plt.subplots(2, 2, 0)}} does not raise an exception, but puts an axes in the \_last\_ position. This is due to the indexing in subplot being 1-based (to mirror MATLAB) so before indexing into the \sphinxcode{\sphinxupquote{GridSpec}} object used to determine where the axes should go, 1 is subtracted off. Passing in 0 results in passing -1 to \sphinxcode{\sphinxupquote{GridSpec}} which results in getting the last position back. Even though this behavior is clearly wrong and not intended, we are going through a deprecation cycle in an abundance of caution that any users are exploiting this ‘feature’. The use of 0 as an index will raise a warning in 1.4 and an exception in 1.5. \item {} Clipping is now off by default on offset boxes. \item {} Matplotlib now uses a less-aggressive call to \sphinxcode{\sphinxupquote{gc.collect(1)}} when closing figures to avoid major delays with large numbers of user objects in memory. \item {} The default clip value of \sphinxstyleemphasis{all} pie artists now defaults to \sphinxcode{\sphinxupquote{False}}. \end{itemize} \subsection{Code removal} \label{\detokenize{api/api_changes:id4}}\begin{itemize} \item {} Removed \sphinxcode{\sphinxupquote{mlab.levypdf}}. The code raised a numpy error (and has for a long time) and was not the standard form of the Levy distribution. \sphinxcode{\sphinxupquote{scipy.stats.levy}} should be used instead \end{itemize} \section{Changes in 1.3.x} \label{\detokenize{api/api_changes:changes-in-1-3-x}}\label{\detokenize{api/api_changes:changes-in-1-3}} \subsection{Changes in 1.3.1} \label{\detokenize{api/api_changes:changes-in-1-3-1}} It is rare that we make an API change in a bugfix release, however, for 1.3.1 since 1.3.0 the following change was made: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{text.Text.cached}} (used to cache font objects) has been made into a private variable. Among the obvious encapsulation benefit, this removes this confusing-looking member from the documentation. \item {} The method {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hist:matplotlib.axes.Axes.hist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hist()}}}}} now always returns bin occupancies as an array of type \sphinxhref{https://docs.python.org/3/library/functions.html\#float}{\sphinxcode{\sphinxupquote{float}}}. Previously, it was sometimes an array of type \sphinxhref{https://docs.python.org/3/library/functions.html\#int}{\sphinxcode{\sphinxupquote{int}}}, depending on the call. \end{itemize} \subsection{Code removal} \label{\detokenize{api/api_changes:id5}}\begin{itemize} \item {} The following items that were deprecated in version 1.2 or earlier have now been removed completely. \begin{itemize} \item {} The Qt 3.x backends (\sphinxcode{\sphinxupquote{qt}} and \sphinxcode{\sphinxupquote{qtagg}}) have been removed in favor of the Qt 4.x backends (\sphinxcode{\sphinxupquote{qt4}} and \sphinxcode{\sphinxupquote{qt4agg}}). \item {} The FltkAgg and Emf backends have been removed. \item {} The \sphinxcode{\sphinxupquote{matplotlib.nxutils}} module has been removed. Use the functionality on {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.contains_point}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.path.Path.contains\_point}}}}} and friends instead. \item {} Instead of \sphinxcode{\sphinxupquote{axes.Axes.get\_frame}}, use \sphinxcode{\sphinxupquote{axes.Axes.patch}}. \item {} The following \sphinxcode{\sphinxupquote{kwargs}} to the \sphinxcode{\sphinxupquote{legend}} function have been renamed: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{pad}} -\textgreater{} \sphinxcode{\sphinxupquote{borderpad}} \item {} \sphinxcode{\sphinxupquote{labelsep}} -\textgreater{} \sphinxcode{\sphinxupquote{labelspacing}} \item {} \sphinxcode{\sphinxupquote{handlelen}} -\textgreater{} \sphinxcode{\sphinxupquote{handlelength}} \item {} \sphinxcode{\sphinxupquote{handletextsep}} -\textgreater{} \sphinxcode{\sphinxupquote{handletextpad}} \item {} \sphinxcode{\sphinxupquote{axespad}} -\textgreater{} \sphinxcode{\sphinxupquote{borderaxespad}} \end{itemize} Related to this, the following rcParams have been removed: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{legend.pad}}, \sphinxcode{\sphinxupquote{legend.labelsep}}, \sphinxcode{\sphinxupquote{legend.handlelen}}, \sphinxcode{\sphinxupquote{legend.handletextsep}} and \sphinxcode{\sphinxupquote{legend.axespad}} \end{itemize} \item {} For the \sphinxcode{\sphinxupquote{hist}} function, instead of \sphinxcode{\sphinxupquote{width}}, use \sphinxcode{\sphinxupquote{rwidth}} (relative width). \item {} On \sphinxcode{\sphinxupquote{patches.Circle}}, the \sphinxcode{\sphinxupquote{resolution}} kwarg has been removed. For a circle made up of line segments, use \sphinxcode{\sphinxupquote{patches.CirclePolygon}}. \item {} The printing functions in the Wx backend have been removed due to the burden of keeping them up-to-date. \item {} \sphinxcode{\sphinxupquote{mlab.liaupunov}} has been removed. \item {} \sphinxcode{\sphinxupquote{mlab.save}}, \sphinxcode{\sphinxupquote{mlab.load}}, \sphinxcode{\sphinxupquote{pylab.save}} and \sphinxcode{\sphinxupquote{pylab.load}} have been removed. We recommend using \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.savetxt.html\#numpy.savetxt}{\sphinxcode{\sphinxupquote{numpy.savetxt}}} and \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html\#numpy.loadtxt}{\sphinxcode{\sphinxupquote{numpy.loadtxt}}} instead. \item {} \sphinxcode{\sphinxupquote{widgets.HorizontalSpanSelector}} has been removed. Use \sphinxcode{\sphinxupquote{widgets.SpanSelector}} instead. \end{itemize} \end{itemize} \subsection{Code deprecation} \label{\detokenize{api/api_changes:code-deprecation}}\begin{itemize} \item {} The CocoaAgg backend has been deprecated, with the possibility for deletion or resurrection in a future release. \item {} The top-level functions in {\hyperref[\detokenize{api/path_api:module-matplotlib.path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.path}}}}} that are implemented in C++ were never meant to be public. Instead, users should use the Pythonic wrappers for them in the \sphinxcode{\sphinxupquote{path.Path}} and \sphinxcode{\sphinxupquote{collections.Collection}} classes. Use the following mapping to update your code: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{point\_in\_path}} -\textgreater{} \sphinxcode{\sphinxupquote{path.Path.contains\_point}} \item {} \sphinxcode{\sphinxupquote{get\_path\_extents}} -\textgreater{} \sphinxcode{\sphinxupquote{path.Path.get\_extents}} \item {} \sphinxcode{\sphinxupquote{point\_in\_path\_collection}} -\textgreater{} \sphinxcode{\sphinxupquote{collection.Collection.contains}} \item {} \sphinxcode{\sphinxupquote{path\_in\_path}} -\textgreater{} \sphinxcode{\sphinxupquote{path.Path.contains\_path}} \item {} \sphinxcode{\sphinxupquote{path\_intersects\_path}} -\textgreater{} \sphinxcode{\sphinxupquote{path.Path.intersects\_path}} \item {} \sphinxcode{\sphinxupquote{convert\_path\_to\_polygons}} -\textgreater{} \sphinxcode{\sphinxupquote{path.Path.to\_polygons}} \item {} \sphinxcode{\sphinxupquote{cleanup\_path}} -\textgreater{} \sphinxcode{\sphinxupquote{path.Path.cleaned}} \item {} \sphinxcode{\sphinxupquote{points\_in\_path}} -\textgreater{} \sphinxcode{\sphinxupquote{path.Path.contains\_points}} \item {} \sphinxcode{\sphinxupquote{clip\_path\_to\_rect}} -\textgreater{} \sphinxcode{\sphinxupquote{path.Path.clip\_to\_bbox}} \end{itemize} \item {} \sphinxcode{\sphinxupquote{matplotlib.colors.normalize}} and \sphinxcode{\sphinxupquote{matplotlib.colors.no\_norm}} have been deprecated in favour of {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.NoNorm:matplotlib.colors.NoNorm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.NoNorm}}}}} respectively. \item {} The \sphinxcode{\sphinxupquote{ScalarMappable}} class’ \sphinxcode{\sphinxupquote{set\_colorbar}} is now deprecated. Instead, the {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable.colorbar}}}}} attribute should be used. In previous Matplotlib versions this attribute was an undocumented tuple of \sphinxcode{\sphinxupquote{(colorbar\_instance, colorbar\_axes)}} but is now just \sphinxcode{\sphinxupquote{colorbar\_instance}}. To get the colorbar axes it is possible to just use the {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.ax}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ax}}}}} attribute on a colorbar instance. \item {} The \sphinxcode{\sphinxupquote{mpl}} module is now deprecated. Those who relied on this module should transition to simply using \sphinxcode{\sphinxupquote{import matplotlib as mpl}}. \end{itemize} \subsection{Code changes} \label{\detokenize{api/api_changes:id6}}\begin{itemize} \item {} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} now fully supports using RGBA values for its \sphinxcode{\sphinxupquote{facecolor}} and \sphinxcode{\sphinxupquote{edgecolor}} attributes, which enables faces and edges to have different alpha values. If the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} object’s \sphinxcode{\sphinxupquote{alpha}} attribute is set to anything other than \sphinxcode{\sphinxupquote{None}}, that value will override any alpha-channel value in both the face and edge colors. Previously, if {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} had \sphinxcode{\sphinxupquote{alpha=None}}, the alpha component of \sphinxcode{\sphinxupquote{edgecolor}} would be applied to both the edge and face. \item {} The optional \sphinxcode{\sphinxupquote{isRGB}} argument to {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_foreground}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_foreground()}}}}} (and the other GraphicsContext classes that descend from it) has been renamed to \sphinxcode{\sphinxupquote{isRGBA}}, and should now only be set to \sphinxcode{\sphinxupquote{True}} if the \sphinxcode{\sphinxupquote{fg}} color argument is known to be an RGBA tuple. \item {} For {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}}, the \sphinxcode{\sphinxupquote{capstyle}} used is now \sphinxcode{\sphinxupquote{butt}}, to be consistent with the default for most other objects, and to avoid problems with non-solid \sphinxcode{\sphinxupquote{linestyle}} appearing solid when using a large \sphinxcode{\sphinxupquote{linewidth}}. Previously, {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} used \sphinxcode{\sphinxupquote{capstyle='projecting'}}. \item {} \sphinxcode{\sphinxupquote{Path}} objects can now be marked as \sphinxcode{\sphinxupquote{readonly}} by passing \sphinxcode{\sphinxupquote{readonly=True}} to its constructor. The built-in path singletons, obtained through \sphinxcode{\sphinxupquote{Path.unit*}} class methods return readonly paths. If you have code that modified these, you will need to make a deepcopy first, using either: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{copy} \PYG{n}{path} \PYG{o}{=} \PYG{n}{copy}\PYG{o}{.}\PYG{n}{deepcopy}\PYG{p}{(}\PYG{n}{Path}\PYG{o}{.}\PYG{n}{unit\PYGZus{}circle}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} or} \PYG{n}{path} \PYG{o}{=} \PYG{n}{Path}\PYG{o}{.}\PYG{n}{unit\PYGZus{}circle}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{deepcopy}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} Deep copying a \sphinxcode{\sphinxupquote{Path}} always creates an editable (i.e. non-readonly) \sphinxcode{\sphinxupquote{Path}}. \item {} The list at \sphinxcode{\sphinxupquote{Path.NUM\_VERTICES}} was replaced by a dictionary mapping Path codes to the number of expected vertices at {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.NUM_VERTICES_FOR_CODE}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{NUM\_VERTICES\_FOR\_CODE}}}}}. \item {} To support XKCD style plots, the \sphinxcode{\sphinxupquote{matplotlib.path.cleanup\_path()}} method’s signature was updated to require a sketch argument. Users of \sphinxcode{\sphinxupquote{matplotlib.path.cleanup\_path()}} are encouraged to use the new {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.cleaned}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cleaned()}}}}} Path method. \item {} Data limits on a plot now start from a state of having “null” limits, rather than limits in the range (0, 1). This has an effect on artists that only control limits in one direction, such as \sphinxcode{\sphinxupquote{axvline}} and \sphinxcode{\sphinxupquote{axhline}}, since their limits will not longer also include the range (0, 1). This fixes some problems where the computed limits would be dependent on the order in which artists were added to the axes. \item {} Fixed a bug in setting the position for the right/top spine with data position type. Previously, it would draw the right or top spine at +1 data offset. \item {} In {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrow:matplotlib.patches.FancyArrow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrow}}}}}, the default arrow head width, \sphinxcode{\sphinxupquote{head\_width}}, has been made larger to produce a visible arrow head. The new value of this kwarg is \sphinxcode{\sphinxupquote{head\_width = 20 * width}}. \item {} It is now possible to provide \sphinxcode{\sphinxupquote{number of levels + 1}} colors in the case of \sphinxcode{\sphinxupquote{extend='both'}} for contourf (or just \sphinxcode{\sphinxupquote{number of levels}} colors for an extend value \sphinxcode{\sphinxupquote{min}} or \sphinxcode{\sphinxupquote{max}}) such that the resulting colormap’s \sphinxcode{\sphinxupquote{set\_under}} and \sphinxcode{\sphinxupquote{set\_over}} are defined appropriately. Any other number of colors will continue to behave as before (if more colors are provided than levels, the colors will be unused). A similar change has been applied to contour, where \sphinxcode{\sphinxupquote{extend='both'}} would expect \sphinxcode{\sphinxupquote{number of levels + 2}} colors. \item {} A new keyword \sphinxstyleemphasis{extendrect} in {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.colorbar:matplotlib.pyplot.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} and {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ColorbarBase}}}}} allows one to control the shape of colorbar extensions. \item {} The extension of {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.MultiCursor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MultiCursor}}}}} to both vertical (default) and/or horizontal cursor implied that \sphinxcode{\sphinxupquote{self.line}} is replaced by \sphinxcode{\sphinxupquote{self.vline}} for vertical cursors lines and \sphinxcode{\sphinxupquote{self.hline}} is added for the horizontal cursors lines. \item {} On POSIX platforms, the {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.report_memory}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{report\_memory()}}}}} function raises \sphinxhref{https://docs.python.org/3/library/exceptions.html\#NotImplementedError}{\sphinxcode{\sphinxupquote{NotImplementedError}}} instead of \sphinxhref{https://docs.python.org/3/library/exceptions.html\#OSError}{\sphinxcode{\sphinxupquote{OSError}}} if the \sphinxstyleliteralstrong{\sphinxupquote{ps}} command cannot be run. \item {} The \sphinxcode{\sphinxupquote{matplotlib.cbook.check\_output()}} function has been moved to \sphinxcode{\sphinxupquote{matplotlib.compat.subprocess()}}. \end{itemize} \subsection{Configuration and rcParams} \label{\detokenize{api/api_changes:configuration-and-rcparams}}\begin{itemize} \item {} On Linux, the user-specific \sphinxcode{\sphinxupquote{matplotlibrc}} configuration file is now located in \sphinxcode{\sphinxupquote{config/matplotlib/matplotlibrc}} to conform to the \sphinxhref{https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html}{XDG Base Directory Specification}. \item {} The \sphinxcode{\sphinxupquote{font.*}} rcParams now affect only text objects created after the rcParam has been set, and will not retroactively affect already existing text objects. This brings their behavior in line with most other rcParams. \item {} Removed call of {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.grid:matplotlib.axes.Axes.grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{grid()}}}}} in {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plotfile:matplotlib.pyplot.plotfile}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plotfile()}}}}}. To draw the axes grid, set the \sphinxcode{\sphinxupquote{axes.grid}} rcParam to \sphinxstyleemphasis{True}, or explicitly call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.grid:matplotlib.axes.Axes.grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{grid()}}}}}. \end{itemize} \section{Changes in 1.2.x} \label{\detokenize{api/api_changes:changes-in-1-2-x}}\begin{itemize} \item {} The \sphinxcode{\sphinxupquote{classic}} option of the rc parameter \sphinxcode{\sphinxupquote{toolbar}} is deprecated and will be removed in the next release. \item {} The \sphinxcode{\sphinxupquote{isvector()}} method has been removed since it is no longer functional. \item {} The \sphinxcode{\sphinxupquote{rasterization\_zorder}} property on {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} a zorder below which artists are rasterized. This has defaulted to -30000.0, but it now defaults to \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, meaning no artists will be rasterized. In order to rasterize artists below a given zorder value, \sphinxcode{\sphinxupquote{set\_rasterization\_zorder}} must be explicitly called. \item {} In {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.scatter:matplotlib.axes.Axes.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter()}}}}}, and \sphinxcode{\sphinxupquote{scatter}}, when specifying a marker using a tuple, the angle is now specified in degrees, not radians. \item {} Using {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.twinx:matplotlib.axes.Axes.twinx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{twinx()}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.twiny:matplotlib.axes.Axes.twiny}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{twiny()}}}}} no longer overrides the current locaters and formatters on the axes. \item {} In {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contourf:matplotlib.axes.Axes.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}}, the handling of the \sphinxstyleemphasis{extend} kwarg has changed. Formerly, the extended ranges were mapped after to 0, 1 after being normed, so that they always corresponded to the extreme values of the colormap. Now they are mapped outside this range so that they correspond to the special colormap values determined by the {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_under}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_under()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_over}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_over()}}}}} methods, which default to the colormap end points. \item {} The new rc parameter \sphinxcode{\sphinxupquote{savefig.format}} replaces \sphinxcode{\sphinxupquote{cairo.format}} and \sphinxcode{\sphinxupquote{savefig.extension}}, and sets the default file format used by {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.savefig}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure.savefig()}}}}}. \item {} In {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pie:matplotlib.pyplot.pie}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pie()}}}}} and \sphinxcode{\sphinxupquote{pie()}}, one can now set the radius of the pie; setting the \sphinxstyleemphasis{radius} to ‘None’ (the default value), will result in a pie with a radius of 1 as before. \item {} Use of \sphinxcode{\sphinxupquote{projection\_factory()}} is now deprecated in favour of axes class identification using {\hyperref[\detokenize{api/projections_api:matplotlib.projections.process_projection_requirements}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{process\_projection\_requirements()}}}}} followed by direct axes class invocation (at the time of writing, functions which do this are: {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_axes()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_subplot()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.gca}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gca()}}}}}). Therefore: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{key} \PYG{o}{=} \PYG{n}{figure}\PYG{o}{.}\PYG{n}{\PYGZus{}make\PYGZus{}key}\PYG{p}{(}\PYG{o}{*}\PYG{n}{args}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{ispolar} \PYG{o}{=} \PYG{n}{kwargs}\PYG{o}{.}\PYG{n}{pop}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{polar}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{k+kc}{False}\PYG{p}{)} \PYG{n}{projection} \PYG{o}{=} \PYG{n}{kwargs}\PYG{o}{.}\PYG{n}{pop}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{projection}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{k+kc}{None}\PYG{p}{)} \PYG{k}{if} \PYG{n}{ispolar}\PYG{p}{:} \PYG{k}{if} \PYG{n}{projection} \PYG{o+ow}{is} \PYG{o+ow}{not} \PYG{k+kc}{None} \PYG{o+ow}{and} \PYG{n}{projection} \PYG{o}{!=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{polar}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{k}{raise} \PYG{n+ne}{ValueError}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{polar and projection args are inconsistent}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{projection} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{polar}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{projection\PYGZus{}factory}\PYG{p}{(}\PYG{n}{projection}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{rect}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{key} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{\PYGZus{}make\PYGZus{}key}\PYG{p}{(}\PYG{o}{*}\PYG{n}{args}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} is now} \PYG{n}{projection\PYGZus{}class}\PYG{p}{,} \PYG{n}{kwargs}\PYG{p}{,} \PYG{n}{key} \PYG{o}{=} \PYGZbs{} \PYG{n}{process\PYGZus{}projection\PYGZus{}requirements}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{o}{*}\PYG{n}{args}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{projection\PYGZus{}class}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{rect}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} This change means that third party objects can expose themselves as Matplotlib axes by providing a \sphinxcode{\sphinxupquote{\_as\_mpl\_axes}} method. See {\hyperref[\detokenize{devel/add_new_projection:adding-new-scales}]{\sphinxcrossref{\DUrole{std,std-ref}{Developer’s guide for creating scales and transformations}}}} for more detail. \item {} A new keyword \sphinxstyleemphasis{extendfrac} in {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.colorbar:matplotlib.pyplot.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} and {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ColorbarBase}}}}} allows one to control the size of the triangular minimum and maximum extensions on colorbars. \item {} A new keyword \sphinxstyleemphasis{capthick} in {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.errorbar:matplotlib.pyplot.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar()}}}}} has been added as an intuitive alias to the \sphinxstyleemphasis{markeredgewidth} and \sphinxstyleemphasis{mew} keyword arguments, which indirectly controlled the thickness of the caps on the errorbars. For backwards compatibility, specifying either of the original keyword arguments will override any value provided by \sphinxstyleemphasis{capthick}. \item {} Transform subclassing behaviour is now subtly changed. If your transform implements a non-affine transformation, then it should override the \sphinxcode{\sphinxupquote{transform\_non\_affine}} method, rather than the generic \sphinxcode{\sphinxupquote{transform}} method. Previously transforms would define \sphinxcode{\sphinxupquote{transform}} and then copy the method into \sphinxcode{\sphinxupquote{transform\_non\_affine}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{class} \PYG{n+nc}{MyTransform}\PYG{p}{(}\PYG{n}{mtrans}\PYG{o}{.}\PYG{n}{Transform}\PYG{p}{)}\PYG{p}{:} \PYG{k}{def} \PYG{n+nf}{transform}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{xy}\PYG{p}{)}\PYG{p}{:} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.} \PYG{n}{transform\PYGZus{}non\PYGZus{}affine} \PYG{o}{=} \PYG{n}{transform} \end{sphinxVerbatim} This approach will no longer function correctly and should be changed to: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{class} \PYG{n+nc}{MyTransform}\PYG{p}{(}\PYG{n}{mtrans}\PYG{o}{.}\PYG{n}{Transform}\PYG{p}{)}\PYG{p}{:} \PYG{k}{def} \PYG{n+nf}{transform\PYGZus{}non\PYGZus{}affine}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{xy}\PYG{p}{)}\PYG{p}{:} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.} \end{sphinxVerbatim} \item {} Artists no longer have \sphinxcode{\sphinxupquote{x\_isdata}} or \sphinxcode{\sphinxupquote{y\_isdata}} attributes; instead any artist’s transform can be interrogated with \sphinxcode{\sphinxupquote{artist\_instance.get\_transform().contains\_branch(ax.transData)}} \item {} Lines added to an axes now take into account their transform when updating the data and view limits. This means transforms can now be used as a pre-transform. For instance: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{transforms} \PYG{k}{as} \PYG{n+nn}{mtrans} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{axes}\PYG{p}{(}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{mtrans}\PYG{o}{.}\PYG{n}{Affine2D}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{scale}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)} \PYG{o}{+} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{viewLim}\PYG{p}{)} \PYG{g+go}{Bbox(\PYGZsq{}array([[ 0., 0.],\PYGZbs{}n [ 90., 90.]])\PYGZsq{})} \end{sphinxVerbatim} \item {} One can now easily get a transform which goes from one transform’s coordinate system to another, in an optimized way, using the new subtract method on a transform. For instance, to go from data coordinates to axes coordinates: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{axes}\PYG{p}{(}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{data2ax} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData} \PYG{o}{\PYGZhy{}} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{o}{.}\PYG{n}{depth}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{o}{.}\PYG{n}{depth}\PYG{p}{)} \PYG{g+go}{3, 1} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{data2ax}\PYG{o}{.}\PYG{n}{depth}\PYG{p}{)} \PYG{g+go}{2} \end{sphinxVerbatim} for versions before 1.2 this could only be achieved in a sub-optimal way, using \sphinxcode{\sphinxupquote{ax.transData + ax.transAxes.inverted()}} (depth is a new concept, but had it existed it would return 4 for this example). \item {} \sphinxcode{\sphinxupquote{twinx}} and \sphinxcode{\sphinxupquote{twiny}} now returns an instance of SubplotBase if parent axes is an instance of SubplotBase. \item {} All Qt3-based backends are now deprecated due to the lack of py3k bindings. Qt and QtAgg backends will continue to work in v1.2.x for py2.6 and py2.7. It is anticipated that the Qt3 support will be completely removed for the next release. \item {} \sphinxcode{\sphinxupquote{ColorConverter}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} now subclasses \sphinxcode{\sphinxupquote{object}} \item {} ContourSet instances no longer have a \sphinxcode{\sphinxupquote{transform}} attribute. Instead, access the transform with the \sphinxcode{\sphinxupquote{get\_transform}} method. \end{itemize} \section{Changes in 1.1.x} \label{\detokenize{api/api_changes:changes-in-1-1-x}}\begin{itemize} \item {} Added new {\hyperref[\detokenize{api/sankey_api:matplotlib.sankey.Sankey}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.sankey.Sankey}}}}} for generating Sankey diagrams. \item {} In {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow()}}}}}, setting \sphinxstyleemphasis{interpolation} to ‘nearest’ will now always mean that the nearest-neighbor interpolation is performed. If you want the no-op interpolation to be performed, choose ‘none’. \item {} There were errors in how the tri-functions were handling input parameters that had to be fixed. If your tri-plots are not working correctly anymore, or you were working around apparent mistakes, please see issue \#203 in the github tracker. When in doubt, use kwargs. \item {} The ‘symlog’ scale had some bad behavior in previous versions. This has now been fixed and users should now be able to use it without frustrations. The fixes did result in some minor changes in appearance for some users who may have been depending on the bad behavior. \item {} There is now a common set of markers for all plotting functions. Previously, some markers existed only for {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.scatter:matplotlib.pyplot.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter()}}}}} or just for {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot()}}}}}. This is now no longer the case. This merge did result in a conflict. The string ‘d’ now means “thin diamond” while ‘D’ will mean “regular diamond”. \end{itemize} \section{Changes beyond 0.99.x} \label{\detokenize{api/api_changes:changes-beyond-0-99-x}}\begin{itemize} \item {} The default behavior of {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim:matplotlib.axes.Axes.set_xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_xlim()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:matplotlib.axes.Axes.set_ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_ylim()}}}}}, and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.axis:matplotlib.axes.Axes.axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.axis()}}}}}, and their corresponding pyplot functions, has been changed: when view limits are set explicitly with one of these methods, autoscaling is turned off for the matching axis. A new \sphinxstyleemphasis{auto} kwarg is available to control this behavior. The limit kwargs have been renamed to \sphinxstyleemphasis{left} and \sphinxstyleemphasis{right} instead of \sphinxstyleemphasis{xmin} and \sphinxstyleemphasis{xmax}, and \sphinxstyleemphasis{bottom} and \sphinxstyleemphasis{top} instead of \sphinxstyleemphasis{ymin} and \sphinxstyleemphasis{ymax}. The old names may still be used, however. \item {} There are five new Axes methods with corresponding pyplot functions to facilitate autoscaling, tick location, and tick label formatting, and the general appearance of ticks and tick labels: \begin{itemize} \item {} {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.autoscale:matplotlib.axes.Axes.autoscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.autoscale()}}}}} turns autoscaling on or off, and applies it. \item {} {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.margins:matplotlib.axes.Axes.margins}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.margins()}}}}} sets margins used to autoscale the \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.viewLim}} based on the \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.dataLim}}. \item {} {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.locator_params:matplotlib.axes.Axes.locator_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.locator\_params()}}}}} allows one to adjust axes locator parameters such as \sphinxstyleemphasis{nbins}. \item {} {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.ticklabel_format:matplotlib.axes.Axes.ticklabel_format}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.ticklabel\_format()}}}}} is a convenience method for controlling the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.ScalarFormatter}}}}} that is used by default with linear axes. \item {} {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.tick_params:matplotlib.axes.Axes.tick_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.tick\_params()}}}}} controls direction, size, visibility, and color of ticks and their labels. \end{itemize} \item {} The {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.bar:matplotlib.axes.Axes.bar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.bar()}}}}} method accepts a \sphinxstyleemphasis{error\_kw} kwarg; it is a dictionary of kwargs to be passed to the errorbar function. \item {} The {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hist:matplotlib.axes.Axes.hist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.hist()}}}}} \sphinxstyleemphasis{color} kwarg now accepts a sequence of color specs to match a sequence of datasets. \item {} The {\hyperref[\detokenize{api/collections_api:matplotlib.collections.EllipseCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{EllipseCollection}}}}} has been changed in two ways: \begin{itemize} \item {} There is a new \sphinxstyleemphasis{units} option, ‘xy’, that scales the ellipse with the data units. This matches the :class:’\textasciitilde{}matplotlib.patches.Ellipse{}` scaling. \item {} The \sphinxstyleemphasis{height} and \sphinxstyleemphasis{width} kwargs have been changed to specify the height and width, again for consistency with {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Ellipse:matplotlib.patches.Ellipse}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Ellipse}}}}}, and to better match their names; previously they specified the half-height and half-width. \end{itemize} \item {} There is a new rc parameter \sphinxcode{\sphinxupquote{axes.color\_cycle}}, and the color cycle is now independent of the rc parameter \sphinxcode{\sphinxupquote{lines.color}}. \sphinxcode{\sphinxupquote{matplotlib.Axes.set\_default\_color\_cycle()}} is deprecated. \item {} You can now print several figures to one pdf file and modify the document information dictionary of a pdf file. See the docstrings of the class {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfPages}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.PdfPages}}}}} for more information. \item {} Removed \sphinxhref{http://www.voidspace.org.uk/python/configobj.html}{configobj} and \sphinxhref{http://code.enthought.com/pages/traits.html}{enthought.traits} packages, which are only required by the experimental traited config and are somewhat out of date. If needed, install them independently. \end{itemize} \begin{itemize} \item {} The new rc parameter \sphinxcode{\sphinxupquote{savefig.extension}} sets the filename extension that is used by {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.savefig}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure.savefig()}}}}} if its \sphinxstyleemphasis{fname} argument lacks an extension. \item {} In an effort to simplify the backend API, all clipping rectangles and paths are now passed in using GraphicsContext objects, even on collections and images. Therefore: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{draw\PYGZus{}path\PYGZus{}collection}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{master\PYGZus{}transform}\PYG{p}{,} \PYG{n}{cliprect}\PYG{p}{,} \PYG{n}{clippath}\PYG{p}{,} \PYG{n}{clippath\PYGZus{}trans}\PYG{p}{,} \PYG{n}{paths}\PYG{p}{,} \PYG{n}{all\PYGZus{}transforms}\PYG{p}{,} \PYG{n}{offsets}\PYG{p}{,} \PYG{n}{offsetTrans}\PYG{p}{,} \PYG{n}{facecolors}\PYG{p}{,} \PYG{n}{edgecolors}\PYG{p}{,} \PYG{n}{linewidths}\PYG{p}{,} \PYG{n}{linestyles}\PYG{p}{,} \PYG{n}{antialiaseds}\PYG{p}{,} \PYG{n}{urls}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} is now} \PYG{n}{draw\PYGZus{}path\PYGZus{}collection}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{gc}\PYG{p}{,} \PYG{n}{master\PYGZus{}transform}\PYG{p}{,} \PYG{n}{paths}\PYG{p}{,} \PYG{n}{all\PYGZus{}transforms}\PYG{p}{,} \PYG{n}{offsets}\PYG{p}{,} \PYG{n}{offsetTrans}\PYG{p}{,} \PYG{n}{facecolors}\PYG{p}{,} \PYG{n}{edgecolors}\PYG{p}{,} \PYG{n}{linewidths}\PYG{p}{,} \PYG{n}{linestyles}\PYG{p}{,} \PYG{n}{antialiaseds}\PYG{p}{,} \PYG{n}{urls}\PYG{p}{)} \PYG{n}{draw\PYGZus{}quad\PYGZus{}mesh}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{master\PYGZus{}transform}\PYG{p}{,} \PYG{n}{cliprect}\PYG{p}{,} \PYG{n}{clippath}\PYG{p}{,} \PYG{n}{clippath\PYGZus{}trans}\PYG{p}{,} \PYG{n}{meshWidth}\PYG{p}{,} \PYG{n}{meshHeight}\PYG{p}{,} \PYG{n}{coordinates}\PYG{p}{,} \PYG{n}{offsets}\PYG{p}{,} \PYG{n}{offsetTrans}\PYG{p}{,} \PYG{n}{facecolors}\PYG{p}{,} \PYG{n}{antialiased}\PYG{p}{,} \PYG{n}{showedges}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} is now} \PYG{n}{draw\PYGZus{}quad\PYGZus{}mesh}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{gc}\PYG{p}{,} \PYG{n}{master\PYGZus{}transform}\PYG{p}{,} \PYG{n}{meshWidth}\PYG{p}{,} \PYG{n}{meshHeight}\PYG{p}{,} \PYG{n}{coordinates}\PYG{p}{,} \PYG{n}{offsets}\PYG{p}{,} \PYG{n}{offsetTrans}\PYG{p}{,} \PYG{n}{facecolors}\PYG{p}{,} \PYG{n}{antialiased}\PYG{p}{,} \PYG{n}{showedges}\PYG{p}{)} \PYG{n}{draw\PYGZus{}image}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{im}\PYG{p}{,} \PYG{n}{bbox}\PYG{p}{,} \PYG{n}{clippath}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{clippath\PYGZus{}trans}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} is now} \PYG{n}{draw\PYGZus{}image}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{gc}\PYG{p}{,} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{im}\PYG{p}{)} \end{sphinxVerbatim} \item {} There are four new Axes methods with corresponding pyplot functions that deal with unstructured triangular grids: \begin{itemize} \item {} {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.tricontour:matplotlib.axes.Axes.tricontour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.tricontour()}}}}} draws contour lines on a triangular grid. \item {} {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.tricontourf:matplotlib.axes.Axes.tricontourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.tricontourf()}}}}} draws filled contours on a triangular grid. \item {} {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.tripcolor:matplotlib.axes.Axes.tripcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.tripcolor()}}}}} draws a pseudocolor plot on a triangular grid. \item {} {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.triplot:matplotlib.axes.Axes.triplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.triplot()}}}}} draws a triangular grid as lines and/or markers. \end{itemize} \end{itemize} \section{Changes in 0.99} \label{\detokenize{api/api_changes:changes-in-0-99}}\begin{itemize} \item {} pylab no longer provides a load and save function. These are available in matplotlib.mlab, or you can use numpy.loadtxt and numpy.savetxt for text files, or np.save and np.load for binary numpy arrays. \item {} User-generated colormaps can now be added to the set recognized by {\hyperref[\detokenize{api/cm_api:matplotlib.cm.get_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.get\_cmap()}}}}}. Colormaps can be made the default and applied to the current image using {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.set_cmap:matplotlib.pyplot.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.set\_cmap()}}}}}. \item {} changed use\_mrecords default to False in mlab.csv2rec since this is partially broken \item {} Axes instances no longer have a “frame” attribute. Instead, use the new “spines” attribute. Spines is a dictionary where the keys are the names of the spines (e.g., ‘left’,’right’ and so on) and the values are the artists that draw the spines. For normal (rectilinear) axes, these artists are Line2D instances. For other axes (such as polar axes), these artists may be Patch instances. \item {} Polar plots no longer accept a resolution kwarg. Instead, each Path must specify its own number of interpolation steps. This is unlikely to be a user-visible change \textendash{} if interpolation of data is required, that should be done before passing it to Matplotlib. \end{itemize} \section{Changes for 0.98.x} \label{\detokenize{api/api_changes:changes-for-0-98-x}}\begin{itemize} \item {} psd(), csd(), and cohere() will now automatically wrap negative frequency components to the beginning of the returned arrays. This is much more sensible behavior and makes them consistent with specgram(). The previous behavior was more of an oversight than a design decision. \item {} Added new keyword parameters \sphinxstyleemphasis{nonposx}, \sphinxstyleemphasis{nonposy} to {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} methods that set log scale parameters. The default is still to mask out non-positive values, but the kwargs accept ‘clip’, which causes non-positive values to be replaced with a very small positive value. \item {} Added new {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.fignum_exists:matplotlib.pyplot.fignum_exists}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.fignum\_exists()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.get_fignums:matplotlib.pyplot.get_fignums}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.get\_fignums()}}}}}; they merely expose information that had been hidden in \sphinxcode{\sphinxupquote{matplotlib.\_pylab\_helpers}}. \item {} Deprecated numerix package. \item {} Added new {\hyperref[\detokenize{api/image_api:matplotlib.image.imsave}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.image.imsave()}}}}} and exposed it to the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot}}}}} interface. \item {} Remove support for pyExcelerator in exceltools \textendash{} use xlwt instead \item {} Changed the defaults of acorr and xcorr to use usevlines=True, maxlags=10 and normed=True since these are the best defaults \item {} Following keyword parameters for \sphinxcode{\sphinxupquote{matplotlib.label.Label}} are now deprecated and new set of parameters are introduced. The new parameters are given as a fraction of the font-size. Also, \sphinxstyleemphasis{scatteryoffsets}, \sphinxstyleemphasis{fancybox} and \sphinxstyleemphasis{columnspacing} are added as keyword parameters. \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Deprecated &\sphinxstyletheadfamily New \\ \hline pad & borderpad \\ \hline labelsep & labelspacing \\ \hline handlelen & handlelength \\ \hline handlestextsep & handletextpad \\ \hline axespad & borderaxespad \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \item {} Removed the configobj and experimental traits rc support \item {} Modified {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.psd()}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.csd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.csd()}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.cohere}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.cohere()}}}}}, and {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.specgram()}}}}} to scale one-sided densities by a factor of 2. Also, optionally scale the densities by the sampling frequency, which gives true values of densities that can be integrated by the returned frequency values. This also gives better MATLAB compatibility. The corresponding {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} methods and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot}}}}} functions were updated as well. \item {} Font lookup now uses a nearest-neighbor approach rather than an exact match. Some fonts may be different in plots, but should be closer to what was requested. \item {} {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim:matplotlib.axes.Axes.set_xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_xlim()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:matplotlib.axes.Axes.set_ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_ylim()}}}}} now return a copy of the \sphinxcode{\sphinxupquote{viewlim}} array to avoid modify-in-place surprises. \item {} {\hyperref[\detokenize{api/afm_api:matplotlib.afm.AFM.get_fullname}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.afm.AFM.get\_fullname()}}}}} and {\hyperref[\detokenize{api/afm_api:matplotlib.afm.AFM.get_familyname}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.afm.AFM.get\_familyname()}}}}} no longer raise an exception if the AFM file does not specify these optional attributes, but returns a guess based on the required FontName attribute. \item {} Changed precision kwarg in {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.spy:matplotlib.pyplot.spy}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.spy()}}}}}; default is 0, and the string value ‘present’ is used for sparse arrays only to show filled locations. \item {} {\hyperref[\detokenize{api/collections_api:matplotlib.collections.EllipseCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.EllipseCollection}}}}} added. \item {} Added \sphinxcode{\sphinxupquote{angles}} kwarg to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.quiver:matplotlib.pyplot.quiver}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.quiver()}}}}} for more flexible specification of the arrow angles. \item {} Deprecated (raise NotImplementedError) all the mlab2 functions from {\hyperref[\detokenize{api/mlab_api:module-matplotlib.mlab}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab}}}}} out of concern that some of them were not clean room implementations. \item {} Methods {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.get_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.Collection.get\_offsets()}}}}} and {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.Collection.set\_offsets()}}}}} added to {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Collection}}}}} base class. \item {} {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.figurePatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure.figurePatch}}}}} renamed \sphinxcode{\sphinxupquote{matplotlib.figure.Figure.patch}}; \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.axesPatch}} renamed \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.patch}}; \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.axesFrame}} renamed \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.frame}}. \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.get\_frame()}}, which returns \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.patch}}, is deprecated. \item {} Changes in the {\hyperref[\detokenize{api/contour_api:matplotlib.contour.ContourLabeler}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.contour.ContourLabeler}}}}} attributes ({\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.clabel:matplotlib.pyplot.clabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.clabel()}}}}} function) so that they all have a form like \sphinxcode{\sphinxupquote{.labelAttribute}}. The three attributes that are most likely to be used by end users, \sphinxcode{\sphinxupquote{.cl}}, \sphinxcode{\sphinxupquote{.cl\_xy}} and \sphinxcode{\sphinxupquote{.cl\_cvalues}} have been maintained for the moment (in addition to their renamed versions), but they are deprecated and will eventually be removed. \item {} Moved several functions in {\hyperref[\detokenize{api/mlab_api:module-matplotlib.mlab}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab}}}}} and {\hyperref[\detokenize{api/cbook_api:module-matplotlib.cbook}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cbook}}}}} into a separate module \sphinxcode{\sphinxupquote{matplotlib.numerical\_methods}} because they were unrelated to the initial purpose of mlab or cbook and appeared more coherent elsewhere. \end{itemize} \section{Changes for 0.98.1} \label{\detokenize{api/api_changes:changes-for-0-98-1}}\begin{itemize} \item {} Removed broken \sphinxcode{\sphinxupquote{matplotlib.axes3d}} support and replaced it with a non-implemented error pointing to 0.91.x \end{itemize} \section{Changes for 0.98.0} \label{\detokenize{api/api_changes:changes-for-0-98-0}}\begin{itemize} \item {} {\hyperref[\detokenize{api/image_api:matplotlib.image.imread}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.image.imread()}}}}} now no longer always returns RGBA data—if the image is luminance or RGB, it will return a MxN or MxNx3 array if possible. Also uint8 is no longer always forced to float. \item {} Rewrote the {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}} callback infrastructure to use {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.CallbackRegistry}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cbook.CallbackRegistry}}}}} rather than custom callback handling. Any users of \sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable.add\_observer()}} of the {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarMappable}}}}} should use the \sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable.callbacks}} {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.CallbackRegistry}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CallbackRegistry}}}}} instead. \item {} New axes function and Axes method provide control over the plot color cycle: \sphinxcode{\sphinxupquote{matplotlib.axes.set\_default\_color\_cycle()}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_color_cycle:matplotlib.axes.Axes.set_color_cycle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_color\_cycle()}}}}}. \item {} Matplotlib now requires Python 2.4, so {\hyperref[\detokenize{api/cbook_api:module-matplotlib.cbook}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cbook}}}}} will no longer provide \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#set}{\sphinxcode{\sphinxupquote{set}}}, \sphinxhref{https://docs.python.org/3/library/functions.html\#enumerate}{\sphinxcode{\sphinxupquote{enumerate()}}}, \sphinxhref{https://docs.python.org/3/library/functions.html\#reversed}{\sphinxcode{\sphinxupquote{reversed()}}} or \sphinxcode{\sphinxupquote{izip()}} compatibility functions. \item {} In Numpy 1.0, bins are specified by the left edges only. The axes method {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hist:matplotlib.axes.Axes.hist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.hist()}}}}} now uses future Numpy 1.3 semantics for histograms. Providing \sphinxcode{\sphinxupquote{binedges}}, the last value gives the upper-right edge now, which was implicitly set to +infinity in Numpy 1.0. This also means that the last bin doesn’t contain upper outliers any more by default. \item {} New axes method and pyplot function, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hexbin:matplotlib.pyplot.hexbin}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hexbin()}}}}}, is an alternative to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.scatter:matplotlib.pyplot.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter()}}}}} for large datasets. It makes something like a {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:matplotlib.pyplot.pcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolor()}}}}} of a 2-D histogram, but uses hexagonal bins. \item {} New kwarg, \sphinxcode{\sphinxupquote{symmetric}}, in {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.MaxNLocator}}}}} allows one require an axis to be centered around zero. \item {} Toolkits must now be imported from \sphinxcode{\sphinxupquote{mpl\_toolkits}} (not \sphinxcode{\sphinxupquote{matplotlib.toolkits}}) \end{itemize} \subsection{Notes about the transforms refactoring} \label{\detokenize{api/api_changes:notes-about-the-transforms-refactoring}} A major new feature of the 0.98 series is a more flexible and extensible transformation infrastructure, written in Python/Numpy rather than a custom C extension. The primary goal of this refactoring was to make it easier to extend matplotlib to support new kinds of projections. This is mostly an internal improvement, and the possible user-visible changes it allows are yet to come. See {\hyperref[\detokenize{api/transformations:module-matplotlib.transforms}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms}}}}} for a description of the design of the new transformation framework. For efficiency, many of these functions return views into Numpy arrays. This means that if you hold on to a reference to them, their contents may change. If you want to store a snapshot of their current values, use the Numpy array method copy(). The view intervals are now stored only in one place \textendash{} in the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} instance, not in the locator instances as well. This means locators must get their limits from their {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axis.Axis}}}}}, which in turn looks up its limits from the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}. If a locator is used temporarily and not assigned to an Axis or Axes, (e.g., in {\hyperref[\detokenize{api/contour_api:module-matplotlib.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.contour}}}}}), a dummy axis must be created to store its bounds. Call \sphinxcode{\sphinxupquote{matplotlib.ticker.Locator.create\_dummy\_axis()}} to do so. The functionality of \sphinxcode{\sphinxupquote{Pbox}} has been merged with {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. Its methods now all return copies rather than modifying in place. The following lists many of the simple changes necessary to update code from the old transformation framework to the new one. In particular, methods that return a copy are named with a verb in the past tense, whereas methods that alter an object in place are named with a verb in the present tense. \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.transforms}}} \label{\detokenize{api/api_changes:matplotlib-transforms}} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Old method &\sphinxstyletheadfamily New method \\ \hline \sphinxcode{\sphinxupquote{Bbox.get\_bounds()}} & \sphinxcode{\sphinxupquote{transforms.Bbox.bounds}} \\ \hline \sphinxcode{\sphinxupquote{Bbox.width()}} & \sphinxcode{\sphinxupquote{transforms.Bbox.width}} \\ \hline \sphinxcode{\sphinxupquote{Bbox.height()}} & \sphinxcode{\sphinxupquote{transforms.Bbox.height}} \\ \hline \sphinxcode{\sphinxupquote{Bbox.intervalx().get\_bounds()}} & \sphinxcode{\sphinxupquote{transforms.Bbox.intervalx}} \\ \hline \sphinxcode{\sphinxupquote{Bbox.intervalx().set\_bounds()}} & {[}\sphinxcode{\sphinxupquote{Bbox.intervalx}} is now a property.{]} \\ \hline \sphinxcode{\sphinxupquote{Bbox.intervaly().get\_bounds()}} & \sphinxcode{\sphinxupquote{transforms.Bbox.intervaly}} \\ \hline \sphinxcode{\sphinxupquote{Bbox.intervaly().set\_bounds()}} & {[}\sphinxcode{\sphinxupquote{Bbox.intervaly}} is now a property.{]} \\ \hline \sphinxcode{\sphinxupquote{Bbox.xmin()}} & \sphinxcode{\sphinxupquote{transforms.Bbox.x0}} or \sphinxcode{\sphinxupquote{transforms.Bbox.xmin}} % \begin{footnote}[1]\sphinxAtStartFootnote The {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} is bound by the points (x0, y0) to (x1, y1) and there is no defined order to these points, that is, x0 is not necessarily the left edge of the box. To get the left edge of the \sphinxcode{\sphinxupquote{Bbox}}, use the read-only property \sphinxcode{\sphinxupquote{xmin}}. % \end{footnote} \\ \hline \sphinxcode{\sphinxupquote{Bbox.ymin()}} & \sphinxcode{\sphinxupquote{transforms.Bbox.y0}} or \sphinxcode{\sphinxupquote{transforms.Bbox.ymin}} \sphinxfootnotemark[1] \\ \hline \sphinxcode{\sphinxupquote{Bbox.xmax()}} & \sphinxcode{\sphinxupquote{transforms.Bbox.x1}} or \sphinxcode{\sphinxupquote{transforms.Bbox.xmax}} \sphinxfootnotemark[1] \\ \hline \sphinxcode{\sphinxupquote{Bbox.ymax()}} & \sphinxcode{\sphinxupquote{transforms.Bbox.y1}} or \sphinxcode{\sphinxupquote{transforms.Bbox.ymax}} \sphinxfootnotemark[1] \\ \hline \sphinxcode{\sphinxupquote{Bbox.overlaps(bboxes)}} & \sphinxcode{\sphinxupquote{Bbox.count\_overlaps(bboxes)}} \\ \hline \sphinxcode{\sphinxupquote{bbox\_all(bboxes)}} & \sphinxcode{\sphinxupquote{Bbox.union(bboxes)}} {[}\sphinxcode{\sphinxupquote{transforms.Bbox.union()}} is a staticmethod.{]} \\ \hline \sphinxcode{\sphinxupquote{lbwh\_to\_bbox(l, b, w, h)}} & \sphinxcode{\sphinxupquote{Bbox.from\_bounds(x0, y0, w, h)}} {[}\sphinxcode{\sphinxupquote{transforms.Bbox.from\_bounds()}} is a staticmethod.{]} \\ \hline \sphinxcode{\sphinxupquote{inverse\_transform\_bbox(trans, bbox)}} & \sphinxcode{\sphinxupquote{Bbox.inverse\_transformed(trans)}} \\ \hline \sphinxcode{\sphinxupquote{Interval.contains\_open(v)}} & \sphinxcode{\sphinxupquote{interval\_contains\_open(tuple, v)}} \\ \hline \sphinxcode{\sphinxupquote{Interval.contains(v)}} & \sphinxcode{\sphinxupquote{interval\_contains(tuple, v)}} \\ \hline \sphinxcode{\sphinxupquote{identity\_transform()}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.IdentityTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.IdentityTransform}}}}} \\ \hline \sphinxcode{\sphinxupquote{blend\_xy\_sep\_transform(xtrans, ytrans)}} & \sphinxcode{\sphinxupquote{blended\_transform\_factory(xtrans, ytrans)}} \\ \hline \sphinxcode{\sphinxupquote{scale\_transform(xs, ys)}} & \sphinxcode{\sphinxupquote{Affine2D().scale(xs{[}, ys{]})}} \\ \hline \sphinxcode{\sphinxupquote{get\_bbox\_transform(boxin, boxout)}} & \sphinxcode{\sphinxupquote{BboxTransform(boxin, boxout)}} or \sphinxcode{\sphinxupquote{BboxTransformFrom(boxin)}} or \sphinxcode{\sphinxupquote{BboxTransformTo(boxout)}} \\ \hline \sphinxcode{\sphinxupquote{Transform.seq\_xy\_tup(points)}} & \sphinxcode{\sphinxupquote{Transform.transform(points)}} \\ \hline \sphinxcode{\sphinxupquote{Transform.inverse\_xy\_tup(points)}} & \sphinxcode{\sphinxupquote{Transform.inverted().transform(points)}} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.axes}}} \label{\detokenize{api/api_changes:matplotlib-axes}} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Old method &\sphinxstyletheadfamily New method \\ \hline \sphinxcode{\sphinxupquote{Axes.get\_position()}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_position:matplotlib.axes.Axes.get_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.get\_position()}}}}} % \begin{footnote}[2]\sphinxAtStartFootnote {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_position:matplotlib.axes.Axes.get_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.get\_position()}}}}} used to return a list of points, now it returns a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Bbox}}}}} instance. % \end{footnote} \\ \hline \sphinxcode{\sphinxupquote{Axes.set\_position()}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_position:matplotlib.axes.Axes.set_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_position()}}}}} % \begin{footnote}[3]\sphinxAtStartFootnote {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_position:matplotlib.axes.Axes.set_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_position()}}}}} now accepts either four scalars or a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Bbox}}}}} instance. % \end{footnote} \\ \hline \sphinxcode{\sphinxupquote{Axes.toggle\_log\_lineary()}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yscale:matplotlib.axes.Axes.set_yscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_yscale()}}}}} % \begin{footnote}[4]\sphinxAtStartFootnote Since the recfactoring allows for more than two scale types (‘log’ or ‘linear’), it no longer makes sense to have a toggle. \sphinxcode{\sphinxupquote{Axes.toggle\_log\_lineary()}} has been removed. % \end{footnote} \\ \hline \sphinxcode{\sphinxupquote{Subplot}} class & removed. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} The \sphinxcode{\sphinxupquote{Polar}} class has moved to {\hyperref[\detokenize{api/projections_api:module-matplotlib.projections.polar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.projections.polar}}}}}. \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.artist}}} \label{\detokenize{api/api_changes:matplotlib-artist}} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Old method &\sphinxstyletheadfamily New method \\ \hline \sphinxcode{\sphinxupquote{Artist.set\_clip\_path(path)}} & \sphinxcode{\sphinxupquote{Artist.set\_clip\_path(path, transform)}} % \begin{footnote}[5]\sphinxAtStartFootnote {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.Artist.set\_clip\_path()}}}}} now accepts a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.path.Path}}}}} instance and a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} that will be applied to the path immediately before clipping. % \end{footnote} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.collections}}} \label{\detokenize{api/api_changes:matplotlib-collections}} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Old method &\sphinxstyletheadfamily New method \\ \hline \sphinxcode{\sphinxupquote{linestyle}} & \sphinxcode{\sphinxupquote{linestyles}} % \begin{footnote}[6]\sphinxAtStartFootnote Linestyles are now treated like all other collection attributes, i.e. a single value or multiple values may be provided. % \end{footnote} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.colors}}} \label{\detokenize{api/api_changes:matplotlib-colors}} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Old method &\sphinxstyletheadfamily New method \\ \hline \sphinxcode{\sphinxupquote{ColorConvertor.to\_rgba\_list(c)}} & \sphinxcode{\sphinxupquote{ColorConvertor.to\_rgba\_array(c)}} {[}\sphinxcode{\sphinxupquote{matplotlib.colors.ColorConvertor.to\_rgba\_array()}} returns an Nx4 Numpy array of RGBA color quadruples.{]} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.contour}}} \label{\detokenize{api/api_changes:matplotlib-contour}} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Old method &\sphinxstyletheadfamily New method \\ \hline \sphinxcode{\sphinxupquote{Contour.\_segments}} & \sphinxcode{\sphinxupquote{matplotlib.contour.Contour.get\_paths{}`()}} {[}Returns a list of {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.path.Path}}}}} instances.{]} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.figure}}} \label{\detokenize{api/api_changes:matplotlib-figure}} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Old method &\sphinxstyletheadfamily New method \\ \hline \sphinxcode{\sphinxupquote{Figure.dpi.get()}} / \sphinxcode{\sphinxupquote{Figure.dpi.set()}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.dpi}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure.dpi}}}}} \sphinxstyleemphasis{(a property)} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.patches}}} \label{\detokenize{api/api_changes:matplotlib-patches}} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Old method &\sphinxstyletheadfamily New method \\ \hline \sphinxcode{\sphinxupquote{Patch.get\_verts()}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.Patch.get\_path()}}}}} {[}Returns a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.path.Path}}}}} instance{]} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backend\_bases}}} \label{\detokenize{api/api_changes:matplotlib-backend-bases}} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Old method &\sphinxstyletheadfamily New method \\ \hline \sphinxcode{\sphinxupquote{GraphicsContext.set\_clip\_rectangle(tuple)}} & \sphinxcode{\sphinxupquote{GraphicsContext.set\_clip\_rectangle(bbox)}} \\ \hline \sphinxcode{\sphinxupquote{GraphicsContext.get\_clip\_path()}} & \sphinxcode{\sphinxupquote{GraphicsContext.get\_clip\_path()}} % \begin{footnote}[7]\sphinxAtStartFootnote \sphinxcode{\sphinxupquote{matplotlib.backend\_bases.GraphicsContext.get\_clip\_path()}} returns a tuple of the form (\sphinxstyleemphasis{path}, \sphinxstyleemphasis{affine\_transform}), where \sphinxstyleemphasis{path} is a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.path.Path}}}}} instance and \sphinxstyleemphasis{affine\_transform} is a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Affine2D}}}}} instance. % \end{footnote} \\ \hline \sphinxcode{\sphinxupquote{GraphicsContext.set\_clip\_path()}} & \sphinxcode{\sphinxupquote{GraphicsContext.set\_clip\_path()}} % \begin{footnote}[8]\sphinxAtStartFootnote \sphinxcode{\sphinxupquote{matplotlib.backend\_bases.GraphicsContext.set\_clip\_path()}} now only accepts a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformedPath}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.TransformedPath}}}}} instance. % \end{footnote} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{RendererBase}}} \label{\detokenize{api/api_changes:rendererbase}} New methods: \begin{itemize} \item {} {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path(self, gc, path, transform, rgbFace)}}}}} \item {} {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_markers(self, gc, marker\_path, marker\_trans, path, trans, rgbFace)}}}}} \item {} {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_path_collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path\_collection(self, master\_transform, cliprect, clippath, clippath\_trans, paths, all\_transforms, offsets, offsetTrans, facecolors, edgecolors, linewidths, linestyles, antialiaseds)}}}}} \sphinxstyleemphasis{{[}optional{]}} \end{itemize} Changed methods: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{draw\_image(self, x, y, im, bbox)}} is now {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_image(self, x, y, im, bbox, clippath, clippath\_trans)}}}}} \end{itemize} Removed methods: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{draw\_arc}} \item {} \sphinxcode{\sphinxupquote{draw\_line\_collection}} \item {} \sphinxcode{\sphinxupquote{draw\_line}} \item {} \sphinxcode{\sphinxupquote{draw\_lines}} \item {} \sphinxcode{\sphinxupquote{draw\_point}} \item {} \sphinxcode{\sphinxupquote{draw\_quad\_mesh}} \item {} \sphinxcode{\sphinxupquote{draw\_poly\_collection}} \item {} \sphinxcode{\sphinxupquote{draw\_polygon}} \item {} \sphinxcode{\sphinxupquote{draw\_rectangle}} \item {} \sphinxcode{\sphinxupquote{draw\_regpoly\_collection}} \end{itemize} \section{Changes for 0.91.2} \label{\detokenize{api/api_changes:changes-for-0-91-2}}\begin{itemize} \item {} For \sphinxcode{\sphinxupquote{csv2rec()}}, checkrows=0 is the new default indicating all rows will be checked for type inference \item {} A warning is issued when an image is drawn on log-scaled axes, since it will not log-scale the image data. \item {} Moved \sphinxcode{\sphinxupquote{rec2gtk()}} to \sphinxcode{\sphinxupquote{matplotlib.toolkits.gtktools}} \item {} Moved \sphinxcode{\sphinxupquote{rec2excel()}} to \sphinxcode{\sphinxupquote{matplotlib.toolkits.exceltools}} \item {} Removed, dead/experimental ExampleInfo, Namespace and Importer code from \sphinxcode{\sphinxupquote{matplotlib.\_\_init\_\_}} \end{itemize} \section{Changes for 0.91.1} \label{\detokenize{api/api_changes:changes-for-0-91-1}} \section{Changes for 0.91.0} \label{\detokenize{api/api_changes:changes-for-0-91-0}}\begin{itemize} \item {} Changed \sphinxcode{\sphinxupquote{cbook.is\_file\_like()}} to \sphinxcode{\sphinxupquote{cbook.is\_writable\_file\_like()}} and corrected behavior. \item {} Added ax kwarg to \sphinxcode{\sphinxupquote{pyplot.colorbar()}} and \sphinxcode{\sphinxupquote{Figure.colorbar()}} so that one can specify the axes object from which space for the colorbar is to be taken, if one does not want to make the colorbar axes manually. \item {} Changed \sphinxcode{\sphinxupquote{cbook.reversed()}} so it yields a tuple rather than a (index, tuple). This agrees with the python reversed builtin, and cbook only defines reversed if python doesn’t provide the builtin. \item {} Made skiprows=1 the default on \sphinxcode{\sphinxupquote{csv2rec()}} \item {} The gd and paint backends have been deleted. \item {} The errorbar method and function now accept additional kwargs so that upper and lower limits can be indicated by capping the bar with a caret instead of a straight line segment. \item {} The {\hyperref[\detokenize{api/dviread:module-matplotlib.dviread}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dviread}}}}} file now has a parser for files like psfonts.map and pdftex.map, to map TeX font names to external files. \item {} The file {\hyperref[\detokenize{api/type1font:module-matplotlib.type1font}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.type1font}}}}} contains a new class for Type 1 fonts. Currently it simply reads pfa and pfb format files and stores the data in a way that is suitable for embedding in pdf files. In the future the class might actually parse the font to allow e.g., subsetting. \item {} \sphinxcode{\sphinxupquote{matplotlib.FT2Font}} now supports \sphinxcode{\sphinxupquote{FT\_Attach\_File()}}. In practice this can be used to read an afm file in addition to a pfa/pfb file, to get metrics and kerning information for a Type 1 font. \item {} The \sphinxcode{\sphinxupquote{AFM}} class now supports querying CapHeight and stem widths. The get\_name\_char method now has an isord kwarg like get\_width\_char. \item {} Changed \sphinxcode{\sphinxupquote{pcolor()}} default to shading=’flat’; but as noted now in the docstring, it is preferable to simply use the edgecolor kwarg. \item {} The mathtext font commands (\sphinxcode{\sphinxupquote{\textbackslash{}cal}}, \sphinxcode{\sphinxupquote{\textbackslash{}rm}}, \sphinxcode{\sphinxupquote{\textbackslash{}it}}, \sphinxcode{\sphinxupquote{\textbackslash{}tt}}) now behave as TeX does: they are in effect until the next font change command or the end of the grouping. Therefore uses of \sphinxcode{\sphinxupquote{\$\textbackslash{}cal\{R\}\$}} should be changed to \sphinxcode{\sphinxupquote{\$\{\textbackslash{}cal R\}\$}}. Alternatively, you may use the new LaTeX-style font commands (\sphinxcode{\sphinxupquote{\textbackslash{}mathcal}}, \sphinxcode{\sphinxupquote{\textbackslash{}mathrm}}, \sphinxcode{\sphinxupquote{\textbackslash{}mathit}}, \sphinxcode{\sphinxupquote{\textbackslash{}mathtt}}) which do affect the following group, e.g., \sphinxcode{\sphinxupquote{\$\textbackslash{}mathcal\{R\}\$}}. \item {} Text creation commands have a new default linespacing and a new \sphinxcode{\sphinxupquote{linespacing}} kwarg, which is a multiple of the maximum vertical extent of a line of ordinary text. The default is 1.2; \sphinxcode{\sphinxupquote{linespacing=2}} would be like ordinary double spacing, for example. \item {} Changed default kwarg in \sphinxcode{\sphinxupquote{matplotlib.colors.Normalize.\_\_init\_\_{}`()}} to \sphinxcode{\sphinxupquote{clip=False}}; clipping silently defeats the purpose of the special over, under, and bad values in the colormap, thereby leading to unexpected behavior. The new default should reduce such surprises. \item {} Made the emit property of {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim:matplotlib.axes.Axes.set_xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xlim()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:matplotlib.axes.Axes.set_ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_ylim()}}}}} \sphinxcode{\sphinxupquote{True}} by default; removed the Axes custom callback handling into a ‘callbacks’ attribute which is a {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.CallbackRegistry}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CallbackRegistry}}}}} instance. This now supports the ‘xlim\_changed’ and ‘ylim\_changed’ Axes events. \end{itemize} \section{Changes for 0.90.1} \label{\detokenize{api/api_changes:changes-for-0-90-1}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{The} \PYG{n}{file} \PYG{n}{dviread}\PYG{o}{.}\PYG{n}{py} \PYG{n}{has} \PYG{n}{a} \PYG{p}{(}\PYG{n}{very} \PYG{n}{limited} \PYG{o+ow}{and} \PYG{n}{fragile}\PYG{p}{)} \PYG{n}{dvi} \PYG{n}{reader} \PYG{k}{for} \PYG{n}{usetex} \PYG{n}{support}\PYG{o}{.} \PYG{n}{The} \PYG{n}{API} \PYG{n}{might} \PYG{n}{change} \PYG{o+ow}{in} \PYG{n}{the} \PYG{n}{future} \PYG{n}{so} \PYG{n}{don}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{t} \PYG{n}{depend} \PYG{n}{on} \PYG{n}{it} \PYG{n}{yet}\PYG{o}{.} \PYG{n}{Removed} \PYG{n}{deprecated} \PYG{n}{support} \PYG{k}{for} \PYG{n}{a} \PYG{n+nb}{float} \PYG{n}{value} \PYG{k}{as} \PYG{n}{a} \PYG{n}{gray}\PYG{o}{\PYGZhy{}}\PYG{n}{scale}\PYG{p}{;} \PYG{n}{now} \PYG{n}{it} \PYG{n}{must} \PYG{n}{be} \PYG{n}{a} \PYG{n}{string}\PYG{p}{,} \PYG{n}{like} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{0.5}\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{.} \PYG{n}{Added} \PYG{n}{alpha} \PYG{n}{kwarg} \PYG{n}{to} \PYG{n}{ColorConverter}\PYG{o}{.}\PYG{n}{to\PYGZus{}rgba\PYGZus{}list}\PYG{o}{.} \PYG{n}{New} \PYG{n}{method} \PYG{n}{set\PYGZus{}bounds}\PYG{p}{(}\PYG{n}{vmin}\PYG{p}{,} \PYG{n}{vmax}\PYG{p}{)} \PYG{k}{for} \PYG{n}{formatters}\PYG{p}{,} \PYG{n}{locators} \PYG{n}{sets} \PYG{n}{the} \PYG{n}{viewInterval} \PYG{o+ow}{and} \PYG{n}{dataInterval} \PYG{k+kn}{from} \PYG{n+nn}{floats}\PYG{n+nn}{.} \PYG{n}{Removed} \PYG{n}{deprecated} \PYG{n}{colorbar\PYGZus{}classic}\PYG{o}{.} \PYG{n}{Line2D}\PYG{o}{.}\PYG{n}{get\PYGZus{}xdata} \PYG{o+ow}{and} \PYG{n}{get\PYGZus{}ydata} \PYG{n}{valid\PYGZus{}only}\PYG{o}{=}\PYG{k+kc}{False} \PYG{n}{kwarg} \PYG{o+ow}{is} \PYG{n}{replaced} \PYG{n}{by} \PYG{n}{orig}\PYG{o}{=}\PYG{k+kc}{True}\PYG{o}{.} \PYG{n}{When} \PYG{k+kc}{True}\PYG{p}{,} \PYG{n}{it} \PYG{n}{returns} \PYG{n}{the} \PYG{n}{original} \PYG{n}{data}\PYG{p}{,} \PYG{n}{otherwise} \PYG{n}{the} \PYG{n}{processed} \PYG{n}{data} \PYG{p}{(}\PYG{n}{masked}\PYG{p}{,} \PYG{n}{converted}\PYG{p}{)} \PYG{n}{Some} \PYG{n}{modifications} \PYG{n}{to} \PYG{n}{the} \PYG{n}{units} \PYG{n}{interface}\PYG{o}{.} \PYG{n}{units}\PYG{o}{.}\PYG{n}{ConversionInterface}\PYG{o}{.}\PYG{n}{tickers} \PYG{n}{renamed} \PYG{n}{to} \PYG{n}{units}\PYG{o}{.}\PYG{n}{ConversionInterface}\PYG{o}{.}\PYG{n}{axisinfo} \PYG{o+ow}{and} \PYG{n}{it} \PYG{n}{now} \PYG{n}{returns} \PYG{n}{a} \PYG{n}{units}\PYG{o}{.}\PYG{n}{AxisInfo} \PYG{n+nb}{object} \PYG{n}{rather} \PYG{n}{than} \PYG{n}{a} \PYG{n+nb}{tuple}\PYG{o}{.} \PYG{n}{This} \PYG{n}{will} \PYG{n}{make} \PYG{n}{it} \PYG{n}{easier} \PYG{n}{to} \PYG{n}{add} \PYG{n}{axis} \PYG{n}{info} \PYG{n}{functionality} \PYG{p}{(}\PYG{n}{e}\PYG{o}{.}\PYG{n}{g}\PYG{o}{.}\PYG{p}{,} \PYG{n}{I} \PYG{n}{added} \PYG{n}{a} \PYG{n}{default} \PYG{n}{label} \PYG{n}{on} \PYG{n}{this} \PYG{n}{iteration}\PYG{p}{)} \PYG{n}{w}\PYG{o}{/}\PYG{n}{o} \PYG{n}{having} \PYG{n}{to} \PYG{n}{change} \PYG{n}{the} \PYG{n+nb}{tuple} \PYG{n}{length} \PYG{o+ow}{and} \PYG{n}{hence} \PYG{n}{the} \PYG{n}{API} \PYG{n}{of} \PYG{n}{the} \PYG{n}{client} \PYG{n}{code} \PYG{n}{every} \PYG{n}{time} \PYG{n}{new} \PYG{n}{functionality} \PYG{o+ow}{is} \PYG{n}{added}\PYG{o}{.} \PYG{n}{Also}\PYG{p}{,} \PYG{n}{units}\PYG{o}{.}\PYG{n}{ConversionInterface}\PYG{o}{.}\PYG{n}{convert\PYGZus{}to\PYGZus{}value} \PYG{o+ow}{is} \PYG{n}{now} \PYG{n}{simply} \PYG{n}{named} \PYG{n}{units}\PYG{o}{.}\PYG{n}{ConversionInterface}\PYG{o}{.}\PYG{n}{convert}\PYG{o}{.} \PYG{n}{Axes}\PYG{o}{.}\PYG{n}{errorbar} \PYG{n}{uses} \PYG{n}{Axes}\PYG{o}{.}\PYG{n}{vlines} \PYG{o+ow}{and} \PYG{n}{Axes}\PYG{o}{.}\PYG{n}{hlines} \PYG{n}{to} \PYG{n}{draw} \PYG{n}{its} \PYG{n}{error} \PYG{n}{limits} \PYG{n+nb}{int} \PYG{n}{he} \PYG{n}{vertical} \PYG{o+ow}{and} \PYG{n}{horizontal} \PYG{n}{direction}\PYG{o}{.} \PYG{n}{As} \PYG{n}{you}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ll see} \PYG{o+ow}{in} \PYG{n}{the} \PYG{n}{changes} \PYG{n}{below}\PYG{p}{,} \PYG{n}{these} \PYG{n}{functions} \PYG{n}{now} \PYG{k}{return} \PYG{n}{a} \PYG{n}{LineCollection} \PYG{n}{rather} \PYG{n}{than} \PYG{n}{a} \PYG{n+nb}{list} \PYG{n}{of} \PYG{n}{lines}\PYG{o}{.} \PYG{n}{The} \PYG{n}{new} \PYG{k}{return} \PYG{n}{signature} \PYG{k}{for} \PYG{n}{errorbar} \PYG{o+ow}{is} \PYG{n}{ylins}\PYG{p}{,} \PYG{n}{caplines}\PYG{p}{,} \PYG{n}{errorcollections} \PYG{n}{where} \PYG{n}{errorcollections} \PYG{o+ow}{is} \PYG{n}{a} \PYG{n}{xerrcollection}\PYG{p}{,} \PYG{n}{yerrcollection} \PYG{n}{Axes}\PYG{o}{.}\PYG{n}{vlines} \PYG{o+ow}{and} \PYG{n}{Axes}\PYG{o}{.}\PYG{n}{hlines} \PYG{n}{now} \PYG{n}{create} \PYG{o+ow}{and} \PYG{n}{returns} \PYG{n}{a} \PYG{n}{LineCollection}\PYG{p}{,} \PYG{o+ow}{not} \PYG{n}{a} \PYG{n+nb}{list} \PYG{n}{of} \PYG{n}{lines}\PYG{o}{.} \PYG{n}{This} \PYG{o+ow}{is} \PYG{n}{much} \PYG{n}{faster}\PYG{o}{.} \PYG{n}{The} \PYG{n}{kwarg} \PYG{n}{signature} \PYG{n}{has} \PYG{n}{changed}\PYG{p}{,} \PYG{n}{so} \PYG{n}{consult} \PYG{n}{the} \PYG{n}{docs} \PYG{n}{MaxNLocator} \PYG{n}{accepts} \PYG{n}{a} \PYG{n}{new} \PYG{n}{Boolean} \PYG{n}{kwarg} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{integer}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{to} \PYG{n}{force} \PYG{n}{ticks} \PYG{n}{to} \PYG{n}{integer} \PYG{n}{locations}\PYG{o}{.} \PYG{n}{Commands} \PYG{n}{that} \PYG{k}{pass} \PYG{n}{an} \PYG{n}{argument} \PYG{n}{to} \PYG{n}{the} \PYG{n}{Text} \PYG{n}{constructor} \PYG{o+ow}{or} \PYG{n}{to} \PYG{n}{Text}\PYG{o}{.}\PYG{n}{set\PYGZus{}text}\PYG{p}{(}\PYG{p}{)} \PYG{n}{now} \PYG{n}{accept} \PYG{n+nb}{any} \PYG{n+nb}{object} \PYG{n}{that} \PYG{n}{can} \PYG{n}{be} \PYG{n}{converted} \PYG{k}{with} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+si}{\PYGZpc{}s}\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{.} \PYG{n}{This} \PYG{n}{affects} \PYG{n}{xlabel}\PYG{p}{(}\PYG{p}{)}\PYG{p}{,} \PYG{n}{title}\PYG{p}{(}\PYG{p}{)}\PYG{p}{,} \PYG{n}{etc}\PYG{o}{.} \PYG{n}{Barh} \PYG{n}{now} \PYG{n}{takes} \PYG{n}{a} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs} \PYG{n+nb}{dict} \PYG{n}{instead} \PYG{n}{of} \PYG{n}{most} \PYG{n}{of} \PYG{n}{the} \PYG{n}{old} \PYG{n}{arguments}\PYG{o}{.} \PYG{n}{This} \PYG{n}{helps} \PYG{n}{ensure} \PYG{n}{that} \PYG{n}{bar} \PYG{o+ow}{and} \PYG{n}{barh} \PYG{n}{are} \PYG{n}{kept} \PYG{o+ow}{in} \PYG{n}{sync}\PYG{p}{,} \PYG{n}{but} \PYG{k}{as} \PYG{n}{a} \PYG{n}{side} \PYG{n}{effect} \PYG{n}{you} \PYG{n}{can} \PYG{n}{no} \PYG{n}{longer} \PYG{k}{pass} \PYG{n}{e}\PYG{o}{.}\PYG{n}{g}\PYG{o}{.}\PYG{p}{,} \PYG{n}{color} \PYG{k}{as} \PYG{n}{a} \PYG{n}{positional} \PYG{n}{argument}\PYG{o}{.} \PYG{n}{ft2font}\PYG{o}{.}\PYG{n}{get\PYGZus{}charmap}\PYG{p}{(}\PYG{p}{)} \PYG{n}{now} \PYG{n}{returns} \PYG{n}{a} \PYG{n+nb}{dict} \PYG{n}{that} \PYG{n}{maps} \PYG{n}{character} \PYG{n}{codes} \PYG{n}{to} \PYG{n}{glyph} \PYG{n}{indices} \PYG{p}{(}\PYG{n}{until} \PYG{n}{now} \PYG{n}{it} \PYG{n}{was} \PYG{n+nb}{reversed}\PYG{p}{)} \PYG{n}{Moved} \PYG{n}{data} \PYG{n}{files} \PYG{n}{into} \PYG{n}{lib}\PYG{o}{/}\PYG{n}{matplotlib} \PYG{n}{so} \PYG{n}{that} \PYG{n}{setuptools}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ develop} \PYG{n}{mode} \PYG{n}{works}\PYG{o}{.} \PYG{n}{Re}\PYG{o}{\PYGZhy{}}\PYG{n}{organized} \PYG{n}{the} \PYG{n}{mpl}\PYG{o}{\PYGZhy{}}\PYG{n}{data} \PYG{n}{layout} \PYG{n}{so} \PYG{n}{that} \PYG{n}{this} \PYG{n}{source} \PYG{n}{structure} \PYG{o+ow}{is} \PYG{n}{maintained} \PYG{o+ow}{in} \PYG{n}{the} \PYG{n}{installation}\PYG{o}{.} \PYG{p}{(}\PYG{n}{i}\PYG{o}{.}\PYG{n}{e}\PYG{o}{.}\PYG{p}{,} \PYG{n}{the} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{fonts}\PYG{l+s+s1}{\PYGZsq{}} \PYG{o+ow}{and} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{images}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{sub}\PYG{o}{\PYGZhy{}}\PYG{n}{directories} \PYG{n}{are} \PYG{n}{maintained} \PYG{o+ow}{in} \PYG{n}{site}\PYG{o}{\PYGZhy{}}\PYG{n}{packages}\PYG{o}{.}\PYG{p}{)}\PYG{o}{.} \PYG{n}{Suggest} \PYG{n}{removing} \PYG{n}{site}\PYG{o}{\PYGZhy{}}\PYG{n}{packages}\PYG{o}{/}\PYG{n}{matplotlib}\PYG{o}{/}\PYG{n}{mpl}\PYG{o}{\PYGZhy{}}\PYG{n}{data} \PYG{o+ow}{and} \PYG{o}{\PYGZti{}}\PYG{o}{/}\PYG{o}{.}\PYG{n}{matplotlib}\PYG{o}{/}\PYG{n}{ttffont}\PYG{o}{.}\PYG{n}{cache} \PYG{n}{before} \PYG{n}{installing} \end{sphinxVerbatim} \section{Changes for 0.90.0} \label{\detokenize{api/api_changes:changes-for-0-90-0}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{All} \PYG{n}{artists} \PYG{n}{now} \PYG{n}{implement} \PYG{n}{a} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{pick}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{method} \PYG{n}{which} \PYG{n}{users} \PYG{n}{should} \PYG{o+ow}{not} \PYG{n}{call}\PYG{o}{.} \PYG{n}{Rather}\PYG{p}{,} \PYG{n+nb}{set} \PYG{n}{the} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{picker}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n+nb}{property} \PYG{n}{of} \PYG{n+nb}{any} \PYG{n}{artist} \PYG{n}{you} \PYG{n}{want} \PYG{n}{to} \PYG{n}{pick} \PYG{n}{on} \PYG{p}{(}\PYG{n}{the} \PYG{n}{epsilon} \PYG{n}{distance} \PYG{o+ow}{in} \PYG{n}{points} \PYG{k}{for} \PYG{n}{a} \PYG{n}{hit} \PYG{n}{test}\PYG{p}{)} \PYG{o+ow}{and} \PYG{n}{register} \PYG{k}{with} \PYG{n}{the} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{pick\PYGZus{}event}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{callback}\PYG{o}{.} \PYG{n}{See} \PYG{n}{examples}\PYG{o}{/}\PYG{n}{pick\PYGZus{}event\PYGZus{}demo}\PYG{o}{.}\PYG{n}{py} \PYG{k}{for} \PYG{n}{details} \PYG{n}{Bar}\PYG{p}{,} \PYG{n}{barh}\PYG{p}{,} \PYG{o+ow}{and} \PYG{n}{hist} \PYG{n}{have} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{log}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{binary} \PYG{n}{kwarg}\PYG{p}{:} \PYG{n}{log}\PYG{o}{=}\PYG{k+kc}{True} \PYG{n}{sets} \PYG{n}{the} \PYG{n}{ordinate} \PYG{n}{to} \PYG{n}{a} \PYG{n}{log} \PYG{n}{scale}\PYG{o}{.} \PYG{n}{Boxplot} \PYG{n}{can} \PYG{n}{handle} \PYG{n}{a} \PYG{n+nb}{list} \PYG{n}{of} \PYG{n}{vectors} \PYG{n}{instead} \PYG{n}{of} \PYG{n}{just} \PYG{n}{an} \PYG{n}{array}\PYG{p}{,} \PYG{n}{so} \PYG{n}{vectors} \PYG{n}{can} \PYG{n}{have} \PYG{n}{different} \PYG{n}{lengths}\PYG{o}{.} \PYG{n}{Plot} \PYG{n}{can} \PYG{n}{handle} \PYG{l+m+mi}{2}\PYG{o}{\PYGZhy{}}\PYG{n}{D} \PYG{n}{x} \PYG{o+ow}{and}\PYG{o}{/}\PYG{o+ow}{or} \PYG{n}{y}\PYG{p}{;} \PYG{n}{it} \PYG{n}{plots} \PYG{n}{the} \PYG{n}{columns}\PYG{o}{.} \PYG{n}{Added} \PYG{n}{linewidth} \PYG{n}{kwarg} \PYG{n}{to} \PYG{n}{bar} \PYG{o+ow}{and} \PYG{n}{barh}\PYG{o}{.} \PYG{n}{Made} \PYG{n}{the} \PYG{n}{default} \PYG{n}{Artist}\PYG{o}{.}\PYG{n}{\PYGZus{}transform} \PYG{k+kc}{None} \PYG{p}{(}\PYG{n}{rather} \PYG{n}{than} \PYG{n}{invoking} \PYG{n}{identity\PYGZus{}transform} \PYG{k}{for} \PYG{n}{each} \PYG{n}{artist} \PYG{n}{only} \PYG{n}{to} \PYG{n}{have} \PYG{n}{it} \PYG{n}{overridden} \PYG{n}{later}\PYG{p}{)}\PYG{o}{.} \PYG{n}{Use} \PYG{n}{artist}\PYG{o}{.}\PYG{n}{get\PYGZus{}transform}\PYG{p}{(}\PYG{p}{)} \PYG{n}{rather} \PYG{n}{than} \PYG{n}{artist}\PYG{o}{.}\PYG{n}{\PYGZus{}transform}\PYG{p}{,} \PYG{n}{even} \PYG{o+ow}{in} \PYG{n}{derived} \PYG{n}{classes}\PYG{p}{,} \PYG{n}{so} \PYG{n}{that} \PYG{n}{the} \PYG{n}{default} \PYG{n}{transform} \PYG{n}{will} \PYG{n}{be} \PYG{n}{created} \PYG{n}{lazily} \PYG{k}{as} \PYG{n}{needed} \PYG{n}{New} \PYG{n}{LogNorm} \PYG{n}{subclass} \PYG{n}{of} \PYG{n}{Normalize} \PYG{n}{added} \PYG{n}{to} \PYG{n}{colors}\PYG{o}{.}\PYG{n}{py}\PYG{o}{.} \PYG{n}{All} \PYG{n}{Normalize} \PYG{n}{subclasses} \PYG{n}{have} \PYG{n}{new} \PYG{n}{inverse}\PYG{p}{(}\PYG{p}{)} \PYG{n}{method}\PYG{p}{,} \PYG{o+ow}{and} \PYG{n}{the} \PYG{n+nf+fm}{\PYGZus{}\PYGZus{}call\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{p}{)} \PYG{n}{method} \PYG{n}{has} \PYG{n}{a} \PYG{n}{new} \PYG{n}{clip} \PYG{n}{kwarg}\PYG{o}{.} \PYG{n}{Changed} \PYG{k}{class} \PYG{n+nc}{names} \PYG{o+ow}{in} \PYG{n}{colors}\PYG{o}{.}\PYG{n}{py} \PYG{n}{to} \PYG{n}{match} \PYG{n}{convention}\PYG{p}{:} \PYG{n}{normalize} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZgt{}} \PYG{n}{Normalize}\PYG{p}{,} \PYG{n}{no\PYGZus{}norm} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZgt{}} \PYG{n}{NoNorm}\PYG{o}{.} \PYG{n}{Old} \PYG{n}{names} \PYG{n}{are} \PYG{n}{still} \PYG{n}{available} \PYG{k}{for} \PYG{n}{now}\PYG{o}{.} \PYG{n}{Removed} \PYG{n}{obsolete} \PYG{n}{pcolor\PYGZus{}classic} \PYG{n}{command} \PYG{o+ow}{and} \PYG{n}{method}\PYG{o}{.} \PYG{n}{Removed} \PYG{n}{lineprops} \PYG{o+ow}{and} \PYG{n}{markerprops} \PYG{k+kn}{from} \PYG{n+nn}{the} \PYG{n}{Annotation} \PYG{n}{code} \PYG{o+ow}{and} \PYG{n}{replaced} \PYG{n}{them} \PYG{k}{with} \PYG{n}{an} \PYG{n}{arrow} \PYG{n}{configurable} \PYG{k}{with} \PYG{n}{kwarg} \PYG{n}{arrowprops}\PYG{o}{.} \PYG{n}{See} \PYG{n}{examples}\PYG{o}{/}\PYG{n}{annotation\PYGZus{}demo}\PYG{o}{.}\PYG{n}{py} \PYG{o}{\PYGZhy{}} \PYG{n}{JDH} \end{sphinxVerbatim} \section{Changes for 0.87.7} \label{\detokenize{api/api_changes:changes-for-0-87-7}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{Completely} \PYG{n}{reworked} \PYG{n}{the} \PYG{n}{annotations} \PYG{n}{API} \PYG{n}{because} \PYG{n}{I} \PYG{n}{found} \PYG{n}{the} \PYG{n}{old} \PYG{n}{API} \PYG{n}{cumbersome}\PYG{o}{.} \PYG{n}{The} \PYG{n}{new} \PYG{n}{design} \PYG{o+ow}{is} \PYG{n}{much} \PYG{n}{more} \PYG{n}{legible} \PYG{o+ow}{and} \PYG{n}{easy} \PYG{n}{to} \PYG{n}{read}\PYG{o}{.} \PYG{n}{See} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{text}\PYG{o}{.}\PYG{n}{Annotation} \PYG{o+ow}{and} \PYG{n}{examples}\PYG{o}{/}\PYG{n}{annotation\PYGZus{}demo}\PYG{o}{.}\PYG{n}{py} \PYG{n}{markeredgecolor} \PYG{o+ow}{and} \PYG{n}{markerfacecolor} \PYG{n}{cannot} \PYG{n}{be} \PYG{n}{configured} \PYG{o+ow}{in} \PYG{n}{matplotlibrc} \PYG{n+nb}{any} \PYG{n}{more}\PYG{o}{.} \PYG{n}{Instead}\PYG{p}{,} \PYG{n}{markers} \PYG{n}{are} \PYG{n}{generally} \PYG{n}{colored} \PYG{n}{automatically} \PYG{n}{based} \PYG{n}{on} \PYG{n}{the} \PYG{n}{color} \PYG{n}{of} \PYG{n}{the} \PYG{n}{line}\PYG{p}{,} \PYG{n}{unless} \PYG{n}{marker} \PYG{n}{colors} \PYG{n}{are} \PYG{n}{explicitly} \PYG{n+nb}{set} \PYG{k}{as} \PYG{n}{kwargs} \PYG{o}{\PYGZhy{}} \PYG{n}{NN} \PYG{n}{Changed} \PYG{n}{default} \PYG{n}{comment} \PYG{n}{character} \PYG{k}{for} \PYG{n}{load} \PYG{n}{to} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsh{}}\PYG{l+s+s1}{\PYGZsq{}} \PYG{o}{\PYGZhy{}} \PYG{n}{JDH} \PYG{n}{math\PYGZus{}parse\PYGZus{}s\PYGZus{}ft2font\PYGZus{}svg} \PYG{k+kn}{from} \PYG{n+nn}{mathtext}\PYG{n+nn}{.}\PYG{n+nn}{py} \PYG{o}{\PYGZam{}} \PYG{n}{mathtext2}\PYG{o}{.}\PYG{n}{py} \PYG{n}{now} \PYG{n}{returns} \PYG{n}{width}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{n}{svg\PYGZus{}elements}\PYG{o}{.} \PYG{n}{svg\PYGZus{}elements} \PYG{o+ow}{is} \PYG{n}{an} \PYG{n}{instance} \PYG{n}{of} \PYG{n}{Bunch} \PYG{p}{(} \PYG{n}{cmbook}\PYG{o}{.}\PYG{n}{py}\PYG{p}{)} \PYG{o+ow}{and} \PYG{n}{has} \PYG{n}{the} \PYG{n}{attributes} \PYG{n}{svg\PYGZus{}glyphs} \PYG{o+ow}{and} \PYG{n}{svg\PYGZus{}lines}\PYG{p}{,} \PYG{n}{which} \PYG{n}{are} \PYG{n}{both} \PYG{n}{lists}\PYG{o}{.} \PYG{n}{Renderer}\PYG{o}{.}\PYG{n}{draw\PYGZus{}arc} \PYG{n}{now} \PYG{n}{takes} \PYG{n}{an} \PYG{n}{additional} \PYG{n}{parameter}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{.} \PYG{n}{It} \PYG{n}{specifies} \PYG{n}{to} \PYG{n}{draw} \PYG{n}{the} \PYG{n}{artist} \PYG{n}{rotated} \PYG{o+ow}{in} \PYG{n}{degrees} \PYG{n}{anti}\PYG{o}{\PYGZhy{}} \PYG{n}{clockwise}\PYG{o}{.} \PYG{n}{It} \PYG{n}{was} \PYG{n}{added} \PYG{k}{for} \PYG{n}{rotated} \PYG{n}{ellipses}\PYG{o}{.} \PYG{n}{Renamed} \PYG{n}{Figure}\PYG{o}{.}\PYG{n}{set\PYGZus{}figsize\PYGZus{}inches} \PYG{n}{to} \PYG{n}{Figure}\PYG{o}{.}\PYG{n}{set\PYGZus{}size\PYGZus{}inches} \PYG{n}{to} \PYG{n}{better} \PYG{n}{match} \PYG{n}{the} \PYG{n}{get} \PYG{n}{method}\PYG{p}{,} \PYG{n}{Figure}\PYG{o}{.}\PYG{n}{get\PYGZus{}size\PYGZus{}inches}\PYG{o}{.} \PYG{n}{Removed} \PYG{n}{the} \PYG{n}{copy\PYGZus{}bbox\PYGZus{}transform} \PYG{k+kn}{from} \PYG{n+nn}{transforms}\PYG{n+nn}{.}\PYG{n+nn}{py}\PYG{p}{;} \PYG{n}{added} \PYG{n}{shallowcopy} \PYG{n}{methods} \PYG{n}{to} \PYG{n+nb}{all} \PYG{n}{transforms}\PYG{o}{.} \PYG{n}{All} \PYG{n}{transforms} \PYG{n}{already} \PYG{n}{had} \PYG{n}{deepcopy} \PYG{n}{methods}\PYG{o}{.} \PYG{n}{FigureManager}\PYG{o}{.}\PYG{n}{resize}\PYG{p}{(}\PYG{n}{width}\PYG{p}{,} \PYG{n}{height}\PYG{p}{)}\PYG{p}{:} \PYG{n}{resize} \PYG{n}{the} \PYG{n}{window} \PYG{n}{specified} \PYG{o+ow}{in} \PYG{n}{pixels} \PYG{n}{barh}\PYG{p}{:} \PYG{n}{x} \PYG{o+ow}{and} \PYG{n}{y} \PYG{n}{args} \PYG{n}{have} \PYG{n}{been} \PYG{n}{renamed} \PYG{n}{to} \PYG{n}{width} \PYG{o+ow}{and} \PYG{n}{bottom} \PYG{n}{respectively}\PYG{p}{,} \PYG{o+ow}{and} \PYG{n}{their} \PYG{n}{order} \PYG{n}{has} \PYG{n}{been} \PYG{n}{swapped} \PYG{n}{to} \PYG{n}{maintain} \PYG{n}{a} \PYG{p}{(}\PYG{n}{position}\PYG{p}{,} \PYG{n}{value}\PYG{p}{)} \PYG{n}{order}\PYG{o}{.} \PYG{n}{bar} \PYG{o+ow}{and} \PYG{n}{barh}\PYG{p}{:} \PYG{n}{now} \PYG{n}{accept} \PYG{n}{kwarg} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{edgecolor}\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{.} \PYG{n}{bar} \PYG{o+ow}{and} \PYG{n}{barh}\PYG{p}{:} \PYG{n}{The} \PYG{n}{left}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{n}{width} \PYG{o+ow}{and} \PYG{n}{bottom} \PYG{n}{args} \PYG{n}{can} \PYG{n}{now} \PYG{n+nb}{all} \PYG{n}{be} \PYG{n}{scalars} \PYG{o+ow}{or} \PYG{n}{sequences}\PYG{p}{;} \PYG{n}{see} \PYG{n}{docstring}\PYG{o}{.} \PYG{n}{barh}\PYG{p}{:} \PYG{n}{now} \PYG{n}{defaults} \PYG{n}{to} \PYG{n}{edge} \PYG{n}{aligned} \PYG{n}{instead} \PYG{n}{of} \PYG{n}{center} \PYG{n}{aligned} \PYG{n}{bars} \PYG{n}{bar}\PYG{p}{,} \PYG{n}{barh} \PYG{o+ow}{and} \PYG{n}{hist}\PYG{p}{:} \PYG{n}{Added} \PYG{n}{a} \PYG{n}{keyword} \PYG{n}{arg} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{align}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{that} \PYG{n}{controls} \PYG{n}{between} \PYG{n}{edge} \PYG{o+ow}{or} \PYG{n}{center} \PYG{n}{bar} \PYG{n}{alignment}\PYG{o}{.} \PYG{n}{Collections}\PYG{p}{:} \PYG{n}{PolyCollection} \PYG{o+ow}{and} \PYG{n}{LineCollection} \PYG{n}{now} \PYG{n}{accept} \PYG{n}{vertices} \PYG{o+ow}{or} \PYG{n}{segments} \PYG{n}{either} \PYG{o+ow}{in} \PYG{n}{the} \PYG{n}{original} \PYG{n}{form} \PYG{p}{[}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,}\PYG{n}{y}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{n}{x}\PYG{p}{,}\PYG{n}{y}\PYG{p}{)}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{]} \PYG{o+ow}{or} \PYG{k}{as} \PYG{n}{a} \PYG{l+m+mi}{2}\PYG{n}{D} \PYG{n}{numerix} \PYG{n}{array}\PYG{p}{,} \PYG{k}{with} \PYG{n}{X} \PYG{k}{as} \PYG{n}{the} \PYG{n}{first} \PYG{n}{column} \PYG{o+ow}{and} \PYG{n}{Y} \PYG{k}{as} \PYG{n}{the} \PYG{n}{second}\PYG{o}{.} \PYG{n}{Contour} \PYG{o+ow}{and} \PYG{n}{quiver} \PYG{n}{output} \PYG{n}{the} \PYG{n}{numerix} \PYG{n}{form}\PYG{o}{.} \PYG{n}{The} \PYG{n}{transforms} \PYG{n}{methods} \PYG{n}{Bbox}\PYG{o}{.}\PYG{n}{update}\PYG{p}{(}\PYG{p}{)} \PYG{o+ow}{and} \PYG{n}{Transformation}\PYG{o}{.}\PYG{n}{seq\PYGZus{}xy\PYGZus{}tups}\PYG{p}{(}\PYG{p}{)} \PYG{n}{now} \PYG{n}{accept} \PYG{n}{either} \PYG{n}{form}\PYG{o}{.} \PYG{n}{Collections}\PYG{p}{:} \PYG{n}{LineCollection} \PYG{o+ow}{is} \PYG{n}{now} \PYG{n}{a} \PYG{n}{ScalarMappable} \PYG{n}{like} \PYG{n}{PolyCollection}\PYG{p}{,} \PYG{n}{etc}\PYG{o}{.} \PYG{n}{Specifying} \PYG{n}{a} \PYG{n}{grayscale} \PYG{n}{color} \PYG{k}{as} \PYG{n}{a} \PYG{n+nb}{float} \PYG{o+ow}{is} \PYG{n}{deprecated}\PYG{p}{;} \PYG{n}{use} \PYG{n}{a} \PYG{n}{string} \PYG{n}{instead}\PYG{p}{,} \PYG{n}{e}\PYG{o}{.}\PYG{n}{g}\PYG{o}{.}\PYG{p}{,} \PYG{l+m+mf}{0.75} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZgt{}} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{0.75}\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{.} \PYG{n}{Collections}\PYG{p}{:} \PYG{n}{initializers} \PYG{n}{now} \PYG{n}{accept} \PYG{n+nb}{any} \PYG{n}{mpl} \PYG{n}{color} \PYG{n}{arg}\PYG{p}{,} \PYG{o+ow}{or} \PYG{n}{sequence} \PYG{n}{of} \PYG{n}{such} \PYG{n}{args}\PYG{p}{;} \PYG{n}{previously} \PYG{n}{only} \PYG{n}{a} \PYG{n}{sequence} \PYG{n}{of} \PYG{n}{rgba} \PYG{n}{tuples} \PYG{n}{was} \PYG{n}{accepted}\PYG{o}{.} \PYG{n}{Colorbar}\PYG{p}{:} \PYG{n}{completely} \PYG{n}{new} \PYG{n}{version} \PYG{o+ow}{and} \PYG{n}{api}\PYG{p}{;} \PYG{n}{see} \PYG{n}{docstring}\PYG{o}{.} \PYG{n}{The} \PYG{n}{original} \PYG{n}{version} \PYG{o+ow}{is} \PYG{n}{still} \PYG{n}{accessible} \PYG{k}{as} \PYG{n}{colorbar\PYGZus{}classic}\PYG{p}{,} \PYG{n}{but} \PYG{o+ow}{is} \PYG{n}{deprecated}\PYG{o}{.} \PYG{n}{Contourf}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{extend}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{kwarg} \PYG{n}{replaces} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{clip\PYGZus{}ends}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{;} \PYG{n}{see} \PYG{n}{docstring}\PYG{o}{.} \PYG{n}{Masked} \PYG{n}{array} \PYG{n}{support} \PYG{n}{added} \PYG{n}{to} \PYG{n}{pcolormesh}\PYG{o}{.} \PYG{n}{Modified} \PYG{n}{aspect}\PYG{o}{\PYGZhy{}}\PYG{n}{ratio} \PYG{n}{handling}\PYG{p}{:} \PYG{n}{Removed} \PYG{n}{aspect} \PYG{n}{kwarg} \PYG{k+kn}{from} \PYG{n+nn}{imshow} \PYG{n}{Axes} \PYG{n}{methods}\PYG{p}{:} \PYG{n}{set\PYGZus{}aspect}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{aspect}\PYG{p}{,} \PYG{n}{adjustable}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{anchor}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)} \PYG{n}{set\PYGZus{}adjustable}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{adjustable}\PYG{p}{)} \PYG{n}{set\PYGZus{}anchor}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{anchor}\PYG{p}{)} \PYG{n}{Pylab} \PYG{n}{interface}\PYG{p}{:} \PYG{n}{axis}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{image}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{Backend} \PYG{n}{developers}\PYG{p}{:} \PYG{n}{ft2font}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{s load\PYGZus{}char now takes a flags} \PYG{n}{argument}\PYG{p}{,} \PYG{n}{which} \PYG{n}{you} \PYG{n}{can} \PYG{n}{OR} \PYG{n}{together} \PYG{k+kn}{from} \PYG{n+nn}{the} \PYG{n}{LOAD\PYGZus{}XXX} \PYG{n}{constants}\PYG{o}{.} \end{sphinxVerbatim} \section{Changes for 0.86} \label{\detokenize{api/api_changes:changes-for-0-86}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{Matplotlib} \PYG{n}{data} \PYG{o+ow}{is} \PYG{n}{installed} \PYG{n}{into} \PYG{n}{the} \PYG{n}{matplotlib} \PYG{n}{module}\PYG{o}{.} \PYG{n}{This} \PYG{o+ow}{is} \PYG{n}{similar} \PYG{n}{to} \PYG{n}{package\PYGZus{}data}\PYG{o}{.} \PYG{n}{This} \PYG{n}{should} \PYG{n}{get} \PYG{n}{rid} \PYG{n}{of} \PYG{n}{having} \PYG{n}{to} \PYG{n}{check} \PYG{k}{for} \PYG{n}{many} \PYG{n}{possibilities} \PYG{o+ow}{in} \PYG{n}{\PYGZus{}get\PYGZus{}data\PYGZus{}path}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.} \PYG{n}{The} \PYG{n}{MATPLOTLIBDATA} \PYG{n}{env} \PYG{n}{key} \PYG{o+ow}{is} \PYG{n}{still} \PYG{n}{checked} \PYG{n}{first} \PYG{n}{to} \PYG{n}{allow} \PYG{k}{for} \PYG{n}{flexibility}\PYG{o}{.} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{Separated} \PYG{n}{the} \PYG{n}{color} \PYG{n}{table} \PYG{n}{data} \PYG{k+kn}{from} \PYG{n+nn}{cm}\PYG{n+nn}{.}\PYG{n+nn}{py} \PYG{n}{out} \PYG{n}{into} \PYG{n}{a} \PYG{n}{new} \PYG{n}{file}\PYG{p}{,} \PYG{n}{\PYGZus{}cm}\PYG{o}{.}\PYG{n}{py}\PYG{p}{,} \PYG{n}{to} \PYG{n}{make} \PYG{n}{it} \PYG{n}{easier} \PYG{n}{to} \PYG{n}{find} \PYG{n}{the} \PYG{n}{actual} \PYG{n}{code} \PYG{o+ow}{in} \PYG{n}{cm}\PYG{o}{.}\PYG{n}{py} \PYG{o+ow}{and} \PYG{n}{to} \PYG{n}{add} \PYG{n}{new} \PYG{n}{colormaps}\PYG{o}{.} \PYG{n}{Everything} \PYG{k+kn}{from} \PYG{n+nn}{\PYGZus{}cm}\PYG{n+nn}{.}\PYG{n+nn}{py} \PYG{o+ow}{is} \PYG{n}{imported} \PYG{n}{by} \PYG{n}{cm}\PYG{o}{.}\PYG{n}{py}\PYG{p}{,} \PYG{n}{so} \PYG{n}{the} \PYG{n}{split} \PYG{n}{should} \PYG{n}{be} \PYG{n}{transparent}\PYG{o}{.} \PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{Enabled} \PYG{n}{automatic} \PYG{n}{generation} \PYG{n}{of} \PYG{n}{a} \PYG{n}{colormap} \PYG{k+kn}{from} \PYG{n+nn}{a} \PYG{n+nb}{list} \PYG{n}{of} \PYG{n}{colors} \PYG{o+ow}{in} \PYG{n}{contour}\PYG{p}{;} \PYG{n}{see} \PYG{n}{modified} \PYG{n}{examples}\PYG{o}{/}\PYG{n}{contour\PYGZus{}demo}\PYG{o}{.}\PYG{n}{py}\PYG{o}{.} \PYG{l+m+mi}{3}\PYG{p}{)} \PYG{n}{Support} \PYG{k}{for} \PYG{n}{imshow} \PYG{n}{of} \PYG{n}{a} \PYG{n}{masked} \PYG{n}{array}\PYG{p}{,} \PYG{k}{with} \PYG{n}{the} \PYG{n}{ability} \PYG{n}{to} \PYG{n}{specify} \PYG{n}{colors} \PYG{p}{(}\PYG{o+ow}{or} \PYG{n}{no} \PYG{n}{color} \PYG{n}{at} \PYG{n+nb}{all}\PYG{p}{)} \PYG{k}{for} \PYG{n}{masked} \PYG{n}{regions}\PYG{p}{,} \PYG{o+ow}{and} \PYG{k}{for} \PYG{n}{regions} \PYG{n}{that} \PYG{n}{are} \PYG{n}{above} \PYG{o+ow}{or} \PYG{n}{below} \PYG{n}{the} \PYG{n}{normally} \PYG{n}{mapped} \PYG{n}{region}\PYG{o}{.} \PYG{n}{See} \PYG{n}{examples}\PYG{o}{/}\PYG{n}{image\PYGZus{}masked}\PYG{o}{.}\PYG{n}{py}\PYG{o}{.} \PYG{l+m+mi}{4}\PYG{p}{)} \PYG{n}{In} \PYG{n}{support} \PYG{n}{of} \PYG{n}{the} \PYG{n}{above}\PYG{p}{,} \PYG{n}{added} \PYG{n}{two} \PYG{n}{new} \PYG{n}{classes}\PYG{p}{,} \PYG{n}{ListedColormap}\PYG{p}{,} \PYG{o+ow}{and} \PYG{n}{no\PYGZus{}norm}\PYG{p}{,} \PYG{n}{to} \PYG{n}{colors}\PYG{o}{.}\PYG{n}{py}\PYG{p}{,} \PYG{o+ow}{and} \PYG{n}{modified} \PYG{n}{the} \PYG{n}{Colormap} \PYG{k}{class} \PYG{n+nc}{to} \PYG{n}{include} \PYG{n}{common} \PYG{n}{functionality}\PYG{o}{.} \PYG{n}{Added} \PYG{n}{a} \PYG{n}{clip} \PYG{n}{kwarg} \PYG{n}{to} \PYG{n}{the} \PYG{n}{normalize} \PYG{n}{class}\PYG{o}{.} \end{sphinxVerbatim} \section{Changes for 0.85} \label{\detokenize{api/api_changes:changes-for-0-85}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{Made} \PYG{n}{xtick} \PYG{o+ow}{and} \PYG{n}{ytick} \PYG{n}{separate} \PYG{n}{props} \PYG{o+ow}{in} \PYG{n}{rc} \PYG{n}{made} \PYG{n}{pos}\PYG{o}{=}\PYG{k+kc}{None} \PYG{n}{the} \PYG{n}{default} \PYG{k}{for} \PYG{n}{tick} \PYG{n}{formatters} \PYG{n}{rather} \PYG{n}{than} \PYG{l+m+mi}{0} \PYG{n}{to} \PYG{n}{indicate} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{not supplied}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{Removed} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{feature}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{of} \PYG{n}{minor} \PYG{n}{ticks} \PYG{n}{which} \PYG{n}{prevents} \PYG{n}{them} \PYG{k+kn}{from} \PYG{n+nn}{overlapping} \PYG{n}{major} \PYG{n}{ticks}\PYG{o}{.} \PYG{n}{Often} \PYG{n}{you} \PYG{n}{want} \PYG{n}{major} \PYG{o+ow}{and} \PYG{n}{minor} \PYG{n}{ticks} \PYG{n}{at} \PYG{n}{the} \PYG{n}{same} \PYG{n}{place}\PYG{p}{,} \PYG{o+ow}{and} \PYG{n}{can} \PYG{n}{offset} \PYG{n}{the} \PYG{n}{major} \PYG{n}{ticks} \PYG{k}{with} \PYG{n}{the} \PYG{n}{pad}\PYG{o}{.} \PYG{n}{This} \PYG{n}{could} \PYG{n}{be} \PYG{n}{made} \PYG{n}{configurable} \PYG{n}{Changed} \PYG{n}{the} \PYG{n}{internal} \PYG{n}{structure} \PYG{n}{of} \PYG{n}{contour}\PYG{o}{.}\PYG{n}{py} \PYG{n}{to} \PYG{n}{a} \PYG{n}{more} \PYG{n}{OO} \PYG{n}{style}\PYG{o}{.} \PYG{n}{Calls} \PYG{n}{to} \PYG{n}{contour} \PYG{o+ow}{or} \PYG{n}{contourf} \PYG{o+ow}{in} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{py} \PYG{o+ow}{or} \PYG{n}{pylab}\PYG{o}{.}\PYG{n}{py} \PYG{n}{now} \PYG{k}{return} \PYG{n}{a} \PYG{n}{ContourSet} \PYG{n+nb}{object} \PYG{n}{which} \PYG{n}{contains} \PYG{n}{references} \PYG{n}{to} \PYG{n}{the} \PYG{n}{LineCollections} \PYG{o+ow}{or} \PYG{n}{PolyCollections} \PYG{n}{created} \PYG{n}{by} \PYG{n}{the} \PYG{n}{call}\PYG{p}{,} \PYG{k}{as} \PYG{n}{well} \PYG{k}{as} \PYG{n}{the} \PYG{n}{configuration} \PYG{n}{variables} \PYG{n}{that} \PYG{n}{were} \PYG{n}{used}\PYG{o}{.} \PYG{n}{The} \PYG{n}{ContourSet} \PYG{n+nb}{object} \PYG{o+ow}{is} \PYG{n}{a} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{mappable}\PYG{l+s+s2}{\PYGZdq{}} \PYG{k}{if} \PYG{n}{a} \PYG{n}{colormap} \PYG{n}{was} \PYG{n}{used}\PYG{o}{.} \PYG{n}{Added} \PYG{n}{a} \PYG{n}{clip\PYGZus{}ends} \PYG{n}{kwarg} \PYG{n}{to} \PYG{n}{contourf}\PYG{o}{.} \PYG{n}{From} \PYG{n}{the} \PYG{n}{docstring}\PYG{p}{:} \PYG{o}{*} \PYG{n}{clip\PYGZus{}ends} \PYG{o}{=} \PYG{k+kc}{True} \PYG{n}{If} \PYG{k+kc}{False}\PYG{p}{,} \PYG{n}{the} \PYG{n}{limits} \PYG{k}{for} \PYG{n}{color} \PYG{n}{scaling} \PYG{n}{are} \PYG{n+nb}{set} \PYG{n}{to} \PYG{n}{the} \PYG{n}{minimum} \PYG{o+ow}{and} \PYG{n}{maximum} \PYG{n}{contour} \PYG{n}{levels}\PYG{o}{.} \PYG{k+kc}{True} \PYG{p}{(}\PYG{n}{default}\PYG{p}{)} \PYG{n}{clips} \PYG{n}{the} \PYG{n}{scaling} \PYG{n}{limits}\PYG{o}{.} \PYG{n}{Example}\PYG{p}{:} \PYG{k}{if} \PYG{n}{the} \PYG{n}{contour} \PYG{n}{boundaries} \PYG{n}{are} \PYG{n}{V} \PYG{o}{=} \PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{100}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{]}\PYG{p}{,} \PYG{n}{then} \PYG{n}{the} \PYG{n}{scaling} \PYG{n}{limits} \PYG{n}{will} \PYG{n}{be} \PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{100}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{]} \PYG{k}{if} \PYG{n}{clip\PYGZus{}ends} \PYG{o+ow}{is} \PYG{k+kc}{False}\PYG{p}{,} \PYG{o+ow}{and} \PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]} \PYG{k}{if} \PYG{n}{clip\PYGZus{}ends} \PYG{o+ow}{is} \PYG{k+kc}{True}\PYG{o}{.} \PYG{n}{Added} \PYG{n}{kwargs} \PYG{n}{linewidths}\PYG{p}{,} \PYG{n}{antialiased}\PYG{p}{,} \PYG{o+ow}{and} \PYG{n}{nchunk} \PYG{n}{to} \PYG{n}{contourf}\PYG{o}{.} \PYG{n}{These} \PYG{n}{are} \PYG{n}{experimental}\PYG{p}{;} \PYG{n}{see} \PYG{n}{the} \PYG{n}{docstring}\PYG{o}{.} \PYG{n}{Changed} \PYG{n}{Figure}\PYG{o}{.}\PYG{n}{colorbar}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{kw} \PYG{n}{argument} \PYG{n}{order} \PYG{n}{changed}\PYG{p}{;} \PYG{k}{if} \PYG{n}{mappable} \PYG{n}{arg} \PYG{o+ow}{is} \PYG{n}{a} \PYG{n}{non}\PYG{o}{\PYGZhy{}}\PYG{n}{filled} \PYG{n}{ContourSet}\PYG{p}{,} \PYG{n}{colorbar}\PYG{p}{(}\PYG{p}{)} \PYG{n}{shows} \PYG{n}{lines} \PYG{n}{instead} \PYG{n}{hof} \PYG{n}{polygons}\PYG{o}{.} \PYG{k}{if} \PYG{n}{mappable} \PYG{n}{arg} \PYG{o+ow}{is} \PYG{n}{a} \PYG{n}{filled} \PYG{n}{ContourSet} \PYG{k}{with} \PYG{n}{clip\PYGZus{}ends}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{,} \PYG{n}{the} \PYG{n}{endpoints} \PYG{n}{are} \PYG{o+ow}{not} \PYG{n}{labelled}\PYG{p}{,} \PYG{n}{so} \PYG{k}{as} \PYG{n}{to} \PYG{n}{give} \PYG{n}{the} \PYG{n}{correct} \PYG{n}{impression} \PYG{n}{of} \PYG{n+nb}{open}\PYG{o}{\PYGZhy{}}\PYG{n}{endedness}\PYG{o}{.} \PYG{n}{Changed} \PYG{n}{LineCollection}\PYG{o}{.}\PYG{n}{get\PYGZus{}linewidths} \PYG{n}{to} \PYG{n}{get\PYGZus{}linewidth}\PYG{p}{,} \PYG{k}{for} \PYG{n}{consistency}\PYG{o}{.} \end{sphinxVerbatim} \section{Changes for 0.84} \label{\detokenize{api/api_changes:changes-for-0-84}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{Unified} \PYG{n}{argument} \PYG{n}{handling} \PYG{n}{between} \PYG{n}{hlines} \PYG{o+ow}{and} \PYG{n}{vlines}\PYG{o}{.} \PYG{n}{Both} \PYG{n}{now} \PYG{n}{take} \PYG{n}{optionally} \PYG{n}{a} \PYG{n}{fmt} \PYG{n}{argument} \PYG{p}{(}\PYG{k}{as} \PYG{o+ow}{in} \PYG{n}{plot}\PYG{p}{)} \PYG{o+ow}{and} \PYG{n}{a} \PYG{n}{keyword} \PYG{n}{args} \PYG{n}{that} \PYG{n}{can} \PYG{n}{be} \PYG{n}{passed} \PYG{n}{onto} \PYG{n}{Line2D}\PYG{o}{.} \PYG{n}{Removed} \PYG{n+nb}{all} \PYG{n}{references} \PYG{n}{to} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{data clipping}\PYG{l+s+s2}{\PYGZdq{}} \PYG{o+ow}{in} \PYG{n}{rc} \PYG{o+ow}{and} \PYG{n}{lines}\PYG{o}{.}\PYG{n}{py} \PYG{n}{since} \PYG{n}{these} \PYG{n}{were} \PYG{o+ow}{not} \PYG{n}{used} \PYG{o+ow}{and} \PYG{o+ow}{not} \PYG{n}{optimized}\PYG{o}{.} \PYG{n}{I}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{m sure they}\PYG{l+s+s1}{\PYGZsq{}}\PYG{n}{ll} \PYG{n}{be} \PYG{n}{resurrected} \PYG{n}{later} \PYG{k}{with} \PYG{n}{a} \PYG{n}{better} \PYG{n}{implementation} \PYG{n}{when} \PYG{n}{needed}\PYG{o}{.} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{set}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{removed} \PYG{o}{\PYGZhy{}} \PYG{n}{no} \PYG{n}{more} \PYG{n}{deprecation} \PYG{n}{warnings}\PYG{o}{.} \PYG{n}{Use} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{setp}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{instead}\PYG{o}{.} \PYG{n}{Backend} \PYG{n}{developers}\PYG{p}{:} \PYG{n}{Added} \PYG{n}{flipud} \PYG{n}{method} \PYG{n}{to} \PYG{n}{image} \PYG{o+ow}{and} \PYG{n}{removed} \PYG{n}{it} \PYG{k+kn}{from} \PYG{n+nn}{to\PYGZus{}str}\PYG{n+nn}{.} \PYG{n}{Removed} \PYG{n}{origin} \PYG{n}{kwarg} \PYG{k+kn}{from} \PYG{n+nn}{backend}\PYG{n+nn}{.}\PYG{n+nn}{draw\PYGZus{}image}\PYG{n+nn}{.} \PYG{n}{origin} \PYG{o+ow}{is} \PYG{n}{handled} \PYG{n}{entirely} \PYG{n}{by} \PYG{n}{the} \PYG{n}{frontend} \PYG{n}{now}\PYG{o}{.} \end{sphinxVerbatim} \section{Changes for 0.83} \label{\detokenize{api/api_changes:changes-for-0-83}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{\PYGZhy{}} \PYG{n}{Made} \PYG{n}{HOME}\PYG{o}{/}\PYG{o}{.}\PYG{n}{matplotlib} \PYG{n}{the} \PYG{n}{new} \PYG{n}{config} \PYG{n+nb}{dir} \PYG{n}{where} \PYG{n}{the} \PYG{n}{matplotlibrc} \PYG{n}{file}\PYG{p}{,} \PYG{n}{the} \PYG{n}{ttf}\PYG{o}{.}\PYG{n}{cache}\PYG{p}{,} \PYG{o+ow}{and} \PYG{n}{the} \PYG{n}{tex}\PYG{o}{.}\PYG{n}{cache} \PYG{n}{live}\PYG{o}{.} \PYG{n}{The} \PYG{n}{new} \PYG{n}{default} \PYG{n}{filenames} \PYG{o+ow}{in} \PYG{o}{.}\PYG{n}{matplotlib} \PYG{n}{have} \PYG{n}{no} \PYG{n}{leading} \PYG{n}{dot} \PYG{o+ow}{and} \PYG{n}{are} \PYG{o+ow}{not} \PYG{n}{hidden}\PYG{o}{.} \PYG{n}{e}\PYG{o}{.}\PYG{n}{g}\PYG{o}{.}\PYG{p}{,} \PYG{n}{the} \PYG{n}{new} \PYG{n}{names} \PYG{n}{are} \PYG{n}{matplotlibrc}\PYG{p}{,} \PYG{n}{tex}\PYG{o}{.}\PYG{n}{cache}\PYG{p}{,} \PYG{o+ow}{and} \PYG{n}{ttffont}\PYG{o}{.}\PYG{n}{cache}\PYG{o}{.} \PYG{n}{This} \PYG{o+ow}{is} \PYG{n}{how} \PYG{n}{ipython} \PYG{n}{does} \PYG{n}{it} \PYG{n}{so} \PYG{n}{it} \PYG{n}{must} \PYG{n}{be} \PYG{n}{right}\PYG{o}{.} \PYG{n}{If} \PYG{n}{old} \PYG{n}{files} \PYG{n}{are} \PYG{n}{found}\PYG{p}{,} \PYG{n}{a} \PYG{n}{warning} \PYG{o+ow}{is} \PYG{n}{issued} \PYG{o+ow}{and} \PYG{n}{they} \PYG{n}{are} \PYG{n}{moved} \PYG{n}{to} \PYG{n}{the} \PYG{n}{new} \PYG{n}{location}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{backends}\PYG{o}{/}\PYG{n+nf+fm}{\PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{}}\PYG{o}{.}\PYG{n}{py} \PYG{n}{no} \PYG{n}{longer} \PYG{n}{imports} \PYG{n}{new\PYGZus{}figure\PYGZus{}manager}\PYG{p}{,} \PYG{n}{draw\PYGZus{}if\PYGZus{}interactive} \PYG{o+ow}{and} \PYG{n}{show} \PYG{k+kn}{from} \PYG{n+nn}{the} \PYG{n}{default} \PYG{n}{backend}\PYG{p}{,} \PYG{n}{but} \PYG{n}{puts} \PYG{n}{these} \PYG{n}{imports} \PYG{n}{into} \PYG{n}{a} \PYG{n}{call} \PYG{n}{to} \PYG{n}{pylab\PYGZus{}setup}\PYG{o}{.} \PYG{n}{Also}\PYG{p}{,} \PYG{n}{the} \PYG{n}{Toolbar} \PYG{o+ow}{is} \PYG{n}{no} \PYG{n}{longer} \PYG{n}{imported} \PYG{k+kn}{from} \PYG{n+nn}{WX}\PYG{o}{/}\PYG{n}{WXAgg}\PYG{o}{.} \PYG{n}{New} \PYG{n}{usage}\PYG{p}{:} \PYG{k+kn}{from} \PYG{n+nn}{backends} \PYG{k}{import} \PYG{n}{pylab\PYGZus{}setup} \PYG{n}{new\PYGZus{}figure\PYGZus{}manager}\PYG{p}{,} \PYG{n}{draw\PYGZus{}if\PYGZus{}interactive}\PYG{p}{,} \PYG{n}{show} \PYG{o}{=} \PYG{n}{pylab\PYGZus{}setup}\PYG{p}{(}\PYG{p}{)} \PYG{o}{\PYGZhy{}} \PYG{n}{Moved} \PYG{n}{Figure}\PYG{o}{.}\PYG{n}{get\PYGZus{}width\PYGZus{}height}\PYG{p}{(}\PYG{p}{)} \PYG{n}{to} \PYG{n}{FigureCanvasBase}\PYG{o}{.} \PYG{n}{It} \PYG{n}{now} \PYG{n}{returns} \PYG{n+nb}{int} \PYG{n}{instead} \PYG{n}{of} \PYG{n+nb}{float}\PYG{o}{.} \end{sphinxVerbatim} \section{Changes for 0.82} \label{\detokenize{api/api_changes:changes-for-0-82}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYGZhy{} toolbar import change in GTKAgg, GTKCairo and WXAgg \PYGZhy{} Added subplot config tool to GTK* backends \PYGZhy{}\PYGZhy{} note you must now import the NavigationToolbar2 from your backend of choice rather than from backend\PYGZus{}gtk because it needs to know about the backend specific canvas \PYGZhy{}\PYGZhy{} see examples/embedding\PYGZus{}in\PYGZus{}gtk2.py. Ditto for wx backend \PYGZhy{}\PYGZhy{} see examples/embedding\PYGZus{}in\PYGZus{}wxagg.py \PYGZhy{} hist bin change Sean Richards notes there was a problem in the way we created the binning for histogram, which made the last bin underrepresented. From his post: I see that hist uses the linspace function to create the bins and then uses searchsorted to put the values in their correct bin. That\PYGZsq{}s all good but I am confused over the use of linspace for the bin creation. I wouldn\PYGZsq{}t have thought that it does what is needed, to quote the docstring it creates a \PYGZdq{}Linear spaced array from min to max\PYGZdq{}. For it to work correctly shouldn\PYGZsq{}t the values in the bins array be the same bound for each bin? (i.e. each value should be the lower bound of a bin). To provide the correct bins for hist would it not be something like def bins(xmin, xmax, N): if N==1: return xmax dx = (xmax\PYGZhy{}xmin)/N \PYGZsh{} instead of N\PYGZhy{}1 return xmin + dx*arange(N) This suggestion is implemented in 0.81. My test script with these changes does not reveal any bias in the binning from matplotlib.numerix.mlab import randn, rand, zeros, Float from matplotlib.mlab import hist, mean Nbins = 50 Ntests = 200 results = zeros((Ntests,Nbins), typecode=Float) for i in range(Ntests): print \PYGZsq{}computing\PYGZsq{}, i x = rand(10000) n, bins = hist(x, Nbins) results[i] = n print mean(results) \end{sphinxVerbatim} \section{Changes for 0.81} \label{\detokenize{api/api_changes:changes-for-0-81}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{\PYGZhy{}} \PYG{n}{pylab} \PYG{o+ow}{and} \PYG{n}{artist} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{set}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{functions} \PYG{n}{renamed} \PYG{n}{to} \PYG{n}{setp} \PYG{n}{to} \PYG{n}{avoid} \PYG{n}{clash} \PYG{k}{with} \PYG{n}{python2}\PYG{o}{.}\PYG{l+m+mi}{4} \PYG{n}{built}\PYG{o}{\PYGZhy{}}\PYG{o+ow}{in} \PYG{n+nb}{set}\PYG{o}{.} \PYG{n}{Current} \PYG{n}{version} \PYG{n}{will} \PYG{n}{issue} \PYG{n}{a} \PYG{n}{deprecation} \PYG{n}{warning} \PYG{n}{which} \PYG{n}{will} \PYG{n}{be} \PYG{n}{removed} \PYG{o+ow}{in} \PYG{n}{future} \PYG{n}{versions} \PYG{o}{\PYGZhy{}} \PYG{n}{imshow} \PYG{n}{interpolation} \PYG{n}{arguments} \PYG{n}{changes} \PYG{k}{for} \PYG{n}{advanced} \PYG{n}{interpolation} \PYG{n}{schemes}\PYG{o}{.} \PYG{n}{See} \PYG{n}{help} \PYG{n}{imshow}\PYG{p}{,} \PYG{n}{particularly} \PYG{n}{the} \PYG{n}{interpolation}\PYG{p}{,} \PYG{n}{filternorm} \PYG{o+ow}{and} \PYG{n}{filterrad} \PYG{n}{kwargs} \PYG{o}{\PYGZhy{}} \PYG{n}{Support} \PYG{k}{for} \PYG{n}{masked} \PYG{n}{arrays} \PYG{n}{has} \PYG{n}{been} \PYG{n}{added} \PYG{n}{to} \PYG{n}{the} \PYG{n}{plot} \PYG{n}{command} \PYG{o+ow}{and} \PYG{n}{to} \PYG{n}{the} \PYG{n}{Line2D} \PYG{n+nb}{object}\PYG{o}{.} \PYG{n}{Only} \PYG{n}{the} \PYG{n}{valid} \PYG{n}{points} \PYG{n}{are} \PYG{n}{plotted}\PYG{o}{.} \PYG{n}{A} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{valid\PYGZus{}only}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{kwarg} \PYG{n}{was} \PYG{n}{added} \PYG{n}{to} \PYG{n}{the} \PYG{n}{get\PYGZus{}xdata}\PYG{p}{(}\PYG{p}{)} \PYG{o+ow}{and} \PYG{n}{get\PYGZus{}ydata}\PYG{p}{(}\PYG{p}{)} \PYG{n}{methods} \PYG{n}{of} \PYG{n}{Line2D}\PYG{p}{;} \PYG{n}{by} \PYG{n}{default} \PYG{n}{it} \PYG{o+ow}{is} \PYG{k+kc}{False}\PYG{p}{,} \PYG{n}{so} \PYG{n}{that} \PYG{n}{the} \PYG{n}{original} \PYG{n}{data} \PYG{n}{arrays} \PYG{n}{are} \PYG{n}{returned}\PYG{o}{.} \PYG{n}{Setting} \PYG{n}{it} \PYG{n}{to} \PYG{k+kc}{True} \PYG{n}{returns} \PYG{n}{the} \PYG{n}{plottable} \PYG{n}{points}\PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{contour} \PYG{n}{changes}\PYG{p}{:} \PYG{n}{Masked} \PYG{n}{arrays}\PYG{p}{:} \PYG{n}{contour} \PYG{o+ow}{and} \PYG{n}{contourf} \PYG{n}{now} \PYG{n}{accept} \PYG{n}{masked} \PYG{n}{arrays} \PYG{k}{as} \PYG{n}{the} \PYG{n}{variable} \PYG{n}{to} \PYG{n}{be} \PYG{n}{contoured}\PYG{o}{.} \PYG{n}{Masking} \PYG{n}{works} \PYG{n}{correctly} \PYG{k}{for} \PYG{n}{contour}\PYG{p}{,} \PYG{n}{but} \PYG{n}{a} \PYG{n}{bug} \PYG{n}{remains} \PYG{n}{to} \PYG{n}{be} \PYG{n}{fixed} \PYG{n}{before} \PYG{n}{it} \PYG{n}{will} \PYG{n}{work} \PYG{k}{for} \PYG{n}{contourf}\PYG{o}{.} \PYG{n}{The} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{badmask}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{kwarg} \PYG{n}{has} \PYG{n}{been} \PYG{n}{removed} \PYG{k+kn}{from} \PYG{n+nn}{both} \PYG{n}{functions}\PYG{o}{.} \PYG{n}{Level} \PYG{n}{argument} \PYG{n}{changes}\PYG{p}{:} \PYG{n}{Old} \PYG{n}{version}\PYG{p}{:} \PYG{n}{a} \PYG{n+nb}{list} \PYG{n}{of} \PYG{n}{levels} \PYG{k}{as} \PYG{n}{one} \PYG{n}{of} \PYG{n}{the} \PYG{n}{positional} \PYG{n}{arguments} \PYG{n}{specified} \PYG{n}{the} \PYG{n}{lower} \PYG{n}{bound} \PYG{n}{of} \PYG{n}{each} \PYG{n}{filled} \PYG{n}{region}\PYG{p}{;} \PYG{n}{the} \PYG{n}{upper} \PYG{n}{bound} \PYG{n}{of} \PYG{n}{the} \PYG{n}{last} \PYG{n}{region} \PYG{n}{was} \PYG{n}{taken} \PYG{k}{as} \PYG{n}{a} \PYG{n}{very} \PYG{n}{large} \PYG{n}{number}\PYG{o}{.} \PYG{n}{Hence}\PYG{p}{,} \PYG{n}{it} \PYG{n}{was} \PYG{o+ow}{not} \PYG{n}{possible} \PYG{n}{to} \PYG{n}{specify} \PYG{n}{that} \PYG{n}{z} \PYG{n}{values} \PYG{n}{between} \PYG{l+m+mi}{0} \PYG{o+ow}{and} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{k}{for} \PYG{n}{example}\PYG{p}{,} \PYG{n}{be} \PYG{n}{filled}\PYG{p}{,} \PYG{o+ow}{and} \PYG{n}{that} \PYG{n}{values} \PYG{n}{outside} \PYG{n}{that} \PYG{n+nb}{range} \PYG{n}{remain} \PYG{n}{unfilled}\PYG{o}{.} \PYG{n}{New} \PYG{n}{version}\PYG{p}{:} \PYG{n}{a} \PYG{n+nb}{list} \PYG{n}{of} \PYG{n}{N} \PYG{n}{levels} \PYG{o+ow}{is} \PYG{n}{taken} \PYG{k}{as} \PYG{n}{specifying} \PYG{n}{the} \PYG{n}{boundaries} \PYG{n}{of} \PYG{n}{N}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1} \PYG{n}{z} \PYG{n}{ranges}\PYG{o}{.} \PYG{n}{Now} \PYG{n}{the} \PYG{n}{user} \PYG{n}{has} \PYG{n}{more} \PYG{n}{control} \PYG{n}{over} \PYG{n}{what} \PYG{o+ow}{is} \PYG{n}{colored} \PYG{o+ow}{and} \PYG{n}{what} \PYG{o+ow}{is} \PYG{o+ow}{not}\PYG{o}{.} \PYG{n}{Repeated} \PYG{n}{calls} \PYG{n}{to} \PYG{n}{contourf} \PYG{p}{(}\PYG{k}{with} \PYG{n}{different} \PYG{n}{colormaps} \PYG{o+ow}{or} \PYG{n}{color} \PYG{n}{specifications}\PYG{p}{,} \PYG{k}{for} \PYG{n}{example}\PYG{p}{)} \PYG{n}{can} \PYG{n}{be} \PYG{n}{used} \PYG{n}{to} \PYG{n}{color} \PYG{n}{different} \PYG{n}{ranges} \PYG{n}{of} \PYG{n}{z}\PYG{o}{.} \PYG{n}{Values} \PYG{n}{of} \PYG{n}{z} \PYG{n}{outside} \PYG{n}{an} \PYG{n}{expected} \PYG{n+nb}{range} \PYG{n}{are} \PYG{n}{left} \PYG{n}{uncolored}\PYG{o}{.} \PYG{n}{Example}\PYG{p}{:} \PYG{n}{Old}\PYG{p}{:} \PYG{n}{contourf}\PYG{p}{(}\PYG{n}{z}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{)} \PYG{n}{would} \PYG{k}{yield} \PYG{l+m+mi}{3} \PYG{n}{regions}\PYG{p}{:} \PYG{l+m+mi}{0}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{o+ow}{and} \PYG{o}{\PYGZgt{}}\PYG{l+m+mf}{2.} \PYG{n}{New}\PYG{p}{:} \PYG{n}{it} \PYG{n}{would} \PYG{k}{yield} \PYG{l+m+mi}{2} \PYG{n}{regions}\PYG{p}{:} \PYG{l+m+mi}{0}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{2.} \PYG{n}{If} \PYG{n}{the} \PYG{n}{same} \PYG{l+m+mi}{3} \PYG{n}{regions} \PYG{n}{were} \PYG{n}{desired}\PYG{p}{,} \PYG{n}{the} \PYG{n}{equivalent} \PYG{n+nb}{list} \PYG{n}{of} \PYG{n}{levels} \PYG{n}{would} \PYG{n}{be} \PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mf}{1e38}\PYG{p}{]}\PYG{o}{.} \end{sphinxVerbatim} \section{Changes for 0.80} \label{\detokenize{api/api_changes:changes-for-0-80}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{\PYGZhy{}} \PYG{n}{xlim}\PYG{o}{/}\PYG{n}{ylim}\PYG{o}{/}\PYG{n}{axis} \PYG{n}{always} \PYG{k}{return} \PYG{n}{the} \PYG{n}{new} \PYG{n}{limits} \PYG{n}{regardless} \PYG{n}{of} \PYG{n}{arguments}\PYG{o}{.} \PYG{n}{They} \PYG{n}{now} \PYG{n}{take} \PYG{n}{kwargs} \PYG{n}{which} \PYG{n}{allow} \PYG{n}{you} \PYG{n}{to} \PYG{n}{selectively} \PYG{n}{change} \PYG{n}{the} \PYG{n}{upper} \PYG{o+ow}{or} \PYG{n}{lower} \PYG{n}{limits} \PYG{k}{while} \PYG{n}{leaving} \PYG{n}{unnamed} \PYG{n}{limits} \PYG{n}{unchanged}\PYG{o}{.} \PYG{n}{See} \PYG{n}{help}\PYG{p}{(}\PYG{n}{xlim}\PYG{p}{)} \PYG{k}{for} \PYG{n}{example} \end{sphinxVerbatim} \section{Changes for 0.73} \label{\detokenize{api/api_changes:changes-for-0-73}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{\PYGZhy{}} \PYG{n}{Removed} \PYG{n}{deprecated} \PYG{n}{ColormapJet} \PYG{o+ow}{and} \PYG{n}{friends} \PYG{o}{\PYGZhy{}} \PYG{n}{Removed} \PYG{n+nb}{all} \PYG{n}{error} \PYG{n}{handling} \PYG{k+kn}{from} \PYG{n+nn}{the} \PYG{n}{verbose} \PYG{n+nb}{object} \PYG{o}{\PYGZhy{}} \PYG{n}{figure} \PYG{n}{num} \PYG{n}{of} \PYG{n}{zero} \PYG{o+ow}{is} \PYG{n}{now} \PYG{n}{allowed} \end{sphinxVerbatim} \section{Changes for 0.72} \label{\detokenize{api/api_changes:changes-for-0-72}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYGZhy{} Line2D, Text, and Patch copy\PYGZus{}properties renamed update\PYGZus{}from and moved into artist base class \PYGZhy{} LineCollecitons.color renamed to LineCollections.set\PYGZus{}color for consistency with set/get introspection mechanism, \PYGZhy{} pylab figure now defaults to num=None, which creates a new figure with a guaranteed unique number \PYGZhy{} contour method syntax changed \PYGZhy{} now it is MATLAB compatible unchanged: contour(Z) old: contour(Z, x=Y, y=Y) new: contour(X, Y, Z) see http://matplotlib.sf.net/matplotlib.pylab.html\PYGZsh{}\PYGZhy{}contour \PYGZhy{} Increased the default resolution for save command. \PYGZhy{} Renamed the base attribute of the ticker classes to \PYGZus{}base to avoid conflict with the base method. Sitt for subs \PYGZhy{} subs=none now does autosubbing in the tick locator. \PYGZhy{} New subplots that overlap old will delete the old axes. If you do not want this behavior, use fig.add\PYGZus{}subplot or the axes command \end{sphinxVerbatim} \section{Changes for 0.71} \label{\detokenize{api/api_changes:changes-for-0-71}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] Significant numerix namespace changes, introduced to resolve namespace clashes between python built\PYGZhy{}ins and mlab names. Refactored numerix to maintain separate modules, rather than folding all these names into a single namespace. See the following mailing list threads for more information and background http://sourceforge.net/mailarchive/forum.php?thread\PYGZus{}id=6398890\PYGZam{}forum\PYGZus{}id=36187 http://sourceforge.net/mailarchive/forum.php?thread\PYGZus{}id=6323208\PYGZam{}forum\PYGZus{}id=36187 OLD usage from matplotlib.numerix import array, mean, fft NEW usage from matplotlib.numerix import array from matplotlib.numerix.mlab import mean from matplotlib.numerix.fft import fft numerix dir structure mirrors numarray (though it is an incomplete implementation) numerix numerix/mlab numerix/linear\PYGZus{}algebra numerix/fft numerix/random\PYGZus{}array but of course you can use \PYGZsq{}numerix : Numeric\PYGZsq{} and still get the symbols. pylab still imports most of the symbols from Numerix, MLab, fft, etc, but is more cautious. For names that clash with python names (min, max, sum), pylab keeps the builtins and provides the numeric versions with an a* prefix, e.g., (amin, amax, asum) \end{sphinxVerbatim} \section{Changes for 0.70} \label{\detokenize{api/api_changes:changes-for-0-70}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{MplEvent} \PYG{n}{factored} \PYG{n}{into} \PYG{n}{a} \PYG{n}{base} \PYG{k}{class} \PYG{n+nc}{Event} \PYG{o+ow}{and} \PYG{n}{derived} \PYG{n}{classes} \PYG{n}{MouseEvent} \PYG{o+ow}{and} \PYG{n}{KeyEvent} \PYG{n}{Removed} \PYG{n}{definct} \PYG{n}{set\PYGZus{}measurement} \PYG{o+ow}{in} \PYG{n}{wx} \PYG{n}{toolbar} \end{sphinxVerbatim} \section{Changes for 0.65.1} \label{\detokenize{api/api_changes:changes-for-0-65-1}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{removed} \PYG{n}{add\PYGZus{}axes} \PYG{o+ow}{and} \PYG{n}{add\PYGZus{}subplot} \PYG{k+kn}{from} \PYG{n+nn}{backend\PYGZus{}bases}\PYG{n+nn}{.} \PYG{n}{Use} \PYG{n}{figure}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes} \PYG{o+ow}{and} \PYG{n}{add\PYGZus{}subplot} \PYG{n}{instead}\PYG{o}{.} \PYG{n}{The} \PYG{n}{figure} \PYG{n}{now} \PYG{n}{manages} \PYG{n}{the} \PYG{n}{current} \PYG{n}{axes} \PYG{k}{with} \PYG{n}{gca} \PYG{o+ow}{and} \PYG{n}{sca} \PYG{k}{for} \PYG{n}{get} \PYG{o+ow}{and} \PYG{n+nb}{set} \PYG{n}{current} \PYG{n}{axes}\PYG{o}{.} \PYG{n}{If} \PYG{n}{you} \PYG{n}{have} \PYG{n}{code} \PYG{n}{you} \PYG{n}{are} \PYG{n}{porting} \PYG{n}{which} \PYG{n}{called}\PYG{p}{,} \PYG{n}{e}\PYG{o}{.}\PYG{n}{g}\PYG{o}{.}\PYG{p}{,} \PYG{n}{figmanager}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{,} \PYG{n}{you} \PYG{n}{can} \PYG{n}{now} \PYG{n}{simply} \PYG{n}{do} \PYG{n}{figmanager}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{o}{.} \end{sphinxVerbatim} \section{Changes for 0.65} \label{\detokenize{api/api_changes:changes-for-0-65}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{mpl\PYGZus{}connect} \PYG{o+ow}{and} \PYG{n}{mpl\PYGZus{}disconnect} \PYG{o+ow}{in} \PYG{n}{the} \PYG{n}{MATLAB} \PYG{n}{interface} \PYG{n}{renamed} \PYG{n}{to} \PYG{n}{connect} \PYG{o+ow}{and} \PYG{n}{disconnect} \PYG{n}{Did} \PYG{n}{away} \PYG{k}{with} \PYG{n}{the} \PYG{n}{text} \PYG{n}{methods} \PYG{k}{for} \PYG{n}{angle} \PYG{n}{since} \PYG{n}{they} \PYG{n}{were} \PYG{n}{ambiguous}\PYG{o}{.} \PYG{n}{fontangle} \PYG{n}{could} \PYG{n}{mean} \PYG{n}{fontstyle} \PYG{p}{(}\PYG{n}{obligue}\PYG{p}{,} \PYG{n}{etc}\PYG{p}{)} \PYG{o+ow}{or} \PYG{n}{the} \PYG{n}{rotation} \PYG{n}{of} \PYG{n}{the} \PYG{n}{text}\PYG{o}{.} \PYG{n}{Use} \PYG{n}{style} \PYG{o+ow}{and} \PYG{n}{rotation} \PYG{n}{instead}\PYG{o}{.} \end{sphinxVerbatim} \section{Changes for 0.63} \label{\detokenize{api/api_changes:changes-for-0-63}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{Dates} \PYG{n}{are} \PYG{n}{now} \PYG{n}{represented} \PYG{n}{internally} \PYG{k}{as} \PYG{n+nb}{float} \PYG{n}{days} \PYG{n}{since} \PYG{l+m+mi}{0001}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{01}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{01}\PYG{p}{,} \PYG{n}{UTC}\PYG{o}{.} \PYG{n}{All} \PYG{n}{date} \PYG{n}{tickers} \PYG{o+ow}{and} \PYG{n}{formatters} \PYG{n}{are} \PYG{n}{now} \PYG{o+ow}{in} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{dates}\PYG{p}{,} \PYG{n}{rather} \PYG{n}{than} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{tickers} \PYG{n}{converters} \PYG{n}{have} \PYG{n}{been} \PYG{n}{abolished} \PYG{k+kn}{from} \PYG{n+nn}{all} \PYG{n}{functions} \PYG{o+ow}{and} \PYG{n}{classes}\PYG{o}{.} \PYG{n}{num2date} \PYG{o+ow}{and} \PYG{n}{date2num} \PYG{n}{are} \PYG{n}{now} \PYG{n}{the} \PYG{n}{converter} \PYG{n}{functions} \PYG{k}{for} \PYG{n+nb}{all} \PYG{n}{date} \PYG{n}{plots} \PYG{n}{Most} \PYG{n}{of} \PYG{n}{the} \PYG{n}{date} \PYG{n}{tick} \PYG{n}{locators} \PYG{n}{have} \PYG{n}{a} \PYG{n}{different} \PYG{n}{meaning} \PYG{o+ow}{in} \PYG{n}{their} \PYG{n}{constructors}\PYG{o}{.} \PYG{n}{In} \PYG{n}{the} \PYG{n}{prior} \PYG{n}{implementation}\PYG{p}{,} \PYG{n}{the} \PYG{n}{first} \PYG{n}{argument} \PYG{n}{was} \PYG{n}{a} \PYG{n}{base} \PYG{o+ow}{and} \PYG{n}{multiples} \PYG{n}{of} \PYG{n}{the} \PYG{n}{base} \PYG{n}{were} \PYG{n}{ticked}\PYG{o}{.} \PYG{n}{e}\PYG{o}{.}\PYG{n}{g}\PYG{o}{.}\PYG{p}{,} \PYG{n}{HourLocator}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} old: tick every 5 minutes} \PYG{n}{In} \PYG{n}{the} \PYG{n}{new} \PYG{n}{implementation}\PYG{p}{,} \PYG{n}{the} \PYG{n}{explicit} \PYG{n}{points} \PYG{n}{you} \PYG{n}{want} \PYG{n}{to} \PYG{n}{tick} \PYG{n}{are} \PYG{n}{provided} \PYG{k}{as} \PYG{n}{a} \PYG{n}{number} \PYG{o+ow}{or} \PYG{n}{sequence} \PYG{n}{HourLocator}\PYG{p}{(}\PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{61}\PYG{p}{)}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} new: tick every 5 minutes} \PYG{n}{This} \PYG{n}{gives} \PYG{n}{much} \PYG{n}{greater} \PYG{n}{flexibility}\PYG{o}{.} \PYG{n}{I} \PYG{n}{have} \PYG{n}{tried} \PYG{n}{to} \PYG{n}{make} \PYG{n}{the} \PYG{n}{default} \PYG{n}{constructors} \PYG{p}{(}\PYG{n}{no} \PYG{n}{args}\PYG{p}{)} \PYG{n}{behave} \PYG{n}{similarly}\PYG{p}{,} \PYG{n}{where} \PYG{n}{possible}\PYG{o}{.} \PYG{n}{Note} \PYG{n}{that} \PYG{n}{YearLocator} \PYG{n}{still} \PYG{n}{works} \PYG{n}{under} \PYG{n}{the} \PYG{n}{base}\PYG{o}{/}\PYG{n}{multiple} \PYG{n}{scheme}\PYG{o}{.} \PYG{n}{The} \PYG{n}{difference} \PYG{n}{between} \PYG{n}{the} \PYG{n}{YearLocator} \PYG{o+ow}{and} \PYG{n}{the} \PYG{n}{other} \PYG{n}{locators} \PYG{o+ow}{is} \PYG{n}{that} \PYG{n}{years} \PYG{n}{are} \PYG{o+ow}{not} \PYG{n}{recurrent}\PYG{o}{.} \PYG{n}{Financial} \PYG{n}{functions}\PYG{p}{:} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{finance}\PYG{o}{.}\PYG{n}{quotes\PYGZus{}historical\PYGZus{}yahoo}\PYG{p}{(}\PYG{n}{ticker}\PYG{p}{,} \PYG{n}{date1}\PYG{p}{,} \PYG{n}{date2}\PYG{p}{)} \PYG{n}{date1}\PYG{p}{,} \PYG{n}{date2} \PYG{n}{are} \PYG{n}{now} \PYG{n}{datetime} \PYG{n}{instances}\PYG{o}{.} \PYG{n}{Return} \PYG{n}{value} \PYG{o+ow}{is} \PYG{n}{a} \PYG{n+nb}{list} \PYG{n}{of} \PYG{n}{quotes} \PYG{n}{where} \PYG{n}{the} \PYG{n}{quote} \PYG{n}{time} \PYG{o+ow}{is} \PYG{n}{a} \PYG{n+nb}{float} \PYG{o}{\PYGZhy{}} \PYG{n}{days} \PYG{n}{since} \PYG{n}{gregorian} \PYG{n}{start}\PYG{p}{,} \PYG{k}{as} \PYG{n}{returned} \PYG{n}{by} \PYG{n}{date2num} \PYG{n}{See} \PYG{n}{examples}\PYG{o}{/}\PYG{n}{finance\PYGZus{}demo}\PYG{o}{.}\PYG{n}{py} \PYG{k}{for} \PYG{n}{example} \PYG{n}{usage} \PYG{n}{of} \PYG{n}{new} \PYG{n}{API} \end{sphinxVerbatim} \section{Changes for 0.61} \label{\detokenize{api/api_changes:changes-for-0-61}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{canvas}\PYG{o}{.}\PYG{n}{connect} \PYG{o+ow}{is} \PYG{n}{now} \PYG{n}{deprecated} \PYG{k}{for} \PYG{n}{event} \PYG{n}{handling}\PYG{o}{.} \PYG{n}{use} \PYG{n}{mpl\PYGZus{}connect} \PYG{o+ow}{and} \PYG{n}{mpl\PYGZus{}disconnect} \PYG{n}{instead}\PYG{o}{.} \PYG{n}{The} \PYG{n}{callback} \PYG{n}{signature} \PYG{o+ow}{is} \PYG{n}{func}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)} \PYG{n}{rather} \PYG{n}{than} \PYG{n}{func}\PYG{p}{(}\PYG{n}{widget}\PYG{p}{,} \PYG{n}{event}\PYG{p}{)} \end{sphinxVerbatim} \section{Changes for 0.60} \label{\detokenize{api/api_changes:changes-for-0-60}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ColormapJet} \PYG{o+ow}{and} \PYG{n}{Grayscale} \PYG{n}{are} \PYG{n}{deprecated}\PYG{o}{.} \PYG{n}{For} \PYG{n}{backwards} \PYG{n}{compatibility}\PYG{p}{,} \PYG{n}{they} \PYG{n}{can} \PYG{n}{be} \PYG{n}{obtained} \PYG{n}{either} \PYG{n}{by} \PYG{n}{doing} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{cm} \PYG{k}{import} \PYG{n}{ColormapJet} \PYG{o+ow}{or} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{matlab} \PYG{k}{import} \PYG{o}{*} \PYG{n}{They} \PYG{n}{are} \PYG{n}{replaced} \PYG{n}{by} \PYG{n}{cm}\PYG{o}{.}\PYG{n}{jet} \PYG{o+ow}{and} \PYG{n}{cm}\PYG{o}{.}\PYG{n}{grey} \end{sphinxVerbatim} \section{Changes for 0.54.3} \label{\detokenize{api/api_changes:changes-for-0-54-3}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{removed} \PYG{n}{the} \PYG{n}{set\PYGZus{}default\PYGZus{}font} \PYG{o}{/} \PYG{n}{get\PYGZus{}default\PYGZus{}font} \PYG{n}{scheme} \PYG{k+kn}{from} \PYG{n+nn}{the} \PYG{n}{font\PYGZus{}manager} \PYG{n}{to} \PYG{n}{unify} \PYG{n}{customization} \PYG{n}{of} \PYG{n}{font} \PYG{n}{defaults} \PYG{k}{with} \PYG{n}{the} \PYG{n}{rest} \PYG{n}{of} \PYG{n}{the} \PYG{n}{rc} \PYG{n}{scheme}\PYG{o}{.} \PYG{n}{See} \PYG{n}{examples}\PYG{o}{/}\PYG{n}{font\PYGZus{}properties\PYGZus{}demo}\PYG{o}{.}\PYG{n}{py} \PYG{o+ow}{and} \PYG{n}{help}\PYG{p}{(}\PYG{n}{rc}\PYG{p}{)} \PYG{o+ow}{in} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{matlab}\PYG{o}{.} \end{sphinxVerbatim} \section{Changes for 0.54} \label{\detokenize{api/api_changes:changes-for-0-54}} \subsection{MATLAB interface} \label{\detokenize{api/api_changes:matlab-interface}} \subsubsection{dpi} \label{\detokenize{api/api_changes:dpi}} Several of the backends used a PIXELS\_PER\_INCH hack that I added to try and make images render consistently across backends. This just complicated matters. So you may find that some font sizes and line widths appear different than before. Apologies for the inconvenience. You should set the dpi to an accurate value for your screen to get true sizes. \subsubsection{pcolor and scatter} \label{\detokenize{api/api_changes:pcolor-and-scatter}} There are two changes to the MATLAB interface API, both involving the patch drawing commands. For efficiency, pcolor and scatter have been rewritten to use polygon collections, which are a new set of objects from matplotlib.collections designed to enable efficient handling of large collections of objects. These new collections make it possible to build large scatter plots or pcolor plots with no loops at the python level, and are significantly faster than their predecessors. The original pcolor and scatter functions are retained as pcolor\_classic and scatter\_classic. The return value from pcolor is a PolyCollection. Most of the propertes that are available on rectangles or other patches are also available on PolyCollections, e.g., you can say: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{c} \PYG{o}{=} \PYG{n}{scatter}\PYG{p}{(}\PYG{n}{blah}\PYG{p}{,} \PYG{n}{blah}\PYG{p}{)} \PYG{n}{c}\PYG{o}{.}\PYG{n}{set\PYGZus{}linewidth}\PYG{p}{(}\PYG{l+m+mf}{1.0}\PYG{p}{)} \PYG{n}{c}\PYG{o}{.}\PYG{n}{set\PYGZus{}facecolor}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{c}\PYG{o}{.}\PYG{n}{set\PYGZus{}alpha}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{)} \end{sphinxVerbatim} or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{c} \PYG{o}{=} \PYG{n}{scatter}\PYG{p}{(}\PYG{n}{blah}\PYG{p}{,} \PYG{n}{blah}\PYG{p}{)} \PYG{n+nb}{set}\PYG{p}{(}\PYG{n}{c}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linewidth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{facecolor}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{alpha}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)} \end{sphinxVerbatim} Because the collection is a single object, you no longer need to loop over the return value of scatter or pcolor to set properties for the entire list. If you want the different elements of a collection to vary on a property, e.g., to have different line widths, see matplotlib.collections for a discussion on how to set the properties as a sequence. For scatter, the size argument is now in points\textasciicircum{}2 (the area of the symbol in points) as in MATLAB and is not in data coords as before. Using sizes in data coords caused several problems. So you will need to adjust your size arguments accordingly or use scatter\_classic. \subsubsection{mathtext spacing} \label{\detokenize{api/api_changes:mathtext-spacing}} For reasons not clear to me (and which I’ll eventually fix) spacing no longer works in font groups. However, I added three new spacing commands which compensate for this ‘’ (regular space), ‘/’ (small space) and ‘hspace\{frac\}’ where frac is a fraction of fontsize in points. You will need to quote spaces in font strings, is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{title}\PYG{p}{(}\PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZdl{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{rm}\PYG{l+s+s1}{\PYGZob{}}\PYG{l+s+s1}{Histogram}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{ of}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{ IQ:\PYGZcb{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{ }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{mu=100,}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{ }\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{sigma=15\PYGZdl{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Object interface - Application programmers} \label{\detokenize{api/api_changes:object-interface-application-programmers}} \subsubsection{Autoscaling} \label{\detokenize{api/api_changes:autoscaling}}\begin{quote} The x and y axis instances no longer have autoscale view. These are handled by axes.autoscale\_view \end{quote} \subsubsection{Axes creation} \label{\detokenize{api/api_changes:axes-creation}}\begin{quote} You should not instantiate your own Axes any more using the OO API. Rather, create a Figure as before and in place of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{f} \PYG{o}{=} \PYG{n}{Figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{,} \PYG{n}{dpi}\PYG{o}{=}\PYG{l+m+mi}{100}\PYG{p}{)} \PYG{n}{a} \PYG{o}{=} \PYG{n}{Subplot}\PYG{p}{(}\PYG{n}{f}\PYG{p}{,} \PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{f}\PYG{o}{.}\PYG{n}{add\PYGZus{}axis}\PYG{p}{(}\PYG{n}{a}\PYG{p}{)} \end{sphinxVerbatim} use: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{f} \PYG{o}{=} \PYG{n}{Figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{,} \PYG{n}{dpi}\PYG{o}{=}\PYG{l+m+mi}{100}\PYG{p}{)} \PYG{n}{a} \PYG{o}{=} \PYG{n}{f}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \end{sphinxVerbatim} That is, add\_axis no longer exists and is replaced by: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{n}{rect}\PYG{p}{,} \PYG{n}{axisbg}\PYG{o}{=}\PYG{n}{defaultcolor}\PYG{p}{,} \PYG{n}{frameon}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)} \PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{num}\PYG{p}{,} \PYG{n}{axisbg}\PYG{o}{=}\PYG{n}{defaultcolor}\PYG{p}{,} \PYG{n}{frameon}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)} \end{sphinxVerbatim} \end{quote} \subsubsection{Artist methods} \label{\detokenize{api/api_changes:artist-methods}}\begin{quote} If you define your own Artists, you need to rename the \_draw method to draw \end{quote} \subsubsection{Bounding boxes} \label{\detokenize{api/api_changes:bounding-boxes}}\begin{quote} matplotlib.transforms.Bound2D is replaced by matplotlib.transforms.Bbox. If you want to construct a bbox from left, bottom, width, height (the signature for Bound2D), use matplotlib.transforms.lbwh\_to\_bbox, as in \begin{quote} bbox = clickBBox = lbwh\_to\_bbox(left, bottom, width, height) \end{quote} The Bbox has a different API than the Bound2D. e.g., if you want to get the width and height of the bbox \begin{quote} \begin{description} \item[{OLD::}] \leavevmode width = fig.bbox.x.interval() height = fig.bbox.y.interval() \item[{New::}] \leavevmode width = fig.bbox.width() height = fig.bbox.height() \end{description} \end{quote} \end{quote} \subsubsection{Object constructors} \label{\detokenize{api/api_changes:object-constructors}}\begin{quote} You no longer pass the bbox, dpi, or transforms to the various Artist constructors. The old way or creating lines and rectangles was cumbersome because you had to pass so many attributes to the Line2D and Rectangle classes not related directly to the geometry and properties of the object. Now default values are added to the object when you call axes.add\_line or axes.add\_patch, so they are hidden from the user. If you want to define a custom transformation on these objects, call o.set\_transform(trans) where trans is a Transformation instance. In prior versions of you wanted to add a custom line in data coords, you would have to do \begin{quote} \begin{description} \item[{l = Line2D(dpi, bbox, x, y,}] \leavevmode color = color, transx = transx, transy = transy, ) \end{description} \end{quote} now all you need is \begin{quote} l = Line2D(x, y, color=color) \end{quote} and the axes will set the transformation for you (unless you have set your own already, in which case it will eave it unchanged) \end{quote} \subsubsection{Transformations} \label{\detokenize{api/api_changes:transformations}}\begin{quote} The entire transformation architecture has been rewritten. Previously the x and y transformations where stored in the xaxis and yaxis instances. The problem with this approach is it only allows for separable transforms (where the x and y transformations don’t depend on one another). But for cases like polar, they do. Now transformations operate on x,y together. There is a new base class matplotlib.transforms.Transformation and two concrete implementations, matplotlib.transforms.SeparableTransformation and matplotlib.transforms.Affine. The SeparableTransformation is constructed with the bounding box of the input (this determines the rectangular coordinate system of the input, i.e., the x and y view limits), the bounding box of the display, and possibly nonlinear transformations of x and y. The 2 most frequently used transformations, data coordinates -\textgreater{} display and axes coordinates -\textgreater{} display are available as ax.transData and ax.transAxes. See alignment\_demo.py which uses axes coords. Also, the transformations should be much faster now, for two reasons \begin{itemize} \item {} they are written entirely in extension code \item {} because they operate on x and y together, they can do the entire transformation in one loop. Earlier I did something along the lines of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{xt} \PYG{o}{=} \PYG{n}{sx}\PYG{o}{*}\PYG{n}{func}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)} \PYG{o}{+} \PYG{n}{tx} \PYG{n}{yt} \PYG{o}{=} \PYG{n}{sy}\PYG{o}{*}\PYG{n}{func}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)} \PYG{o}{+} \PYG{n}{ty} \end{sphinxVerbatim} Although this was done in numerix, it still involves 6 length(x) for-loops (the multiply, add, and function evaluation each for x and y). Now all of that is done in a single pass. \end{itemize} If you are using transformations and bounding boxes to get the cursor position in data coordinates, the method calls are a little different now. See the updated examples/coords\_demo.py which shows you how to do this. Likewise, if you are using the artist bounding boxes to pick items on the canvas with the GUI, the bbox methods are somewhat different. You will need to see the updated examples/object\_picker.py. See unit/transforms\_unit.py for many examples using the new transformations. \end{quote} \section{Changes for 0.50} \label{\detokenize{api/api_changes:changes-for-0-50}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] * refactored Figure class so it is no longer backend dependent. FigureCanvasBackend takes over the backend specific duties of the Figure. matplotlib.backend\PYGZus{}bases.FigureBase moved to matplotlib.figure.Figure. * backends must implement FigureCanvasBackend (the thing that controls the figure and handles the events if any) and FigureManagerBackend (wraps the canvas and the window for MATLAB interface). FigureCanvasBase implements a backend switching mechanism * Figure is now an Artist (like everything else in the figure) and is totally backend independent * GDFONTPATH renamed to TTFPATH * backend faceColor argument changed to rgbFace * colormap stuff moved to colors.py * arg\PYGZus{}to\PYGZus{}rgb in backend\PYGZus{}bases moved to class ColorConverter in colors.py * GD users must upgrade to gd\PYGZhy{}2.0.22 and gdmodule\PYGZhy{}0.52 since new gd features (clipping, antialiased lines) are now used. * Renderer must implement points\PYGZus{}to\PYGZus{}pixels Migrating code: MATLAB interface: The only API change for those using the MATLAB interface is in how you call figure redraws for dynamically updating figures. In the old API, you did fig.draw() In the new API, you do manager = get\PYGZus{}current\PYGZus{}fig\PYGZus{}manager() manager.canvas.draw() See the examples system\PYGZus{}monitor.py, dynamic\PYGZus{}demo.py, and anim.py API There is one important API change for application developers. Figure instances used subclass GUI widgets that enabled them to be placed directly into figures. e.g., FigureGTK subclassed gtk.DrawingArea. Now the Figure class is independent of the backend, and FigureCanvas takes over the functionality formerly handled by Figure. In order to include figures into your apps, you now need to do, for example \PYGZsh{} gtk example fig = Figure(figsize=(5,4), dpi=100) canvas = FigureCanvasGTK(fig) \PYGZsh{} a gtk.DrawingArea canvas.show() vbox.pack\PYGZus{}start(canvas) If you use the NavigationToolbar, this in now initialized with a FigureCanvas, not a Figure. The examples embedding\PYGZus{}in\PYGZus{}gtk.py, embedding\PYGZus{}in\PYGZus{}gtk2.py, and mpl\PYGZus{}with\PYGZus{}glade.py all reflect the new API so use these as a guide. All prior calls to figure.draw() and figure.print\PYGZus{}figure(args) should now be canvas.draw() and canvas.print\PYGZus{}figure(args) Apologies for the inconvenience. This refactorization brings significant more freedom in developing matplotlib and should bring better plotting capabilities, so I hope the inconvenience is worth it. \end{sphinxVerbatim} \section{Changes for 0.42} \label{\detokenize{api/api_changes:changes-for-0-42}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] * Refactoring AxisText to be backend independent. Text drawing and get\PYGZus{}window\PYGZus{}extent functionality will be moved to the Renderer. * backend\PYGZus{}bases.AxisTextBase is now text.Text module * All the erase and reset functionality removed from AxisText \PYGZhy{} not needed with double buffered drawing. Ditto with state change. Text instances have a get\PYGZus{}prop\PYGZus{}tup method that returns a hashable tuple of text properties which you can use to see if text props have changed, e.g., by caching a font or layout instance in a dict with the prop tup as a key \PYGZhy{}\PYGZhy{} see RendererGTK.get\PYGZus{}pango\PYGZus{}layout in backend\PYGZus{}gtk for an example. * Text.\PYGZus{}get\PYGZus{}xy\PYGZus{}display renamed Text.get\PYGZus{}xy\PYGZus{}display * Artist set\PYGZus{}renderer and wash\PYGZus{}brushes methods removed * Moved Legend class from matplotlib.axes into matplotlib.legend * Moved Tick, XTick, YTick, Axis, XAxis, YAxis from matplotlib.axes to matplotlib.axis * moved process\PYGZus{}text\PYGZus{}args to matplotlib.text * After getting Text handled in a backend independent fashion, the import process is much cleaner since there are no longer cyclic dependencies * matplotlib.matlab.\PYGZus{}get\PYGZus{}current\PYGZus{}fig\PYGZus{}manager renamed to matplotlib.matlab.get\PYGZus{}current\PYGZus{}fig\PYGZus{}manager to allow user access to the GUI window attribute, e.g., figManager.window for GTK and figManager.frame for wx \end{sphinxVerbatim} \section{Changes for 0.40} \label{\detokenize{api/api_changes:changes-for-0-40}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYGZhy{} Artist * \PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{} takes a DPI instance and a Bound2D instance which is the bounding box of the artist in display coords * get\PYGZus{}window\PYGZus{}extent returns a Bound2D instance * set\PYGZus{}size is removed; replaced by bbox and dpi * the clip\PYGZus{}gc method is removed. Artists now clip themselves with their box * added \PYGZus{}clipOn boolean attribute. If True, gc clip to bbox. \PYGZhy{} AxisTextBase * Initialized with a transx, transy which are Transform instances * set\PYGZus{}drawing\PYGZus{}area removed * get\PYGZus{}left\PYGZus{}right and get\PYGZus{}top\PYGZus{}bottom are replaced by get\PYGZus{}window\PYGZus{}extent \PYGZhy{} Line2D Patches now take transx, transy * Initialized with a transx, transy which are Transform instances \PYGZhy{} Patches * Initialized with a transx, transy which are Transform instances \PYGZhy{} FigureBase attributes dpi is a DPI instance rather than scalar and new attribute bbox is a Bound2D in display coords, and I got rid of the left, width, height, etc... attributes. These are now accessible as, for example, bbox.x.min is left, bbox.x.interval() is width, bbox.y.max is top, etc... \PYGZhy{} GcfBase attribute pagesize renamed to figsize \PYGZhy{} Axes * removed figbg attribute * added fig instance to \PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{} * resizing is handled by figure call to resize. \PYGZhy{} Subplot * added fig instance to \PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{} \PYGZhy{} Renderer methods for patches now take gcEdge and gcFace instances. gcFace=None takes the place of filled=False \PYGZhy{} True and False symbols provided by cbook in a python2.3 compatible way \PYGZhy{} new module transforms supplies Bound1D, Bound2D and Transform instances and more \PYGZhy{} Changes to the MATLAB helpers API * \PYGZus{}matlab\PYGZus{}helpers.GcfBase is renamed by Gcf. Backends no longer need to derive from this class. Instead, they provide a factory function new\PYGZus{}figure\PYGZus{}manager(num, figsize, dpi). The destroy method of the GcfDerived from the backends is moved to the derived FigureManager. * FigureManagerBase moved to backend\PYGZus{}bases * Gcf.get\PYGZus{}all\PYGZus{}figwins renamed to Gcf.get\PYGZus{}all\PYGZus{}fig\PYGZus{}managers Jeremy: Make sure to self.\PYGZus{}reset = False in AxisTextWX.\PYGZus{}set\PYGZus{}font. This was something missing in my backend code. \end{sphinxVerbatim} \chapter{The top level \sphinxstyleliteralintitle{\sphinxupquote{matplotlib}} module} \label{\detokenize{api/matplotlib_configuration_api:the-top-level-matplotlib-module}}\label{\detokenize{api/matplotlib_configuration_api::doc}}\index{use() (in module matplotlib)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.use}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.}}\sphinxbfcode{\sphinxupquote{use}}}{\emph{arg}, \emph{warn=True}, \emph{force=False}}{} Set the matplotlib backend to one of the known backends. The argument is case-insensitive. \sphinxstyleemphasis{warn} specifies whether a warning should be issued if a backend has already been set up. \sphinxstyleemphasis{force} is an \sphinxstylestrong{experimental} flag that tells matplotlib to attempt to initialize a new backend by reloading the backend module. \begin{sphinxadmonition}{note}{Note:} This function must be called \sphinxstyleemphasis{before} importing pyplot for the first time; or, if you are not using pyplot, it must be called before importing matplotlib.backends. If warn is True, a warning is issued if you try and call this after pylab or pyplot have been loaded. In certain black magic use cases, e.g. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.switch_backend:matplotlib.pyplot.switch_backend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pyplot.switch\_backend()}}}}}, we are doing the reloading necessary to make the backend switch work (in some cases, e.g., pure image backends) so one can set warn=False to suppress the warnings. \end{sphinxadmonition} To find out which backend is currently set, see {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.get_backend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.get\_backend()}}}}}. \end{fulllineitems} \index{get\_backend() (in module matplotlib)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.get_backend}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.}}\sphinxbfcode{\sphinxupquote{get\_backend}}}{}{} Return the name of the current backend. \end{fulllineitems} \index{rcParams (in module matplotlib)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.}}\sphinxbfcode{\sphinxupquote{rcParams}}} An instance of {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.RcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RcParams}}}}} for handling default matplotlib values. \end{fulllineitems} \index{rc\_context() (in module matplotlib)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.rc_context}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.}}\sphinxbfcode{\sphinxupquote{rc\_context}}}{\emph{rc=None}, \emph{fname=None}}{} Return a context manager for managing rc settings. This allows one to do: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{with} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rc\PYGZus{}context}\PYG{p}{(}\PYG{n}{fname}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{screen.rc}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{:} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{a}\PYG{p}{)} \PYG{k}{with} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rc\PYGZus{}context}\PYG{p}{(}\PYG{n}{fname}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{print.rc}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{:} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{b}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{c}\PYG{p}{)} \end{sphinxVerbatim} The ‘a’ vs ‘x’ and ‘c’ vs ‘x’ plots would have settings from ‘screen.rc’, while the ‘b’ vs ‘x’ plot would have settings from ‘print.rc’. A dictionary can also be passed to the context manager: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{with} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rc\PYGZus{}context}\PYG{p}{(}\PYG{n}{rc}\PYG{o}{=}\PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{text.usetex}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{k+kc}{True}\PYG{p}{\PYGZcb{}}\PYG{p}{,} \PYG{n}{fname}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{screen.rc}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{:} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{a}\PYG{p}{)} \end{sphinxVerbatim} The ‘rc’ dictionary takes precedence over the settings loaded from ‘fname’. Passing a dictionary only is also valid. For example a common usage is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{with} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rc\PYGZus{}context}\PYG{p}{(}\PYG{n}{rc}\PYG{o}{=}\PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{interactive}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{k+kc}{False}\PYG{p}{\PYGZcb{}}\PYG{p}{)}\PYG{p}{:} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{savefig}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{A.png}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n+nb}{format}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{png}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{close}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{rc() (in module matplotlib)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.rc}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.}}\sphinxbfcode{\sphinxupquote{rc}}}{\emph{group}, \emph{**kwargs}}{} Set the current rc params. Group is the grouping for the rc, e.g., for \sphinxcode{\sphinxupquote{lines.linewidth}} the group is \sphinxcode{\sphinxupquote{lines}}, for \sphinxcode{\sphinxupquote{axes.facecolor}}, the group is \sphinxcode{\sphinxupquote{axes}}, and so on. Group may also be a list or tuple of group names, e.g., (\sphinxstyleemphasis{xtick}, \sphinxstyleemphasis{ytick}). \sphinxstyleemphasis{kwargs} is a dictionary attribute name/value pairs, e.g.,: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{rc}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} sets the current rc params and is equivalent to: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines.linewidth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mi}{2} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines.color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} The following aliases are available to save typing for interactive users: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Alias &\sphinxstyletheadfamily Property \\ \hline ‘lw’ & ‘linewidth’ \\ \hline ‘ls’ & ‘linestyle’ \\ \hline ‘c’ & ‘color’ \\ \hline ‘fc’ & ‘facecolor’ \\ \hline ‘ec’ & ‘edgecolor’ \\ \hline ‘mew’ & ‘markeredgewidth’ \\ \hline ‘aa’ & ‘antialiased’ \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Thus you could abbreviate the above rc command as: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{rc}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{c}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} Note you can use python’s kwargs dictionary facility to store dictionaries of default parameters. e.g., you can customize the font rc as follows: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{font} \PYG{o}{=} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{family}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{monospace}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{weight}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bold}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{size}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{larger}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}} \PYG{n}{rc}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{font}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{font}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} pass in the font dict as kwargs} \end{sphinxVerbatim} This enables you to easily switch between several configurations. Use \sphinxcode{\sphinxupquote{matplotlib.style.use('default')}} or {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcdefaults}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rcdefaults()}}}}} to restore the default rc params after changes. \end{fulllineitems} \index{rc\_file() (in module matplotlib)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.rc_file}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.}}\sphinxbfcode{\sphinxupquote{rc\_file}}}{\emph{fname}}{} Update rc params from file. \end{fulllineitems} \index{rcdefaults() (in module matplotlib)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.rcdefaults}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.}}\sphinxbfcode{\sphinxupquote{rcdefaults}}}{}{} Restore the rc params from Matplotlib’s internal defaults. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rc_file_defaults}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rc\_file\_defaults}}}}}}] \leavevmode Restore the rc params from the rc file originally loaded by Matplotlib. \item[{{\hyperref[\detokenize{api/style_api:matplotlib.style.use}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.style.use}}}}}}] \leavevmode Use a specific style file. Call \sphinxcode{\sphinxupquote{style.use('default')}} to restore the default style. \end{description} \end{fulllineitems} \index{rc\_file\_defaults() (in module matplotlib)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.rc_file_defaults}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.}}\sphinxbfcode{\sphinxupquote{rc\_file\_defaults}}}{}{} Restore the rc params from the original rc file loaded by Matplotlib. \end{fulllineitems} \index{RcParams (class in matplotlib)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.RcParams}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.}}\sphinxbfcode{\sphinxupquote{RcParams}}}{\emph{*args}, \emph{**kwargs}}{} A dictionary object including validation validating functions are defined and associated with rc parameters in {\hyperref[\detokenize{api/rcsetup_api:module-matplotlib.rcsetup}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcsetup}}}}} \index{find\_all() (matplotlib.RcParams method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.RcParams.find_all}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{find\_all}}}{\emph{pattern}}{} Return the subset of this RcParams dictionary whose keys match, using \sphinxhref{https://docs.python.org/3/library/re.html\#re.search}{\sphinxcode{\sphinxupquote{re.search()}}}, the given \sphinxcode{\sphinxupquote{pattern}}. \begin{sphinxadmonition}{note}{Note:} Changes to the returned dictionary are \sphinxstyleemphasis{not} propagated to the parent RcParams dictionary. \end{sphinxadmonition} \end{fulllineitems} \index{msg\_backend\_obsolete (matplotlib.RcParams attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.RcParams.msg_backend_obsolete}}\pysigline{\sphinxbfcode{\sphinxupquote{msg\_backend\_obsolete}}\sphinxbfcode{\sphinxupquote{ = 'The \{\} rcParam was deprecated in version 2.2. In order to force the use of a specific Qt binding, either import that binding first, or set the QT\_API environment variable.'}}} \end{fulllineitems} \index{msg\_depr (matplotlib.RcParams attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.RcParams.msg_depr}}\pysigline{\sphinxbfcode{\sphinxupquote{msg\_depr}}\sphinxbfcode{\sphinxupquote{ = '\%s is deprecated and replaced with \%s; please use the latter.'}}} \end{fulllineitems} \index{msg\_depr\_ignore (matplotlib.RcParams attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.RcParams.msg_depr_ignore}}\pysigline{\sphinxbfcode{\sphinxupquote{msg\_depr\_ignore}}\sphinxbfcode{\sphinxupquote{ = '\%s is deprecated and ignored. Use \%s instead.'}}} \end{fulllineitems} \index{msg\_depr\_set (matplotlib.RcParams attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.RcParams.msg_depr_set}}\pysigline{\sphinxbfcode{\sphinxupquote{msg\_depr\_set}}\sphinxbfcode{\sphinxupquote{ = '\%s is deprecated. Please remove it from your matplotlibrc and/or style files.'}}} \end{fulllineitems} \index{msg\_obsolete (matplotlib.RcParams attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.RcParams.msg_obsolete}}\pysigline{\sphinxbfcode{\sphinxupquote{msg\_obsolete}}\sphinxbfcode{\sphinxupquote{ = '\%s is obsolete. Please remove it from your matplotlibrc and/or style files.'}}} \end{fulllineitems} \index{validate (matplotlib.RcParams attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.RcParams.validate}}\pysigline{\sphinxbfcode{\sphinxupquote{validate}}\sphinxbfcode{\sphinxupquote{ = \{'\_internal.classic\_mode': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'agg.path.chunksize': \textless{}function validate\_int at 0x7f9312c2bd90\textgreater{}, 'animation.avconv\_args': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'animation.avconv\_path': \textless{}function validate\_animation\_writer\_path at 0x7f9312c326a8\textgreater{}, 'animation.bitrate': \textless{}function validate\_int at 0x7f9312c2bd90\textgreater{}, 'animation.codec': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'animation.convert\_args': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'animation.convert\_path': \textless{}function validate\_animation\_writer\_path at 0x7f9312c326a8\textgreater{}, 'animation.embed\_limit': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'animation.ffmpeg\_args': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'animation.ffmpeg\_path': \textless{}function validate\_animation\_writer\_path at 0x7f9312c326a8\textgreater{}, 'animation.frame\_format': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c2f320\textgreater{}, 'animation.html': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c2f3c8\textgreater{}, 'animation.html\_args': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'animation.writer': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c2f358\textgreater{}, 'axes.autolimit\_mode': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c2f860\textgreater{}, 'axes.axisbelow': \textless{}function validate\_axisbelow at 0x7f9312c2bc80\textgreater{}, 'axes.edgecolor': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'axes.facecolor': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'axes.formatter.limits': \textless{}matplotlib.rcsetup.validate\_nseq\_int object at 0x7f9312c2f7f0\textgreater{}, 'axes.formatter.min\_exponent': \textless{}function validate\_int at 0x7f9312c2bd90\textgreater{}, 'axes.formatter.offset\_threshold': \textless{}function validate\_int at 0x7f9312c2bd90\textgreater{}, 'axes.formatter.use\_locale': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'axes.formatter.use\_mathtext': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'axes.formatter.useoffset': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'axes.grid': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'axes.grid.axis': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c2f400\textgreater{}, 'axes.grid.which': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c2f390\textgreater{}, 'axes.hold': \textless{}function deprecate\_axes\_hold at 0x7f9312c2b9d8\textgreater{}, 'axes.labelcolor': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'axes.labelpad': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'axes.labelsize': \textless{}function validate\_fontsize at 0x7f9312c2c840\textgreater{}, 'axes.labelweight': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'axes.linewidth': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'axes.prop\_cycle': \textless{}function validate\_cycler at 0x7f9312c32598\textgreater{}, 'axes.spines.bottom': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'axes.spines.left': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'axes.spines.right': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'axes.spines.top': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'axes.titlepad': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'axes.titlesize': \textless{}function validate\_fontsize at 0x7f9312c2c840\textgreater{}, 'axes.titleweight': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'axes.unicode\_minus': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'axes.xmargin': \textless{}matplotlib.rcsetup.ValidateInterval object at 0x7f9312c2f898\textgreater{}, 'axes.ymargin': \textless{}matplotlib.rcsetup.ValidateInterval object at 0x7f9312c2f8d0\textgreater{}, 'axes3d.grid': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'backend': \textless{}function validate\_backend at 0x7f9312c2bf28\textgreater{}, 'backend.qt4': \textless{}function validate\_qt4 at 0x7f9312c2c048\textgreater{}, 'backend.qt5': \textless{}function validate\_qt5 at 0x7f9312c2c0d0\textgreater{}, 'backend\_fallback': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'boxplot.bootstrap': \textless{}function validate\_int\_or\_None at 0x7f9312c2be18\textgreater{}, 'boxplot.boxprops.color': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'boxplot.boxprops.linestyle': \textless{}function \_validate\_linestyle at 0x7f9312c327b8\textgreater{}, 'boxplot.boxprops.linewidth': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'boxplot.capprops.color': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'boxplot.capprops.linestyle': \textless{}function \_validate\_linestyle at 0x7f9312c327b8\textgreater{}, 'boxplot.capprops.linewidth': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'boxplot.flierprops.color': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'boxplot.flierprops.linestyle': \textless{}function \_validate\_linestyle at 0x7f9312c327b8\textgreater{}, 'boxplot.flierprops.linewidth': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'boxplot.flierprops.marker': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'boxplot.flierprops.markeredgecolor': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'boxplot.flierprops.markerfacecolor': \textless{}function validate\_color\_or\_auto at 0x7f9312c2c488\textgreater{}, 'boxplot.flierprops.markersize': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'boxplot.meanline': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'boxplot.meanprops.color': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'boxplot.meanprops.linestyle': \textless{}function \_validate\_linestyle at 0x7f9312c327b8\textgreater{}, 'boxplot.meanprops.linewidth': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'boxplot.meanprops.marker': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'boxplot.meanprops.markeredgecolor': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'boxplot.meanprops.markerfacecolor': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'boxplot.meanprops.markersize': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'boxplot.medianprops.color': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'boxplot.medianprops.linestyle': \textless{}function \_validate\_linestyle at 0x7f9312c327b8\textgreater{}, 'boxplot.medianprops.linewidth': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'boxplot.notch': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'boxplot.patchartist': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'boxplot.showbox': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'boxplot.showcaps': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'boxplot.showfliers': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'boxplot.showmeans': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'boxplot.vertical': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'boxplot.whiskerprops.color': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'boxplot.whiskerprops.linestyle': \textless{}function \_validate\_linestyle at 0x7f9312c327b8\textgreater{}, 'boxplot.whiskerprops.linewidth': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'boxplot.whiskers': \textless{}function validate\_whiskers at 0x7f9312c2c9d8\textgreater{}, 'contour.corner\_mask': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'contour.negative\_linestyle': \textless{}function \_validate\_linestyle at 0x7f9312c327b8\textgreater{}, 'datapath': \textless{}function validate\_path\_exists at 0x7f9312c2b840\textgreater{}, 'date.autoformatter.day': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'date.autoformatter.hour': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'date.autoformatter.microsecond': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'date.autoformatter.minute': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'date.autoformatter.month': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'date.autoformatter.second': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'date.autoformatter.year': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'docstring.hardcopy': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'errorbar.capsize': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'examples.directory': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'figure.autolayout': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'figure.constrained\_layout.h\_pad': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'figure.constrained\_layout.hspace': \textless{}matplotlib.rcsetup.ValidateInterval object at 0x7f9312c2fa90\textgreater{}, 'figure.constrained\_layout.use': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'figure.constrained\_layout.w\_pad': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'figure.constrained\_layout.wspace': \textless{}matplotlib.rcsetup.ValidateInterval object at 0x7f9312c2fac8\textgreater{}, 'figure.dpi': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'figure.edgecolor': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'figure.facecolor': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'figure.figsize': \textless{}matplotlib.rcsetup.validate\_nseq\_float object at 0x7f9312c2f908\textgreater{}, 'figure.frameon': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'figure.max\_open\_warning': \textless{}function validate\_int at 0x7f9312c2bd90\textgreater{}, 'figure.subplot.bottom': \textless{}matplotlib.rcsetup.ValidateInterval object at 0x7f9312c2f9b0\textgreater{}, 'figure.subplot.hspace': \textless{}matplotlib.rcsetup.ValidateInterval object at 0x7f9312c2fa58\textgreater{}, 'figure.subplot.left': \textless{}matplotlib.rcsetup.ValidateInterval object at 0x7f9312c2f940\textgreater{}, 'figure.subplot.right': \textless{}matplotlib.rcsetup.ValidateInterval object at 0x7f9312c2f978\textgreater{}, 'figure.subplot.top': \textless{}matplotlib.rcsetup.ValidateInterval object at 0x7f9312c2f9e8\textgreater{}, 'figure.subplot.wspace': \textless{}matplotlib.rcsetup.ValidateInterval object at 0x7f9312c2fa20\textgreater{}, 'figure.titlesize': \textless{}function validate\_fontsize at 0x7f9312c2c840\textgreater{}, 'figure.titleweight': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'font.cursive': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'font.family': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'font.fantasy': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'font.monospace': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'font.sans-serif': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'font.serif': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'font.size': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'font.stretch': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'font.style': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'font.variant': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'font.weight': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'grid.alpha': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'grid.color': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'grid.linestyle': \textless{}function \_validate\_linestyle at 0x7f9312c327b8\textgreater{}, 'grid.linewidth': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'hatch.color': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'hatch.linewidth': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'hist.bins': \textless{}function validate\_hist\_bins at 0x7f9312c32620\textgreater{}, 'image.aspect': \textless{}function validate\_aspect at 0x7f9312c2c7b8\textgreater{}, 'image.cmap': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'image.composite\_image': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'image.interpolation': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'image.lut': \textless{}function validate\_int at 0x7f9312c2bd90\textgreater{}, 'image.origin': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'image.resample': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'interactive': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'keymap.all\_axes': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'keymap.back': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'keymap.forward': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'keymap.fullscreen': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'keymap.grid': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'keymap.grid\_minor': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'keymap.home': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'keymap.pan': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'keymap.quit': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'keymap.quit\_all': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'keymap.save': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'keymap.xscale': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'keymap.yscale': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'keymap.zoom': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'legend.borderaxespad': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'legend.borderpad': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'legend.columnspacing': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'legend.edgecolor': \textless{}function validate\_color\_or\_inherit at 0x7f9312c2c1e0\textgreater{}, 'legend.facecolor': \textless{}function validate\_color\_or\_inherit at 0x7f9312c2c1e0\textgreater{}, 'legend.fancybox': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'legend.fontsize': \textless{}function validate\_fontsize at 0x7f9312c2c840\textgreater{}, 'legend.framealpha': \textless{}function validate\_float\_or\_None at 0x7f9312c2bb70\textgreater{}, 'legend.frameon': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'legend.handleheight': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'legend.handlelength': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'legend.handletextpad': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'legend.labelspacing': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'legend.loc': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c2f1d0\textgreater{}, 'legend.markerscale': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'legend.numpoints': \textless{}function validate\_int at 0x7f9312c2bd90\textgreater{}, 'legend.scatterpoints': \textless{}function validate\_int at 0x7f9312c2bd90\textgreater{}, 'legend.shadow': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'lines.antialiased': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'lines.color': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'lines.dash\_capstyle': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c15f28\textgreater{}, 'lines.dash\_joinstyle': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c11550\textgreater{}, 'lines.dashdot\_pattern': \textless{}matplotlib.rcsetup.validate\_nseq\_float object at 0x7f9312c2f710\textgreater{}, 'lines.dashed\_pattern': \textless{}matplotlib.rcsetup.validate\_nseq\_float object at 0x7f9312c2f470\textgreater{}, 'lines.dotted\_pattern': \textless{}matplotlib.rcsetup.validate\_nseq\_float object at 0x7f9312c2f748\textgreater{}, 'lines.linestyle': \textless{}function \_validate\_linestyle at 0x7f9312c327b8\textgreater{}, 'lines.linewidth': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'lines.marker': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'lines.markeredgewidth': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'lines.markersize': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'lines.scale\_dashes': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'lines.solid\_capstyle': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c15f28\textgreater{}, 'lines.solid\_joinstyle': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c11550\textgreater{}, 'markers.fillstyle': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c2f048\textgreater{}, 'mathtext.bf': \textless{}function validate\_font\_properties at 0x7f9312c2c950\textgreater{}, 'mathtext.cal': \textless{}function validate\_font\_properties at 0x7f9312c2c950\textgreater{}, 'mathtext.default': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c11470\textgreater{}, 'mathtext.fallback\_to\_cm': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'mathtext.fontset': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c11080\textgreater{}, 'mathtext.it': \textless{}function validate\_font\_properties at 0x7f9312c2c950\textgreater{}, 'mathtext.rm': \textless{}function validate\_font\_properties at 0x7f9312c2c950\textgreater{}, 'mathtext.sf': \textless{}function validate\_font\_properties at 0x7f9312c2c950\textgreater{}, 'mathtext.tt': \textless{}function validate\_font\_properties at 0x7f9312c2c950\textgreater{}, 'patch.antialiased': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'patch.edgecolor': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'patch.facecolor': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'patch.force\_edgecolor': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'patch.linewidth': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'path.effects': \textless{}function validate\_any at 0x7f9312c2b730\textgreater{}, 'path.simplify': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'path.simplify\_threshold': \textless{}matplotlib.rcsetup.ValidateInterval object at 0x7f9312c2fb00\textgreater{}, 'path.sketch': \textless{}function validate\_sketch at 0x7f9312c32158\textgreater{}, 'path.snap': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'pdf.compression': \textless{}function validate\_int at 0x7f9312c2bd90\textgreater{}, 'pdf.fonttype': \textless{}function validate\_fonttype at 0x7f9312c2bea0\textgreater{}, 'pdf.inheritcolor': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'pdf.use14corefonts': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'pgf.debug': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'pgf.preamble': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'pgf.rcfonts': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'pgf.texsystem': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c2f240\textgreater{}, 'polaraxes.grid': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'ps.distiller.res': \textless{}function validate\_int at 0x7f9312c2bd90\textgreater{}, 'ps.fonttype': \textless{}function validate\_fonttype at 0x7f9312c2bea0\textgreater{}, 'ps.papersize': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c11518\textgreater{}, 'ps.useafm': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'ps.usedistiller': \textless{}function validate\_ps\_distiller at 0x7f9312c2cae8\textgreater{}, 'savefig.bbox': \textless{}function validate\_bbox at 0x7f9312c320d0\textgreater{}, 'savefig.directory': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'savefig.dpi': \textless{}function validate\_dpi at 0x7f9312c2bd08\textgreater{}, 'savefig.edgecolor': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'savefig.facecolor': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'savefig.format': \textless{}function update\_savefig\_format at 0x7f9312c2ca60\textgreater{}, 'savefig.frameon': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'savefig.jpeg\_quality': \textless{}function validate\_int at 0x7f9312c2bd90\textgreater{}, 'savefig.orientation': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c09f98\textgreater{}, 'savefig.pad\_inches': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'savefig.transparent': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'scatter.marker': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'svg.fonttype': \textless{}function validate\_svg\_fonttype at 0x7f9312c2cd08\textgreater{}, 'svg.hashsalt': \textless{}function validate\_string\_or\_None at 0x7f9312c2bbf8\textgreater{}, 'svg.image\_inline': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'text.antialiased': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'text.color': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'text.hinting': \textless{}function validate\_hinting at 0x7f9312c2cf28\textgreater{}, 'text.hinting\_factor': \textless{}function validate\_int at 0x7f9312c2bd90\textgreater{}, 'text.latex.preamble': \textless{}function \_listify\_validator.\textless{}locals\textgreater{}.f at 0x7f9312c2c730\textgreater{}, 'text.latex.preview': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'text.latex.unicode': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'text.usetex': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'timezone': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'tk.window\_focus': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'toolbar': \textless{}function validate\_toolbar at 0x7f9312c2c158\textgreater{}, 'verbose.fileo': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'verbose.level': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c114a8\textgreater{}, 'webagg.address': \textless{}function validate\_webagg\_address at 0x7f9312c32730\textgreater{}, 'webagg.open\_in\_browser': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'webagg.port': \textless{}function validate\_int at 0x7f9312c2bd90\textgreater{}, 'webagg.port\_retries': \textless{}function validate\_int at 0x7f9312c2bd90\textgreater{}, 'xtick.alignment': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c114e0\textgreater{}, 'xtick.bottom': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'xtick.color': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'xtick.direction': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'xtick.labelbottom': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'xtick.labelsize': \textless{}function validate\_fontsize at 0x7f9312c2c840\textgreater{}, 'xtick.labeltop': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'xtick.major.bottom': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'xtick.major.pad': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'xtick.major.size': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'xtick.major.top': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'xtick.major.width': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'xtick.minor.bottom': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'xtick.minor.pad': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'xtick.minor.size': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'xtick.minor.top': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'xtick.minor.visible': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'xtick.minor.width': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'xtick.top': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'ytick.alignment': \textless{}matplotlib.rcsetup.ValidateInStrings object at 0x7f9312c114e0\textgreater{}, 'ytick.color': \textless{}function validate\_color at 0x7f9312c2c598\textgreater{}, 'ytick.direction': \textless{}function validate\_string at 0x7f9312c2c6a8\textgreater{}, 'ytick.labelleft': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'ytick.labelright': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'ytick.labelsize': \textless{}function validate\_fontsize at 0x7f9312c2c840\textgreater{}, 'ytick.left': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'ytick.major.left': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'ytick.major.pad': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'ytick.major.right': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'ytick.major.size': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'ytick.major.width': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'ytick.minor.left': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'ytick.minor.pad': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'ytick.minor.right': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'ytick.minor.size': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'ytick.minor.visible': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}, 'ytick.minor.width': \textless{}function validate\_float at 0x7f9312c2ba60\textgreater{}, 'ytick.right': \textless{}function validate\_bool at 0x7f9312c2b8c8\textgreater{}\}}}} \end{fulllineitems} \end{fulllineitems} \index{rc\_params() (in module matplotlib)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.rc_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.}}\sphinxbfcode{\sphinxupquote{rc\_params}}}{\emph{fail\_on\_error=False}}{} Return a {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.RcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.RcParams}}}}} instance from the default matplotlib rc file. \end{fulllineitems} \index{rc\_params\_from\_file() (in module matplotlib)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.rc_params_from_file}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.}}\sphinxbfcode{\sphinxupquote{rc\_params\_from\_file}}}{\emph{fname}, \emph{fail\_on\_error=False}, \emph{use\_default\_template=True}}{} Return {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.RcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.RcParams}}}}} from the contents of the given file. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fname}}] \leavevmode{[}str{]} Name of file parsed for matplotlib settings. \item[{\sphinxstylestrong{fail\_on\_error}}] \leavevmode{[}bool{]} If True, raise an error when the parser fails to convert a parameter. \item[{\sphinxstylestrong{use\_default\_template}}] \leavevmode{[}bool{]} If True, initialize with default parameters before updating with those in the given file. If False, the configuration class only contains the parameters specified in the file. (Useful for updating dicts.) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{matplotlib\_fname() (in module matplotlib)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.matplotlib_fname}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.}}\sphinxbfcode{\sphinxupquote{matplotlib\_fname}}}{}{} Get the location of the config file. The file location is determined in the following order \begin{itemize} \item {} \sphinxcode{\sphinxupquote{\$PWD/matplotlibrc}} \item {} \sphinxcode{\sphinxupquote{\$MATPLOTLIBRC}} if it is a file (or a named pipe, which can be created e.g. by process substitution) \item {} \sphinxcode{\sphinxupquote{\$MATPLOTLIBRC/matplotlibrc}} \item {} \sphinxcode{\sphinxupquote{\$MPLCONFIGDIR/matplotlibrc}} \item {} On Linux, \begin{itemize} \item {} \sphinxcode{\sphinxupquote{\$XDG\_CONFIG\_HOME/matplotlib/matplotlibrc}} (if \$XDG\_CONFIG\_HOME is defined) \item {} or \sphinxcode{\sphinxupquote{\$HOME/.config/matplotlib/matplotlibrc}} (if \$XDG\_CONFIG\_HOME is not defined) \end{itemize} \item {} On other platforms, \begin{itemize} \item {} \sphinxcode{\sphinxupquote{\$HOME/.matplotlib/matplotlibrc}} if \sphinxcode{\sphinxupquote{\$HOME}} is defined. \end{itemize} \item {} Lastly, it looks in \sphinxcode{\sphinxupquote{\$MATPLOTLIBDATA/matplotlibrc}} for a system-defined copy. \end{itemize} \end{fulllineitems} \index{interactive() (in module matplotlib)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.interactive}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.}}\sphinxbfcode{\sphinxupquote{interactive}}}{\emph{b}}{} Set interactive mode to boolean b. If b is True, then draw after every plotting command, e.g., after xlabel \end{fulllineitems} \index{is\_interactive() (in module matplotlib)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/matplotlib_configuration_api:matplotlib.is_interactive}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.}}\sphinxbfcode{\sphinxupquote{is\_interactive}}}{}{} Return true if plot mode is interactive \end{fulllineitems} \chapter{afm (Adobe Font Metrics interface)} \label{\detokenize{api/afm_api:afm-adobe-font-metrics-interface}}\label{\detokenize{api/afm_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.afm}}} \label{\detokenize{api/afm_api:module-matplotlib.afm}}\label{\detokenize{api/afm_api:matplotlib-afm}}\index{matplotlib.afm (module)} This is a python interface to Adobe Font Metrics Files. Although a number of other python implementations exist, and may be more complete than this, it was decided not to go with them because they were either: \begin{enumerate} \item {} copyrighted or used a non-BSD compatible license \item {} had too many dependencies and a free standing lib was needed \item {} Did more than needed and it was easier to write afresh rather than figure out how to get just what was needed. \end{enumerate} It is pretty easy to use, and requires only built-in python libs: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{matplotlib} \PYG{k}{import} \PYG{n}{rcParams} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{os}\PYG{n+nn}{.}\PYG{n+nn}{path} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{afm\PYGZus{}fname} \PYG{o}{=} \PYG{n}{os}\PYG{o}{.}\PYG{n}{path}\PYG{o}{.}\PYG{n}{join}\PYG{p}{(}\PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{datapath}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{g+gp}{... } \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{fonts}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{afm}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ptmr8a.afm}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{g+go}{\PYGZgt{}\PYGZgt{}\PYGZgt{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{afm} \PYG{k}{import} \PYG{n}{AFM} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k}{with} \PYG{n+nb}{open}\PYG{p}{(}\PYG{n}{afm\PYGZus{}fname}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{rb}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k}{as} \PYG{n}{fh}\PYG{p}{:} \PYG{g+gp}{... } \PYG{n}{afm} \PYG{o}{=} \PYG{n}{AFM}\PYG{p}{(}\PYG{n}{fh}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{afm}\PYG{o}{.}\PYG{n}{string\PYGZus{}width\PYGZus{}height}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{What the heck?}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{g+go}{(6220.0, 694)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{afm}\PYG{o}{.}\PYG{n}{get\PYGZus{}fontname}\PYG{p}{(}\PYG{p}{)} \PYG{g+go}{\PYGZsq{}Times\PYGZhy{}Roman\PYGZsq{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{afm}\PYG{o}{.}\PYG{n}{get\PYGZus{}kern\PYGZus{}dist}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{A}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{f}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{g+go}{0} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{afm}\PYG{o}{.}\PYG{n}{get\PYGZus{}kern\PYGZus{}dist}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{A}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{y}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{g+go}{\PYGZhy{}92.0} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{afm}\PYG{o}{.}\PYG{n}{get\PYGZus{}bbox\PYGZus{}char}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{!}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{g+go}{[130, \PYGZhy{}9, 238, 676]} \end{sphinxVerbatim} \index{AFM (class in matplotlib.afm)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.afm.}}\sphinxbfcode{\sphinxupquote{AFM}}}{\emph{fh}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Parse the AFM file in file object \sphinxstyleemphasis{fh} \index{family\_name (matplotlib.afm.AFM attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.family_name}}\pysigline{\sphinxbfcode{\sphinxupquote{family\_name}}}~ \end{fulllineitems} \index{get\_angle() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_angle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_angle}}}{}{} Return the fontangle as float \end{fulllineitems} \index{get\_bbox\_char() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_bbox_char}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_bbox\_char}}}{\emph{c}, \emph{isord=False}}{}~ \end{fulllineitems} \index{get\_capheight() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_capheight}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capheight}}}{}{} Return the cap height as float \end{fulllineitems} \index{get\_familyname() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_familyname}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_familyname}}}{}{} Return the font family name, e.g., ‘Times’ \end{fulllineitems} \index{get\_fontname() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_fontname}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fontname}}}{}{} Return the font name, e.g., ‘Times-Roman’ \end{fulllineitems} \index{get\_fullname() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_fullname}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fullname}}}{}{} Return the font full name, e.g., ‘Times-Roman’ \end{fulllineitems} \index{get\_height\_char() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_height_char}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_height\_char}}}{\emph{c}, \emph{isord=False}}{} Get the height of character \sphinxstyleemphasis{c} from the bounding box. This is the ink height (space is 0) \end{fulllineitems} \index{get\_horizontal\_stem\_width() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_horizontal_stem_width}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_horizontal\_stem\_width}}}{}{} Return the standard horizontal stem width as float, or \sphinxstyleemphasis{None} if not specified in AFM file. \end{fulllineitems} \index{get\_kern\_dist() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_kern_dist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_kern\_dist}}}{\emph{c1}, \emph{c2}}{} Return the kerning pair distance (possibly 0) for chars \sphinxstyleemphasis{c1} and \sphinxstyleemphasis{c2} \end{fulllineitems} \index{get\_kern\_dist\_from\_name() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_kern_dist_from_name}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_kern\_dist\_from\_name}}}{\emph{name1}, \emph{name2}}{} Return the kerning pair distance (possibly 0) for chars \sphinxstyleemphasis{name1} and \sphinxstyleemphasis{name2} \end{fulllineitems} \index{get\_name\_char() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_name_char}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_name\_char}}}{\emph{c}, \emph{isord=False}}{} Get the name of the character, i.e., ‘;’ is ‘semicolon’ \end{fulllineitems} \index{get\_str\_bbox() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_str_bbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_str\_bbox}}}{\emph{s}}{} Return the string bounding box \end{fulllineitems} \index{get\_str\_bbox\_and\_descent() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_str_bbox_and_descent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_str\_bbox\_and\_descent}}}{\emph{s}}{} Return the string bounding box \end{fulllineitems} \index{get\_underline\_thickness() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_underline_thickness}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_underline\_thickness}}}{}{} Return the underline thickness as float \end{fulllineitems} \index{get\_vertical\_stem\_width() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_vertical_stem_width}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_vertical\_stem\_width}}}{}{} Return the standard vertical stem width as float, or \sphinxstyleemphasis{None} if not specified in AFM file. \end{fulllineitems} \index{get\_weight() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_weight}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_weight}}}{}{} Return the font weight, e.g., ‘Bold’ or ‘Roman’ \end{fulllineitems} \index{get\_width\_char() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_width_char}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_width\_char}}}{\emph{c}, \emph{isord=False}}{} Get the width of the character from the character metric WX field \end{fulllineitems} \index{get\_width\_from\_char\_name() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_width_from_char_name}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_width\_from\_char\_name}}}{\emph{name}}{} Get the width of the character from a type1 character name \end{fulllineitems} \index{get\_xheight() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.get_xheight}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_xheight}}}{}{} Return the xheight as float \end{fulllineitems} \index{string\_width\_height() (matplotlib.afm.AFM method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.AFM.string_width_height}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{string\_width\_height}}}{\emph{s}}{} Return the string width (including kerning) and string height as a (\sphinxstyleemphasis{w}, \sphinxstyleemphasis{h}) tuple. \end{fulllineitems} \end{fulllineitems} \index{parse\_afm() (in module matplotlib.afm)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/afm_api:matplotlib.afm.parse_afm}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.afm.}}\sphinxbfcode{\sphinxupquote{parse\_afm}}}{\emph{fh}}{} Parse the Adobe Font Metics file in file handle \sphinxstyleemphasis{fh}. Return value is a (\sphinxstyleemphasis{dhead}, \sphinxstyleemphasis{dcmetrics\_ascii}, \sphinxstyleemphasis{dmetrics\_name}, \sphinxstyleemphasis{dkernpairs}, \sphinxstyleemphasis{dcomposite}) tuple where \sphinxstyleemphasis{dhead} is a \sphinxcode{\sphinxupquote{\_parse\_header()}} dict, \sphinxstyleemphasis{dcmetrics\_ascii} and \sphinxstyleemphasis{dcmetrics\_name} are the two resulting dicts from \sphinxcode{\sphinxupquote{\_parse\_char\_metrics()}}, \sphinxstyleemphasis{dkernpairs} is a \sphinxcode{\sphinxupquote{\_parse\_kern\_pairs()}} dict (possibly \{\}) and \sphinxstyleemphasis{dcomposite} is a \sphinxcode{\sphinxupquote{\_parse\_composites()}} dict (possibly \{\}) \end{fulllineitems} \chapter{animation} \label{\detokenize{api/animation_api:module-matplotlib.animation}}\label{\detokenize{api/animation_api:animation}}\label{\detokenize{api/animation_api::doc}}\index{matplotlib.animation (module)} \begin{sphinxShadowBox} \sphinxstyletopictitle{Table of Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{api/animation_api:id4}}{\hyperref[\detokenize{api/animation_api:id1}]{\sphinxcrossref{Animation}}} \item {} \phantomsection\label{\detokenize{api/animation_api:id5}}{\hyperref[\detokenize{api/animation_api:writer-classes}]{\sphinxcrossref{Writer Classes}}} \item {} \phantomsection\label{\detokenize{api/animation_api:id6}}{\hyperref[\detokenize{api/animation_api:helper-classes}]{\sphinxcrossref{Helper Classes}}} \item {} \phantomsection\label{\detokenize{api/animation_api:id7}}{\hyperref[\detokenize{api/animation_api:inheritance-diagrams}]{\sphinxcrossref{Inheritance Diagrams}}} \end{itemize} \end{sphinxShadowBox} \section{Animation} \label{\detokenize{api/animation_api:id1}} The easiest way to make a live animation in matplotlib is to use one of the {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Animation}}}}} classes. \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FuncAnimation:matplotlib.animation.FuncAnimation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FuncAnimation}}}}} & Makes an animation by repeatedly calling a function \sphinxcode{\sphinxupquote{func}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.ArtistAnimation:matplotlib.animation.ArtistAnimation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ArtistAnimation}}}}} & Animation using a fixed set of \sphinxcode{\sphinxupquote{Artist}} objects. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.animation.FuncAnimation} \label{\detokenize{api/_as_gen/matplotlib.animation.FuncAnimation:matplotlib-animation-funcanimation}}\label{\detokenize{api/_as_gen/matplotlib.animation.FuncAnimation::doc}}\index{FuncAnimation (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FuncAnimation:matplotlib.animation.FuncAnimation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{FuncAnimation}}}{\emph{fig}, \emph{func}, \emph{frames=None}, \emph{init\_func=None}, \emph{fargs=None}, \emph{save\_count=None}, \emph{**kwargs}}{} Makes an animation by repeatedly calling a function \sphinxcode{\sphinxupquote{func}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}matplotlib.figure.Figure{]} The figure object that is used to get draw, resize, and any other needed events. \item[{\sphinxstylestrong{func}}] \leavevmode{[}callable{]} The function to call at each frame. The first argument will be the next value in \sphinxcode{\sphinxupquote{frames}}. Any additional positional arguments can be supplied via the \sphinxcode{\sphinxupquote{fargs}} parameter. The required signature is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{func}\PYG{p}{(}\PYG{n}{frame}\PYG{p}{,} \PYG{o}{*}\PYG{n}{fargs}\PYG{p}{)} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZgt{}} \PYG{n}{iterable\PYGZus{}of\PYGZus{}artists}\PYG{p}{:} \end{sphinxVerbatim} \item[{\sphinxstylestrong{frames}}] \leavevmode{[}iterable, int, generator function, or None, optional{]} Source of data to pass \sphinxcode{\sphinxupquote{func}} and each frame of the animation If an iterable, then simply use the values provided. If the iterable has a length, it will override the \sphinxcode{\sphinxupquote{save\_count}} kwarg. If an integer, then equivalent to passing \sphinxcode{\sphinxupquote{range(frames)}} If a generator function, then must have the signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{gen\PYGZus{}function}\PYG{p}{(}\PYG{p}{)} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZgt{}} \PYG{n}{obj}\PYG{p}{:} \end{sphinxVerbatim} If \sphinxcode{\sphinxupquote{None}}, then equivalent to passing \sphinxcode{\sphinxupquote{itertools.count}}. In all of these cases, the values in \sphinxstyleemphasis{frames} is simply passed through to the user-supplied \sphinxstyleemphasis{func} and thus can be of any type. \item[{\sphinxstylestrong{init\_func}}] \leavevmode{[}callable, optional{]} A function used to draw a clear frame. If not given, the results of drawing from the first item in the frames sequence will be used. This function will be called once before the first frame. If \sphinxcode{\sphinxupquote{blit == True}}, \sphinxcode{\sphinxupquote{init\_func}} must return an iterable of artists to be re-drawn. The required signature is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{init\PYGZus{}func}\PYG{p}{(}\PYG{p}{)} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZgt{}} \PYG{n}{iterable\PYGZus{}of\PYGZus{}artists}\PYG{p}{:} \end{sphinxVerbatim} \item[{\sphinxstylestrong{fargs}}] \leavevmode{[}tuple or None, optional{]} Additional arguments to pass to each call to \sphinxstyleemphasis{func}. \item[{\sphinxstylestrong{save\_count}}] \leavevmode{[}int, optional{]} The number of values from \sphinxstyleemphasis{frames} to cache. \item[{\sphinxstylestrong{interval}}] \leavevmode{[}number, optional{]} Delay between frames in milliseconds. Defaults to 200. \item[{\sphinxstylestrong{repeat\_delay}}] \leavevmode{[}number, optional{]} If the animation in repeated, adds a delay in milliseconds before repeating the animation. Defaults to \sphinxcode{\sphinxupquote{None}}. \item[{\sphinxstylestrong{repeat}}] \leavevmode{[}bool, optional{]} Controls whether the animation should repeat when the sequence of frames is completed. Defaults to \sphinxcode{\sphinxupquote{True}}. \item[{\sphinxstylestrong{blit}}] \leavevmode{[}bool, optional{]} Controls whether blitting is used to optimize drawing. Defaults to \sphinxcode{\sphinxupquote{False}}. \end{description} \end{description}\end{quote} \index{\_\_init\_\_() (matplotlib.animation.FuncAnimation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FuncAnimation:matplotlib.animation.FuncAnimation.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{fig}, \emph{func}, \emph{frames=None}, \emph{init\_func=None}, \emph{fargs=None}, \emph{save\_count=None}, \emph{**kwargs}}{} Initialize self. See help(type(self)) for accurate signature. \end{fulllineitems} \paragraph{Methods} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FuncAnimation:matplotlib.animation.FuncAnimation.__init__}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{\_\_init\_\_}}}}}(fig, func{[}, frames, init\_func, …{]}) & Initialize self. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FuncAnimation:matplotlib.animation.FuncAnimation.new_frame_seq}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{new\_frame\_seq}}}}}() & Creates a new sequence of frame information. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FuncAnimation:matplotlib.animation.FuncAnimation.new_saved_frame_seq}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{new\_saved\_frame\_seq}}}}}() & Creates a new sequence of saved/cached frame information. \\ \hline \sphinxcode{\sphinxupquote{save}}(filename{[}, writer, fps, dpi, codec, …{]}) & Saves a movie file by drawing every frame. \\ \hline \sphinxcode{\sphinxupquote{to\_html5\_video}}({[}embed\_limit{]}) & Returns animation as an HTML5 video tag. \\ \hline \sphinxcode{\sphinxupquote{to\_jshtml}}({[}fps, embed\_frames, default\_mode{]}) & Generate HTML representation of the animation \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \index{new\_frame\_seq() (matplotlib.animation.FuncAnimation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FuncAnimation:matplotlib.animation.FuncAnimation.new_frame_seq}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{new\_frame\_seq}}}{}{} Creates a new sequence of frame information. \end{fulllineitems} \index{new\_saved\_frame\_seq() (matplotlib.animation.FuncAnimation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FuncAnimation:matplotlib.animation.FuncAnimation.new_saved_frame_seq}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{new\_saved\_frame\_seq}}}{}{} Creates a new sequence of saved/cached frame information. \end{fulllineitems} \end{fulllineitems} \subsection{matplotlib.animation.ArtistAnimation} \label{\detokenize{api/_as_gen/matplotlib.animation.ArtistAnimation:matplotlib-animation-artistanimation}}\label{\detokenize{api/_as_gen/matplotlib.animation.ArtistAnimation::doc}}\index{ArtistAnimation (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.ArtistAnimation:matplotlib.animation.ArtistAnimation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{ArtistAnimation}}}{\emph{fig}, \emph{artists}, \emph{*args}, \emph{**kwargs}}{} Animation using a fixed set of \sphinxcode{\sphinxupquote{Artist}} objects. Before creating an instance, all plotting should have taken place and the relevant artists saved. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}matplotlib.figure.Figure{]} The figure object that is used to get draw, resize, and any other needed events. \item[{\sphinxstylestrong{artists}}] \leavevmode{[}list{]} Each list entry a collection of artists that represent what needs to be enabled on each frame. These will be disabled for other frames. \item[{\sphinxstylestrong{interval}}] \leavevmode{[}number, optional{]} Delay between frames in milliseconds. Defaults to 200. \item[{\sphinxstylestrong{repeat\_delay}}] \leavevmode{[}number, optional{]} If the animation in repeated, adds a delay in milliseconds before repeating the animation. Defaults to \sphinxcode{\sphinxupquote{None}}. \item[{\sphinxstylestrong{repeat}}] \leavevmode{[}bool, optional{]} Controls whether the animation should repeat when the sequence of frames is completed. Defaults to \sphinxcode{\sphinxupquote{True}}. \item[{\sphinxstylestrong{blit}}] \leavevmode{[}bool, optional{]} Controls whether blitting is used to optimize drawing. Defaults to \sphinxcode{\sphinxupquote{False}}. \end{description} \end{description}\end{quote} \index{\_\_init\_\_() (matplotlib.animation.ArtistAnimation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.ArtistAnimation:matplotlib.animation.ArtistAnimation.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{fig}, \emph{artists}, \emph{*args}, \emph{**kwargs}}{} Initialize self. See help(type(self)) for accurate signature. \end{fulllineitems} \paragraph{Methods} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.ArtistAnimation:matplotlib.animation.ArtistAnimation.__init__}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{\_\_init\_\_}}}}}(fig, artists, *args, **kwargs) & Initialize self. \\ \hline \sphinxcode{\sphinxupquote{new\_frame\_seq}}() & Creates a new sequence of frame information. \\ \hline \sphinxcode{\sphinxupquote{new\_saved\_frame\_seq}}() & Creates a new sequence of saved/cached frame information. \\ \hline \sphinxcode{\sphinxupquote{save}}(filename{[}, writer, fps, dpi, codec, …{]}) & Saves a movie file by drawing every frame. \\ \hline \sphinxcode{\sphinxupquote{to\_html5\_video}}({[}embed\_limit{]}) & Returns animation as an HTML5 video tag. \\ \hline \sphinxcode{\sphinxupquote{to\_jshtml}}({[}fps, embed\_frames, default\_mode{]}) & Generate HTML representation of the animation \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{fulllineitems} In both cases it is critical to keep a reference to the instance object. The animation is advanced by a timer (typically from the host GUI framework) which the {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Animation}}}}} object holds the only reference to. If you do not hold a reference to the {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Animation}}}}} object, it (and hence the timers), will be garbage collected which will stop the animation. To save an animation to disk use {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.save}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Animation.save}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.to_html5_video}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Animation.to\_html5\_video}}}}} See {\hyperref[\detokenize{api/animation_api:ani-writer-classes}]{\sphinxcrossref{\DUrole{std,std-ref}{Helper Classes}}}} below for details about what movie formats are supported. \subsection{\sphinxstyleliteralintitle{\sphinxupquote{FuncAnimation}}} \label{\detokenize{api/animation_api:funcanimation}} The inner workings of {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FuncAnimation:matplotlib.animation.FuncAnimation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FuncAnimation}}}}} is more-or-less: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{for} \PYG{n}{d} \PYG{o+ow}{in} \PYG{n}{frames}\PYG{p}{:} \PYG{n}{artists} \PYG{o}{=} \PYG{n}{func}\PYG{p}{(}\PYG{n}{d}\PYG{p}{,} \PYG{o}{*}\PYG{n}{fargs}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{draw\PYGZus{}idle}\PYG{p}{(}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{start\PYGZus{}event\PYGZus{}loop}\PYG{p}{(}\PYG{n}{interval}\PYG{p}{)} \end{sphinxVerbatim} with details to handle ‘blitting’ (to dramatically improve the live performance), to be non-blocking, not repeatedly start/stop the GUI event loop, handle repeats, multiple animated axes, and easily save the animation to a movie file. ‘Blitting’ is a \sphinxhref{https://en.wikipedia.org/wiki/Bit\_blit}{old technique} in computer graphics. The general gist is to take an existing bit map (in our case a mostly rasterized figure) and then ‘blit’ one more artist on top. Thus, by managing a saved ‘clean’ bitmap, we can only re-draw the few artists that are changing at each frame and possibly save significant amounts of time. When using blitting (by passing \sphinxcode{\sphinxupquote{blit=True}}) the core loop of {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FuncAnimation:matplotlib.animation.FuncAnimation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FuncAnimation}}}}} gets a bit more complicated \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{gca}\PYG{p}{(}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{update\PYGZus{}blit}\PYG{p}{(}\PYG{n}{artists}\PYG{p}{)}\PYG{p}{:} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{restore\PYGZus{}region}\PYG{p}{(}\PYG{n}{bg\PYGZus{}cache}\PYG{p}{)} \PYG{k}{for} \PYG{n}{a} \PYG{o+ow}{in} \PYG{n}{artists}\PYG{p}{:} \PYG{n}{a}\PYG{o}{.}\PYG{n}{axes}\PYG{o}{.}\PYG{n}{draw\PYGZus{}artist}\PYG{p}{(}\PYG{n}{a}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{blit}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{bbox}\PYG{p}{)} \PYG{n}{artists} \PYG{o}{=} \PYG{n}{init\PYGZus{}func}\PYG{p}{(}\PYG{p}{)} \PYG{k}{for} \PYG{n}{a} \PYG{o+ow}{in} \PYG{n}{artists}\PYG{p}{:} \PYG{n}{a}\PYG{o}{.}\PYG{n}{set\PYGZus{}animated}\PYG{p}{(}\PYG{k+kc}{True}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \PYG{n}{bg\PYGZus{}cache} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{copy\PYGZus{}from\PYGZus{}bbox}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{bbox}\PYG{p}{)} \PYG{k}{for} \PYG{n}{f} \PYG{o+ow}{in} \PYG{n}{frames}\PYG{p}{:} \PYG{n}{artists} \PYG{o}{=} \PYG{n}{func}\PYG{p}{(}\PYG{n}{f}\PYG{p}{,} \PYG{o}{*}\PYG{n}{fargs}\PYG{p}{)} \PYG{n}{update\PYGZus{}blit}\PYG{p}{(}\PYG{n}{artists}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{start\PYGZus{}event\PYGZus{}loop}\PYG{p}{(}\PYG{n}{interval}\PYG{p}{)} \end{sphinxVerbatim} This is of course leaving out many details (such as updating the background when the figure is resized or fully re-drawn). However, this hopefully minimalist example gives a sense of how \sphinxcode{\sphinxupquote{init\_func}} and \sphinxcode{\sphinxupquote{func}} are used inside of {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FuncAnimation:matplotlib.animation.FuncAnimation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FuncAnimation}}}}} and the theory of how ‘blitting’ works. The expected signature on \sphinxcode{\sphinxupquote{func}} and \sphinxcode{\sphinxupquote{init\_func}} is very simple to keep {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FuncAnimation:matplotlib.animation.FuncAnimation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FuncAnimation}}}}} out of your book keeping and plotting logic, but this means that the callable objects you pass in must know what artists they should be working on. There are several approaches to handling this, of varying complexity and encapsulation. The simplest approach, which works quite well in the case of a script, is to define the artist at a global scope and let Python sort things out. For example \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{animation} \PYG{k}{import} \PYG{n}{FuncAnimation} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{xdata}\PYG{p}{,} \PYG{n}{ydata} \PYG{o}{=} \PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{p}{]} \PYG{n}{ln}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ro}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{animated}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{init}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{k}{return} \PYG{n}{ln}\PYG{p}{,} \PYG{k}{def} \PYG{n+nf}{update}\PYG{p}{(}\PYG{n}{frame}\PYG{p}{)}\PYG{p}{:} \PYG{n}{xdata}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{frame}\PYG{p}{)} \PYG{n}{ydata}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{frame}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ln}\PYG{o}{.}\PYG{n}{set\PYGZus{}data}\PYG{p}{(}\PYG{n}{xdata}\PYG{p}{,} \PYG{n}{ydata}\PYG{p}{)} \PYG{k}{return} \PYG{n}{ln}\PYG{p}{,} \PYG{n}{ani} \PYG{o}{=} \PYG{n}{FuncAnimation}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{update}\PYG{p}{,} \PYG{n}{frames}\PYG{o}{=}\PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{,} \PYG{l+m+mi}{128}\PYG{p}{)}\PYG{p}{,} \PYG{n}{init\PYGZus{}func}\PYG{o}{=}\PYG{n}{init}\PYG{p}{,} \PYG{n}{blit}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} The second method is to us \sphinxhref{https://docs.python.org/3/library/functools.html\#functools.partial}{\sphinxcode{\sphinxupquote{functools.partial}}} to ‘bind’ artists to function. A third method is to use closures to build up the required artists and functions. A fourth method is to create a class. \subsubsection{Examples} \label{\detokenize{api/animation_api:examples}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{gallery/animation/animate_decay:sphx-glr-download-gallery-animation-animate-decay-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \paragraph{Decay} \label{\detokenize{gallery/animation/animate_decay:decay}}\label{\detokenize{gallery/animation/animate_decay:sphx-glr-gallery-animation-animate-decay-py}}\label{\detokenize{gallery/animation/animate_decay::doc}} This example showcases: - using a generator to drive an animation, - changing axes limits during an animation. \noindent\sphinxincludegraphics{{sphx_glr_animate_decay_001}.png} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.animation} \PYG{k+kn}{as} \PYG{n+nn}{animation} \PYG{k}{def} \PYG{n+nf}{data\PYGZus{}gen}\PYG{p}{(}\PYG{n}{t}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{:} \PYG{n}{cnt} \PYG{o}{=} \PYG{l+m+mi}{0} \PYG{k}{while} \PYG{n}{cnt} \PYG{o}{\PYGZlt{}} \PYG{l+m+mi}{1000}\PYG{p}{:} \PYG{n}{cnt} \PYG{o}{+}\PYG{o}{=} \PYG{l+m+mi}{1} \PYG{n}{t} \PYG{o}{+}\PYG{o}{=} \PYG{l+m+mf}{0.1} \PYG{k}{yield} \PYG{n}{t}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{t}\PYG{p}{)} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{exp}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{n}{t}\PYG{o}{/}\PYG{l+m+mf}{10.}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{init}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{1.1}\PYG{p}{,} \PYG{l+m+mf}{1.1}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{)} \PYG{k}{del} \PYG{n}{xdata}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{k}{del} \PYG{n}{ydata}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}data}\PYG{p}{(}\PYG{n}{xdata}\PYG{p}{,} \PYG{n}{ydata}\PYG{p}{)} \PYG{k}{return} \PYG{n}{line}\PYG{p}{,} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{grid}\PYG{p}{(}\PYG{p}{)} \PYG{n}{xdata}\PYG{p}{,} \PYG{n}{ydata} \PYG{o}{=} \PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{p}{]} \PYG{k}{def} \PYG{n+nf}{run}\PYG{p}{(}\PYG{n}{data}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} update the data} \PYG{n}{t}\PYG{p}{,} \PYG{n}{y} \PYG{o}{=} \PYG{n}{data} \PYG{n}{xdata}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{t}\PYG{p}{)} \PYG{n}{ydata}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)} \PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}xlim}\PYG{p}{(}\PYG{p}{)} \PYG{k}{if} \PYG{n}{t} \PYG{o}{\PYGZgt{}}\PYG{o}{=} \PYG{n}{xmax}\PYG{p}{:} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{xmax}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}data}\PYG{p}{(}\PYG{n}{xdata}\PYG{p}{,} \PYG{n}{ydata}\PYG{p}{)} \PYG{k}{return} \PYG{n}{line}\PYG{p}{,} \PYG{n}{ani} \PYG{o}{=} \PYG{n}{animation}\PYG{o}{.}\PYG{n}{FuncAnimation}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{run}\PYG{p}{,} \PYG{n}{data\PYGZus{}gen}\PYG{p}{,} \PYG{n}{blit}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{,} \PYG{n}{interval}\PYG{o}{=}\PYG{l+m+mi}{10}\PYG{p}{,} \PYG{n}{repeat}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{,} \PYG{n}{init\PYGZus{}func}\PYG{o}{=}\PYG{n}{init}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \phantomsection\label{\detokenize{gallery/animation/animate_decay:sphx-glr-download-gallery-animation-animate-decay-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{gallery/animation/bayes_update:sphx-glr-download-gallery-animation-bayes-update-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \paragraph{The Bayes update} \label{\detokenize{gallery/animation/bayes_update:the-bayes-update}}\label{\detokenize{gallery/animation/bayes_update:sphx-glr-gallery-animation-bayes-update-py}}\label{\detokenize{gallery/animation/bayes_update::doc}} 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. \noindent\sphinxincludegraphics{{sphx_glr_bayes_update_001}.png} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{math} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib.animation} \PYG{k+kn}{import} \PYG{n}{FuncAnimation} \PYG{k}{def} \PYG{n+nf}{beta\PYGZus{}pdf}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{a}\PYG{p}{,} \PYG{n}{b}\PYG{p}{)}\PYG{p}{:} \PYG{k}{return} \PYG{p}{(}\PYG{n}{x}\PYG{o}{*}\PYG{o}{*}\PYG{p}{(}\PYG{n}{a}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{o}{*} \PYG{p}{(}\PYG{l+m+mi}{1}\PYG{o}{\PYGZhy{}}\PYG{n}{x}\PYG{p}{)}\PYG{o}{*}\PYG{o}{*}\PYG{p}{(}\PYG{n}{b}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{o}{*} \PYG{n}{math}\PYG{o}{.}\PYG{n}{gamma}\PYG{p}{(}\PYG{n}{a} \PYG{o}{+} \PYG{n}{b}\PYG{p}{)} \PYG{o}{/} \PYG{p}{(}\PYG{n}{math}\PYG{o}{.}\PYG{n}{gamma}\PYG{p}{(}\PYG{n}{a}\PYG{p}{)} \PYG{o}{*} \PYG{n}{math}\PYG{o}{.}\PYG{n}{gamma}\PYG{p}{(}\PYG{n}{b}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{k}{class} \PYG{n+nc}{UpdateDist}\PYG{p}{(}\PYG{n+nb}{object}\PYG{p}{)}\PYG{p}{:} \PYG{k}{def} \PYG{n+nf+fm}{\PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{ax}\PYG{p}{,} \PYG{n}{prob}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{success} \PYG{o}{=} \PYG{l+m+mi}{0} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{prob} \PYG{o}{=} \PYG{n}{prob} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{200}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ax} \PYG{o}{=} \PYG{n}{ax} \PYG{c+c1}{\PYGZsh{} Set up plot parameters} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{15}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{grid}\PYG{p}{(}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} This vertical line represents the theoretical value, to} \PYG{c+c1}{\PYGZsh{} which the plotted distribution should converge.} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{axvline}\PYG{p}{(}\PYG{n}{prob}\PYG{p}{,} \PYG{n}{linestyle}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{black}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{init}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{success} \PYG{o}{=} \PYG{l+m+mi}{0} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}data}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{p}{]}\PYG{p}{)} \PYG{k}{return} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{line}\PYG{p}{,} \PYG{k}{def} \PYG{n+nf+fm}{\PYGZus{}\PYGZus{}call\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{i}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} This way the plot can continuously run and we just keep} \PYG{c+c1}{\PYGZsh{} watching new realizations of the process} \PYG{k}{if} \PYG{n}{i} \PYG{o}{==} \PYG{l+m+mi}{0}\PYG{p}{:} \PYG{k}{return} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{init}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Choose success based on exceed a threshold with a uniform pick} \PYG{k}{if} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{p}{)} \PYG{o}{\PYGZlt{}} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{prob}\PYG{p}{:} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{success} \PYG{o}{+}\PYG{o}{=} \PYG{l+m+mi}{1} \PYG{n}{y} \PYG{o}{=} \PYG{n}{beta\PYGZus{}pdf}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{x}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{success} \PYG{o}{+} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{p}{(}\PYG{n}{i} \PYG{o}{\PYGZhy{}} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{success}\PYG{p}{)} \PYG{o}{+} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}data}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{k}{return} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{line}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} Fixing random state for reproducibility} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{19680801}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ud} \PYG{o}{=} \PYG{n}{UpdateDist}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{prob}\PYG{o}{=}\PYG{l+m+mf}{0.7}\PYG{p}{)} \PYG{n}{anim} \PYG{o}{=} \PYG{n}{FuncAnimation}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{ud}\PYG{p}{,} \PYG{n}{frames}\PYG{o}{=}\PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{)}\PYG{p}{,} \PYG{n}{init\PYGZus{}func}\PYG{o}{=}\PYG{n}{ud}\PYG{o}{.}\PYG{n}{init}\PYG{p}{,} \PYG{n}{interval}\PYG{o}{=}\PYG{l+m+mi}{100}\PYG{p}{,} \PYG{n}{blit}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \phantomsection\label{\detokenize{gallery/animation/bayes_update:sphx-glr-download-gallery-animation-bayes-update-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{gallery/animation/double_pendulum_sgskip:sphx-glr-download-gallery-animation-double-pendulum-sgskip-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \paragraph{The double pendulum problem} \label{\detokenize{gallery/animation/double_pendulum_sgskip:the-double-pendulum-problem}}\label{\detokenize{gallery/animation/double_pendulum_sgskip:sphx-glr-gallery-animation-double-pendulum-sgskip-py}}\label{\detokenize{gallery/animation/double_pendulum_sgskip::doc}} This animation illustrates the double pendulum problem. Double pendulum formula translated from the C code at \sphinxurl{http://www.physics.usyd.edu.au/~wheat/dpend\_html/solve\_dpend.c} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{numpy} \PYG{k+kn}{import} \PYG{n}{sin}\PYG{p}{,} \PYG{n}{cos} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{scipy.integrate} \PYG{k+kn}{as} \PYG{n+nn}{integrate} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.animation} \PYG{k+kn}{as} \PYG{n+nn}{animation} \PYG{n}{G} \PYG{o}{=} \PYG{l+m+mf}{9.8} \PYG{c+c1}{\PYGZsh{} acceleration due to gravity, in m/s\PYGZca{}2} \PYG{n}{L1} \PYG{o}{=} \PYG{l+m+mf}{1.0} \PYG{c+c1}{\PYGZsh{} length of pendulum 1 in m} \PYG{n}{L2} \PYG{o}{=} \PYG{l+m+mf}{1.0} \PYG{c+c1}{\PYGZsh{} length of pendulum 2 in m} \PYG{n}{M1} \PYG{o}{=} \PYG{l+m+mf}{1.0} \PYG{c+c1}{\PYGZsh{} mass of pendulum 1 in kg} \PYG{n}{M2} \PYG{o}{=} \PYG{l+m+mf}{1.0} \PYG{c+c1}{\PYGZsh{} mass of pendulum 2 in kg} \PYG{k}{def} \PYG{n+nf}{derivs}\PYG{p}{(}\PYG{n}{state}\PYG{p}{,} \PYG{n}{t}\PYG{p}{)}\PYG{p}{:} \PYG{n}{dydx} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{zeros\PYGZus{}like}\PYG{p}{(}\PYG{n}{state}\PYG{p}{)} \PYG{n}{dydx}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{n}{state}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{n}{del\PYGZus{}} \PYG{o}{=} \PYG{n}{state}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{]} \PYG{o}{\PYGZhy{}} \PYG{n}{state}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{n}{den1} \PYG{o}{=} \PYG{p}{(}\PYG{n}{M1} \PYG{o}{+} \PYG{n}{M2}\PYG{p}{)}\PYG{o}{*}\PYG{n}{L1} \PYG{o}{\PYGZhy{}} \PYG{n}{M2}\PYG{o}{*}\PYG{n}{L1}\PYG{o}{*}\PYG{n}{cos}\PYG{p}{(}\PYG{n}{del\PYGZus{}}\PYG{p}{)}\PYG{o}{*}\PYG{n}{cos}\PYG{p}{(}\PYG{n}{del\PYGZus{}}\PYG{p}{)} \PYG{n}{dydx}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{M2}\PYG{o}{*}\PYG{n}{L1}\PYG{o}{*}\PYG{n}{state}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{*}\PYG{n}{state}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{*}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{del\PYGZus{}}\PYG{p}{)}\PYG{o}{*}\PYG{n}{cos}\PYG{p}{(}\PYG{n}{del\PYGZus{}}\PYG{p}{)} \PYG{o}{+} \PYG{n}{M2}\PYG{o}{*}\PYG{n}{G}\PYG{o}{*}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{state}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{)}\PYG{o}{*}\PYG{n}{cos}\PYG{p}{(}\PYG{n}{del\PYGZus{}}\PYG{p}{)} \PYG{o}{+} \PYG{n}{M2}\PYG{o}{*}\PYG{n}{L2}\PYG{o}{*}\PYG{n}{state}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{o}{*}\PYG{n}{state}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{o}{*}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{del\PYGZus{}}\PYG{p}{)} \PYG{o}{\PYGZhy{}} \PYG{p}{(}\PYG{n}{M1} \PYG{o}{+} \PYG{n}{M2}\PYG{p}{)}\PYG{o}{*}\PYG{n}{G}\PYG{o}{*}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{state}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)}\PYG{p}{)}\PYG{o}{/}\PYG{n}{den1} \PYG{n}{dydx}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{]} \PYG{o}{=} \PYG{n}{state}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{]} \PYG{n}{den2} \PYG{o}{=} \PYG{p}{(}\PYG{n}{L2}\PYG{o}{/}\PYG{n}{L1}\PYG{p}{)}\PYG{o}{*}\PYG{n}{den1} \PYG{n}{dydx}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{n}{M2}\PYG{o}{*}\PYG{n}{L2}\PYG{o}{*}\PYG{n}{state}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{o}{*}\PYG{n}{state}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{o}{*}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{del\PYGZus{}}\PYG{p}{)}\PYG{o}{*}\PYG{n}{cos}\PYG{p}{(}\PYG{n}{del\PYGZus{}}\PYG{p}{)} \PYG{o}{+} \PYG{p}{(}\PYG{n}{M1} \PYG{o}{+} \PYG{n}{M2}\PYG{p}{)}\PYG{o}{*}\PYG{n}{G}\PYG{o}{*}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{state}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)}\PYG{o}{*}\PYG{n}{cos}\PYG{p}{(}\PYG{n}{del\PYGZus{}}\PYG{p}{)} \PYG{o}{\PYGZhy{}} \PYG{p}{(}\PYG{n}{M1} \PYG{o}{+} \PYG{n}{M2}\PYG{p}{)}\PYG{o}{*}\PYG{n}{L1}\PYG{o}{*}\PYG{n}{state}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{*}\PYG{n}{state}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{*}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{del\PYGZus{}}\PYG{p}{)} \PYG{o}{\PYGZhy{}} \PYG{p}{(}\PYG{n}{M1} \PYG{o}{+} \PYG{n}{M2}\PYG{p}{)}\PYG{o}{*}\PYG{n}{G}\PYG{o}{*}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{state}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{)}\PYG{p}{)}\PYG{o}{/}\PYG{n}{den2} \PYG{k}{return} \PYG{n}{dydx} \PYG{c+c1}{\PYGZsh{} create a time array from 0..100 sampled at 0.05 second steps} \PYG{n}{dt} \PYG{o}{=} \PYG{l+m+mf}{0.05} \PYG{n}{t} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mi}{20}\PYG{p}{,} \PYG{n}{dt}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} th1 and th2 are the initial angles (degrees)} \PYG{c+c1}{\PYGZsh{} w10 and w20 are the initial angular velocities (degrees per second)} \PYG{n}{th1} \PYG{o}{=} \PYG{l+m+mf}{120.0} \PYG{n}{w1} \PYG{o}{=} \PYG{l+m+mf}{0.0} \PYG{n}{th2} \PYG{o}{=} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{10.0} \PYG{n}{w2} \PYG{o}{=} \PYG{l+m+mf}{0.0} \PYG{c+c1}{\PYGZsh{} initial state} \PYG{n}{state} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{radians}\PYG{p}{(}\PYG{p}{[}\PYG{n}{th1}\PYG{p}{,} \PYG{n}{w1}\PYG{p}{,} \PYG{n}{th2}\PYG{p}{,} \PYG{n}{w2}\PYG{p}{]}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} integrate your ODE using scipy.integrate.} \PYG{n}{y} \PYG{o}{=} \PYG{n}{integrate}\PYG{o}{.}\PYG{n}{odeint}\PYG{p}{(}\PYG{n}{derivs}\PYG{p}{,} \PYG{n}{state}\PYG{p}{,} \PYG{n}{t}\PYG{p}{)} \PYG{n}{x1} \PYG{o}{=} \PYG{n}{L1}\PYG{o}{*}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{y1} \PYG{o}{=} \PYG{o}{\PYGZhy{}}\PYG{n}{L1}\PYG{o}{*}\PYG{n}{cos}\PYG{p}{(}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{x2} \PYG{o}{=} \PYG{n}{L2}\PYG{o}{*}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{)} \PYG{o}{+} \PYG{n}{x1} \PYG{n}{y2} \PYG{o}{=} \PYG{o}{\PYGZhy{}}\PYG{n}{L2}\PYG{o}{*}\PYG{n}{cos}\PYG{p}{(}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{)} \PYG{o}{+} \PYG{n}{y1} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{,} \PYG{n}{autoscale\PYGZus{}on}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{,} \PYG{n}{xlim}\PYG{o}{=}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{,} \PYG{n}{ylim}\PYG{o}{=}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}aspect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{equal}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{grid}\PYG{p}{(}\PYG{p}{)} \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{o\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{time\PYGZus{}template} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{time = }\PYG{l+s+si}{\PYGZpc{}.1f}\PYG{l+s+s1}{s}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{time\PYGZus{}text} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.05}\PYG{p}{,} \PYG{l+m+mf}{0.9}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{init}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}data}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{p}{]}\PYG{p}{)} \PYG{n}{time\PYGZus{}text}\PYG{o}{.}\PYG{n}{set\PYGZus{}text}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k}{return} \PYG{n}{line}\PYG{p}{,} \PYG{n}{time\PYGZus{}text} \PYG{k}{def} \PYG{n+nf}{animate}\PYG{p}{(}\PYG{n}{i}\PYG{p}{)}\PYG{p}{:} \PYG{n}{thisx} \PYG{o}{=} \PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{x1}\PYG{p}{[}\PYG{n}{i}\PYG{p}{]}\PYG{p}{,} \PYG{n}{x2}\PYG{p}{[}\PYG{n}{i}\PYG{p}{]}\PYG{p}{]} \PYG{n}{thisy} \PYG{o}{=} \PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{[}\PYG{n}{i}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{[}\PYG{n}{i}\PYG{p}{]}\PYG{p}{]} \PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}data}\PYG{p}{(}\PYG{n}{thisx}\PYG{p}{,} \PYG{n}{thisy}\PYG{p}{)} \PYG{n}{time\PYGZus{}text}\PYG{o}{.}\PYG{n}{set\PYGZus{}text}\PYG{p}{(}\PYG{n}{time\PYGZus{}template} \PYG{o}{\PYGZpc{}} \PYG{p}{(}\PYG{n}{i}\PYG{o}{*}\PYG{n}{dt}\PYG{p}{)}\PYG{p}{)} \PYG{k}{return} \PYG{n}{line}\PYG{p}{,} \PYG{n}{time\PYGZus{}text} \PYG{n}{ani} \PYG{o}{=} \PYG{n}{animation}\PYG{o}{.}\PYG{n}{FuncAnimation}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{animate}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)}\PYG{p}{)}\PYG{p}{,} \PYG{n}{interval}\PYG{o}{=}\PYG{l+m+mi}{25}\PYG{p}{,} \PYG{n}{blit}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{,} \PYG{n}{init\PYGZus{}func}\PYG{o}{=}\PYG{n}{init}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \phantomsection\label{\detokenize{gallery/animation/double_pendulum_sgskip:sphx-glr-download-gallery-animation-double-pendulum-sgskip-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{gallery/animation/animated_histogram:sphx-glr-download-gallery-animation-animated-histogram-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \paragraph{Animated histogram} \label{\detokenize{gallery/animation/animated_histogram:animated-histogram}}\label{\detokenize{gallery/animation/animated_histogram:sphx-glr-gallery-animation-animated-histogram-py}}\label{\detokenize{gallery/animation/animated_histogram::doc}} Use a path patch to draw a bunch of rectangles for an animated histogram. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.patches} \PYG{k+kn}{as} \PYG{n+nn}{patches} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.path} \PYG{k+kn}{as} \PYG{n+nn}{path} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.animation} \PYG{k+kn}{as} \PYG{n+nn}{animation} \PYG{c+c1}{\PYGZsh{} Fixing random state for reproducibility} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{19680801}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} histogram our data with numpy} \PYG{n}{data} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{1000}\PYG{p}{)} \PYG{n}{n}\PYG{p}{,} \PYG{n}{bins} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{histogram}\PYG{p}{(}\PYG{n}{data}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} get the corners of the rectangles for the histogram} \PYG{n}{left} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{array}\PYG{p}{(}\PYG{n}{bins}\PYG{p}{[}\PYG{p}{:}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{right} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{array}\PYG{p}{(}\PYG{n}{bins}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{]}\PYG{p}{)} \PYG{n}{bottom} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{zeros}\PYG{p}{(}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{left}\PYG{p}{)}\PYG{p}{)} \PYG{n}{top} \PYG{o}{=} \PYG{n}{bottom} \PYG{o}{+} \PYG{n}{n} \PYG{n}{nrects} \PYG{o}{=} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{left}\PYG{p}{)} \end{sphinxVerbatim} Here comes the tricky part \textendash{} we have to set up the vertex and path codes arrays using \sphinxcode{\sphinxupquote{plt.Path.MOVETO}}, \sphinxcode{\sphinxupquote{plt.Path.LINETO}} and \sphinxcode{\sphinxupquote{plt.Path.CLOSEPOLY}} for each rect. \begin{itemize} \item {} We need 1 \sphinxcode{\sphinxupquote{MOVETO}} per rectangle, which sets the initial point. \item {} We need 3 \sphinxcode{\sphinxupquote{LINETO}}’s, which tell Matplotlib to draw lines from vertex 1 to vertex 2, v2 to v3, and v3 to v4. \item {} We then need one \sphinxcode{\sphinxupquote{CLOSEPOLY}} which tells Matplotlib to draw a line from the v4 to our initial vertex (the \sphinxcode{\sphinxupquote{MOVETO}} vertex), in order to close the polygon. \end{itemize} \begin{sphinxadmonition}{note}{Note:} The vertex for \sphinxcode{\sphinxupquote{CLOSEPOLY}} is ignored, but we still need a placeholder in the \sphinxcode{\sphinxupquote{verts}} array to keep the codes aligned with the vertices. \end{sphinxadmonition} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{nverts} \PYG{o}{=} \PYG{n}{nrects} \PYG{o}{*} \PYG{p}{(}\PYG{l+m+mi}{1} \PYG{o}{+} \PYG{l+m+mi}{3} \PYG{o}{+} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{verts} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{zeros}\PYG{p}{(}\PYG{p}{(}\PYG{n}{nverts}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{)} \PYG{n}{codes} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{ones}\PYG{p}{(}\PYG{n}{nverts}\PYG{p}{,} \PYG{n+nb}{int}\PYG{p}{)} \PYG{o}{*} \PYG{n}{path}\PYG{o}{.}\PYG{n}{Path}\PYG{o}{.}\PYG{n}{LINETO} \PYG{n}{codes}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{]} \PYG{o}{=} \PYG{n}{path}\PYG{o}{.}\PYG{n}{Path}\PYG{o}{.}\PYG{n}{MOVETO} \PYG{n}{codes}\PYG{p}{[}\PYG{l+m+mi}{4}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{]} \PYG{o}{=} \PYG{n}{path}\PYG{o}{.}\PYG{n}{Path}\PYG{o}{.}\PYG{n}{CLOSEPOLY} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{n}{left} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{=} \PYG{n}{bottom} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{n}{left} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{=} \PYG{n}{top} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{n}{right} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{=} \PYG{n}{top} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{n}{right} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{=} \PYG{n}{bottom} \end{sphinxVerbatim} To animate the histogram, we need an \sphinxcode{\sphinxupquote{animate}} function, which generates a random set of numbers and updates the locations of the vertices for the histogram (in this case, only the heights of each rectangle). \sphinxcode{\sphinxupquote{patch}} will eventually be a \sphinxcode{\sphinxupquote{Patch}} object. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{patch} \PYG{o}{=} \PYG{n+nb+bp}{None} \PYG{k}{def} \PYG{n+nf}{animate}\PYG{p}{(}\PYG{n}{i}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} simulate new data coming in} \PYG{n}{data} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{1000}\PYG{p}{)} \PYG{n}{n}\PYG{p}{,} \PYG{n}{bins} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{histogram}\PYG{p}{(}\PYG{n}{data}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{)} \PYG{n}{top} \PYG{o}{=} \PYG{n}{bottom} \PYG{o}{+} \PYG{n}{n} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{=} \PYG{n}{top} \PYG{n}{verts}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{:}\PYG{p}{:}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{=} \PYG{n}{top} \PYG{k}{return} \PYG{p}{[}\PYG{n}{patch}\PYG{p}{,} \PYG{p}{]} \end{sphinxVerbatim} And now we build the \sphinxcode{\sphinxupquote{Path}} and \sphinxcode{\sphinxupquote{Patch}} instances for the histogram using our vertices and codes. We add the patch to the \sphinxcode{\sphinxupquote{Axes}} instance, and setup the \sphinxcode{\sphinxupquote{FuncAnimation}} with our animate function. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{barpath} \PYG{o}{=} \PYG{n}{path}\PYG{o}{.}\PYG{n}{Path}\PYG{p}{(}\PYG{n}{verts}\PYG{p}{,} \PYG{n}{codes}\PYG{p}{)} \PYG{n}{patch} \PYG{o}{=} \PYG{n}{patches}\PYG{o}{.}\PYG{n}{PathPatch}\PYG{p}{(} \PYG{n}{barpath}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{green}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{edgecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{yellow}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{add\PYGZus{}patch}\PYG{p}{(}\PYG{n}{patch}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{n}{left}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{right}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{n}{bottom}\PYG{o}{.}\PYG{n}{min}\PYG{p}{(}\PYG{p}{)}\PYG{p}{,} \PYG{n}{top}\PYG{o}{.}\PYG{n}{max}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ani} \PYG{o}{=} \PYG{n}{animation}\PYG{o}{.}\PYG{n}{FuncAnimation}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{animate}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{,} \PYG{n}{repeat}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{,} \PYG{n}{blit}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \noindent\sphinxincludegraphics{{sphx_glr_animated_histogram_001}.png} \phantomsection\label{\detokenize{gallery/animation/animated_histogram:sphx-glr-download-gallery-animation-animated-histogram-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{gallery/animation/rain:sphx-glr-download-gallery-animation-rain-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \paragraph{Rain simulation} \label{\detokenize{gallery/animation/rain:rain-simulation}}\label{\detokenize{gallery/animation/rain:sphx-glr-gallery-animation-rain-py}}\label{\detokenize{gallery/animation/rain::doc}} Simulates rain drops on a surface by animating the scale and opacity of 50 scatter points. Author: Nicolas P. Rougier \noindent\sphinxincludegraphics{{sphx_glr_rain_001}.png} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib.animation} \PYG{k+kn}{import} \PYG{n}{FuncAnimation} \PYG{c+c1}{\PYGZsh{} Fixing random state for reproducibility} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{19680801}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Create new Figure and an Axes which fills it.} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{7}\PYG{p}{,} \PYG{l+m+mi}{7}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{frameon}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xticks}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}yticks}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Create rain data} \PYG{n}{n\PYGZus{}drops} \PYG{o}{=} \PYG{l+m+mi}{50} \PYG{n}{rain\PYGZus{}drops} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{zeros}\PYG{p}{(}\PYG{n}{n\PYGZus{}drops}\PYG{p}{,} \PYG{n}{dtype}\PYG{o}{=}\PYG{p}{[}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{position}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n+nb}{float}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{size}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n+nb}{float}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{growth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n+nb}{float}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n+nb}{float}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{)}\PYG{p}{]}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Initialize the raindrops in random positions and with} \PYG{c+c1}{\PYGZsh{} random growth rates.} \PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{position}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{uniform}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{p}{(}\PYG{n}{n\PYGZus{}drops}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{)} \PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{growth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{uniform}\PYG{p}{(}\PYG{l+m+mi}{50}\PYG{p}{,} \PYG{l+m+mi}{200}\PYG{p}{,} \PYG{n}{n\PYGZus{}drops}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Construct the scatter which we will update during animation} \PYG{c+c1}{\PYGZsh{} as the raindrops develop.} \PYG{n}{scat} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{scatter}\PYG{p}{(}\PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{position}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{position}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{s}\PYG{o}{=}\PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{size}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{n}{edgecolors}\PYG{o}{=}\PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{n}{facecolors}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{none}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{update}\PYG{p}{(}\PYG{n}{frame\PYGZus{}number}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} Get an index which we can use to re\PYGZhy{}spawn the oldest raindrop.} \PYG{n}{current\PYGZus{}index} \PYG{o}{=} \PYG{n}{frame\PYGZus{}number} \PYG{o}{\PYGZpc{}} \PYG{n}{n\PYGZus{}drops} \PYG{c+c1}{\PYGZsh{} Make all colors more transparent as time progresses.} \PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]} \PYG{o}{\PYGZhy{}}\PYG{o}{=} \PYG{l+m+mf}{1.0}\PYG{o}{/}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{rain\PYGZus{}drops}\PYG{p}{)} \PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{clip}\PYG{p}{(}\PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Make all circles bigger.} \PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{size}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{+}\PYG{o}{=} \PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{growth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{c+c1}{\PYGZsh{} Pick a new position for oldest rain drop, resetting its size,} \PYG{c+c1}{\PYGZsh{} color and growth factor.} \PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{position}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{[}\PYG{n}{current\PYGZus{}index}\PYG{p}{]} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{uniform}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{size}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{[}\PYG{n}{current\PYGZus{}index}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mi}{5} \PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{[}\PYG{n}{current\PYGZus{}index}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{growth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{[}\PYG{n}{current\PYGZus{}index}\PYG{p}{]} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{uniform}\PYG{p}{(}\PYG{l+m+mi}{50}\PYG{p}{,} \PYG{l+m+mi}{200}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Update the scatter collection, with the new colors, sizes and positions.} \PYG{n}{scat}\PYG{o}{.}\PYG{n}{set\PYGZus{}edgecolors}\PYG{p}{(}\PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \PYG{n}{scat}\PYG{o}{.}\PYG{n}{set\PYGZus{}sizes}\PYG{p}{(}\PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{size}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \PYG{n}{scat}\PYG{o}{.}\PYG{n}{set\PYGZus{}offsets}\PYG{p}{(}\PYG{n}{rain\PYGZus{}drops}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{position}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Construct the animation, using the update function as the animation director.} \PYG{n}{animation} \PYG{o}{=} \PYG{n}{FuncAnimation}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{update}\PYG{p}{,} \PYG{n}{interval}\PYG{o}{=}\PYG{l+m+mi}{10}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \phantomsection\label{\detokenize{gallery/animation/rain:sphx-glr-download-gallery-animation-rain-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{gallery/animation/random_walk:sphx-glr-download-gallery-animation-random-walk-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \paragraph{Animated 3D random walk} \label{\detokenize{gallery/animation/random_walk:animated-3d-random-walk}}\label{\detokenize{gallery/animation/random_walk:sphx-glr-gallery-animation-random-walk-py}}\label{\detokenize{gallery/animation/random_walk::doc}} \noindent\sphinxincludegraphics{{sphx_glr_random_walk_001}.png} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{mpl\PYGZus{}toolkits.mplot3d.axes3d} \PYG{k+kn}{as} \PYG{n+nn}{p3} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.animation} \PYG{k+kn}{as} \PYG{n+nn}{animation} \PYG{c+c1}{\PYGZsh{} Fixing random state for reproducibility} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{19680801}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{Gen\PYGZus{}RandLine}\PYG{p}{(}\PYG{n}{length}\PYG{p}{,} \PYG{n}{dims}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ Create a line using a random walk algorithm} \PYG{l+s+sd}{ length is the number of points for the line.} \PYG{l+s+sd}{ dims is the number of dimensions the line has.} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{n}{lineData} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{empty}\PYG{p}{(}\PYG{p}{(}\PYG{n}{dims}\PYG{p}{,} \PYG{n}{length}\PYG{p}{)}\PYG{p}{)} \PYG{n}{lineData}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{n}{dims}\PYG{p}{)} \PYG{k}{for} \PYG{n}{index} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{length}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} scaling the random numbers by 0.1 so} \PYG{c+c1}{\PYGZsh{} movement is small compared to position.} \PYG{c+c1}{\PYGZsh{} subtraction by 0.5 is to change the range to [\PYGZhy{}0.5, 0.5]} \PYG{c+c1}{\PYGZsh{} to allow a line to move backwards.} \PYG{n}{step} \PYG{o}{=} \PYG{p}{(}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{n}{dims}\PYG{p}{)} \PYG{o}{\PYGZhy{}} \PYG{l+m+mf}{0.5}\PYG{p}{)} \PYG{o}{*} \PYG{l+m+mf}{0.1}\PYG{p}{)} \PYG{n}{lineData}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{n}{index}\PYG{p}{]} \PYG{o}{=} \PYG{n}{lineData}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{n}{index} \PYG{o}{\PYGZhy{}} \PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{+} \PYG{n}{step} \PYG{k}{return} \PYG{n}{lineData} \PYG{k}{def} \PYG{n+nf}{update\PYGZus{}lines}\PYG{p}{(}\PYG{n}{num}\PYG{p}{,} \PYG{n}{dataLines}\PYG{p}{,} \PYG{n}{lines}\PYG{p}{)}\PYG{p}{:} \PYG{k}{for} \PYG{n}{line}\PYG{p}{,} \PYG{n}{data} \PYG{o+ow}{in} \PYG{n+nb}{zip}\PYG{p}{(}\PYG{n}{lines}\PYG{p}{,} \PYG{n}{dataLines}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} NOTE: there is no .set\PYGZus{}data() for 3 dim data...} \PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}data}\PYG{p}{(}\PYG{n}{data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{:}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{p}{:}\PYG{n}{num}\PYG{p}{]}\PYG{p}{)} \PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}3d\PYGZus{}properties}\PYG{p}{(}\PYG{n}{data}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{p}{:}\PYG{n}{num}\PYG{p}{]}\PYG{p}{)} \PYG{k}{return} \PYG{n}{lines} \PYG{c+c1}{\PYGZsh{} Attaching 3D axis to the figure} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{p3}\PYG{o}{.}\PYG{n}{Axes3D}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Fifty lines of random 3\PYGZhy{}D lines} \PYG{n}{data} \PYG{o}{=} \PYG{p}{[}\PYG{n}{Gen\PYGZus{}RandLine}\PYG{p}{(}\PYG{l+m+mi}{25}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)} \PYG{k}{for} \PYG{n}{index} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{50}\PYG{p}{)}\PYG{p}{]} \PYG{c+c1}{\PYGZsh{} Creating fifty line objects.} \PYG{c+c1}{\PYGZsh{} NOTE: Can\PYGZsq{}t pass empty arrays into 3d version of plot()} \PYG{n}{lines} \PYG{o}{=} \PYG{p}{[}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{dat}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{:}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{dat}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{:}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{dat}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{:}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{k}{for} \PYG{n}{dat} \PYG{o+ow}{in} \PYG{n}{data}\PYG{p}{]} \PYG{c+c1}{\PYGZsh{} Setting the axes properties} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim3d}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{X}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim3d}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Y}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}zlim3d}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}zlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Z}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{3D Test}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Creating the Animation object} \PYG{n}{line\PYGZus{}ani} \PYG{o}{=} \PYG{n}{animation}\PYG{o}{.}\PYG{n}{FuncAnimation}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{update\PYGZus{}lines}\PYG{p}{,} \PYG{l+m+mi}{25}\PYG{p}{,} \PYG{n}{fargs}\PYG{o}{=}\PYG{p}{(}\PYG{n}{data}\PYG{p}{,} \PYG{n}{lines}\PYG{p}{)}\PYG{p}{,} \PYG{n}{interval}\PYG{o}{=}\PYG{l+m+mi}{50}\PYG{p}{,} \PYG{n}{blit}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \phantomsection\label{\detokenize{gallery/animation/random_walk:sphx-glr-download-gallery-animation-random-walk-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{gallery/animation/simple_anim:sphx-glr-download-gallery-animation-simple-anim-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \paragraph{Animated line plot} \label{\detokenize{gallery/animation/simple_anim:animated-line-plot}}\label{\detokenize{gallery/animation/simple_anim:sphx-glr-gallery-animation-simple-anim-py}}\label{\detokenize{gallery/animation/simple_anim::doc}} \noindent\sphinxincludegraphics{{sphx_glr_simple_anim_001}.png} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.animation} \PYG{k+kn}{as} \PYG{n+nn}{animation} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{,} \PYG{l+m+mf}{0.01}\PYG{p}{)} \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{init}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} only required for blitting to give a clean slate.} \PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}ydata}\PYG{p}{(}\PYG{p}{[}\PYG{n}{np}\PYG{o}{.}\PYG{n}{nan}\PYG{p}{]} \PYG{o}{*} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)}\PYG{p}{)} \PYG{k}{return} \PYG{n}{line}\PYG{p}{,} \PYG{k}{def} \PYG{n+nf}{animate}\PYG{p}{(}\PYG{n}{i}\PYG{p}{)}\PYG{p}{:} \PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}ydata}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{x} \PYG{o}{+} \PYG{n}{i} \PYG{o}{/} \PYG{l+m+mi}{100}\PYG{p}{)}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} update the data.} \PYG{k}{return} \PYG{n}{line}\PYG{p}{,} \PYG{n}{ani} \PYG{o}{=} \PYG{n}{animation}\PYG{o}{.}\PYG{n}{FuncAnimation}\PYG{p}{(} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{animate}\PYG{p}{,} \PYG{n}{init\PYGZus{}func}\PYG{o}{=}\PYG{n}{init}\PYG{p}{,} \PYG{n}{interval}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{blit}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{,} \PYG{n}{save\PYGZus{}count}\PYG{o}{=}\PYG{l+m+mi}{50}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} To save the animation, use e.g.} \PYG{c+c1}{\PYGZsh{}} \PYG{c+c1}{\PYGZsh{} ani.save(\PYGZdq{}movie.mp4\PYGZdq{})} \PYG{c+c1}{\PYGZsh{}} \PYG{c+c1}{\PYGZsh{} or} \PYG{c+c1}{\PYGZsh{}} \PYG{c+c1}{\PYGZsh{} from matplotlib.animation import FFMpegWriter} \PYG{c+c1}{\PYGZsh{} writer = FFMpegWriter(fps=15, metadata=dict(artist=\PYGZsq{}Me\PYGZsq{}), bitrate=1800)} \PYG{c+c1}{\PYGZsh{} ani.save(\PYGZdq{}movie.mp4\PYGZdq{}, writer=writer)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \phantomsection\label{\detokenize{gallery/animation/simple_anim:sphx-glr-download-gallery-animation-simple-anim-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{gallery/animation/strip_chart:sphx-glr-download-gallery-animation-strip-chart-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \paragraph{Oscilloscope} \label{\detokenize{gallery/animation/strip_chart:oscilloscope}}\label{\detokenize{gallery/animation/strip_chart:sphx-glr-gallery-animation-strip-chart-py}}\label{\detokenize{gallery/animation/strip_chart::doc}} Emulates an oscilloscope. \noindent\sphinxincludegraphics{{sphx_glr_strip_chart_001}.png} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib.lines} \PYG{k+kn}{import} \PYG{n}{Line2D} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.animation} \PYG{k+kn}{as} \PYG{n+nn}{animation} \PYG{k}{class} \PYG{n+nc}{Scope}\PYG{p}{(}\PYG{n+nb}{object}\PYG{p}{)}\PYG{p}{:} \PYG{k}{def} \PYG{n+nf+fm}{\PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{ax}\PYG{p}{,} \PYG{n}{maxt}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{dt}\PYG{o}{=}\PYG{l+m+mf}{0.02}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ax} \PYG{o}{=} \PYG{n}{ax} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{dt} \PYG{o}{=} \PYG{n}{dt} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{maxt} \PYG{o}{=} \PYG{n}{maxt} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{tdata} \PYG{o}{=} \PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ydata} \PYG{o}{=} \PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{line} \PYG{o}{=} \PYG{n}{Line2D}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{tdata}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ydata}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{add\PYGZus{}line}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{line}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{o}{.}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mf}{1.1}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{maxt}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{update}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)}\PYG{p}{:} \PYG{n}{lastt} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{tdata}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{k}{if} \PYG{n}{lastt} \PYG{o}{\PYGZgt{}} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{tdata}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{+} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{maxt}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} reset the arrays} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{tdata} \PYG{o}{=} \PYG{p}{[}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{tdata}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{]} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ydata} \PYG{o}{=} \PYG{p}{[}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ydata}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{]} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{tdata}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{tdata}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{+} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{maxt}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \PYG{n}{t} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{tdata}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{+} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{dt} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{tdata}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{t}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ydata}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}data}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{tdata}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{ydata}\PYG{p}{)} \PYG{k}{return} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{line}\PYG{p}{,} \PYG{k}{def} \PYG{n+nf}{emitter}\PYG{p}{(}\PYG{n}{p}\PYG{o}{=}\PYG{l+m+mf}{0.03}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{return a random value with probability p, else 0}\PYG{l+s+s1}{\PYGZsq{}} \PYG{k}{while} \PYG{n+nb+bp}{True}\PYG{p}{:} \PYG{n}{v} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{k}{if} \PYG{n}{v} \PYG{o}{\PYGZgt{}} \PYG{n}{p}\PYG{p}{:} \PYG{k}{yield} \PYG{l+m+mf}{0.} \PYG{k}{else}\PYG{p}{:} \PYG{k}{yield} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Fixing random state for reproducibility} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{19680801}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{scope} \PYG{o}{=} \PYG{n}{Scope}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} pass a generator in \PYGZdq{}emitter\PYGZdq{} to produce data for the update func} \PYG{n}{ani} \PYG{o}{=} \PYG{n}{animation}\PYG{o}{.}\PYG{n}{FuncAnimation}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{scope}\PYG{o}{.}\PYG{n}{update}\PYG{p}{,} \PYG{n}{emitter}\PYG{p}{,} \PYG{n}{interval}\PYG{o}{=}\PYG{l+m+mi}{10}\PYG{p}{,} \PYG{n}{blit}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \phantomsection\label{\detokenize{gallery/animation/strip_chart:sphx-glr-download-gallery-animation-strip-chart-py}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{gallery/animation/unchained:sphx-glr-download-gallery-animation-unchained-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \paragraph{MATPLOTLIB \sphinxstylestrong{UNCHAINED}} \label{\detokenize{gallery/animation/unchained:matplotlib-unchained}}\label{\detokenize{gallery/animation/unchained:sphx-glr-gallery-animation-unchained-py}}\label{\detokenize{gallery/animation/unchained::doc}} Comparative path demonstration of frequency from a fake signal of a pulsar (mostly known because of the cover for Joy Division’s Unknown Pleasures). Author: Nicolas P. Rougier \noindent\sphinxincludegraphics{{sphx_glr_unchained_001}.png} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.animation} \PYG{k+kn}{as} \PYG{n+nn}{animation} \PYG{c+c1}{\PYGZsh{} Fixing random state for reproducibility} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{19680801}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Create new Figure with black background} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{8}\PYG{p}{,} \PYG{l+m+mi}{8}\PYG{p}{)}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{black}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Add a subplot with no frame} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{,} \PYG{n}{frameon}\PYG{o}{=}\PYG{n+nb+bp}{False}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Generate random data} \PYG{n}{data} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{uniform}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mi}{64}\PYG{p}{,} \PYG{l+m+mi}{75}\PYG{p}{)}\PYG{p}{)} \PYG{n}{X} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{data}\PYG{o}{.}\PYG{n}{shape}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{G} \PYG{o}{=} \PYG{l+m+mf}{1.5} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{exp}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{4} \PYG{o}{*} \PYG{n}{X} \PYG{o}{*}\PYG{o}{*} \PYG{l+m+mi}{2}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Generate line plots} \PYG{n}{lines} \PYG{o}{=} \PYG{p}{[}\PYG{p}{]} \PYG{k}{for} \PYG{n}{i} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{data}\PYG{p}{)}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} Small reduction of the X extents to get a cheap perspective effect} \PYG{n}{xscale} \PYG{o}{=} \PYG{l+m+mi}{1} \PYG{o}{\PYGZhy{}} \PYG{n}{i} \PYG{o}{/} \PYG{l+m+mf}{200.} \PYG{c+c1}{\PYGZsh{} Same for linewidth (thicker strokes on bottom)} \PYG{n}{lw} \PYG{o}{=} \PYG{l+m+mf}{1.5} \PYG{o}{\PYGZhy{}} \PYG{n}{i} \PYG{o}{/} \PYG{l+m+mf}{100.0} \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{xscale} \PYG{o}{*} \PYG{n}{X}\PYG{p}{,} \PYG{n}{i} \PYG{o}{+} \PYG{n}{G} \PYG{o}{*} \PYG{n}{data}\PYG{p}{[}\PYG{n}{i}\PYG{p}{]}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{w}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{n}{lw}\PYG{p}{)} \PYG{n}{lines}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{line}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Set y limit (or first line is cropped because of thickness)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{70}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} No ticks} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}xticks}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}yticks}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} 2 part titles to get different font weights} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{MATPLOTLIB }\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{right}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{bottom}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{w}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{family}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{sans\PYGZhy{}serif}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{fontweight}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{light}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{16}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{UNCHAINED}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{,} \PYG{n}{ha}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{left}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{va}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{bottom}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{w}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{family}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{sans\PYGZhy{}serif}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{fontweight}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{bold}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{16}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{update}\PYG{p}{(}\PYG{o}{*}\PYG{n}{args}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} Shift all data to the right} \PYG{n}{data}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{n}{data}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{p}{:}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{c+c1}{\PYGZsh{} Fill\PYGZhy{}in new values} \PYG{n}{data}\PYG{p}{[}\PYG{p}{:}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{uniform}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{data}\PYG{p}{)}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Update data} \PYG{k}{for} \PYG{n}{i} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{data}\PYG{p}{)}\PYG{p}{)}\PYG{p}{:} \PYG{n}{lines}\PYG{p}{[}\PYG{n}{i}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}ydata}\PYG{p}{(}\PYG{n}{i} \PYG{o}{+} \PYG{n}{G} \PYG{o}{*} \PYG{n}{data}\PYG{p}{[}\PYG{n}{i}\PYG{p}{]}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Return modified artists} \PYG{k}{return} \PYG{n}{lines} \PYG{c+c1}{\PYGZsh{} Construct the animation, using the update function as the animation director.} \PYG{n}{anim} \PYG{o}{=} \PYG{n}{animation}\PYG{o}{.}\PYG{n}{FuncAnimation}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{update}\PYG{p}{,} \PYG{n}{interval}\PYG{o}{=}\PYG{l+m+mi}{10}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \phantomsection\label{\detokenize{gallery/animation/unchained:sphx-glr-download-gallery-animation-unchained-py}} \subsection{\sphinxstyleliteralintitle{\sphinxupquote{ArtistAnimation}}} \label{\detokenize{api/animation_api:artistanimation}} \subsubsection{Examples} \label{\detokenize{api/animation_api:id2}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{gallery/animation/dynamic_image:sphx-glr-download-gallery-animation-dynamic-image-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \paragraph{Animated image using a precomputed list of images} \label{\detokenize{gallery/animation/dynamic_image:animated-image-using-a-precomputed-list-of-images}}\label{\detokenize{gallery/animation/dynamic_image:sphx-glr-gallery-animation-dynamic-image-py}}\label{\detokenize{gallery/animation/dynamic_image::doc}} \noindent\sphinxincludegraphics{{sphx_glr_dynamic_image_001}.png} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.animation} \PYG{k+kn}{as} \PYG{n+nn}{animation} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{f}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)}\PYG{p}{:} \PYG{k}{return} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)} \PYG{o}{+} \PYG{n}{np}\PYG{o}{.}\PYG{n}{cos}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)} \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{,} \PYG{l+m+mi}{120}\PYG{p}{)} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{)}\PYG{o}{.}\PYG{n}{reshape}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} ims is a list of lists, each row is a list of artists to draw in the} \PYG{c+c1}{\PYGZsh{} current frame; here we are just animating one artist, the image, in} \PYG{c+c1}{\PYGZsh{} each frame} \PYG{n}{ims} \PYG{o}{=} \PYG{p}{[}\PYG{p}{]} \PYG{k}{for} \PYG{n}{i} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{60}\PYG{p}{)}\PYG{p}{:} \PYG{n}{x} \PYG{o}{+}\PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{pi} \PYG{o}{/} \PYG{l+m+mf}{15.} \PYG{n}{y} \PYG{o}{+}\PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{pi} \PYG{o}{/} \PYG{l+m+mf}{20.} \PYG{n}{im} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{f}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)}\PYG{p}{,} \PYG{n}{animated}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} \PYG{n}{ims}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{p}{[}\PYG{n}{im}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ani} \PYG{o}{=} \PYG{n}{animation}\PYG{o}{.}\PYG{n}{ArtistAnimation}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{ims}\PYG{p}{,} \PYG{n}{interval}\PYG{o}{=}\PYG{l+m+mi}{50}\PYG{p}{,} \PYG{n}{blit}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{,} \PYG{n}{repeat\PYGZus{}delay}\PYG{o}{=}\PYG{l+m+mi}{1000}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} To save the animation, use e.g.} \PYG{c+c1}{\PYGZsh{}} \PYG{c+c1}{\PYGZsh{} ani.save(\PYGZdq{}movie.mp4\PYGZdq{})} \PYG{c+c1}{\PYGZsh{}} \PYG{c+c1}{\PYGZsh{} or} \PYG{c+c1}{\PYGZsh{}} \PYG{c+c1}{\PYGZsh{} from matplotlib.animation import FFMpegWriter} \PYG{c+c1}{\PYGZsh{} writer = FFMpegWriter(fps=15, metadata=dict(artist=\PYGZsq{}Me\PYGZsq{}), bitrate=1800)} \PYG{c+c1}{\PYGZsh{} ani.save(\PYGZdq{}movie.mp4\PYGZdq{}, writer=writer)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \phantomsection\label{\detokenize{gallery/animation/dynamic_image:sphx-glr-download-gallery-animation-dynamic-image-py}} \section{Writer Classes} \label{\detokenize{api/animation_api:writer-classes}} The provided writers fall into a few broad categories. The Pillow writer relies on the Pillow library to write the animation, keeping all data in memory. \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.PillowWriter:matplotlib.animation.PillowWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PillowWriter}}}}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.animation.PillowWriter} \label{\detokenize{api/_as_gen/matplotlib.animation.PillowWriter:matplotlib-animation-pillowwriter}}\label{\detokenize{api/_as_gen/matplotlib.animation.PillowWriter::doc}}\index{PillowWriter (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.PillowWriter:matplotlib.animation.PillowWriter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{PillowWriter}}}{\emph{*args}, \emph{**kwargs}}{}~\index{\_\_init\_\_() (matplotlib.animation.PillowWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.PillowWriter:matplotlib.animation.PillowWriter.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{*args}, \emph{**kwargs}}{} MovieWriter \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fps: int}}] \leavevmode Framerate for movie. \item[{\sphinxstylestrong{codec: string or None, optional}}] \leavevmode The codec to use. If \sphinxcode{\sphinxupquote{None}} (the default) the \sphinxcode{\sphinxupquote{animation.codec}} rcParam is used. \item[{\sphinxstylestrong{bitrate: int or None, optional}}] \leavevmode The bitrate for the saved movie file, which is one way to control the output file size and quality. The default value is \sphinxcode{\sphinxupquote{None}}, which uses the \sphinxcode{\sphinxupquote{animation.bitrate}} rcParam. A value of -1 implies that the bitrate should be determined automatically by the underlying utility. \item[{\sphinxstylestrong{extra\_args: list of strings or None, optional}}] \leavevmode A list of extra string arguments to be passed to the underlying movie utility. The default is \sphinxcode{\sphinxupquote{None}}, which passes the additional arguments in the \sphinxcode{\sphinxupquote{animation.extra\_args}} rcParam. \item[{\sphinxstylestrong{metadata: Dict{[}str, str{]} or None}}] \leavevmode A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment. \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{Methods} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.PillowWriter:matplotlib.animation.PillowWriter.__init__}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{\_\_init\_\_}}}}}(*args, **kwargs) & MovieWriter \\ \hline \sphinxcode{\sphinxupquote{bin\_path}}() & Returns the binary path to the commandline tool used by a specific subclass. \\ \hline \sphinxcode{\sphinxupquote{cleanup}}() & Clean-up and collect the process used to write the movie file. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.PillowWriter:matplotlib.animation.PillowWriter.finish}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{finish}}}}}() & Finish any processing for writing the movie. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.PillowWriter:matplotlib.animation.PillowWriter.grab_frame}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{grab\_frame}}}}}(**savefig\_kwargs) & Grab the image information from the figure and save as a movie frame. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.PillowWriter:matplotlib.animation.PillowWriter.isAvailable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{isAvailable}}}}}() & Check to see if a MovieWriter subclass is actually available by running the commandline tool. \\ \hline \sphinxcode{\sphinxupquote{saving}}(fig, outfile, dpi, *args, **kwargs) & Context manager to facilitate writing the movie file. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.PillowWriter:matplotlib.animation.PillowWriter.setup}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setup}}}}}(fig, outfile{[}, dpi{]}) & Perform setup for writing the movie file. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \paragraph{Attributes} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot \sphinxcode{\sphinxupquote{frame\_size}} & A tuple \sphinxcode{\sphinxupquote{(width, height)}} in pixels of a movie frame. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \index{finish() (matplotlib.animation.PillowWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.PillowWriter:matplotlib.animation.PillowWriter.finish}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{finish}}}{}{} Finish any processing for writing the movie. \end{fulllineitems} \index{grab\_frame() (matplotlib.animation.PillowWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.PillowWriter:matplotlib.animation.PillowWriter.grab_frame}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{grab\_frame}}}{\emph{**savefig\_kwargs}}{} Grab the image information from the figure and save as a movie frame. All keyword arguments in savefig\_kwargs are passed on to the \sphinxcode{\sphinxupquote{savefig}} command that saves the figure. \end{fulllineitems} \index{isAvailable() (matplotlib.animation.PillowWriter class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.PillowWriter:matplotlib.animation.PillowWriter.isAvailable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{isAvailable}}}{}{} Check to see if a MovieWriter subclass is actually available by running the commandline tool. \end{fulllineitems} \index{setup() (matplotlib.animation.PillowWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.PillowWriter:matplotlib.animation.PillowWriter.setup}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{setup}}}{\emph{fig}, \emph{outfile}, \emph{dpi=None}}{} Perform setup for writing the movie file. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}matplotlib.figure.Figure{]} The figure object that contains the information for frames \item[{\sphinxstylestrong{outfile}}] \leavevmode{[}string{]} The filename of the resulting movie file \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}int, optional{]} The DPI (or resolution) for the file. This controls the size in pixels of the resulting movie file. Default is fig.dpi. \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} The pipe-based writers stream the captured frames over a pipe to an external process. The pipe-based variants tend to be more performant, but may not work on all systems. \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FFMpegWriter:matplotlib.animation.FFMpegWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FFMpegWriter}}}}} & Pipe-based ffmpeg writer. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.ImageMagickFileWriter:matplotlib.animation.ImageMagickFileWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ImageMagickFileWriter}}}}} & File-based animated gif writer. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.AVConvWriter:matplotlib.animation.AVConvWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AVConvWriter}}}}} & Pipe-based avconv writer. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.animation.FFMpegWriter} \label{\detokenize{api/_as_gen/matplotlib.animation.FFMpegWriter:matplotlib-animation-ffmpegwriter}}\label{\detokenize{api/_as_gen/matplotlib.animation.FFMpegWriter::doc}}\index{FFMpegWriter (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FFMpegWriter:matplotlib.animation.FFMpegWriter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{FFMpegWriter}}}{\emph{fps=5}, \emph{codec=None}, \emph{bitrate=None}, \emph{extra\_args=None}, \emph{metadata=None}}{} Pipe-based ffmpeg writer. Frames are streamed directly to ffmpeg via a pipe and written in a single pass. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fps: int}}] \leavevmode Framerate for movie. \item[{\sphinxstylestrong{codec: string or None, optional}}] \leavevmode The codec to use. If \sphinxcode{\sphinxupquote{None}} (the default) the \sphinxcode{\sphinxupquote{animation.codec}} rcParam is used. \item[{\sphinxstylestrong{bitrate: int or None, optional}}] \leavevmode The bitrate for the saved movie file, which is one way to control the output file size and quality. The default value is \sphinxcode{\sphinxupquote{None}}, which uses the \sphinxcode{\sphinxupquote{animation.bitrate}} rcParam. A value of -1 implies that the bitrate should be determined automatically by the underlying utility. \item[{\sphinxstylestrong{extra\_args: list of strings or None, optional}}] \leavevmode A list of extra string arguments to be passed to the underlying movie utility. The default is \sphinxcode{\sphinxupquote{None}}, which passes the additional arguments in the \sphinxcode{\sphinxupquote{animation.extra\_args}} rcParam. \item[{\sphinxstylestrong{metadata: Dict{[}str, str{]} or None}}] \leavevmode A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment. \end{description} \end{description}\end{quote} \index{\_\_init\_\_() (matplotlib.animation.FFMpegWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FFMpegWriter:matplotlib.animation.FFMpegWriter.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{fps=5}, \emph{codec=None}, \emph{bitrate=None}, \emph{extra\_args=None}, \emph{metadata=None}}{} MovieWriter \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fps: int}}] \leavevmode Framerate for movie. \item[{\sphinxstylestrong{codec: string or None, optional}}] \leavevmode The codec to use. If \sphinxcode{\sphinxupquote{None}} (the default) the \sphinxcode{\sphinxupquote{animation.codec}} rcParam is used. \item[{\sphinxstylestrong{bitrate: int or None, optional}}] \leavevmode The bitrate for the saved movie file, which is one way to control the output file size and quality. The default value is \sphinxcode{\sphinxupquote{None}}, which uses the \sphinxcode{\sphinxupquote{animation.bitrate}} rcParam. A value of -1 implies that the bitrate should be determined automatically by the underlying utility. \item[{\sphinxstylestrong{extra\_args: list of strings or None, optional}}] \leavevmode A list of extra string arguments to be passed to the underlying movie utility. The default is \sphinxcode{\sphinxupquote{None}}, which passes the additional arguments in the \sphinxcode{\sphinxupquote{animation.extra\_args}} rcParam. \item[{\sphinxstylestrong{metadata: Dict{[}str, str{]} or None}}] \leavevmode A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment. \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{Methods} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FFMpegWriter:matplotlib.animation.FFMpegWriter.__init__}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{\_\_init\_\_}}}}}({[}fps, codec, bitrate, extra\_args, …{]}) & MovieWriter \\ \hline \sphinxcode{\sphinxupquote{bin\_path}}() & Returns the binary path to the commandline tool used by a specific subclass. \\ \hline \sphinxcode{\sphinxupquote{cleanup}}() & Clean-up and collect the process used to write the movie file. \\ \hline \sphinxcode{\sphinxupquote{finish}}() & Finish any processing for writing the movie. \\ \hline \sphinxcode{\sphinxupquote{grab\_frame}}(**savefig\_kwargs) & Grab the image information from the figure and save as a movie frame. \\ \hline \sphinxcode{\sphinxupquote{isAvailable}}() & Check to see if a MovieWriter subclass is actually available by running the commandline tool. \\ \hline \sphinxcode{\sphinxupquote{saving}}(fig, outfile, dpi, *args, **kwargs) & Context manager to facilitate writing the movie file. \\ \hline \sphinxcode{\sphinxupquote{setup}}(fig, outfile{[}, dpi{]}) & Perform setup for writing the movie file. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \paragraph{Attributes} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot \sphinxcode{\sphinxupquote{args\_key}} & \\ \hline \sphinxcode{\sphinxupquote{exec\_key}} & \\ \hline \sphinxcode{\sphinxupquote{frame\_size}} & A tuple \sphinxcode{\sphinxupquote{(width, height)}} in pixels of a movie frame. \\ \hline \sphinxcode{\sphinxupquote{output\_args}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{fulllineitems} \subsection{matplotlib.animation.ImageMagickFileWriter} \label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickFileWriter:matplotlib-animation-imagemagickfilewriter}}\label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickFileWriter::doc}}\index{ImageMagickFileWriter (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickFileWriter:matplotlib.animation.ImageMagickFileWriter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{ImageMagickFileWriter}}}{\emph{*args}, \emph{**kwargs}}{} File-based animated gif writer. Frames are written to temporary files on disk and then stitched together at the end. \index{\_\_init\_\_() (matplotlib.animation.ImageMagickFileWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickFileWriter:matplotlib.animation.ImageMagickFileWriter.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{*args}, \emph{**kwargs}}{} MovieWriter \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fps: int}}] \leavevmode Framerate for movie. \item[{\sphinxstylestrong{codec: string or None, optional}}] \leavevmode The codec to use. If \sphinxcode{\sphinxupquote{None}} (the default) the \sphinxcode{\sphinxupquote{animation.codec}} rcParam is used. \item[{\sphinxstylestrong{bitrate: int or None, optional}}] \leavevmode The bitrate for the saved movie file, which is one way to control the output file size and quality. The default value is \sphinxcode{\sphinxupquote{None}}, which uses the \sphinxcode{\sphinxupquote{animation.bitrate}} rcParam. A value of -1 implies that the bitrate should be determined automatically by the underlying utility. \item[{\sphinxstylestrong{extra\_args: list of strings or None, optional}}] \leavevmode A list of extra string arguments to be passed to the underlying movie utility. The default is \sphinxcode{\sphinxupquote{None}}, which passes the additional arguments in the \sphinxcode{\sphinxupquote{animation.extra\_args}} rcParam. \item[{\sphinxstylestrong{metadata: Dict{[}str, str{]} or None}}] \leavevmode A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment. \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{Methods} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.ImageMagickFileWriter:matplotlib.animation.ImageMagickFileWriter.__init__}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{\_\_init\_\_}}}}}(*args, **kwargs) & MovieWriter \\ \hline \sphinxcode{\sphinxupquote{bin\_path}}() & Returns the binary path to the commandline tool used by a specific subclass. \\ \hline \sphinxcode{\sphinxupquote{cleanup}}() & Clean-up and collect the process used to write the movie file. \\ \hline \sphinxcode{\sphinxupquote{finish}}() & Finish any processing for writing the movie. \\ \hline \sphinxcode{\sphinxupquote{grab\_frame}}(**savefig\_kwargs) & Grab the image information from the figure and save as a movie frame. \\ \hline \sphinxcode{\sphinxupquote{isAvailable}}() & Check to see if a ImageMagickWriter is actually available. \\ \hline \sphinxcode{\sphinxupquote{saving}}(fig, outfile, dpi, *args, **kwargs) & Context manager to facilitate writing the movie file. \\ \hline \sphinxcode{\sphinxupquote{setup}}(fig, outfile{[}, dpi, frame\_prefix, …{]}) & Perform setup for writing the movie file. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \paragraph{Attributes} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot \sphinxcode{\sphinxupquote{args\_key}} & \\ \hline \sphinxcode{\sphinxupquote{delay}} & \\ \hline \sphinxcode{\sphinxupquote{exec\_key}} & \\ \hline \sphinxcode{\sphinxupquote{frame\_format}} & Format (png, jpeg, etc.) to use for saving the frames, which can be decided by the individual subclasses. \\ \hline \sphinxcode{\sphinxupquote{frame\_size}} & A tuple \sphinxcode{\sphinxupquote{(width, height)}} in pixels of a movie frame. \\ \hline \sphinxcode{\sphinxupquote{output\_args}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.ImageMagickFileWriter:matplotlib.animation.ImageMagickFileWriter.supported_formats}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{supported\_formats}}}}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \index{supported\_formats (matplotlib.animation.ImageMagickFileWriter attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickFileWriter:matplotlib.animation.ImageMagickFileWriter.supported_formats}}\pysigline{\sphinxbfcode{\sphinxupquote{supported\_formats}}\sphinxbfcode{\sphinxupquote{ = {[}'png', 'jpeg', 'ppm', 'tiff', 'sgi', 'bmp', 'pbm', 'raw', 'rgba'{]}}}} \end{fulllineitems} \end{fulllineitems} \subsection{matplotlib.animation.AVConvWriter} \label{\detokenize{api/_as_gen/matplotlib.animation.AVConvWriter:matplotlib-animation-avconvwriter}}\label{\detokenize{api/_as_gen/matplotlib.animation.AVConvWriter::doc}}\index{AVConvWriter (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.AVConvWriter:matplotlib.animation.AVConvWriter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{AVConvWriter}}}{\emph{fps=5}, \emph{codec=None}, \emph{bitrate=None}, \emph{extra\_args=None}, \emph{metadata=None}}{} Pipe-based avconv writer. Frames are streamed directly to avconv via a pipe and written in a single pass. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fps: int}}] \leavevmode Framerate for movie. \item[{\sphinxstylestrong{codec: string or None, optional}}] \leavevmode The codec to use. If \sphinxcode{\sphinxupquote{None}} (the default) the \sphinxcode{\sphinxupquote{animation.codec}} rcParam is used. \item[{\sphinxstylestrong{bitrate: int or None, optional}}] \leavevmode The bitrate for the saved movie file, which is one way to control the output file size and quality. The default value is \sphinxcode{\sphinxupquote{None}}, which uses the \sphinxcode{\sphinxupquote{animation.bitrate}} rcParam. A value of -1 implies that the bitrate should be determined automatically by the underlying utility. \item[{\sphinxstylestrong{extra\_args: list of strings or None, optional}}] \leavevmode A list of extra string arguments to be passed to the underlying movie utility. The default is \sphinxcode{\sphinxupquote{None}}, which passes the additional arguments in the \sphinxcode{\sphinxupquote{animation.extra\_args}} rcParam. \item[{\sphinxstylestrong{metadata: Dict{[}str, str{]} or None}}] \leavevmode A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment. \end{description} \end{description}\end{quote} \index{\_\_init\_\_() (matplotlib.animation.AVConvWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.AVConvWriter:matplotlib.animation.AVConvWriter.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{fps=5}, \emph{codec=None}, \emph{bitrate=None}, \emph{extra\_args=None}, \emph{metadata=None}}{} MovieWriter \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fps: int}}] \leavevmode Framerate for movie. \item[{\sphinxstylestrong{codec: string or None, optional}}] \leavevmode The codec to use. If \sphinxcode{\sphinxupquote{None}} (the default) the \sphinxcode{\sphinxupquote{animation.codec}} rcParam is used. \item[{\sphinxstylestrong{bitrate: int or None, optional}}] \leavevmode The bitrate for the saved movie file, which is one way to control the output file size and quality. The default value is \sphinxcode{\sphinxupquote{None}}, which uses the \sphinxcode{\sphinxupquote{animation.bitrate}} rcParam. A value of -1 implies that the bitrate should be determined automatically by the underlying utility. \item[{\sphinxstylestrong{extra\_args: list of strings or None, optional}}] \leavevmode A list of extra string arguments to be passed to the underlying movie utility. The default is \sphinxcode{\sphinxupquote{None}}, which passes the additional arguments in the \sphinxcode{\sphinxupquote{animation.extra\_args}} rcParam. \item[{\sphinxstylestrong{metadata: Dict{[}str, str{]} or None}}] \leavevmode A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment. \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{Methods} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.AVConvWriter:matplotlib.animation.AVConvWriter.__init__}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{\_\_init\_\_}}}}}({[}fps, codec, bitrate, extra\_args, …{]}) & MovieWriter \\ \hline \sphinxcode{\sphinxupquote{bin\_path}}() & Returns the binary path to the commandline tool used by a specific subclass. \\ \hline \sphinxcode{\sphinxupquote{cleanup}}() & Clean-up and collect the process used to write the movie file. \\ \hline \sphinxcode{\sphinxupquote{finish}}() & Finish any processing for writing the movie. \\ \hline \sphinxcode{\sphinxupquote{grab\_frame}}(**savefig\_kwargs) & Grab the image information from the figure and save as a movie frame. \\ \hline \sphinxcode{\sphinxupquote{isAvailable}}() & Check to see if a MovieWriter subclass is actually available by running the commandline tool. \\ \hline \sphinxcode{\sphinxupquote{saving}}(fig, outfile, dpi, *args, **kwargs) & Context manager to facilitate writing the movie file. \\ \hline \sphinxcode{\sphinxupquote{setup}}(fig, outfile{[}, dpi{]}) & Perform setup for writing the movie file. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \paragraph{Attributes} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot \sphinxcode{\sphinxupquote{args\_key}} & \\ \hline \sphinxcode{\sphinxupquote{exec\_key}} & \\ \hline \sphinxcode{\sphinxupquote{frame\_size}} & A tuple \sphinxcode{\sphinxupquote{(width, height)}} in pixels of a movie frame. \\ \hline \sphinxcode{\sphinxupquote{output\_args}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{fulllineitems} The file-based writers save temporary files for each frame which are stitched into a single file at the end. Although slower, these writers can be easier to debug. \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FFMpegFileWriter:matplotlib.animation.FFMpegFileWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FFMpegFileWriter}}}}} & File-based ffmpeg writer. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.ImageMagickWriter:matplotlib.animation.ImageMagickWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ImageMagickWriter}}}}} & Pipe-based animated gif. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.AVConvFileWriter:matplotlib.animation.AVConvFileWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AVConvFileWriter}}}}} & File-based avconv writer. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.animation.FFMpegFileWriter} \label{\detokenize{api/_as_gen/matplotlib.animation.FFMpegFileWriter:matplotlib-animation-ffmpegfilewriter}}\label{\detokenize{api/_as_gen/matplotlib.animation.FFMpegFileWriter::doc}}\index{FFMpegFileWriter (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FFMpegFileWriter:matplotlib.animation.FFMpegFileWriter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{FFMpegFileWriter}}}{\emph{*args}, \emph{**kwargs}}{} File-based ffmpeg writer. Frames are written to temporary files on disk and then stitched together at the end. \index{\_\_init\_\_() (matplotlib.animation.FFMpegFileWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FFMpegFileWriter:matplotlib.animation.FFMpegFileWriter.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{*args}, \emph{**kwargs}}{} MovieWriter \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fps: int}}] \leavevmode Framerate for movie. \item[{\sphinxstylestrong{codec: string or None, optional}}] \leavevmode The codec to use. If \sphinxcode{\sphinxupquote{None}} (the default) the \sphinxcode{\sphinxupquote{animation.codec}} rcParam is used. \item[{\sphinxstylestrong{bitrate: int or None, optional}}] \leavevmode The bitrate for the saved movie file, which is one way to control the output file size and quality. The default value is \sphinxcode{\sphinxupquote{None}}, which uses the \sphinxcode{\sphinxupquote{animation.bitrate}} rcParam. A value of -1 implies that the bitrate should be determined automatically by the underlying utility. \item[{\sphinxstylestrong{extra\_args: list of strings or None, optional}}] \leavevmode A list of extra string arguments to be passed to the underlying movie utility. The default is \sphinxcode{\sphinxupquote{None}}, which passes the additional arguments in the \sphinxcode{\sphinxupquote{animation.extra\_args}} rcParam. \item[{\sphinxstylestrong{metadata: Dict{[}str, str{]} or None}}] \leavevmode A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment. \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{Methods} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FFMpegFileWriter:matplotlib.animation.FFMpegFileWriter.__init__}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{\_\_init\_\_}}}}}(*args, **kwargs) & MovieWriter \\ \hline \sphinxcode{\sphinxupquote{bin\_path}}() & Returns the binary path to the commandline tool used by a specific subclass. \\ \hline \sphinxcode{\sphinxupquote{cleanup}}() & Clean-up and collect the process used to write the movie file. \\ \hline \sphinxcode{\sphinxupquote{finish}}() & Finish any processing for writing the movie. \\ \hline \sphinxcode{\sphinxupquote{grab\_frame}}(**savefig\_kwargs) & Grab the image information from the figure and save as a movie frame. \\ \hline \sphinxcode{\sphinxupquote{isAvailable}}() & Check to see if a MovieWriter subclass is actually available by running the commandline tool. \\ \hline \sphinxcode{\sphinxupquote{saving}}(fig, outfile, dpi, *args, **kwargs) & Context manager to facilitate writing the movie file. \\ \hline \sphinxcode{\sphinxupquote{setup}}(fig, outfile{[}, dpi, frame\_prefix, …{]}) & Perform setup for writing the movie file. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \paragraph{Attributes} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot \sphinxcode{\sphinxupquote{args\_key}} & \\ \hline \sphinxcode{\sphinxupquote{exec\_key}} & \\ \hline \sphinxcode{\sphinxupquote{frame\_format}} & Format (png, jpeg, etc.) to use for saving the frames, which can be decided by the individual subclasses. \\ \hline \sphinxcode{\sphinxupquote{frame\_size}} & A tuple \sphinxcode{\sphinxupquote{(width, height)}} in pixels of a movie frame. \\ \hline \sphinxcode{\sphinxupquote{output\_args}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FFMpegFileWriter:matplotlib.animation.FFMpegFileWriter.supported_formats}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{supported\_formats}}}}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \index{supported\_formats (matplotlib.animation.FFMpegFileWriter attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FFMpegFileWriter:matplotlib.animation.FFMpegFileWriter.supported_formats}}\pysigline{\sphinxbfcode{\sphinxupquote{supported\_formats}}\sphinxbfcode{\sphinxupquote{ = {[}'png', 'jpeg', 'ppm', 'tiff', 'sgi', 'bmp', 'pbm', 'raw', 'rgba'{]}}}} \end{fulllineitems} \end{fulllineitems} \subsection{matplotlib.animation.ImageMagickWriter} \label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickWriter:matplotlib-animation-imagemagickwriter}}\label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickWriter::doc}}\index{ImageMagickWriter (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickWriter:matplotlib.animation.ImageMagickWriter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{ImageMagickWriter}}}{\emph{fps=5}, \emph{codec=None}, \emph{bitrate=None}, \emph{extra\_args=None}, \emph{metadata=None}}{} Pipe-based animated gif. Frames are streamed directly to ImageMagick via a pipe and written in a single pass. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fps: int}}] \leavevmode Framerate for movie. \item[{\sphinxstylestrong{codec: string or None, optional}}] \leavevmode The codec to use. If \sphinxcode{\sphinxupquote{None}} (the default) the \sphinxcode{\sphinxupquote{animation.codec}} rcParam is used. \item[{\sphinxstylestrong{bitrate: int or None, optional}}] \leavevmode The bitrate for the saved movie file, which is one way to control the output file size and quality. The default value is \sphinxcode{\sphinxupquote{None}}, which uses the \sphinxcode{\sphinxupquote{animation.bitrate}} rcParam. A value of -1 implies that the bitrate should be determined automatically by the underlying utility. \item[{\sphinxstylestrong{extra\_args: list of strings or None, optional}}] \leavevmode A list of extra string arguments to be passed to the underlying movie utility. The default is \sphinxcode{\sphinxupquote{None}}, which passes the additional arguments in the \sphinxcode{\sphinxupquote{animation.extra\_args}} rcParam. \item[{\sphinxstylestrong{metadata: Dict{[}str, str{]} or None}}] \leavevmode A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment. \end{description} \end{description}\end{quote} \index{\_\_init\_\_() (matplotlib.animation.ImageMagickWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickWriter:matplotlib.animation.ImageMagickWriter.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{fps=5}, \emph{codec=None}, \emph{bitrate=None}, \emph{extra\_args=None}, \emph{metadata=None}}{} MovieWriter \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fps: int}}] \leavevmode Framerate for movie. \item[{\sphinxstylestrong{codec: string or None, optional}}] \leavevmode The codec to use. If \sphinxcode{\sphinxupquote{None}} (the default) the \sphinxcode{\sphinxupquote{animation.codec}} rcParam is used. \item[{\sphinxstylestrong{bitrate: int or None, optional}}] \leavevmode The bitrate for the saved movie file, which is one way to control the output file size and quality. The default value is \sphinxcode{\sphinxupquote{None}}, which uses the \sphinxcode{\sphinxupquote{animation.bitrate}} rcParam. A value of -1 implies that the bitrate should be determined automatically by the underlying utility. \item[{\sphinxstylestrong{extra\_args: list of strings or None, optional}}] \leavevmode A list of extra string arguments to be passed to the underlying movie utility. The default is \sphinxcode{\sphinxupquote{None}}, which passes the additional arguments in the \sphinxcode{\sphinxupquote{animation.extra\_args}} rcParam. \item[{\sphinxstylestrong{metadata: Dict{[}str, str{]} or None}}] \leavevmode A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment. \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{Methods} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.ImageMagickWriter:matplotlib.animation.ImageMagickWriter.__init__}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{\_\_init\_\_}}}}}({[}fps, codec, bitrate, extra\_args, …{]}) & MovieWriter \\ \hline \sphinxcode{\sphinxupquote{bin\_path}}() & Returns the binary path to the commandline tool used by a specific subclass. \\ \hline \sphinxcode{\sphinxupquote{cleanup}}() & Clean-up and collect the process used to write the movie file. \\ \hline \sphinxcode{\sphinxupquote{finish}}() & Finish any processing for writing the movie. \\ \hline \sphinxcode{\sphinxupquote{grab\_frame}}(**savefig\_kwargs) & Grab the image information from the figure and save as a movie frame. \\ \hline \sphinxcode{\sphinxupquote{isAvailable}}() & Check to see if a ImageMagickWriter is actually available. \\ \hline \sphinxcode{\sphinxupquote{saving}}(fig, outfile, dpi, *args, **kwargs) & Context manager to facilitate writing the movie file. \\ \hline \sphinxcode{\sphinxupquote{setup}}(fig, outfile{[}, dpi{]}) & Perform setup for writing the movie file. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \paragraph{Attributes} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot \sphinxcode{\sphinxupquote{args\_key}} & \\ \hline \sphinxcode{\sphinxupquote{delay}} & \\ \hline \sphinxcode{\sphinxupquote{exec\_key}} & \\ \hline \sphinxcode{\sphinxupquote{frame\_size}} & A tuple \sphinxcode{\sphinxupquote{(width, height)}} in pixels of a movie frame. \\ \hline \sphinxcode{\sphinxupquote{output\_args}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{fulllineitems} \subsection{matplotlib.animation.AVConvFileWriter} \label{\detokenize{api/_as_gen/matplotlib.animation.AVConvFileWriter:matplotlib-animation-avconvfilewriter}}\label{\detokenize{api/_as_gen/matplotlib.animation.AVConvFileWriter::doc}}\index{AVConvFileWriter (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.AVConvFileWriter:matplotlib.animation.AVConvFileWriter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{AVConvFileWriter}}}{\emph{*args}, \emph{**kwargs}}{} File-based avconv writer. Frames are written to temporary files on disk and then stitched together at the end. \index{\_\_init\_\_() (matplotlib.animation.AVConvFileWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.AVConvFileWriter:matplotlib.animation.AVConvFileWriter.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{*args}, \emph{**kwargs}}{} MovieWriter \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fps: int}}] \leavevmode Framerate for movie. \item[{\sphinxstylestrong{codec: string or None, optional}}] \leavevmode The codec to use. If \sphinxcode{\sphinxupquote{None}} (the default) the \sphinxcode{\sphinxupquote{animation.codec}} rcParam is used. \item[{\sphinxstylestrong{bitrate: int or None, optional}}] \leavevmode The bitrate for the saved movie file, which is one way to control the output file size and quality. The default value is \sphinxcode{\sphinxupquote{None}}, which uses the \sphinxcode{\sphinxupquote{animation.bitrate}} rcParam. A value of -1 implies that the bitrate should be determined automatically by the underlying utility. \item[{\sphinxstylestrong{extra\_args: list of strings or None, optional}}] \leavevmode A list of extra string arguments to be passed to the underlying movie utility. The default is \sphinxcode{\sphinxupquote{None}}, which passes the additional arguments in the \sphinxcode{\sphinxupquote{animation.extra\_args}} rcParam. \item[{\sphinxstylestrong{metadata: Dict{[}str, str{]} or None}}] \leavevmode A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment. \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{Methods} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.AVConvFileWriter:matplotlib.animation.AVConvFileWriter.__init__}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{\_\_init\_\_}}}}}(*args, **kwargs) & MovieWriter \\ \hline \sphinxcode{\sphinxupquote{bin\_path}}() & Returns the binary path to the commandline tool used by a specific subclass. \\ \hline \sphinxcode{\sphinxupquote{cleanup}}() & Clean-up and collect the process used to write the movie file. \\ \hline \sphinxcode{\sphinxupquote{finish}}() & Finish any processing for writing the movie. \\ \hline \sphinxcode{\sphinxupquote{grab\_frame}}(**savefig\_kwargs) & Grab the image information from the figure and save as a movie frame. \\ \hline \sphinxcode{\sphinxupquote{isAvailable}}() & Check to see if a MovieWriter subclass is actually available by running the commandline tool. \\ \hline \sphinxcode{\sphinxupquote{saving}}(fig, outfile, dpi, *args, **kwargs) & Context manager to facilitate writing the movie file. \\ \hline \sphinxcode{\sphinxupquote{setup}}(fig, outfile{[}, dpi, frame\_prefix, …{]}) & Perform setup for writing the movie file. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \paragraph{Attributes} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot \sphinxcode{\sphinxupquote{args\_key}} & \\ \hline \sphinxcode{\sphinxupquote{exec\_key}} & \\ \hline \sphinxcode{\sphinxupquote{frame\_format}} & Format (png, jpeg, etc.) to use for saving the frames, which can be decided by the individual subclasses. \\ \hline \sphinxcode{\sphinxupquote{frame\_size}} & A tuple \sphinxcode{\sphinxupquote{(width, height)}} in pixels of a movie frame. \\ \hline \sphinxcode{\sphinxupquote{output\_args}} & \\ \hline \sphinxcode{\sphinxupquote{supported\_formats}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{fulllineitems} Fundamentally, a {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MovieWriter}}}}} provides a way to grab sequential frames from the same underlying {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} object. The base class {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MovieWriter}}}}} implements 3 methods and a context manager. The only difference between the pipe-based and file-based writers is in the arguments to their respective \sphinxcode{\sphinxupquote{setup}} methods. The \sphinxcode{\sphinxupquote{setup()}} method is used to prepare the writer (possibly opening a pipe), successive calls to \sphinxcode{\sphinxupquote{grab\_frame()}} capture a single frame at a time and \sphinxcode{\sphinxupquote{finish()}} finalizes the movie and writes the output file to disk. For example \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{moviewriter} \PYG{o}{=} \PYG{n}{MovieWriter}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{moviewriter}\PYG{o}{.}\PYG{n}{setup}\PYG{p}{(}\PYG{n}{fig}\PYG{o}{=}\PYG{n}{fig}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{my\PYGZus{}movie.ext}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{dpi}\PYG{o}{=}\PYG{l+m+mi}{100}\PYG{p}{)} \PYG{k}{for} \PYG{n}{j} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{n}{n}\PYG{p}{)}\PYG{p}{:} \PYG{n}{update\PYGZus{}figure}\PYG{p}{(}\PYG{n}{n}\PYG{p}{)} \PYG{n}{moviewriter}\PYG{o}{.}\PYG{n}{grab\PYGZus{}frame}\PYG{p}{(}\PYG{p}{)} \PYG{n}{moviewriter}\PYG{o}{.}\PYG{n}{finish}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} If using the writer classes directly (not through {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.save}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Animation.save}}}}}), it is strongly encouraged to use the \sphinxcode{\sphinxupquote{saving}} context manager \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{with} \PYG{n}{moviewriter}\PYG{o}{.}\PYG{n}{saving}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{myfile.mp4}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{dpi}\PYG{o}{=}\PYG{l+m+mi}{100}\PYG{p}{)}\PYG{p}{:} \PYG{k}{for} \PYG{n}{j} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{n}{n}\PYG{p}{)}\PYG{p}{:} \PYG{n}{update\PYGZus{}figure}\PYG{p}{(}\PYG{n}{n}\PYG{p}{)} \PYG{n}{moviewriter}\PYG{o}{.}\PYG{n}{grab\PYGZus{}frame}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} to ensures that setup and cleanup are performed as necessary. \subsection{Examples} \label{\detokenize{api/animation_api:id3}} \begin{sphinxadmonition}{note}{Note:} Click {\hyperref[\detokenize{gallery/animation/frame_grabbing_sgskip:sphx-glr-download-gallery-animation-frame-grabbing-sgskip-py}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to download the full example code \end{sphinxadmonition} \subsubsection{Frame grabbing} \label{\detokenize{gallery/animation/frame_grabbing_sgskip:frame-grabbing}}\label{\detokenize{gallery/animation/frame_grabbing_sgskip:sphx-glr-gallery-animation-frame-grabbing-sgskip-py}}\label{\detokenize{gallery/animation/frame_grabbing_sgskip::doc}} 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. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Agg}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib.animation} \PYG{k+kn}{import} \PYG{n}{FFMpegWriter} \PYG{c+c1}{\PYGZsh{} Fixing random state for reproducibility} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{19680801}\PYG{p}{)} \PYG{n}{metadata} \PYG{o}{=} \PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{title}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Movie Test}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{artist}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Matplotlib}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{comment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Movie support!}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{writer} \PYG{o}{=} \PYG{n}{FFMpegWriter}\PYG{p}{(}\PYG{n}{fps}\PYG{o}{=}\PYG{l+m+mi}{15}\PYG{p}{,} \PYG{n}{metadata}\PYG{o}{=}\PYG{n}{metadata}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{l}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k\PYGZhy{}o}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{xlim}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{ylim}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{)} \PYG{n}{x0}\PYG{p}{,} \PYG{n}{y0} \PYG{o}{=} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0} \PYG{k}{with} \PYG{n}{writer}\PYG{o}{.}\PYG{n}{saving}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{writer\PYGZus{}test.mp4}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{)}\PYG{p}{:} \PYG{k}{for} \PYG{n}{i} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{)}\PYG{p}{:} \PYG{n}{x0} \PYG{o}{+}\PYG{o}{=} \PYG{l+m+mf}{0.1} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{p}{)} \PYG{n}{y0} \PYG{o}{+}\PYG{o}{=} \PYG{l+m+mf}{0.1} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{randn}\PYG{p}{(}\PYG{p}{)} \PYG{n}{l}\PYG{o}{.}\PYG{n}{set\PYGZus{}data}\PYG{p}{(}\PYG{n}{x0}\PYG{p}{,} \PYG{n}{y0}\PYG{p}{)} \PYG{n}{writer}\PYG{o}{.}\PYG{n}{grab\PYGZus{}frame}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \phantomsection\label{\detokenize{gallery/animation/frame_grabbing_sgskip:sphx-glr-download-gallery-animation-frame-grabbing-sgskip-py}} \section{Helper Classes} \label{\detokenize{api/animation_api:helper-classes}}\label{\detokenize{api/animation_api:ani-writer-classes}} \subsection{Animation Base Classes} \label{\detokenize{api/animation_api:animation-base-classes}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Animation}}}}} & This class wraps the creation of an animation using matplotlib. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.TimedAnimation:matplotlib.animation.TimedAnimation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TimedAnimation}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Animation}}}}} subclass for time-based animation. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.animation.Animation} \label{\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib-animation-animation}}\label{\detokenize{api/_as_gen/matplotlib.animation.Animation::doc}}\index{Animation (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{Animation}}}{\emph{fig}, \emph{event\_source=None}, \emph{blit=False}}{} This class wraps the creation of an animation using matplotlib. It is only a base class which should be subclassed to provide needed behavior. This class is not typically used directly. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}matplotlib.figure.Figure{]} The figure object that is used to get draw, resize, and any other needed events. \item[{\sphinxstylestrong{event\_source}}] \leavevmode{[}object, optional{]} A class that can run a callback when desired events are generated, as well as be stopped and started. Examples include timers (see {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.TimedAnimation:matplotlib.animation.TimedAnimation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TimedAnimation}}}}}) and file system notifications. \item[{\sphinxstylestrong{blit}}] \leavevmode{[}bool, optional{]} controls whether blitting is used to optimize drawing. Defaults to \sphinxcode{\sphinxupquote{False}}. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FuncAnimation:matplotlib.animation.FuncAnimation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FuncAnimation}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.ArtistAnimation:matplotlib.animation.ArtistAnimation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ArtistAnimation}}}}} \index{\_\_init\_\_() (matplotlib.animation.Animation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{fig}, \emph{event\_source=None}, \emph{blit=False}}{} Initialize self. See help(type(self)) for accurate signature. \end{fulllineitems} \paragraph{Methods} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.__init__}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{\_\_init\_\_}}}}}(fig{[}, event\_source, blit{]}) & Initialize self. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.new_frame_seq}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{new\_frame\_seq}}}}}() & Creates a new sequence of frame information. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.new_saved_frame_seq}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{new\_saved\_frame\_seq}}}}}() & Creates a new sequence of saved/cached frame information. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.save}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{save}}}}}(filename{[}, writer, fps, dpi, codec, …{]}) & Saves a movie file by drawing every frame. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.to_html5_video}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{to\_html5\_video}}}}}({[}embed\_limit{]}) & Returns animation as an HTML5 video tag. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.to_jshtml}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{to\_jshtml}}}}}({[}fps, embed\_frames, default\_mode{]}) & Generate HTML representation of the animation \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \index{new\_frame\_seq() (matplotlib.animation.Animation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.new_frame_seq}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{new\_frame\_seq}}}{}{} Creates a new sequence of frame information. \end{fulllineitems} \index{new\_saved\_frame\_seq() (matplotlib.animation.Animation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.new_saved_frame_seq}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{new\_saved\_frame\_seq}}}{}{} Creates a new sequence of saved/cached frame information. \end{fulllineitems} \index{save() (matplotlib.animation.Animation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.save}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{save}}}{\emph{filename}, \emph{writer=None}, \emph{fps=None}, \emph{dpi=None}, \emph{codec=None}, \emph{bitrate=None}, \emph{extra\_args=None}, \emph{metadata=None}, \emph{extra\_anim=None}, \emph{savefig\_kwargs=None}}{} Saves a movie file by drawing every frame. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filename}}] \leavevmode{[}str{]} The output filename, e.g., \sphinxcode{\sphinxupquote{mymovie.mp4}}. \item[{\sphinxstylestrong{writer}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MovieWriter}}}}} or str, optional{]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MovieWriter}}}}} instance to use or a key that identifies a class to use, such as ‘ffmpeg’. If \sphinxcode{\sphinxupquote{None}}, defaults to \sphinxcode{\sphinxupquote{rcParams{[}"animation.writer"{]}}}. \item[{\sphinxstylestrong{fps}}] \leavevmode{[}number, optional{]} Frames per second in the movie. Defaults to \sphinxcode{\sphinxupquote{None}}, which will use the animation’s specified interval to set the frames per second. \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}number, optional{]} Controls the dots per inch for the movie frames. This combined with the figure’s size in inches controls the size of the movie. If \sphinxcode{\sphinxupquote{None}}, defaults to \sphinxcode{\sphinxupquote{rcParams{[}"savefig.dpi"{]}}}. \item[{\sphinxstylestrong{codec}}] \leavevmode{[}str, optional{]} The video codec to be used. Not all codecs are supported by a given {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MovieWriter}}}}}. If \sphinxcode{\sphinxupquote{None}}, default to \sphinxcode{\sphinxupquote{rcParams{[}"animation.codec"{]}}}. \item[{\sphinxstylestrong{bitrate}}] \leavevmode{[}number, optional{]} Specifies the number of bits used per second in the compressed movie, in kilobits per second. A higher number means a higher quality movie, but at the cost of increased file size. If \sphinxcode{\sphinxupquote{None}}, defaults to \sphinxcode{\sphinxupquote{rcParams{[}"animation.bitrate"{]}}}. \item[{\sphinxstylestrong{extra\_args}}] \leavevmode{[}list, optional{]} List of extra string arguments to be passed to the underlying movie utility. If \sphinxcode{\sphinxupquote{None}}, defaults to \sphinxcode{\sphinxupquote{rcParams{[}"animation.extra\_args"{]}}}. \item[{\sphinxstylestrong{metadata}}] \leavevmode{[}Dict{[}str, str{]}, optional{]} Dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment. \item[{\sphinxstylestrong{extra\_anim}}] \leavevmode{[}list, optional{]} Additional {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Animation}}}}} objects that should be included in the saved movie file. These need to be from the same {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure}}}}} instance. Also, animation frames will just be simply combined, so there should be a 1:1 correspondence between the frames from the different animations. \item[{\sphinxstylestrong{savefig\_kwargs}}] \leavevmode{[}dict, optional{]} Is a dictionary containing keyword arguments to be passed on to the \sphinxcode{\sphinxupquote{savefig}} command which is called repeatedly to save the individual frames. \end{description} \end{description}\end{quote} \paragraph{Notes} fps, codec, bitrate, extra\_args, metadata are used to construct a {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MovieWriter}}}}} instance and can only be passed if \sphinxcode{\sphinxupquote{writer}} is a string. If they are passed as non-\sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}} and \sphinxcode{\sphinxupquote{writer}} is a {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MovieWriter}}}}}, a \sphinxhref{https://docs.python.org/3/library/exceptions.html\#RuntimeError}{\sphinxcode{\sphinxupquote{RuntimeError}}} will be raised. \end{fulllineitems} \index{to\_html5\_video() (matplotlib.animation.Animation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.to_html5_video}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_html5\_video}}}{\emph{embed\_limit=None}}{} Returns animation as an HTML5 video tag. This saves the animation as an h264 video, encoded in base64 directly into the HTML5 video tag. This respects the rc parameters for the writer as well as the bitrate. This also makes use of the \sphinxcode{\sphinxupquote{interval}} to control the speed, and uses the \sphinxcode{\sphinxupquote{repeat}} parameter to decide whether to loop. \end{fulllineitems} \index{to\_jshtml() (matplotlib.animation.Animation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.to_jshtml}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_jshtml}}}{\emph{fps=None}, \emph{embed\_frames=True}, \emph{default\_mode=None}}{} Generate HTML representation of the animation \end{fulllineitems} \end{fulllineitems} \subsubsection{matplotlib.animation.TimedAnimation} \label{\detokenize{api/_as_gen/matplotlib.animation.TimedAnimation:matplotlib-animation-timedanimation}}\label{\detokenize{api/_as_gen/matplotlib.animation.TimedAnimation::doc}}\index{TimedAnimation (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.TimedAnimation:matplotlib.animation.TimedAnimation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{TimedAnimation}}}{\emph{fig}, \emph{interval=200}, \emph{repeat\_delay=None}, \emph{repeat=True}, \emph{event\_source=None}, \emph{*args}, \emph{**kwargs}}{} {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Animation}}}}} subclass for time-based animation. A new frame is drawn every \sphinxstyleemphasis{interval} milliseconds. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}matplotlib.figure.Figure{]} The figure object that is used to get draw, resize, and any other needed events. \item[{\sphinxstylestrong{interval}}] \leavevmode{[}number, optional{]} Delay between frames in milliseconds. Defaults to 200. \item[{\sphinxstylestrong{repeat\_delay}}] \leavevmode{[}number, optional{]} If the animation in repeated, adds a delay in milliseconds before repeating the animation. Defaults to \sphinxcode{\sphinxupquote{None}}. \item[{\sphinxstylestrong{repeat}}] \leavevmode{[}bool, optional{]} Controls whether the animation should repeat when the sequence of frames is completed. Defaults to \sphinxcode{\sphinxupquote{True}}. \item[{\sphinxstylestrong{blit}}] \leavevmode{[}bool, optional{]} Controls whether blitting is used to optimize drawing. Defaults to \sphinxcode{\sphinxupquote{False}}. \end{description} \end{description}\end{quote} \index{\_\_init\_\_() (matplotlib.animation.TimedAnimation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.TimedAnimation:matplotlib.animation.TimedAnimation.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{fig}, \emph{interval=200}, \emph{repeat\_delay=None}, \emph{repeat=True}, \emph{event\_source=None}, \emph{*args}, \emph{**kwargs}}{} Initialize self. See help(type(self)) for accurate signature. \end{fulllineitems} \paragraph{Methods} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.TimedAnimation:matplotlib.animation.TimedAnimation.__init__}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{\_\_init\_\_}}}}}(fig{[}, interval, repeat\_delay, …{]}) & Initialize self. \\ \hline \sphinxcode{\sphinxupquote{new\_frame\_seq}}() & Creates a new sequence of frame information. \\ \hline \sphinxcode{\sphinxupquote{new\_saved\_frame\_seq}}() & Creates a new sequence of saved/cached frame information. \\ \hline \sphinxcode{\sphinxupquote{save}}(filename{[}, writer, fps, dpi, codec, …{]}) & Saves a movie file by drawing every frame. \\ \hline \sphinxcode{\sphinxupquote{to\_html5\_video}}({[}embed\_limit{]}) & Returns animation as an HTML5 video tag. \\ \hline \sphinxcode{\sphinxupquote{to\_jshtml}}({[}fps, embed\_frames, default\_mode{]}) & Generate HTML representation of the animation \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{fulllineitems} \subsection{Writer Registry} \label{\detokenize{api/animation_api:writer-registry}} A module-level registry is provided to map between the name of the writer and the class to allow a string to be passed to {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.save}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Animation.save}}}}} instead of a writer instance. \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry:matplotlib.animation.MovieWriterRegistry}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MovieWriterRegistry}}}}} & Registry of available writer classes by human readable name. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.animation.MovieWriterRegistry} \label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry:matplotlib-animation-moviewriterregistry}}\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry::doc}}\index{MovieWriterRegistry (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry:matplotlib.animation.MovieWriterRegistry}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{MovieWriterRegistry}}} Registry of available writer classes by human readable name. \index{\_\_init\_\_() (matplotlib.animation.MovieWriterRegistry method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry:matplotlib.animation.MovieWriterRegistry.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{}{} Initialize self. See help(type(self)) for accurate signature. \end{fulllineitems} \paragraph{Methods} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry:matplotlib.animation.MovieWriterRegistry.__init__}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{\_\_init\_\_}}}}}() & Initialize self. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry:matplotlib.animation.MovieWriterRegistry.ensure_not_dirty}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ensure\_not\_dirty}}}}}() & If dirty, reasks the writers if they are available \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry:matplotlib.animation.MovieWriterRegistry.is_available}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{is\_available}}}}}(name) & Check if given writer is available by name. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry:matplotlib.animation.MovieWriterRegistry.list}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{list}}}}}() & Get a list of available MovieWriters. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry:matplotlib.animation.MovieWriterRegistry.register}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{register}}}}}(name) & Decorator for registering a class under a name. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry:matplotlib.animation.MovieWriterRegistry.reset_available_writers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{reset\_available\_writers}}}}}() & Reset the available state of all registered writers \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry:matplotlib.animation.MovieWriterRegistry.set_dirty}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_dirty}}}}}() & Sets a flag to re-setup the writers. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \index{ensure\_not\_dirty() (matplotlib.animation.MovieWriterRegistry method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry:matplotlib.animation.MovieWriterRegistry.ensure_not_dirty}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{ensure\_not\_dirty}}}{}{} If dirty, reasks the writers if they are available \end{fulllineitems} \index{is\_available() (matplotlib.animation.MovieWriterRegistry method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry:matplotlib.animation.MovieWriterRegistry.is_available}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_available}}}{\emph{name}}{} Check if given writer is available by name. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{name}}] \leavevmode{[}str{]} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{available}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{list() (matplotlib.animation.MovieWriterRegistry method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry:matplotlib.animation.MovieWriterRegistry.list}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{list}}}{}{} Get a list of available MovieWriters. \end{fulllineitems} \index{register() (matplotlib.animation.MovieWriterRegistry method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry:matplotlib.animation.MovieWriterRegistry.register}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{register}}}{\emph{name}}{} Decorator for registering a class under a name. Example use: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n+nd}{@registry}\PYG{o}{.}\PYG{n}{register}\PYG{p}{(}\PYG{n}{name}\PYG{p}{)} \PYG{k}{class} \PYG{n+nc}{Foo}\PYG{p}{:} \PYG{k}{pass} \end{sphinxVerbatim} \end{fulllineitems} \index{reset\_available\_writers() (matplotlib.animation.MovieWriterRegistry method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry:matplotlib.animation.MovieWriterRegistry.reset_available_writers}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{reset\_available\_writers}}}{}{} Reset the available state of all registered writers \end{fulllineitems} \index{set\_dirty() (matplotlib.animation.MovieWriterRegistry method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriterRegistry:matplotlib.animation.MovieWriterRegistry.set_dirty}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dirty}}}{}{} Sets a flag to re-setup the writers. \end{fulllineitems} \end{fulllineitems} \subsection{Writer Base Classes} \label{\detokenize{api/animation_api:writer-base-classes}} To reduce code duplication base classes \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.AbstractMovieWriter:matplotlib.animation.AbstractMovieWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractMovieWriter}}}}} & Abstract base class for writing movies. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MovieWriter}}}}} & Base class for writing movies. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FileMovieWriter:matplotlib.animation.FileMovieWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FileMovieWriter}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MovieWriter}}}}} for writing to individual files and stitching at the end. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.animation.AbstractMovieWriter} \label{\detokenize{api/_as_gen/matplotlib.animation.AbstractMovieWriter:matplotlib-animation-abstractmoviewriter}}\label{\detokenize{api/_as_gen/matplotlib.animation.AbstractMovieWriter::doc}}\index{AbstractMovieWriter (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.AbstractMovieWriter:matplotlib.animation.AbstractMovieWriter}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{AbstractMovieWriter}}} Abstract base class for writing movies. Fundamentally, what a MovieWriter does is provide is a way to grab frames by calling grab\_frame(). setup() is called to start the process and finish() is called afterwards. This class is set up to provide for writing movie frame data to a pipe. saving() is provided as a context manager to facilitate this process as: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{with} \PYG{n}{moviewriter}\PYG{o}{.}\PYG{n}{saving}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{outfile}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{myfile.mp4}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{dpi}\PYG{o}{=}\PYG{l+m+mi}{100}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} Iterate over frames} \PYG{n}{moviewriter}\PYG{o}{.}\PYG{n}{grab\PYGZus{}frame}\PYG{p}{(}\PYG{o}{*}\PYG{o}{*}\PYG{n}{savefig\PYGZus{}kwargs}\PYG{p}{)} \end{sphinxVerbatim} The use of the context manager ensures that setup() and finish() are performed as necessary. An instance of a concrete subclass of this class can be given as the \sphinxcode{\sphinxupquote{writer}} argument of {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.save}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Animation.save()}}}}}. \index{\_\_init\_\_() (matplotlib.animation.AbstractMovieWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.AbstractMovieWriter:matplotlib.animation.AbstractMovieWriter.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{\$self}, \emph{/}, \emph{*args}, \emph{**kwargs}}{} Initialize self. See help(type(self)) for accurate signature. \end{fulllineitems} \paragraph{Methods} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.AbstractMovieWriter:matplotlib.animation.AbstractMovieWriter.finish}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{finish}}}}}() & Finish any processing for writing the movie. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.AbstractMovieWriter:matplotlib.animation.AbstractMovieWriter.grab_frame}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{grab\_frame}}}}}(**savefig\_kwargs) & Grab the image information from the figure and save as a movie frame. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.AbstractMovieWriter:matplotlib.animation.AbstractMovieWriter.saving}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{saving}}}}}(fig, outfile, dpi, *args, **kwargs) & Context manager to facilitate writing the movie file. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.AbstractMovieWriter:matplotlib.animation.AbstractMovieWriter.setup}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setup}}}}}(fig, outfile{[}, dpi{]}) & Perform setup for writing the movie file. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \index{finish() (matplotlib.animation.AbstractMovieWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.AbstractMovieWriter:matplotlib.animation.AbstractMovieWriter.finish}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{finish}}}{}{} Finish any processing for writing the movie. \end{fulllineitems} \index{grab\_frame() (matplotlib.animation.AbstractMovieWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.AbstractMovieWriter:matplotlib.animation.AbstractMovieWriter.grab_frame}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{grab\_frame}}}{\emph{**savefig\_kwargs}}{} Grab the image information from the figure and save as a movie frame. All keyword arguments in savefig\_kwargs are passed on to the \sphinxcode{\sphinxupquote{savefig}} command that saves the figure. \end{fulllineitems} \index{saving() (matplotlib.animation.AbstractMovieWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.AbstractMovieWriter:matplotlib.animation.AbstractMovieWriter.saving}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{saving}}}{\emph{fig}, \emph{outfile}, \emph{dpi}, \emph{*args}, \emph{**kwargs}}{} Context manager to facilitate writing the movie file. \sphinxcode{\sphinxupquote{*args, **kw}} are any parameters that should be passed to {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.AbstractMovieWriter:matplotlib.animation.AbstractMovieWriter.setup}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setup}}}}}. \end{fulllineitems} \index{setup() (matplotlib.animation.AbstractMovieWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.AbstractMovieWriter:matplotlib.animation.AbstractMovieWriter.setup}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{setup}}}{\emph{fig}, \emph{outfile}, \emph{dpi=None}}{} Perform setup for writing the movie file. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig: {}`matplotlib.figure.Figure{}` instance}}] \leavevmode The figure object that contains the information for frames \item[{\sphinxstylestrong{outfile: string}}] \leavevmode The filename of the resulting movie file \item[{\sphinxstylestrong{dpi: int, optional}}] \leavevmode The DPI (or resolution) for the file. This controls the size in pixels of the resulting movie file. Default is \sphinxcode{\sphinxupquote{fig.dpi}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \subsubsection{matplotlib.animation.MovieWriter} \label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib-animation-moviewriter}}\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriter::doc}}\index{MovieWriter (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{MovieWriter}}}{\emph{fps=5}, \emph{codec=None}, \emph{bitrate=None}, \emph{extra\_args=None}, \emph{metadata=None}}{} Base class for writing movies. This class is set up to provide for writing movie frame data to a pipe. See examples for how to use these classes. \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{frame\_format}}] \leavevmode{[}str{]} The format used in writing frame data, defaults to ‘rgba’ \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} The figure to capture data from. This must be provided by the sub-classes. \end{description} \end{description}\end{quote} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fps: int}}] \leavevmode Framerate for movie. \item[{\sphinxstylestrong{codec: string or None, optional}}] \leavevmode The codec to use. If \sphinxcode{\sphinxupquote{None}} (the default) the \sphinxcode{\sphinxupquote{animation.codec}} rcParam is used. \item[{\sphinxstylestrong{bitrate: int or None, optional}}] \leavevmode The bitrate for the saved movie file, which is one way to control the output file size and quality. The default value is \sphinxcode{\sphinxupquote{None}}, which uses the \sphinxcode{\sphinxupquote{animation.bitrate}} rcParam. A value of -1 implies that the bitrate should be determined automatically by the underlying utility. \item[{\sphinxstylestrong{extra\_args: list of strings or None, optional}}] \leavevmode A list of extra string arguments to be passed to the underlying movie utility. The default is \sphinxcode{\sphinxupquote{None}}, which passes the additional arguments in the \sphinxcode{\sphinxupquote{animation.extra\_args}} rcParam. \item[{\sphinxstylestrong{metadata: Dict{[}str, str{]} or None}}] \leavevmode A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment. \end{description} \end{description}\end{quote} \index{\_\_init\_\_() (matplotlib.animation.MovieWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{fps=5}, \emph{codec=None}, \emph{bitrate=None}, \emph{extra\_args=None}, \emph{metadata=None}}{} MovieWriter \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fps: int}}] \leavevmode Framerate for movie. \item[{\sphinxstylestrong{codec: string or None, optional}}] \leavevmode The codec to use. If \sphinxcode{\sphinxupquote{None}} (the default) the \sphinxcode{\sphinxupquote{animation.codec}} rcParam is used. \item[{\sphinxstylestrong{bitrate: int or None, optional}}] \leavevmode The bitrate for the saved movie file, which is one way to control the output file size and quality. The default value is \sphinxcode{\sphinxupquote{None}}, which uses the \sphinxcode{\sphinxupquote{animation.bitrate}} rcParam. A value of -1 implies that the bitrate should be determined automatically by the underlying utility. \item[{\sphinxstylestrong{extra\_args: list of strings or None, optional}}] \leavevmode A list of extra string arguments to be passed to the underlying movie utility. The default is \sphinxcode{\sphinxupquote{None}}, which passes the additional arguments in the \sphinxcode{\sphinxupquote{animation.extra\_args}} rcParam. \item[{\sphinxstylestrong{metadata: Dict{[}str, str{]} or None}}] \leavevmode A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment. \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{Methods} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter.__init__}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{\_\_init\_\_}}}}}({[}fps, codec, bitrate, extra\_args, …{]}) & MovieWriter \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter.bin_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bin\_path}}}}}() & Returns the binary path to the commandline tool used by a specific subclass. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter.cleanup}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cleanup}}}}}() & Clean-up and collect the process used to write the movie file. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter.finish}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{finish}}}}}() & Finish any processing for writing the movie. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter.grab_frame}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{grab\_frame}}}}}(**savefig\_kwargs) & Grab the image information from the figure and save as a movie frame. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter.isAvailable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{isAvailable}}}}}() & Check to see if a MovieWriter subclass is actually available by running the commandline tool. \\ \hline \sphinxcode{\sphinxupquote{saving}}(fig, outfile, dpi, *args, **kwargs) & Context manager to facilitate writing the movie file. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter.setup}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setup}}}}}(fig, outfile{[}, dpi{]}) & Perform setup for writing the movie file. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \paragraph{Attributes} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter.frame_size}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{frame\_size}}}}} & A tuple \sphinxcode{\sphinxupquote{(width, height)}} in pixels of a movie frame. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \index{bin\_path() (matplotlib.animation.MovieWriter class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter.bin_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{bin\_path}}}{}{} Returns the binary path to the commandline tool used by a specific subclass. This is a class method so that the tool can be looked for before making a particular MovieWriter subclass available. \end{fulllineitems} \index{cleanup() (matplotlib.animation.MovieWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter.cleanup}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{cleanup}}}{}{} Clean-up and collect the process used to write the movie file. \end{fulllineitems} \index{finish() (matplotlib.animation.MovieWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter.finish}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{finish}}}{}{} Finish any processing for writing the movie. \end{fulllineitems} \index{frame\_size (matplotlib.animation.MovieWriter attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter.frame_size}}\pysigline{\sphinxbfcode{\sphinxupquote{frame\_size}}} A tuple \sphinxcode{\sphinxupquote{(width, height)}} in pixels of a movie frame. \end{fulllineitems} \index{grab\_frame() (matplotlib.animation.MovieWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter.grab_frame}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{grab\_frame}}}{\emph{**savefig\_kwargs}}{} Grab the image information from the figure and save as a movie frame. All keyword arguments in savefig\_kwargs are passed on to the \sphinxcode{\sphinxupquote{savefig}} command that saves the figure. \end{fulllineitems} \index{isAvailable() (matplotlib.animation.MovieWriter class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter.isAvailable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{isAvailable}}}{}{} Check to see if a MovieWriter subclass is actually available by running the commandline tool. \end{fulllineitems} \index{setup() (matplotlib.animation.MovieWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter.setup}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{setup}}}{\emph{fig}, \emph{outfile}, \emph{dpi=None}}{} Perform setup for writing the movie file. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}matplotlib.figure.Figure{]} The figure object that contains the information for frames \item[{\sphinxstylestrong{outfile}}] \leavevmode{[}string{]} The filename of the resulting movie file \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}int, optional{]} The DPI (or resolution) for the file. This controls the size in pixels of the resulting movie file. Default is fig.dpi. \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \subsubsection{matplotlib.animation.FileMovieWriter} \label{\detokenize{api/_as_gen/matplotlib.animation.FileMovieWriter:matplotlib-animation-filemoviewriter}}\label{\detokenize{api/_as_gen/matplotlib.animation.FileMovieWriter::doc}}\index{FileMovieWriter (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FileMovieWriter:matplotlib.animation.FileMovieWriter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{FileMovieWriter}}}{\emph{*args}, \emph{**kwargs}}{} {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MovieWriter}}}}} for writing to individual files and stitching at the end. This must be sub-classed to be useful. \index{\_\_init\_\_() (matplotlib.animation.FileMovieWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FileMovieWriter:matplotlib.animation.FileMovieWriter.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{*args}, \emph{**kwargs}}{} MovieWriter \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fps: int}}] \leavevmode Framerate for movie. \item[{\sphinxstylestrong{codec: string or None, optional}}] \leavevmode The codec to use. If \sphinxcode{\sphinxupquote{None}} (the default) the \sphinxcode{\sphinxupquote{animation.codec}} rcParam is used. \item[{\sphinxstylestrong{bitrate: int or None, optional}}] \leavevmode The bitrate for the saved movie file, which is one way to control the output file size and quality. The default value is \sphinxcode{\sphinxupquote{None}}, which uses the \sphinxcode{\sphinxupquote{animation.bitrate}} rcParam. A value of -1 implies that the bitrate should be determined automatically by the underlying utility. \item[{\sphinxstylestrong{extra\_args: list of strings or None, optional}}] \leavevmode A list of extra string arguments to be passed to the underlying movie utility. The default is \sphinxcode{\sphinxupquote{None}}, which passes the additional arguments in the \sphinxcode{\sphinxupquote{animation.extra\_args}} rcParam. \item[{\sphinxstylestrong{metadata: Dict{[}str, str{]} or None}}] \leavevmode A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment. \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{Methods} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FileMovieWriter:matplotlib.animation.FileMovieWriter.__init__}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{\_\_init\_\_}}}}}(*args, **kwargs) & MovieWriter \\ \hline \sphinxcode{\sphinxupquote{bin\_path}}() & Returns the binary path to the commandline tool used by a specific subclass. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FileMovieWriter:matplotlib.animation.FileMovieWriter.cleanup}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cleanup}}}}}() & Clean-up and collect the process used to write the movie file. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FileMovieWriter:matplotlib.animation.FileMovieWriter.finish}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{finish}}}}}() & Finish any processing for writing the movie. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FileMovieWriter:matplotlib.animation.FileMovieWriter.grab_frame}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{grab\_frame}}}}}(**savefig\_kwargs) & Grab the image information from the figure and save as a movie frame. \\ \hline \sphinxcode{\sphinxupquote{isAvailable}}() & Check to see if a MovieWriter subclass is actually available by running the commandline tool. \\ \hline \sphinxcode{\sphinxupquote{saving}}(fig, outfile, dpi, *args, **kwargs) & Context manager to facilitate writing the movie file. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FileMovieWriter:matplotlib.animation.FileMovieWriter.setup}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setup}}}}}(fig, outfile{[}, dpi, frame\_prefix, …{]}) & Perform setup for writing the movie file. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \paragraph{Attributes} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FileMovieWriter:matplotlib.animation.FileMovieWriter.frame_format}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{frame\_format}}}}} & Format (png, jpeg, etc.) to use for saving the frames, which can be decided by the individual subclasses. \\ \hline \sphinxcode{\sphinxupquote{frame\_size}} & A tuple \sphinxcode{\sphinxupquote{(width, height)}} in pixels of a movie frame. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \index{cleanup() (matplotlib.animation.FileMovieWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FileMovieWriter:matplotlib.animation.FileMovieWriter.cleanup}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{cleanup}}}{}{} Clean-up and collect the process used to write the movie file. \end{fulllineitems} \index{finish() (matplotlib.animation.FileMovieWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FileMovieWriter:matplotlib.animation.FileMovieWriter.finish}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{finish}}}{}{} Finish any processing for writing the movie. \end{fulllineitems} \index{frame\_format (matplotlib.animation.FileMovieWriter attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FileMovieWriter:matplotlib.animation.FileMovieWriter.frame_format}}\pysigline{\sphinxbfcode{\sphinxupquote{frame\_format}}} Format (png, jpeg, etc.) to use for saving the frames, which can be decided by the individual subclasses. \end{fulllineitems} \index{grab\_frame() (matplotlib.animation.FileMovieWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FileMovieWriter:matplotlib.animation.FileMovieWriter.grab_frame}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{grab\_frame}}}{\emph{**savefig\_kwargs}}{} Grab the image information from the figure and save as a movie frame. All keyword arguments in savefig\_kwargs are passed on to the \sphinxcode{\sphinxupquote{savefig}} command that saves the figure. \end{fulllineitems} \index{setup() (matplotlib.animation.FileMovieWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FileMovieWriter:matplotlib.animation.FileMovieWriter.setup}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{setup}}}{\emph{fig}, \emph{outfile}, \emph{dpi=None}, \emph{frame\_prefix='\_tmp'}, \emph{clear\_temp=True}}{} Perform setup for writing the movie file. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}matplotlib.figure.Figure{]} The figure to grab the rendered frames from. \item[{\sphinxstylestrong{outfile}}] \leavevmode{[}str{]} The filename of the resulting movie file. \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}number, optional{]} The dpi of the output file. This, with the figure size, controls the size in pixels of the resulting movie file. Default is fig.dpi. \item[{\sphinxstylestrong{frame\_prefix}}] \leavevmode{[}str, optional{]} The filename prefix to use for temporary files. Defaults to \sphinxcode{\sphinxupquote{'\_tmp'}}. \item[{\sphinxstylestrong{clear\_temp}}] \leavevmode{[}bool, optional{]} If the temporary files should be deleted after stitching the final result. Setting this to \sphinxcode{\sphinxupquote{False}} can be useful for debugging. Defaults to \sphinxcode{\sphinxupquote{True}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} and mixins \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.AVConvBase:matplotlib.animation.AVConvBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AVConvBase}}}}} & Mixin class for avconv output. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FFMpegBase:matplotlib.animation.FFMpegBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FFMpegBase}}}}} & Mixin class for FFMpeg output. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.ImageMagickBase:matplotlib.animation.ImageMagickBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ImageMagickBase}}}}} & Mixin class for ImageMagick output. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.animation.AVConvBase} \label{\detokenize{api/_as_gen/matplotlib.animation.AVConvBase:matplotlib-animation-avconvbase}}\label{\detokenize{api/_as_gen/matplotlib.animation.AVConvBase::doc}}\index{AVConvBase (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.AVConvBase:matplotlib.animation.AVConvBase}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{AVConvBase}}} Mixin class for avconv output. To be useful this must be multiply-inherited from with a \sphinxcode{\sphinxupquote{MovieWriterBase}} sub-class. \index{\_\_init\_\_() (matplotlib.animation.AVConvBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.AVConvBase:matplotlib.animation.AVConvBase.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{\$self}, \emph{/}, \emph{*args}, \emph{**kwargs}}{} Initialize self. See help(type(self)) for accurate signature. \end{fulllineitems} \paragraph{Attributes} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.AVConvBase:matplotlib.animation.AVConvBase.args_key}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{args\_key}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.AVConvBase:matplotlib.animation.AVConvBase.exec_key}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{exec\_key}}}}} & \\ \hline \sphinxcode{\sphinxupquote{output\_args}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \index{args\_key (matplotlib.animation.AVConvBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.AVConvBase:matplotlib.animation.AVConvBase.args_key}}\pysigline{\sphinxbfcode{\sphinxupquote{args\_key}}\sphinxbfcode{\sphinxupquote{ = 'animation.avconv\_args'}}} \end{fulllineitems} \index{exec\_key (matplotlib.animation.AVConvBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.AVConvBase:matplotlib.animation.AVConvBase.exec_key}}\pysigline{\sphinxbfcode{\sphinxupquote{exec\_key}}\sphinxbfcode{\sphinxupquote{ = 'animation.avconv\_path'}}} \end{fulllineitems} \end{fulllineitems} \subsubsection{matplotlib.animation.FFMpegBase} \label{\detokenize{api/_as_gen/matplotlib.animation.FFMpegBase:matplotlib-animation-ffmpegbase}}\label{\detokenize{api/_as_gen/matplotlib.animation.FFMpegBase::doc}}\index{FFMpegBase (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FFMpegBase:matplotlib.animation.FFMpegBase}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{FFMpegBase}}} Mixin class for FFMpeg output. To be useful this must be multiply-inherited from with a \sphinxcode{\sphinxupquote{MovieWriterBase}} sub-class. \index{\_\_init\_\_() (matplotlib.animation.FFMpegBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FFMpegBase:matplotlib.animation.FFMpegBase.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{\$self}, \emph{/}, \emph{*args}, \emph{**kwargs}}{} Initialize self. See help(type(self)) for accurate signature. \end{fulllineitems} \paragraph{Attributes} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FFMpegBase:matplotlib.animation.FFMpegBase.args_key}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{args\_key}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FFMpegBase:matplotlib.animation.FFMpegBase.exec_key}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{exec\_key}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.FFMpegBase:matplotlib.animation.FFMpegBase.output_args}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_args}}}}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \index{args\_key (matplotlib.animation.FFMpegBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FFMpegBase:matplotlib.animation.FFMpegBase.args_key}}\pysigline{\sphinxbfcode{\sphinxupquote{args\_key}}\sphinxbfcode{\sphinxupquote{ = 'animation.ffmpeg\_args'}}} \end{fulllineitems} \index{exec\_key (matplotlib.animation.FFMpegBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FFMpegBase:matplotlib.animation.FFMpegBase.exec_key}}\pysigline{\sphinxbfcode{\sphinxupquote{exec\_key}}\sphinxbfcode{\sphinxupquote{ = 'animation.ffmpeg\_path'}}} \end{fulllineitems} \index{output\_args (matplotlib.animation.FFMpegBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.FFMpegBase:matplotlib.animation.FFMpegBase.output_args}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_args}}}~ \end{fulllineitems} \end{fulllineitems} \subsubsection{matplotlib.animation.ImageMagickBase} \label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickBase:matplotlib-animation-imagemagickbase}}\label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickBase::doc}}\index{ImageMagickBase (class in matplotlib.animation)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickBase:matplotlib.animation.ImageMagickBase}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.animation.}}\sphinxbfcode{\sphinxupquote{ImageMagickBase}}} Mixin class for ImageMagick output. To be useful this must be multiply-inherited from with a \sphinxcode{\sphinxupquote{MovieWriterBase}} sub-class. \index{\_\_init\_\_() (matplotlib.animation.ImageMagickBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickBase:matplotlib.animation.ImageMagickBase.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{\$self}, \emph{/}, \emph{*args}, \emph{**kwargs}}{} Initialize self. See help(type(self)) for accurate signature. \end{fulllineitems} \paragraph{Methods} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.ImageMagickBase:matplotlib.animation.ImageMagickBase.isAvailable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{isAvailable}}}}}() & Check to see if a ImageMagickWriter is actually available. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \paragraph{Attributes} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.ImageMagickBase:matplotlib.animation.ImageMagickBase.args_key}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{args\_key}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.ImageMagickBase:matplotlib.animation.ImageMagickBase.delay}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{delay}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.ImageMagickBase:matplotlib.animation.ImageMagickBase.exec_key}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{exec\_key}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.ImageMagickBase:matplotlib.animation.ImageMagickBase.output_args}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_args}}}}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \index{args\_key (matplotlib.animation.ImageMagickBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickBase:matplotlib.animation.ImageMagickBase.args_key}}\pysigline{\sphinxbfcode{\sphinxupquote{args\_key}}\sphinxbfcode{\sphinxupquote{ = 'animation.convert\_args'}}} \end{fulllineitems} \index{delay (matplotlib.animation.ImageMagickBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickBase:matplotlib.animation.ImageMagickBase.delay}}\pysigline{\sphinxbfcode{\sphinxupquote{delay}}}~ \end{fulllineitems} \index{exec\_key (matplotlib.animation.ImageMagickBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickBase:matplotlib.animation.ImageMagickBase.exec_key}}\pysigline{\sphinxbfcode{\sphinxupquote{exec\_key}}\sphinxbfcode{\sphinxupquote{ = 'animation.convert\_path'}}} \end{fulllineitems} \index{isAvailable() (matplotlib.animation.ImageMagickBase class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickBase:matplotlib.animation.ImageMagickBase.isAvailable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{isAvailable}}}{}{} Check to see if a ImageMagickWriter is actually available. Done by first checking the windows registry (if applicable) and then running the commandline tool. \end{fulllineitems} \index{output\_args (matplotlib.animation.ImageMagickBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.animation.ImageMagickBase:matplotlib.animation.ImageMagickBase.output_args}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_args}}}~ \end{fulllineitems} \end{fulllineitems} are provided. See the source code for how to easily implement new {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.MovieWriter:matplotlib.animation.MovieWriter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MovieWriter}}}}} classes. \section{Inheritance Diagrams} \label{\detokenize{api/animation_api:inheritance-diagrams}} \sphinxincludegraphics[]{inheritance-15a1817c5d693c6bc99a6312940f1373380a6ba7.pdf} \sphinxincludegraphics[]{inheritance-70dfa79ad3b082f1274a5727130a9c7b2c4daa04.pdf} \chapter{\sphinxstyleliteralintitle{\sphinxupquote{artist}} Module} \label{\detokenize{api/artist_api:artist-module}}\label{\detokenize{api/artist_api:artist-api}}\label{\detokenize{api/artist_api::doc}} \sphinxincludegraphics[]{inheritance-fcc33bb075793b34da5438788a41527b90fcd75d.pdf} \phantomsection\label{\detokenize{api/artist_api:module-matplotlib.artist}}\index{matplotlib.artist (module)} \section{\sphinxstyleliteralintitle{\sphinxupquote{Artist}} class} \label{\detokenize{api/artist_api:artist-class}}\index{Artist (class in matplotlib.artist)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/artist_api:matplotlib.artist.Artist}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.artist.}}\sphinxbfcode{\sphinxupquote{Artist}}} Abstract base class for someone who renders into a \sphinxcode{\sphinxupquote{FigureCanvas}}. \end{fulllineitems} \subsection{Interactive} \label{\detokenize{api/artist_api:interactive}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.add_callback:matplotlib.artist.Artist.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.add\_callback}}}}} & Adds a callback function that will be called whenever one of the {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}}’s properties changes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.format_cursor_data:matplotlib.artist.Artist.format_cursor_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.format\_cursor\_data}}}}} & Return \sphinxstyleemphasis{cursor data} string formatted. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_contains:matplotlib.artist.Artist.get_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_contains}}}}} & Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_cursor_data:matplotlib.artist.Artist.get_cursor_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_cursor\_data}}}}} & Get the cursor data for a given event. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_picker:matplotlib.artist.Artist.get_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_picker}}}}} & Return the picker object used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.mouseover:matplotlib.artist.Artist.mouseover}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.mouseover}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.pchanged:matplotlib.artist.Artist.pchanged}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.pchanged}}}}} & Fire an event when property changed, calling all of the registered callbacks. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.pick:matplotlib.artist.Artist.pick}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.pick}}}}} & Process pick event \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.pickable:matplotlib.artist.Artist.pickable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.pickable}}}}} & Return \sphinxstyleemphasis{True} if {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} is pickable. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.remove_callback:matplotlib.artist.Artist.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.remove\_callback}}}}} & Remove a callback based on its \sphinxstyleemphasis{id}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_contains}}}}} & Replace the contains test used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_picker}}}}} & Set the epsilon for picking used by this artist \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.contains:matplotlib.artist.Artist.contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.contains}}}}} & Test whether the artist contains the mouse event. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.artist.Artist.add\_callback} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.add_callback:matplotlib-artist-artist-add-callback}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.add_callback::doc}}\index{add\_callback() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.add_callback:matplotlib.artist.Artist.add_callback}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.remove_callback:matplotlib.artist.Artist.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.format\_cursor\_data} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.format_cursor_data:matplotlib-artist-artist-format-cursor-data}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.format_cursor_data::doc}}\index{format\_cursor\_data() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.format_cursor_data:matplotlib.artist.Artist.format_cursor_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_contains} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_contains:matplotlib-artist-artist-get-contains}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_contains::doc}}\index{get\_contains() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_contains:matplotlib.artist.Artist.get_contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_cursor\_data} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_cursor_data:matplotlib-artist-artist-get-cursor-data}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_cursor_data::doc}}\index{get\_cursor\_data() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_cursor_data:matplotlib.artist.Artist.get_cursor_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_picker} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_picker:matplotlib-artist-artist-get-picker}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_picker::doc}}\index{get\_picker() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_picker:matplotlib.artist.Artist.get_picker}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.mouseover} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.mouseover:matplotlib-artist-artist-mouseover}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.mouseover::doc}}\index{mouseover (matplotlib.artist.Artist attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.mouseover:matplotlib.artist.Artist.mouseover}}\pysigline{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.pchanged} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.pchanged:matplotlib-artist-artist-pchanged}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.pchanged::doc}}\index{pchanged() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.pchanged:matplotlib.artist.Artist.pchanged}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.pick} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.pick:matplotlib-artist-artist-pick}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.pick::doc}}\index{pick() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.pick:matplotlib.artist.Artist.pick}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.pickable} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.pickable:matplotlib-artist-artist-pickable}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.pickable::doc}}\index{pickable() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.pickable:matplotlib.artist.Artist.pickable}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} is pickable. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.remove\_callback} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.remove_callback:matplotlib-artist-artist-remove-callback}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.remove_callback::doc}}\index{remove\_callback() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.remove_callback:matplotlib.artist.Artist.remove_callback}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.add_callback:matplotlib.artist.Artist.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_contains} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib-artist-artist-set-contains}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains::doc}}\index{set\_contains() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_picker} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib-artist-artist-set-picker}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker::doc}}\index{set\_picker() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.contains} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.contains:matplotlib-artist-artist-contains}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.contains::doc}}\index{contains() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.contains:matplotlib.artist.Artist.contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the artist contains the mouse event. Returns the truth value and a dictionary of artist specific details of selection, such as which points are contained in the pick radius. See individual artists for details. \end{fulllineitems} \subsection{Margins and Autoscaling} \label{\detokenize{api/artist_api:margins-and-autoscaling}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.sticky_edges:matplotlib.artist.Artist.sticky_edges}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.sticky\_edges}}}}} & \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} sticky edge lists. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.artist.Artist.sticky\_edges} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.sticky_edges:matplotlib-artist-artist-sticky-edges}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.sticky_edges::doc}}\index{sticky\_edges (matplotlib.artist.Artist attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.sticky_edges:matplotlib.artist.Artist.sticky_edges}}\pysigline{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{sticky\_edges}}} \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} sticky edge lists. When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added\textendash{}the view limit “sticks” to the edge. A typical usecase is histograms, where one usually expects no margin on the bottom edge (0) of the histogram. This attribute cannot be assigned to; however, the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} lists can be modified in place as needed. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{x}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsection{Clipping} \label{\detokenize{api/artist_api:clipping}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_clip_box:matplotlib.artist.Artist.get_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_clip\_box}}}}} & Return artist clipbox \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_clip_on:matplotlib.artist.Artist.get_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_clip\_on}}}}} & Return whether artist uses clipping \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_clip_path:matplotlib.artist.Artist.get_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_clip\_path}}}}} & Return artist clip path \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_clip\_box}}}}} & Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_clip\_on}}}}} & Set whether artist uses clipping. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_clip\_path}}}}} & Set the artist’s clip path, which may be: \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.artist.Artist.get\_clip\_box} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_clip_box:matplotlib-artist-artist-get-clip-box}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_clip_box::doc}}\index{get\_clip\_box() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_clip_box:matplotlib.artist.Artist.get_clip_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_clip\_on} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_clip_on:matplotlib-artist-artist-get-clip-on}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_clip_on::doc}}\index{get\_clip\_on() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_clip_on:matplotlib.artist.Artist.get_clip_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_clip\_path} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_clip_path:matplotlib-artist-artist-get-clip-path}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_clip_path::doc}}\index{get\_clip\_path() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_clip_path:matplotlib.artist.Artist.get_clip_path}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_clip\_box} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib-artist-artist-set-clip-box}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box::doc}}\index{set\_clip\_box() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_clip\_on} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib-artist-artist-set-clip-on}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on::doc}}\index{set\_clip\_on() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_clip\_path} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib-artist-artist-set-clip-path}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path::doc}}\index{set\_clip\_path() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \subsection{Bulk Properties} \label{\detokenize{api/artist_api:bulk-properties}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.update:matplotlib.artist.Artist.update}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.update}}}}} & Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.update_from:matplotlib.artist.Artist.update_from}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.update\_from}}}}} & Copy properties from \sphinxstyleemphasis{other} to \sphinxstyleemphasis{self}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.properties:matplotlib.artist.Artist.properties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.properties}}}}} & return a dictionary mapping property name -\textgreater{} value for all Artist props \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set:matplotlib.artist.Artist.set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set}}}}} & A property batch setter. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.artist.Artist.update} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.update:matplotlib-artist-artist-update}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.update::doc}}\index{update() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.update:matplotlib.artist.Artist.update}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.update\_from} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.update_from:matplotlib-artist-artist-update-from}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.update_from::doc}}\index{update\_from() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.update_from:matplotlib.artist.Artist.update_from}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} Copy properties from \sphinxstyleemphasis{other} to \sphinxstyleemphasis{self}. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.properties} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.properties:matplotlib-artist-artist-properties}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.properties::doc}}\index{properties() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.properties:matplotlib.artist.Artist.properties}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set:matplotlib-artist-artist-set}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set::doc}}\index{set() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set:matplotlib.artist.Artist.set}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \subsection{Drawing} \label{\detokenize{api/artist_api:drawing}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.draw:matplotlib.artist.Artist.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.draw}}}}} & Derived classes drawing method \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_animated:matplotlib.artist.Artist.get_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_animated}}}}} & Return the artist’s animated state \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_animated}}}}} & Set the artist’s animation state. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_agg_filter:matplotlib.artist.Artist.get_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_agg\_filter}}}}} & Return filter function to be used for agg filter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_alpha:matplotlib.artist.Artist.get_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_alpha}}}}} & Return the alpha value used for blending - not supported on all backends \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_snap:matplotlib.artist.Artist.get_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_snap}}}}} & Returns the snap setting which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_visible:matplotlib.artist.Artist.get_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_visible}}}}} & Return the artist’s visiblity \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_zorder:matplotlib.artist.Artist.get_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_zorder}}}}} & Return the artist’s zorder. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_agg\_filter}}}}} & Set the agg filter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_alpha}}}}} & Set the alpha value used for blending - not supported on all backends. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_sketch\_params}}}}} & Sets the sketch parameters. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_snap}}}}} & Sets the snap setting which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_rasterized:matplotlib.artist.Artist.get_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_rasterized}}}}} & Return whether the artist is to be rasterized. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_sketch_params:matplotlib.artist.Artist.get_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_sketch\_params}}}}} & Returns the sketch parameters for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_path\_effects}}}}} & Set the path effects. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_rasterized}}}}} & Force rasterized (bitmap) drawing in vector backend output. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.zorder:matplotlib.artist.Artist.zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.zorder}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_visible}}}}} & Set the artist’s visibility. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_zorder}}}}} & Set the zorder for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_window_extent:matplotlib.artist.Artist.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_window\_extent}}}}} & Get the axes bounding box in display space. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_path_effects:matplotlib.artist.Artist.get_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_path\_effects}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_transformed_clip_path_and_affine:matplotlib.artist.Artist.get_transformed_clip_path_and_affine}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_transformed\_clip\_path\_and\_affine}}}}} & Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.artist.Artist.draw} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.draw:matplotlib-artist-artist-draw}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.draw::doc}}\index{draw() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.draw:matplotlib.artist.Artist.draw}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}, \emph{*args}, \emph{**kwargs}}{} Derived classes drawing method \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_animated} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_animated:matplotlib-artist-artist-get-animated}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_animated::doc}}\index{get\_animated() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_animated:matplotlib.artist.Artist.get_animated}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_animated} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib-artist-artist-set-animated}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated::doc}}\index{set\_animated() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_agg\_filter} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_agg_filter:matplotlib-artist-artist-get-agg-filter}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_agg_filter::doc}}\index{get\_agg\_filter() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_agg_filter:matplotlib.artist.Artist.get_agg_filter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_alpha} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_alpha:matplotlib-artist-artist-get-alpha}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_alpha::doc}}\index{get\_alpha() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_alpha:matplotlib.artist.Artist.get_alpha}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_snap} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_snap:matplotlib-artist-artist-get-snap}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_snap::doc}}\index{get\_snap() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_snap:matplotlib.artist.Artist.get_snap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_visible} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_visible:matplotlib-artist-artist-get-visible}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_visible::doc}}\index{get\_visible() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_visible:matplotlib.artist.Artist.get_visible}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_zorder} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_zorder:matplotlib-artist-artist-get-zorder}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_zorder::doc}}\index{get\_zorder() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_zorder:matplotlib.artist.Artist.get_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_agg\_filter} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib-artist-artist-set-agg-filter}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter::doc}}\index{set\_agg\_filter() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_alpha} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib-artist-artist-set-alpha}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha::doc}}\index{set\_alpha() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha value used for blending - not supported on all backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_sketch\_params} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib-artist-artist-set-sketch-params}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params::doc}}\index{set\_sketch\_params() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_snap} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib-artist-artist-set-snap}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap::doc}}\index{set\_snap() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_rasterized} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_rasterized:matplotlib-artist-artist-get-rasterized}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_rasterized::doc}}\index{get\_rasterized() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_rasterized:matplotlib.artist.Artist.get_rasterized}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_sketch\_params} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_sketch_params:matplotlib-artist-artist-get-sketch-params}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_sketch_params::doc}}\index{get\_sketch\_params() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_sketch_params:matplotlib.artist.Artist.get_sketch_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_path\_effects} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib-artist-artist-set-path-effects}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects::doc}}\index{set\_path\_effects() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_rasterized} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib-artist-artist-set-rasterized}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized::doc}}\index{set\_rasterized() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.zorder} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.zorder:matplotlib-artist-artist-zorder}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.zorder::doc}}\index{zorder (matplotlib.artist.Artist attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.zorder:matplotlib.artist.Artist.zorder}}\pysigline{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_visible} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib-artist-artist-set-visible}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible::doc}}\index{set\_visible() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_zorder} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib-artist-artist-set-zorder}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder::doc}}\index{set\_zorder() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_window\_extent} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_window_extent:matplotlib-artist-artist-get-window-extent}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_window_extent::doc}}\index{get\_window\_extent() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_window_extent:matplotlib.artist.Artist.get_window_extent}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_path\_effects} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_path_effects:matplotlib-artist-artist-get-path-effects}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_path_effects::doc}}\index{get\_path\_effects() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_path_effects:matplotlib.artist.Artist.get_path_effects}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_transformed\_clip\_path\_and\_affine} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_transformed_clip_path_and_affine:matplotlib-artist-artist-get-transformed-clip-path-and-affine}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_transformed_clip_path_and_affine::doc}}\index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_transformed_clip_path_and_affine:matplotlib.artist.Artist.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \subsection{Figure and Axes} \label{\detokenize{api/artist_api:figure-and-axes}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.remove:matplotlib.artist.Artist.remove}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.remove}}}}} & Remove the artist from the figure if possible. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.axes:matplotlib.artist.Artist.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.axes}}}}} & The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_figure}}}}} & Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_figure:matplotlib.artist.Artist.get_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_figure}}}}} & Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.artist.Artist.remove} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.remove:matplotlib-artist-artist-remove}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.remove::doc}}\index{remove() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.remove:matplotlib.artist.Artist.remove}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.axes} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.axes:matplotlib-artist-artist-axes}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.axes::doc}}\index{axes (matplotlib.artist.Artist attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.axes:matplotlib.artist.Artist.axes}}\pysigline{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_figure} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib-artist-artist-set-figure}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure::doc}}\index{set\_figure() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_figure} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_figure:matplotlib-artist-artist-get-figure}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_figure::doc}}\index{get\_figure() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_figure:matplotlib.artist.Artist.get_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \subsection{Children} \label{\detokenize{api/artist_api:children}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_children:matplotlib.artist.Artist.get_children}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_children}}}}} & Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.findobj:matplotlib.artist.Artist.findobj}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.findobj}}}}} & Find artist objects. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.artist.Artist.get\_children} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_children:matplotlib-artist-artist-get-children}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_children::doc}}\index{get\_children() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_children:matplotlib.artist.Artist.get_children}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.findobj} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.findobj:matplotlib-artist-artist-findobj}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.findobj::doc}}\index{findobj() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.findobj:matplotlib.artist.Artist.findobj}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \subsection{Transform} \label{\detokenize{api/artist_api:transform}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_transform}}}}} & Set the artist transform. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_transform:matplotlib.artist.Artist.get_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_transform}}}}} & Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.is_transform_set:matplotlib.artist.Artist.is_transform_set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.is\_transform\_set}}}}} & Returns \sphinxstyleemphasis{True} if {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} has a transform explicitly set. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.artist.Artist.set\_transform} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib-artist-artist-set-transform}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform::doc}}\index{set\_transform() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_transform} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_transform:matplotlib-artist-artist-get-transform}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_transform::doc}}\index{get\_transform() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_transform:matplotlib.artist.Artist.get_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.is\_transform\_set} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.is_transform_set:matplotlib-artist-artist-is-transform-set}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.is_transform_set::doc}}\index{is\_transform\_set() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.is_transform_set:matplotlib.artist.Artist.is_transform_set}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} has a transform explicitly set. \end{fulllineitems} \subsection{Units} \label{\detokenize{api/artist_api:units}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.convert_xunits:matplotlib.artist.Artist.convert_xunits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.convert\_xunits}}}}} & For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.convert_yunits:matplotlib.artist.Artist.convert_yunits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.convert\_yunits}}}}} & For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.have_units:matplotlib.artist.Artist.have_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.have\_units}}}}} & Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.artist.Artist.convert\_xunits} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.convert_xunits:matplotlib-artist-artist-convert-xunits}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.convert_xunits::doc}}\index{convert\_xunits() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.convert_xunits:matplotlib.artist.Artist.convert_xunits}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.convert\_yunits} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.convert_yunits:matplotlib-artist-artist-convert-yunits}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.convert_yunits::doc}}\index{convert\_yunits() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.convert_yunits:matplotlib.artist.Artist.convert_yunits}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.have\_units} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.have_units:matplotlib-artist-artist-have-units}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.have_units::doc}}\index{have\_units() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.have_units:matplotlib.artist.Artist.have_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \subsection{Metadata} \label{\detokenize{api/artist_api:metadata}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_gid:matplotlib.artist.Artist.get_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_gid}}}}} & Returns the group id. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_label:matplotlib.artist.Artist.get_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_label}}}}} & Get the label used for this artist in the legend. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_gid}}}}} & Sets the (group) id for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_label}}}}} & Set the label to \sphinxstyleemphasis{s} for auto legend. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_url:matplotlib.artist.Artist.get_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.get\_url}}}}} & Returns the url. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.set\_url}}}}} & Sets the url for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.aname:matplotlib.artist.Artist.aname}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.aname}}}}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.artist.Artist.get\_gid} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_gid:matplotlib-artist-artist-get-gid}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_gid::doc}}\index{get\_gid() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_gid:matplotlib.artist.Artist.get_gid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_label} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_label:matplotlib-artist-artist-get-label}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_label::doc}}\index{get\_label() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_label:matplotlib.artist.Artist.get_label}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_gid} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib-artist-artist-set-gid}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid::doc}}\index{set\_gid() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_label} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib-artist-artist-set-label}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label::doc}}\index{set\_label() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.get\_url} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_url:matplotlib-artist-artist-get-url}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_url::doc}}\index{get\_url() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.get_url:matplotlib.artist.Artist.get_url}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.set\_url} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib-artist-artist-set-url}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url::doc}}\index{set\_url() (matplotlib.artist.Artist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.artist.Artist.aname} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.aname:matplotlib-artist-artist-aname}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.aname::doc}}\index{aname (matplotlib.artist.Artist attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.aname:matplotlib.artist.Artist.aname}}\pysigline{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \subsection{Stale} \label{\detokenize{api/artist_api:stale}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.stale:matplotlib.artist.Artist.stale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist.stale}}}}} & If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.artist.Artist.stale} \label{\detokenize{api/_as_gen/matplotlib.artist.Artist.stale:matplotlib-artist-artist-stale}}\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.stale::doc}}\index{stale (matplotlib.artist.Artist attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.Artist.stale:matplotlib.artist.Artist.stale}}\pysigline{\sphinxcode{\sphinxupquote{Artist.}}\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \section{Functions} \label{\detokenize{api/artist_api:functions}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.allow_rasterization:matplotlib.artist.allow_rasterization}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{allow\_rasterization}}}}} & Decorator for Artist.draw method. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.get:matplotlib.artist.get}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get}}}}} & Return the value of object’s property. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.getp:matplotlib.artist.getp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{getp}}}}} & Return the value of object’s property. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.setp:matplotlib.artist.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setp}}}}} & Set a property on an artist object. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.kwdoc:matplotlib.artist.kwdoc}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{kwdoc}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ArtistInspector}}}}} & A helper class to inspect an {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} and return information about it’s settable properties and their current values. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.artist.allow\_rasterization} \label{\detokenize{api/_as_gen/matplotlib.artist.allow_rasterization:matplotlib-artist-allow-rasterization}}\label{\detokenize{api/_as_gen/matplotlib.artist.allow_rasterization::doc}}\index{allow\_rasterization() (in module matplotlib.artist)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.allow_rasterization:matplotlib.artist.allow_rasterization}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.artist.}}\sphinxbfcode{\sphinxupquote{allow\_rasterization}}}{\emph{draw}}{} Decorator for Artist.draw method. Provides routines that run before and after the draw call. The before and after functions are useful for changing artist-dependent renderer attributes or making other setup function calls, such as starting and flushing a mixed-mode renderer. \end{fulllineitems} \subsection{matplotlib.artist.get} \label{\detokenize{api/_as_gen/matplotlib.artist.get:matplotlib-artist-get}}\label{\detokenize{api/_as_gen/matplotlib.artist.get::doc}}\index{get() (in module matplotlib.artist)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.get:matplotlib.artist.get}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.artist.}}\sphinxbfcode{\sphinxupquote{get}}}{\emph{obj}, \emph{property=None}}{} Return the value of object’s property. \sphinxstyleemphasis{property} is an optional string for the property you want to return Example usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{getp}\PYG{p}{(}\PYG{n}{obj}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} get all the object properties} \PYG{n}{getp}\PYG{p}{(}\PYG{n}{obj}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} get the linestyle property} \end{sphinxVerbatim} \sphinxstyleemphasis{obj} is a {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instance, e.g., \sphinxcode{\sphinxupquote{Line2D}} or an instance of a {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} or {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}}. If the \sphinxstyleemphasis{property} is ‘somename’, this function returns \begin{quote} obj.get\_somename() \end{quote} {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.getp:matplotlib.artist.getp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{getp()}}}}} can be used to query all the gettable properties with \sphinxcode{\sphinxupquote{getp(obj)}}. Many properties have aliases for shorter typing, e.g. ‘lw’ is an alias for ‘linewidth’. In the output, aliases and full property names will be listed as: \begin{quote} property or alias = value \end{quote} e.g.: \begin{quote} linewidth or lw = 2 \end{quote} \end{fulllineitems} \subsection{matplotlib.artist.getp} \label{\detokenize{api/_as_gen/matplotlib.artist.getp:matplotlib-artist-getp}}\label{\detokenize{api/_as_gen/matplotlib.artist.getp::doc}}\index{getp() (in module matplotlib.artist)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.getp:matplotlib.artist.getp}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.artist.}}\sphinxbfcode{\sphinxupquote{getp}}}{\emph{obj}, \emph{property=None}}{} Return the value of object’s property. \sphinxstyleemphasis{property} is an optional string for the property you want to return Example usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{getp}\PYG{p}{(}\PYG{n}{obj}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} get all the object properties} \PYG{n}{getp}\PYG{p}{(}\PYG{n}{obj}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} get the linestyle property} \end{sphinxVerbatim} \sphinxstyleemphasis{obj} is a {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instance, e.g., \sphinxcode{\sphinxupquote{Line2D}} or an instance of a {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} or {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}}. If the \sphinxstyleemphasis{property} is ‘somename’, this function returns \begin{quote} obj.get\_somename() \end{quote} {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.getp:matplotlib.artist.getp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{getp()}}}}} can be used to query all the gettable properties with \sphinxcode{\sphinxupquote{getp(obj)}}. Many properties have aliases for shorter typing, e.g. ‘lw’ is an alias for ‘linewidth’. In the output, aliases and full property names will be listed as: \begin{quote} property or alias = value \end{quote} e.g.: \begin{quote} linewidth or lw = 2 \end{quote} \end{fulllineitems} \subsection{matplotlib.artist.setp} \label{\detokenize{api/_as_gen/matplotlib.artist.setp:matplotlib-artist-setp}}\label{\detokenize{api/_as_gen/matplotlib.artist.setp::doc}}\index{setp() (in module matplotlib.artist)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.setp:matplotlib.artist.setp}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.artist.}}\sphinxbfcode{\sphinxupquote{setp}}}{\emph{obj}, \emph{*args}, \emph{**kwargs}}{} Set a property on an artist object. matplotlib supports the use of {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.setp:matplotlib.artist.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setp()}}}}} (“set property”) and {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.getp:matplotlib.artist.getp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{getp()}}}}} to set and get object properties, as well as to do introspection on the object. For example, to set the linestyle of a line to be dashed, you can do: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{setp}\PYG{p}{(}\PYG{n}{line}\PYG{p}{,} \PYG{n}{linestyle}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} If you want to know the valid types of arguments, you can provide the name of the property you want to set without a value: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{setp}\PYG{p}{(}\PYG{n}{line}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{g+go}{ linestyle: [ \PYGZsq{}\PYGZhy{}\PYGZsq{} \textbar{} \PYGZsq{}\PYGZhy{}\PYGZhy{}\PYGZsq{} \textbar{} \PYGZsq{}\PYGZhy{}.\PYGZsq{} \textbar{} \PYGZsq{}:\PYGZsq{} \textbar{} \PYGZsq{}steps\PYGZsq{} \textbar{} \PYGZsq{}None\PYGZsq{} ]} \end{sphinxVerbatim} If you want to see all the properties that can be set, and their possible values, you can do: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{setp}\PYG{p}{(}\PYG{n}{line}\PYG{p}{)} \PYG{g+go}{ ... long output listing omitted} \end{sphinxVerbatim} You may specify another output file to {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.setp:matplotlib.artist.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setp}}}}} if \sphinxhref{https://docs.python.org/3/library/sys.html\#sys.stdout}{\sphinxcode{\sphinxupquote{sys.stdout}}} is not acceptable for some reason using the \sphinxcode{\sphinxupquote{file}} keyword-only argument: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k}{with} \PYG{n}{fopen}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{output.log}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k}{as} \PYG{n}{f}\PYG{p}{:} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} } \PYG{n}{setp}\PYG{p}{(}\PYG{n}{line}\PYG{p}{,} \PYG{n}{file}\PYG{o}{=}\PYG{n}{f}\PYG{p}{)} \end{sphinxVerbatim} {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.setp:matplotlib.artist.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setp()}}}}} operates on a single instance or a iterable of instances. If you are in query mode introspecting the possible values, only the first instance in the sequence is used. When actually setting values, all the instances will be set. e.g., suppose you have a list of two lines, the following will make both lines thicker and red: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{x} \PYG{o}{=} \PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mf}{1.0}\PYG{p}{,}\PYG{l+m+mf}{0.01}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{y1} \PYG{o}{=} \PYG{n}{sin}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{x}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{y2} \PYG{o}{=} \PYG{n}{sin}\PYG{p}{(}\PYG{l+m+mi}{4}\PYG{o}{*}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{x}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{lines} \PYG{o}{=} \PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{,} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{setp}\PYG{p}{(}\PYG{n}{lines}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.setp:matplotlib.artist.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setp()}}}}} works with the MATLAB style string/value pairs or with python kwargs. For example, the following are equivalent: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{setp}\PYG{p}{(}\PYG{n}{lines}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linewidth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} MATLAB style} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{setp}\PYG{p}{(}\PYG{n}{lines}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} python style} \end{sphinxVerbatim} \end{fulllineitems} \subsection{matplotlib.artist.kwdoc} \label{\detokenize{api/_as_gen/matplotlib.artist.kwdoc:matplotlib-artist-kwdoc}}\label{\detokenize{api/_as_gen/matplotlib.artist.kwdoc::doc}}\index{kwdoc() (in module matplotlib.artist)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.kwdoc:matplotlib.artist.kwdoc}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.artist.}}\sphinxbfcode{\sphinxupquote{kwdoc}}}{\emph{a}}{}~ \end{fulllineitems} \subsection{matplotlib.artist.ArtistInspector} \label{\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib-artist-artistinspector}}\label{\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector::doc}}\index{ArtistInspector (class in matplotlib.artist)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.artist.}}\sphinxbfcode{\sphinxupquote{ArtistInspector}}}{\emph{o}}{} A helper class to inspect an {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} and return information about it’s settable properties and their current values. Initialize the artist inspector with an {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} or iterable of \sphinxcode{\sphinxupquote{Artists}}. If an iterable is used, we assume it is a homogeneous sequence (all \sphinxcode{\sphinxupquote{Artists}} are of the same type) and it is your responsibility to make sure this is so. \index{\_\_init\_\_() (matplotlib.artist.ArtistInspector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.__init__}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{\_\_init\_\_}}}{\emph{o}}{} Initialize the artist inspector with an {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} or iterable of \sphinxcode{\sphinxupquote{Artists}}. If an iterable is used, we assume it is a homogeneous sequence (all \sphinxcode{\sphinxupquote{Artists}} are of the same type) and it is your responsibility to make sure this is so. \end{fulllineitems} \paragraph{Methods} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.__init__}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{\_\_init\_\_}}}}}(o) & Initialize the artist inspector with an {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} or iterable of \sphinxcode{\sphinxupquote{Artists}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.aliased_name}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{aliased\_name}}}}}(s) & return ‘PROPNAME or alias’ if \sphinxstyleemphasis{s} has an alias, else return PROPNAME. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.aliased_name_rest}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{aliased\_name\_rest}}}}}(s, target) & return ‘PROPNAME or alias’ if \sphinxstyleemphasis{s} has an alias, else return PROPNAME formatted for ReST \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.get_aliases}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_aliases}}}}}() & Get a dict mapping \sphinxstyleemphasis{fullname} -\textgreater{} \sphinxstyleemphasis{alias} for each \sphinxstyleemphasis{alias} in the {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ArtistInspector}}}}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.get_setters}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_setters}}}}}() & Get the attribute strings with setters for object. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.get_valid_values}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_valid\_values}}}}}(attr) & Get the legal arguments for the setter associated with \sphinxstyleemphasis{attr}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.is_alias}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{is\_alias}}}}}(o) & Return \sphinxstyleemphasis{True} if method object \sphinxstyleemphasis{o} is an alias for another function. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.pprint_getters}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pprint\_getters}}}}}() & Return the getters and actual values as list of strings. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.pprint_setters}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pprint\_setters}}}}}({[}prop, leadingspace{]}) & If \sphinxstyleemphasis{prop} is \sphinxstyleemphasis{None}, return a list of strings of all settable properties and their valid values. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.pprint_setters_rest}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pprint\_setters\_rest}}}}}({[}prop, leadingspace{]}) & If \sphinxstyleemphasis{prop} is \sphinxstyleemphasis{None}, return a list of strings of all settable properties and their valid values. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.properties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{properties}}}}}() & return a dictionary mapping property name -\textgreater{} value \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \index{aliased\_name() (matplotlib.artist.ArtistInspector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.aliased_name}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{aliased\_name}}}{\emph{s}}{} return ‘PROPNAME or alias’ if \sphinxstyleemphasis{s} has an alias, else return PROPNAME. e.g., for the line markerfacecolor property, which has an alias, return ‘markerfacecolor or mfc’ and for the transform property, which does not, return ‘transform’ \end{fulllineitems} \index{aliased\_name\_rest() (matplotlib.artist.ArtistInspector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.aliased_name_rest}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{aliased\_name\_rest}}}{\emph{s}, \emph{target}}{} return ‘PROPNAME or alias’ if \sphinxstyleemphasis{s} has an alias, else return PROPNAME formatted for ReST e.g., for the line markerfacecolor property, which has an alias, return ‘markerfacecolor or mfc’ and for the transform property, which does not, return ‘transform’ \end{fulllineitems} \index{get\_aliases() (matplotlib.artist.ArtistInspector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.get_aliases}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_aliases}}}{}{} Get a dict mapping \sphinxstyleemphasis{fullname} -\textgreater{} \sphinxstyleemphasis{alias} for each \sphinxstyleemphasis{alias} in the {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ArtistInspector}}}}}. e.g., for lines: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{markerfacecolor}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{mfc}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linewidth}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lw}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{p}{\PYGZcb{}} \end{sphinxVerbatim} \end{fulllineitems} \index{get\_setters() (matplotlib.artist.ArtistInspector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.get_setters}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_setters}}}{}{} Get the attribute strings with setters for object. e.g., for a line, return \sphinxcode{\sphinxupquote{{[}'markerfacecolor', 'linewidth', ....{]}}}. \end{fulllineitems} \index{get\_valid\_values() (matplotlib.artist.ArtistInspector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.get_valid_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_valid\_values}}}{\emph{attr}}{} Get the legal arguments for the setter associated with \sphinxstyleemphasis{attr}. This is done by querying the docstring of the function \sphinxstyleemphasis{set\_attr} for a line that begins with “ACCEPTS” or “.. ACCEPTS”: e.g., for a line linestyle, return “{[} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'steps'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} {]}” \end{fulllineitems} \index{is\_alias() (matplotlib.artist.ArtistInspector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.is_alias}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_alias}}}{\emph{o}}{} Return \sphinxstyleemphasis{True} if method object \sphinxstyleemphasis{o} is an alias for another function. \end{fulllineitems} \index{pprint\_getters() (matplotlib.artist.ArtistInspector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.pprint_getters}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pprint\_getters}}}{}{} Return the getters and actual values as list of strings. \end{fulllineitems} \index{pprint\_setters() (matplotlib.artist.ArtistInspector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.pprint_setters}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pprint\_setters}}}{\emph{prop=None}, \emph{leadingspace=2}}{} If \sphinxstyleemphasis{prop} is \sphinxstyleemphasis{None}, return a list of strings of all settable properties and their valid values. If \sphinxstyleemphasis{prop} is not \sphinxstyleemphasis{None}, it is a valid property name and that property will be returned as a string of property : valid values. \end{fulllineitems} \index{pprint\_setters\_rest() (matplotlib.artist.ArtistInspector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.pprint_setters_rest}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pprint\_setters\_rest}}}{\emph{prop=None}, \emph{leadingspace=4}}{} If \sphinxstyleemphasis{prop} is \sphinxstyleemphasis{None}, return a list of strings of all settable properties and their valid values. Format the output for ReST If \sphinxstyleemphasis{prop} is not \sphinxstyleemphasis{None}, it is a valid property name and that property will be returned as a string of property : valid values. \end{fulllineitems} \index{properties() (matplotlib.artist.ArtistInspector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.artist.ArtistInspector:matplotlib.artist.ArtistInspector.properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value \end{fulllineitems} \end{fulllineitems} \chapter{\sphinxstyleliteralintitle{\sphinxupquote{Axes}} class} \label{\detokenize{api/axes_api:axes-class}}\label{\detokenize{api/axes_api::doc}}\index{Axes (class in matplotlib.axes)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/axes_api:matplotlib.axes.Axes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.axes.}}\sphinxbfcode{\sphinxupquote{Axes}}}{\emph{fig}, \emph{rect}, \emph{facecolor=None}, \emph{frameon=True}, \emph{sharex=None}, \emph{sharey=None}, \emph{label=''}, \emph{xscale=None}, \emph{yscale=None}, \emph{**kwargs}}{} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} contains most of the figure elements: {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}}, {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Tick}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}}, {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Polygon}}}}}, etc., and sets the coordinate system. The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance supports callbacks through a callbacks attribute which is a {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.CallbackRegistry}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CallbackRegistry}}}}} instance. The events you can connect to are ‘xlim\_changed’ and ‘ylim\_changed’ and the callback will be called with func(\sphinxstyleemphasis{ax}) where \sphinxstyleemphasis{ax} is the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance. \end{fulllineitems} \begin{sphinxShadowBox} \sphinxstyletopictitle{Table of Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{api/axes_api:id1}}{\hyperref[\detokenize{api/axes_api:plotting}]{\sphinxcrossref{Plotting}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{api/axes_api:id2}}{\hyperref[\detokenize{api/axes_api:basic}]{\sphinxcrossref{Basic}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id3}}{\hyperref[\detokenize{api/axes_api:spans}]{\sphinxcrossref{Spans}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id4}}{\hyperref[\detokenize{api/axes_api:spectral}]{\sphinxcrossref{Spectral}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id5}}{\hyperref[\detokenize{api/axes_api:statistics}]{\sphinxcrossref{Statistics}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id6}}{\hyperref[\detokenize{api/axes_api:binned}]{\sphinxcrossref{Binned}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id7}}{\hyperref[\detokenize{api/axes_api:contours}]{\sphinxcrossref{Contours}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id8}}{\hyperref[\detokenize{api/axes_api:array}]{\sphinxcrossref{Array}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id9}}{\hyperref[\detokenize{api/axes_api:unstructured-triangles}]{\sphinxcrossref{Unstructured Triangles}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id10}}{\hyperref[\detokenize{api/axes_api:text-and-annotations}]{\sphinxcrossref{Text and Annotations}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id11}}{\hyperref[\detokenize{api/axes_api:fields}]{\sphinxcrossref{Fields}}} \end{itemize} \item {} \phantomsection\label{\detokenize{api/axes_api:id12}}{\hyperref[\detokenize{api/axes_api:clearing}]{\sphinxcrossref{Clearing}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id13}}{\hyperref[\detokenize{api/axes_api:appearance}]{\sphinxcrossref{Appearance}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id14}}{\hyperref[\detokenize{api/axes_api:property-cycle}]{\sphinxcrossref{Property cycle}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id15}}{\hyperref[\detokenize{api/axes_api:axis-limits}]{\sphinxcrossref{Axis / limits}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{api/axes_api:id16}}{\hyperref[\detokenize{api/axes_api:axis-limits-and-direction}]{\sphinxcrossref{Axis Limits and direction}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id17}}{\hyperref[\detokenize{api/axes_api:axis-labels-title-and-legend}]{\sphinxcrossref{Axis Labels, title, and legend}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id18}}{\hyperref[\detokenize{api/axes_api:axis-scales}]{\sphinxcrossref{Axis scales}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id19}}{\hyperref[\detokenize{api/axes_api:autoscaling-and-margins}]{\sphinxcrossref{Autoscaling and margins}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id20}}{\hyperref[\detokenize{api/axes_api:aspect-ratio}]{\sphinxcrossref{Aspect ratio}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id21}}{\hyperref[\detokenize{api/axes_api:ticks-and-tick-labels}]{\sphinxcrossref{Ticks and tick labels}}} \end{itemize} \item {} \phantomsection\label{\detokenize{api/axes_api:id22}}{\hyperref[\detokenize{api/axes_api:units}]{\sphinxcrossref{Units}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id23}}{\hyperref[\detokenize{api/axes_api:adding-artists}]{\sphinxcrossref{Adding Artists}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id24}}{\hyperref[\detokenize{api/axes_api:twinning}]{\sphinxcrossref{Twinning}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id25}}{\hyperref[\detokenize{api/axes_api:axes-position}]{\sphinxcrossref{Axes Position}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id26}}{\hyperref[\detokenize{api/axes_api:async-event-based}]{\sphinxcrossref{Async/Event based}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id27}}{\hyperref[\detokenize{api/axes_api:interactive}]{\sphinxcrossref{Interactive}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id28}}{\hyperref[\detokenize{api/axes_api:children}]{\sphinxcrossref{Children}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id29}}{\hyperref[\detokenize{api/axes_api:drawing}]{\sphinxcrossref{Drawing}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id30}}{\hyperref[\detokenize{api/axes_api:bulk-property-manipulation}]{\sphinxcrossref{Bulk property manipulation}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id31}}{\hyperref[\detokenize{api/axes_api:general-artist-properties}]{\sphinxcrossref{General Artist Properties}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id32}}{\hyperref[\detokenize{api/axes_api:artist-methods}]{\sphinxcrossref{Artist Methods}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id33}}{\hyperref[\detokenize{api/axes_api:projection}]{\sphinxcrossref{Projection}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id34}}{\hyperref[\detokenize{api/axes_api:other}]{\sphinxcrossref{Other}}} \item {} \phantomsection\label{\detokenize{api/axes_api:id35}}{\hyperref[\detokenize{api/axes_api:inheritance}]{\sphinxcrossref{Inheritance}}} \end{itemize} \end{sphinxShadowBox} \section{Plotting} \label{\detokenize{api/axes_api:plotting}} \subsection{Basic} \label{\detokenize{api/axes_api:basic}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.plot}}}}} & Plot y versus x as lines and/or markers. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.errorbar:matplotlib.axes.Axes.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.errorbar}}}}} & Plot y versus x as lines and/or markers with attached errorbars. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.scatter:matplotlib.axes.Axes.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.scatter}}}}} & A scatter plot of \sphinxstyleemphasis{y} vs \sphinxstyleemphasis{x} with varying marker size and/or color. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot_date:matplotlib.axes.Axes.plot_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.plot\_date}}}}} & Plot data that contains dates. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.step:matplotlib.axes.Axes.step}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.step}}}}} & Make a step plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.loglog:matplotlib.axes.Axes.loglog}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.loglog}}}}} & Make a plot with log scaling on both the x and y axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.semilogx:matplotlib.axes.Axes.semilogx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.semilogx}}}}} & Make a plot with log scaling on the x axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.semilogy:matplotlib.axes.Axes.semilogy}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.semilogy}}}}} & Make a plot with log scaling on the y axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.fill_between:matplotlib.axes.Axes.fill_between}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.fill\_between}}}}} & Fill the area between two horizontal curves. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.fill_betweenx:matplotlib.axes.Axes.fill_betweenx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.fill\_betweenx}}}}} & Fill the area between two vertical curves. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.bar:matplotlib.axes.Axes.bar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.bar}}}}} & Make a bar plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.barh:matplotlib.axes.Axes.barh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.barh}}}}} & Make a horizontal bar plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.stem:matplotlib.axes.Axes.stem}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.stem}}}}} & Create a stem plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.eventplot:matplotlib.axes.Axes.eventplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.eventplot}}}}} & Plot identical parallel lines at the given positions. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.pie:matplotlib.axes.Axes.pie}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.pie}}}}} & Plot a pie chart. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.stackplot:matplotlib.axes.Axes.stackplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.stackplot}}}}} & Draws a stacked area plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.broken_barh:matplotlib.axes.Axes.broken_barh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.broken\_barh}}}}} & Plot a horizontal sequence of rectangles. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.vlines:matplotlib.axes.Axes.vlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.vlines}}}}} & Plot vertical lines. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hlines:matplotlib.axes.Axes.hlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.hlines}}}}} & Plot horizontal lines at each \sphinxstyleemphasis{y} from \sphinxstyleemphasis{xmin} to \sphinxstyleemphasis{xmax}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.fill:matplotlib.axes.Axes.fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.fill}}}}} & Plot filled polygons. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axes.Axes.plot} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib-axes-axes-plot}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.plot::doc}}\index{plot() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{plot}}}{\emph{*args}, \emph{data=None}, \emph{**kwargs}}{} Plot y versus x as lines and/or markers. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{n}{data}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{n}{x2}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt2}\PYG{p}{]}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} The coordinates of the points or line nodes are given by \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}. The optional parameter \sphinxstyleemphasis{fmt} is a convenient way for defining basic formatting like color, marker and linestyle. It’s a shortcut string notation described in the \sphinxstyleemphasis{Notes} section below. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} plot x and y using default line style and color} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bo}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} plot x and y using blue circle markers} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} plot y using x as index array 0..N\PYGZhy{}1} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{y}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r+}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} ditto, but with red plusses} \end{sphinxVerbatim} You can use {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties as keyword arguments for more control on the appearance. Line properties and \sphinxstyleemphasis{fmt} can be mixed. The following two calls yield identical results: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{go\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{markersize}\PYG{o}{=}\PYG{l+m+mi}{12}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{green}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{marker}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{o}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linestyle}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{dashed}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{g+go}{ linewidth=2, markersize=12)} \end{sphinxVerbatim} When conflicting with \sphinxstyleemphasis{fmt}, keyword arguments take precedence. \sphinxstylestrong{Plotting labelled data} There’s a convenient way for plotting objects with labelled data (i.e. data that can be accessed by index \sphinxcode{\sphinxupquote{obj{[}'y'{]}}}). Instead of giving the data in \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}, you can provide the object in the \sphinxstyleemphasis{data} parameter and just give the labels for \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{xlabel}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ylabel}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{data}\PYG{o}{=}\PYG{n}{obj}\PYG{p}{)} \end{sphinxVerbatim} All indexable objects are supported. This could e.g. be a \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#dict}{\sphinxcode{\sphinxupquote{dict}}}, a \sphinxcode{\sphinxupquote{pandas.DataFame}} or a structured numpy array. \sphinxstylestrong{Plotting multiple sets of data} There are various ways to plot multiple sets of data. \begin{itemize} \item {} The most straight forward way is just to call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} multiple times. Example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bo}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x2}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{go}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \item {} Alternatively, if your data is already a 2d array, you can pass it directly to \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}. A separate data set will be drawn for every column. Example: an array \sphinxcode{\sphinxupquote{a}} where the first column represents the \sphinxstyleemphasis{x} values and the other columns are the \sphinxstyleemphasis{y} columns: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{a}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{a}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \item {} The third way is to specify multiple sets of \sphinxstyleemphasis{{[}x{]}}, \sphinxstyleemphasis{y}, \sphinxstyleemphasis{{[}fmt{]}} groups: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g\PYGZca{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{x2}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} In this case, any additional keyword argument applies to all datasets. Also this syntax cannot be combined with the \sphinxstyleemphasis{data} parameter. \end{itemize} By default, each line is assigned a different style specified by a ‘style cycle’. The \sphinxstyleemphasis{fmt} and line property parameters are only necessary if you want explicit deviations from these defaults. Alternatively, you can also change the style cycle using the ‘axes.prop\_cycle’ rcParam. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}array-like or scalar{]} The horizontal / vertical coordinates of the data points. \sphinxstyleemphasis{x} values are optional. If not given, they default to \sphinxcode{\sphinxupquote{{[}0, ..., N-1{]}}}. Commonly, these parameters are arrays of length N. However, scalars are supported as well (equivalent to an array with constant value). The parameters can also be 2-dimensional. Then, the columns represent separate data sets. \item[{\sphinxstylestrong{fmt}}] \leavevmode{[}str, optional{]} A format string, e.g. ‘ro’ for red circles. See the \sphinxstyleemphasis{Notes} section for a full description of the format strings. Format strings are just an abbreviation for quickly setting basic line properties. All of these and more can also be controlled by keyword arguments. \item[{\sphinxstylestrong{data}}] \leavevmode{[}indexable object, optional{]} An object with labelled data. If given, provide the label names to plot in \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. \begin{sphinxadmonition}{note}{Note:} Technically there’s a slight ambiguity in calls where the second label is a valid \sphinxstyleemphasis{fmt}. \sphinxcode{\sphinxupquote{plot('n', 'o', data=obj)}} could be \sphinxcode{\sphinxupquote{plt(x, y)}} or \sphinxcode{\sphinxupquote{plt(y, fmt)}}. In such cases, the former interpretation is chosen, but a warning is issued. You may suppress the warning by adding an empty format string \sphinxcode{\sphinxupquote{plot('n', 'o', '{'}, data=obj)}}. \end{sphinxadmonition} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lines}}] \leavevmode A list of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} objects representing the plotted data. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scalex, scaley}}] \leavevmode{[}bool, optional, default: True{]} These parameters determined if the view limits are adapted to the data limits. The values are passed on to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.autoscale_view:matplotlib.axes.Axes.autoscale_view}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{autoscale\_view}}}}}. \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties, optional{]} \sphinxstyleemphasis{kwargs} are used to specify properties like a line label (for auto legends), linewidth, antialiasing, marker face color. Example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{go\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{line 1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{4}\PYG{p}{,}\PYG{l+m+mi}{9}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{rs}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{line 2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} If you make multiple lines with one plot command, the kwargs apply to all those lines. Here is a list of available {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.scatter:matplotlib.axes.Axes.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter}}}}}}] \leavevmode XY scatter plot with markers of variing size and/or color ( sometimes also called bubble chart). \end{description} \paragraph{Notes} \sphinxstylestrong{Format Strings} A format string consists of a part for color, marker and line: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fmt} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{[color][marker][line]}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} Each of them is optional. If not provided, the value from the style cycle is used. Exception: If \sphinxcode{\sphinxupquote{line}} is given, but no \sphinxcode{\sphinxupquote{marker}}, the data will be a line without markers. \sphinxstylestrong{Colors} The following color abbreviations are supported: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily character &\sphinxstyletheadfamily color \\ \hline \sphinxcode{\sphinxupquote{'b'}} & blue \\ \hline \sphinxcode{\sphinxupquote{'g'}} & green \\ \hline \sphinxcode{\sphinxupquote{'r'}} & red \\ \hline \sphinxcode{\sphinxupquote{'c'}} & cyan \\ \hline \sphinxcode{\sphinxupquote{'m'}} & magenta \\ \hline \sphinxcode{\sphinxupquote{'y'}} & yellow \\ \hline \sphinxcode{\sphinxupquote{'k'}} & black \\ \hline \sphinxcode{\sphinxupquote{'w'}} & white \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} If the color is the only part of the format string, you can additionally use any {\hyperref[\detokenize{api/colors_api:module-matplotlib.colors}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors}}}}} spec, e.g. full names (\sphinxcode{\sphinxupquote{'green'}}) or hex strings (\sphinxcode{\sphinxupquote{'\#008000'}}). \sphinxstylestrong{Markers} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily character &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'.'}} & point marker \\ \hline \sphinxcode{\sphinxupquote{','}} & pixel marker \\ \hline \sphinxcode{\sphinxupquote{'o'}} & circle marker \\ \hline \sphinxcode{\sphinxupquote{'v'}} & triangle\_down marker \\ \hline \sphinxcode{\sphinxupquote{'\textasciicircum{}'}} & triangle\_up marker \\ \hline \sphinxcode{\sphinxupquote{'\textless{}'}} & triangle\_left marker \\ \hline \sphinxcode{\sphinxupquote{'\textgreater{}'}} & triangle\_right marker \\ \hline \sphinxcode{\sphinxupquote{'1'}} & tri\_down marker \\ \hline \sphinxcode{\sphinxupquote{'2'}} & tri\_up marker \\ \hline \sphinxcode{\sphinxupquote{'3'}} & tri\_left marker \\ \hline \sphinxcode{\sphinxupquote{'4'}} & tri\_right marker \\ \hline \sphinxcode{\sphinxupquote{'s'}} & square marker \\ \hline \sphinxcode{\sphinxupquote{'p'}} & pentagon marker \\ \hline \sphinxcode{\sphinxupquote{'*'}} & star marker \\ \hline \sphinxcode{\sphinxupquote{'h'}} & hexagon1 marker \\ \hline \sphinxcode{\sphinxupquote{'H'}} & hexagon2 marker \\ \hline \sphinxcode{\sphinxupquote{'+'}} & plus marker \\ \hline \sphinxcode{\sphinxupquote{'x'}} & x marker \\ \hline \sphinxcode{\sphinxupquote{'D'}} & diamond marker \\ \hline \sphinxcode{\sphinxupquote{'d'}} & thin\_diamond marker \\ \hline \sphinxcode{\sphinxupquote{'\textbar{}'}} & vline marker \\ \hline \sphinxcode{\sphinxupquote{'\_'}} & hline marker \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \sphinxstylestrong{Line Styles} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily character &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} & solid line style \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} & dashed line style \\ \hline \sphinxcode{\sphinxupquote{'-.'}} & dash-dot line style \\ \hline \sphinxcode{\sphinxupquote{':'}} & dotted line style \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Example format strings: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} blue markers with default shape} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ro}\PYG{l+s+s1}{\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} red circles} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} green solid line} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} dashed line with default color} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k\PYGZca{}:}\PYG{l+s+s1}{\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} black triangle\PYGZus{}up markers connected by a dotted line} \end{sphinxVerbatim} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.axes.Axes.plot}}} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:examples-using-matplotlib-axes-axes-plot}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_simple\_plot.py} \end{itemize} \subsubsection{matplotlib.axes.Axes.errorbar} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.errorbar:matplotlib-axes-axes-errorbar}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.errorbar::doc}}\index{errorbar() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.errorbar:matplotlib.axes.Axes.errorbar}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{errorbar}}}{\emph{x}, \emph{y}, \emph{yerr=None}, \emph{xerr=None}, \emph{fmt=''}, \emph{ecolor=None}, \emph{elinewidth=None}, \emph{capsize=None}, \emph{barsabove=False}, \emph{lolims=False}, \emph{uplims=False}, \emph{xlolims=False}, \emph{xuplims=False}, \emph{errorevery=1}, \emph{capthick=None}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Plot y versus x as lines and/or markers with attached errorbars. \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} define the data locations, \sphinxstyleemphasis{xerr}, \sphinxstyleemphasis{yerr} define the errorbar sizes. By default, this draws the data markers/lines as well the errorbars. Use fmt=’none’ to draw errorbars without any data markers. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}scalar or array-like{]} The data positions. \item[{\sphinxstylestrong{xerr, yerr}}] \leavevmode{[}scalar or array-like, shape(N,) or shape(2,N), optional{]} The errorbar sizes: \begin{itemize} \item {} scalar: Symmetric +/- values for all data points. \item {} shape(N,): Symmetric +/-values for each data point. \item {} shape(2,N): Separate + and - values for each data point. \item {} \sphinxstyleemphasis{None}: No errorbar. \end{itemize} \item[{\sphinxstylestrong{fmt}}] \leavevmode{[}plot format string, optional, default: ‘’{]} The format for the data points / data lines. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} for details. Use ‘none’ (case insensitive) to plot errorbars without any data markers. \item[{\sphinxstylestrong{ecolor}}] \leavevmode{[}mpl color, optional, default: None{]} A matplotlib color arg which gives the color the errorbar lines. If None, use the color of the line connecting the markers. \item[{\sphinxstylestrong{elinewidth}}] \leavevmode{[}scalar, optional, default: None{]} The linewidth of the errorbar lines. If None, the linewidth of the current style is used. \item[{\sphinxstylestrong{capsize}}] \leavevmode{[}scalar, optional, default: None{]} The length of the error bar caps in points. If None, it will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"errorbar.capsize"{]}}}. \item[{\sphinxstylestrong{capthick}}] \leavevmode{[}scalar, optional, default: None{]} An alias to the keyword argument \sphinxstyleemphasis{markeredgewidth} (a.k.a. \sphinxstyleemphasis{mew}). This setting is a more sensible name for the property that controls the thickness of the error bar cap in points. For backwards compatibility, if \sphinxstyleemphasis{mew} or \sphinxstyleemphasis{markeredgewidth} are given, then they will over-ride \sphinxstyleemphasis{capthick}. This may change in future releases. \item[{\sphinxstylestrong{barsabove}}] \leavevmode{[}bool, optional, default: False{]} If True, will plot the errorbars above the plot symbols. Default is below. \item[{\sphinxstylestrong{lolims, uplims, xlolims, xuplims}}] \leavevmode{[}bool, optional, default: None{]} These arguments can be used to indicate that a value gives only upper/lower limits. In that case a caret symbol is used to indicate this. \sphinxstyleemphasis{lims}-arguments may be of the same type as \sphinxstyleemphasis{xerr} and \sphinxstyleemphasis{yerr}. To use limits with inverted axes, {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim:matplotlib.axes.Axes.set_xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xlim()}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:matplotlib.axes.Axes.set_ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_ylim()}}}}} must be called before {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.errorbar:matplotlib.axes.Axes.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar()}}}}}. \item[{\sphinxstylestrong{errorevery}}] \leavevmode{[}positive integer, optional, default: 1{]} Subsamples the errorbars. e.g., if errorevery=5, errorbars for every 5-th datapoint will be plotted. The data plot itself still shows all data points. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{:class:{}`\textasciitilde{}.container.ErrorbarContainer{}`}}] \leavevmode The container contains: \begin{itemize} \item {} plotline: {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instance of x, y plot markers and/or line. \item {} caplines: A tuple of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instances of the error bar caps. \item {} barlinecols: A tuple of {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} with the horizontal and vertical error ranges. \end{itemize} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode All other keyword arguments are passed on to the plot command for the markers. For example, this code makes big red squares with thick green edges: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{x}\PYG{p}{,}\PYG{n}{y}\PYG{p}{,}\PYG{n}{yerr} \PYG{o}{=} \PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,}\PYG{l+m+mi}{10}\PYG{p}{)} \PYG{n}{errorbar}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{yerr}\PYG{p}{,} \PYG{n}{marker}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{s}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{mfc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{mec}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{green}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ms}\PYG{o}{=}\PYG{l+m+mi}{20}\PYG{p}{,} \PYG{n}{mew}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxstyleemphasis{mfc}, \sphinxstyleemphasis{mec}, \sphinxstyleemphasis{ms} and \sphinxstyleemphasis{mew} are aliases for the longer property names, \sphinxstyleemphasis{markerfacecolor}, \sphinxstyleemphasis{markeredgecolor}, \sphinxstyleemphasis{markersize} and \sphinxstyleemphasis{markeredgewidth}. Valid kwargs for the marker properties are \sphinxcode{\sphinxupquote{Lines2D}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘xerr’, ‘y’, ‘yerr’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.scatter} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.scatter:matplotlib-axes-axes-scatter}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.scatter::doc}}\index{scatter() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.scatter:matplotlib.axes.Axes.scatter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{scatter}}}{\emph{x}, \emph{y}, \emph{s=None}, \emph{c=None}, \emph{marker=None}, \emph{cmap=None}, \emph{norm=None}, \emph{vmin=None}, \emph{vmax=None}, \emph{alpha=None}, \emph{linewidths=None}, \emph{verts=None}, \emph{edgecolors=None}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} A scatter plot of \sphinxstyleemphasis{y} vs \sphinxstyleemphasis{x} with varying marker size and/or color. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}array\_like, shape (n, ){]} The data positions. \item[{\sphinxstylestrong{s}}] \leavevmode{[}scalar or array\_like, shape (n, ), optional{]} The marker size in points**2. Default is \sphinxcode{\sphinxupquote{rcParams{[}'lines.markersize'{]} ** 2}}. \item[{\sphinxstylestrong{c}}] \leavevmode{[}color, sequence, or sequence of color, optional, default: ‘b’{]} The marker color. Possible values: \begin{itemize} \item {} A single color format string. \item {} A sequence of color specifications of length n. \item {} A sequence of n numbers to be mapped to colors using \sphinxstyleemphasis{cmap} and \sphinxstyleemphasis{norm}. \item {} A 2-D array in which the rows are RGB or RGBA. \end{itemize} Note that \sphinxstyleemphasis{c} should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. If you want to specify the same RGB or RGBA value for all points, use a 2-D array with a single row. \item[{\sphinxstylestrong{marker}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MarkerStyle}}}}}, optional, default: ‘o’{]} The marker style. \sphinxstyleemphasis{marker} can be either an instance of the class or the text shorthand for a particular marker. See {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markers}}}}} for more information marker styles. \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}}, optional, default: None{]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}} instance or registered colormap name. \sphinxstyleemphasis{cmap} is only used if \sphinxstyleemphasis{c} is an array of floats. If \sphinxcode{\sphinxupquote{None}}, defaults to rc \sphinxcode{\sphinxupquote{image.cmap}}. \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}, optional, default: None{]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} instance is used to scale luminance data to 0, 1. \sphinxstyleemphasis{norm} is only used if \sphinxstyleemphasis{c} is an array of floats. If \sphinxstyleemphasis{None}, use the default {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colors.Normalize}}}}}. \item[{\sphinxstylestrong{vmin, vmax}}] \leavevmode{[}scalar, optional, default: None{]} \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} are used in conjunction with \sphinxstyleemphasis{norm} to normalize luminance data. If None, the respective min and max of the color array is used. \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} are ignored if you pass a \sphinxstyleemphasis{norm} instance. \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}scalar, optional, default: None{]} The alpha blending value, between 0 (transparent) and 1 (opaque). \item[{\sphinxstylestrong{linewidths}}] \leavevmode{[}scalar or array\_like, optional, default: None{]} The linewidth of the marker edges. Note: The default \sphinxstyleemphasis{edgecolors} is ‘face’. You may want to change this as well. If \sphinxstyleemphasis{None}, defaults to rcParams \sphinxcode{\sphinxupquote{lines.linewidth}}. \item[{\sphinxstylestrong{verts}}] \leavevmode{[}sequence of (x, y), optional{]} If \sphinxstyleemphasis{marker} is \sphinxstyleemphasis{None}, these vertices will be used to construct the marker. The center of the marker is located at (0, 0) in normalized units. The overall marker is rescaled by \sphinxstyleemphasis{s}. \item[{\sphinxstylestrong{edgecolors}}] \leavevmode{[}color or sequence of color, optional, default: ‘face’{]} The edge color of the marker. Possible values: \begin{itemize} \item {} ‘face’: The edge color will always be the same as the face color. \item {} ‘none’: No patch boundary will be drawn. \item {} A matplotib color. \end{itemize} For non-filled markers, the \sphinxstyleemphasis{edgecolors} kwarg is ignored and forced to ‘face’ internally. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{paths}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.PathCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathCollection}}}}}{]} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Collection}}}}} properties{]} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}}] \leavevmode To plot scatter plots when markers are identical in size and color. \end{description} \paragraph{Notes} \begin{itemize} \item {} The {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} function will be faster for scatterplots where markers don’t vary in size or color. \item {} Any or all of \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}, \sphinxstyleemphasis{s}, and \sphinxstyleemphasis{c} may be masked arrays, in which case all masks will be combined and only unmasked points will be plotted. \item {} Fundamentally, scatter works with 1-D arrays; \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}, \sphinxstyleemphasis{s}, and \sphinxstyleemphasis{c} may be input as 2-D arrays, but within scatter they will be flattened. The exception is \sphinxstyleemphasis{c}, which will be flattened only if its size matches the size of \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. \end{itemize} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘c’, ‘color’, ‘edgecolors’, ‘facecolor’, ‘facecolors’, ‘linewidths’, ‘s’, ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.axes.Axes.scatter}}} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.scatter:examples-using-matplotlib-axes-axes-scatter}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_scatter.py} \end{itemize} \subsubsection{matplotlib.axes.Axes.plot\_date} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.plot_date:matplotlib-axes-axes-plot-date}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.plot_date::doc}}\index{plot\_date() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.plot_date:matplotlib.axes.Axes.plot_date}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{plot\_date}}}{\emph{x}, \emph{y}, \emph{fmt='o'}, \emph{tz=None}, \emph{xdate=True}, \emph{ydate=False}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Plot data that contains dates. Similar to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}, this plots \sphinxstyleemphasis{y} vs. \sphinxstyleemphasis{x} as lines or markers. However, the axis labels are formatted as dates depending on \sphinxstyleemphasis{xdate} and \sphinxstyleemphasis{ydate}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}array-like{]} The coordinates of the data points. If \sphinxstyleemphasis{xdate} or \sphinxstyleemphasis{ydate} is \sphinxstyleemphasis{True}, the respective values \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} are interpreted as {\hyperref[\detokenize{api/dates_api:date-format}]{\sphinxcrossref{\DUrole{std,std-ref}{Matplotlib dates}}}}. \item[{\sphinxstylestrong{fmt}}] \leavevmode{[}str, optional{]} The plot format string. For details, see the corresponding parameter in {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}. \item[{\sphinxstylestrong{tz}}] \leavevmode{[}{[} \sphinxstyleemphasis{None} \textbar{} timezone string \textbar{} \sphinxcode{\sphinxupquote{tzinfo}} instance{]}{]} The time zone to use in labeling dates. If \sphinxstyleemphasis{None}, defaults to rcParam \sphinxcode{\sphinxupquote{timezone}}. \item[{\sphinxstylestrong{xdate}}] \leavevmode{[}bool, optional, default: True{]} If \sphinxstyleemphasis{True}, the \sphinxstyleemphasis{x}-axis will be interpreted as Matplotlib dates. \item[{\sphinxstylestrong{ydate}}] \leavevmode{[}bool, optional, default: False{]} If \sphinxstyleemphasis{True}, the \sphinxstyleemphasis{y}-axis will be interpreted as Matplotlib dates. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lines}}] \leavevmode A list of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} objects representing the plotted data. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode Keyword arguments control the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/dates_api:module-matplotlib.dates}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates}}}}}}] \leavevmode Helper functions on dates. \item[{{\hyperref[\detokenize{api/dates_api:matplotlib.dates.date2num}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.date2num}}}}}}] \leavevmode Convert dates to num. \item[{{\hyperref[\detokenize{api/dates_api:matplotlib.dates.num2date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.num2date}}}}}}] \leavevmode Convert num to dates. \item[{{\hyperref[\detokenize{api/dates_api:matplotlib.dates.drange}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.drange}}}}}}] \leavevmode Create an equally spaced sequence of dates. \end{description} \paragraph{Notes} If you are using custom date tickers and formatters, it may be necessary to set the formatters/locators after the call to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot_date:matplotlib.axes.Axes.plot_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot\_date}}}}}. {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot_date:matplotlib.axes.Axes.plot_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot\_date}}}}} will set the default tick locator to {\hyperref[\detokenize{api/dates_api:matplotlib.dates.AutoDateLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AutoDateLocator}}}}} (if the tick locator is not already set to a {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{DateLocator}}}}} instance) and the default tick formatter to {\hyperref[\detokenize{api/dates_api:matplotlib.dates.AutoDateFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AutoDateFormatter}}}}} (if the tick formatter is not already set to a {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{DateFormatter}}}}} instance). \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.step} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.step:matplotlib-axes-axes-step}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.step::doc}}\index{step() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.step:matplotlib.axes.Axes.step}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{step}}}{\emph{x}, \emph{y}, \emph{*args}, \emph{data=None}, \emph{**kwargs}}{} Make a step plot. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{step}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{data}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{where}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{pre}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{step}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{n}{x2}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt2}\PYG{p}{]}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{where}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{pre}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} This is just a thin wrapper around {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} which changes some formatting options. Most of the concepts and parameters of plot can be used here as well. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}array\_like{]} 1-D sequence of x positions. It is assumed, but not checked, that it is uniformly increasing. \item[{\sphinxstylestrong{y}}] \leavevmode{[}array\_like{]} 1-D sequence of y levels. \item[{\sphinxstylestrong{fmt}}] \leavevmode{[}str, optional{]} A format string, e.g. ‘g’ for a green line. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} for a more detailed description. Note: While full format strings are accepted, it is recommended to only specify the color. Line styles are currently ignored (use the keyword argument \sphinxstyleemphasis{linestyle} instead). Markers are accepted and plotted on the given positions, however, this is a rarely needed feature for step plots. \item[{\sphinxstylestrong{data}}] \leavevmode{[}indexable object, optional{]} An object with labelled data. If given, provide the label names to plot in \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. \item[{\sphinxstylestrong{where}}] \leavevmode{[}\{‘pre’, ‘post’, ‘mid’\}, optional, default ‘pre’{]} Define where the steps should be placed: \begin{itemize} \item {} ‘pre’: The y value is continued constantly to the left from every \sphinxstyleemphasis{x} position, i.e. the interval \sphinxcode{\sphinxupquote{(x{[}i-1{]}, x{[}i{]}{]}}} has the value \sphinxcode{\sphinxupquote{y{[}i{]}}}. \item {} ‘post’: The y value is continued constantly to the right from every \sphinxstyleemphasis{x} position, i.e. the interval \sphinxcode{\sphinxupquote{{[}x{[}i{]}, x{[}i+1{]})}} has the value \sphinxcode{\sphinxupquote{y{[}i{]}}}. \item {} ‘mid’: Steps occur half-way between the \sphinxstyleemphasis{x} positions. \end{itemize} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lines}}] \leavevmode A list of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} objects representing the plotted data. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode Additional parameters are the same as those for {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}. \end{description} \end{description}\end{quote} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.loglog} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.loglog:matplotlib-axes-axes-loglog}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.loglog::doc}}\index{loglog() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.loglog:matplotlib.axes.Axes.loglog}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{loglog}}}{\emph{*args}, \emph{**kwargs}}{} Make a plot with log scaling on both the x and y axis. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{loglog}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{n}{data}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{loglog}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{n}{x2}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt2}\PYG{p}{]}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} This is just a thin wrapper around {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} which additionally changes both the x-axis and the y-axis to log scaling. All of the concepts and parameters of plot can be used here as well. The additional parameters \sphinxstyleemphasis{basex/y}, \sphinxstyleemphasis{subsx/y} and \sphinxstyleemphasis{nonposx/y} control the x/y-axis properties. They are just forwarded to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xscale:matplotlib.axes.Axes.set_xscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_xscale}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yscale:matplotlib.axes.Axes.set_yscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_yscale}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{basex, basey}}] \leavevmode{[}scalar, optional, default 10{]} Base of the x/y logarithm. \item[{\sphinxstylestrong{subsx, subsy}}] \leavevmode{[}sequence, optional{]} The location of the minor x/y ticks. If \sphinxstyleemphasis{None}, reasonable locations are automatically chosen depending on the number of decades in the plot. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xscale:matplotlib.axes.Axes.set_xscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_xscale}}}}} / {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yscale:matplotlib.axes.Axes.set_yscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_yscale}}}}} for details. \item[{\sphinxstylestrong{nonposx, nonposy}}] \leavevmode{[}\{‘mask’, ‘clip’\}, optional, default ‘mask’{]} Non-positive values in x or y can be masked as invalid, or clipped to a very small positive number. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lines}}] \leavevmode A list of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} objects representing the plotted data. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode All parameters supported by {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.semilogx} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.semilogx:matplotlib-axes-axes-semilogx}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.semilogx::doc}}\index{semilogx() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.semilogx:matplotlib.axes.Axes.semilogx}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{semilogx}}}{\emph{*args}, \emph{**kwargs}}{} Make a plot with log scaling on the x axis. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{semilogx}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{n}{data}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{semilogx}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{n}{x2}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt2}\PYG{p}{]}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} This is just a thin wrapper around {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} which additionally changes the x-axis to log scaling. All of the concepts and parameters of plot can be used here as well. The additional parameters \sphinxstyleemphasis{basex}, \sphinxstyleemphasis{subsx} and \sphinxstyleemphasis{nonposx} control the x-axis properties. They are just forwarded to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xscale:matplotlib.axes.Axes.set_xscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_xscale}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{basex}}] \leavevmode{[}scalar, optional, default 10{]} Base of the x logarithm. \item[{\sphinxstylestrong{subsx}}] \leavevmode{[}array\_like, optional{]} The location of the minor xticks. If \sphinxstyleemphasis{None}, reasonable locations are automatically chosen depending on the number of decades in the plot. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xscale:matplotlib.axes.Axes.set_xscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_xscale}}}}} for details. \item[{\sphinxstylestrong{nonposx}}] \leavevmode{[}\{‘mask’, ‘clip’\}, optional, default ‘mask’{]} Non-positive values in x can be masked as invalid, or clipped to a very small positive number. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lines}}] \leavevmode A list of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} objects representing the plotted data. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode All parameters supported by {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.semilogy} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.semilogy:matplotlib-axes-axes-semilogy}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.semilogy::doc}}\index{semilogy() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.semilogy:matplotlib.axes.Axes.semilogy}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{semilogy}}}{\emph{*args}, \emph{**kwargs}}{} Make a plot with log scaling on the y axis. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{semilogy}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{n}{data}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{semilogy}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{n}{x2}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt2}\PYG{p}{]}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} This is just a thin wrapper around {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} which additionally changes the y-axis to log scaling. All of the concepts and parameters of plot can be used here as well. The additional parameters \sphinxstyleemphasis{basey}, \sphinxstyleemphasis{subsy} and \sphinxstyleemphasis{nonposy} control the y-axis properties. They are just forwarded to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yscale:matplotlib.axes.Axes.set_yscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_yscale}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{basey}}] \leavevmode{[}scalar, optional, default 10{]} Base of the y logarithm. \item[{\sphinxstylestrong{subsy}}] \leavevmode{[}array\_like, optional{]} The location of the minor yticks. If \sphinxstyleemphasis{None}, reasonable locations are automatically chosen depending on the number of decades in the plot. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yscale:matplotlib.axes.Axes.set_yscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_yscale}}}}} for details. \item[{\sphinxstylestrong{nonposy}}] \leavevmode{[}\{‘mask’, ‘clip’\}, optional, default ‘mask’{]} Non-positive values in y can be masked as invalid, or clipped to a very small positive number. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lines}}] \leavevmode A list of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} objects representing the plotted data. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode All parameters supported by {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.fill\_between} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.fill_between:matplotlib-axes-axes-fill-between}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.fill_between::doc}}\index{fill\_between() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.fill_between:matplotlib.axes.Axes.fill_between}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{fill\_between}}}{\emph{x}, \emph{y1}, \emph{y2=0}, \emph{where=None}, \emph{interpolate=False}, \emph{step=None}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Fill the area between two horizontal curves. The curves are defined by the points (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y1}) and (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y2}). This creates one or multiple polygons describing the filled area. You may exclude some horizontal sections from filling using \sphinxstyleemphasis{where}. By default, the edges connect the given points directly. Use \sphinxstyleemphasis{step} if the filling should be a step function, i.e. constant in between \sphinxstyleemphasis{x}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}array (length N){]} The x coordinates of the nodes defining the curves. \item[{\sphinxstylestrong{y1}}] \leavevmode{[}array (length N) or scalar{]} The y coordinates of the nodes defining the first curve. \item[{\sphinxstylestrong{y2}}] \leavevmode{[}array (length N) or scalar, optional, default: 0{]} The y coordinates of the nodes defining the second curve. \item[{\sphinxstylestrong{where}}] \leavevmode{[}array of bool (length N), optional, default: None{]} Define \sphinxstyleemphasis{where} to exclude some horizontal regions from being filled. The filled regions are defined by the coordinates \sphinxcode{\sphinxupquote{x{[}where{]}}}. More precisely, fill between \sphinxcode{\sphinxupquote{x{[}i{]}}} and \sphinxcode{\sphinxupquote{x{[}i+1{]}}} if \sphinxcode{\sphinxupquote{where{[}i{]} and where{[}i+1{]}}}. Note that this definition implies that an isolated \sphinxstyleemphasis{True} value between two \sphinxstyleemphasis{False} values in \sphinxstyleemphasis{where} will not result in filling. Both sides of the \sphinxstyleemphasis{True} position remain unfilled due to the adjacent \sphinxstyleemphasis{False} values. \item[{\sphinxstylestrong{interpolate}}] \leavevmode{[}bool, optional{]} This option is only relvant if \sphinxstyleemphasis{where} is used and the two curves are crossing each other. Semantically, \sphinxstyleemphasis{where} is often used for \sphinxstyleemphasis{y1} \textgreater{} \sphinxstyleemphasis{y2} or similar. By default, the nodes of the polygon defining the filled region will only be placed at the positions in the \sphinxstyleemphasis{x} array. Such a polygon cannot describe the above semantics close to the intersection. The x-sections containing the intersecion are simply clipped. Setting \sphinxstyleemphasis{interpolate} to \sphinxstyleemphasis{True} will calculate the actual interscection point and extend the filled region up to this point. \item[{\sphinxstylestrong{step}}] \leavevmode{[}\{‘pre’, ‘post’, ‘mid’\}, optional{]} Define \sphinxstyleemphasis{step} if the filling should be a step function, i.e. constant in between \sphinxstyleemphasis{x}. The value determines where the step will occur: \begin{itemize} \item {} ‘pre’: The y value is continued constantly to the left from every \sphinxstyleemphasis{x} position, i.e. the interval \sphinxcode{\sphinxupquote{(x{[}i-1{]}, x{[}i{]}{]}}} has the value \sphinxcode{\sphinxupquote{y{[}i{]}}}. \item {} ‘post’: The y value is continued constantly to the right from every \sphinxstyleemphasis{x} position, i.e. the interval \sphinxcode{\sphinxupquote{{[}x{[}i{]}, x{[}i+1{]})}} has the value \sphinxcode{\sphinxupquote{y{[}i{]}}}. \item {} ‘mid’: Steps occur half-way between the \sphinxstyleemphasis{x} positions. \end{itemize} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{{}`.PolyCollection{}`}}] \leavevmode A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} containing the plotted polygons. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode All other keyword arguments are passed on to {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}}. They control the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Polygon}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or antialiaseds & Boolean or sequence of booleans \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{array}}}}} & ndarray \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}} & a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cmap}}}}} & a colormap or registered colormap name \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color arg or sequence of rgba tuples \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or edgecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or facecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or dashes or linestyles & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or linewidths or lw & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_norm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{norm}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offset\_position}}}}} & {[} ‘screen’ \textbar{} ‘data’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offsets}}}}} & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_urls}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{urls}}}}} & List{[}str{]} or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.fill_betweenx:matplotlib.axes.Axes.fill_betweenx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill\_betweenx}}}}}}] \leavevmode Fill between two sets of x-values. \end{description} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘where’, ‘x’, ‘y1’, ‘y2’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.fill\_betweenx} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.fill_betweenx:matplotlib-axes-axes-fill-betweenx}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.fill_betweenx::doc}}\index{fill\_betweenx() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.fill_betweenx:matplotlib.axes.Axes.fill_betweenx}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{fill\_betweenx}}}{\emph{y}, \emph{x1}, \emph{x2=0}, \emph{where=None}, \emph{step=None}, \emph{interpolate=False}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Fill the area between two vertical curves. The curves are defined by the points (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y}) and (\sphinxstyleemphasis{x2}, \sphinxstyleemphasis{y}). This creates one or multiple polygons describing the filled area. You may exclude some vertical sections from filling using \sphinxstyleemphasis{where}. By default, the edges connect the given points directly. Use \sphinxstyleemphasis{step} if the filling should be a step function, i.e. constant in between \sphinxstyleemphasis{y}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{y}}] \leavevmode{[}array (length N){]} The y coordinates of the nodes defining the curves. \item[{\sphinxstylestrong{x1}}] \leavevmode{[}array (length N) or scalar{]} The x coordinates of the nodes defining the first curve. \item[{\sphinxstylestrong{x2}}] \leavevmode{[}array (length N) or scalar, optional, default: 0{]} The x coordinates of the nodes defining the second curve. \item[{\sphinxstylestrong{where}}] \leavevmode{[}array of bool (length N), optional, default: None{]} Define \sphinxstyleemphasis{where} to exclude some vertical regions from being filled. The filled regions are defined by the coordinates \sphinxcode{\sphinxupquote{y{[}where{]}}}. More precisely, fill between \sphinxcode{\sphinxupquote{y{[}i{]}}} and \sphinxcode{\sphinxupquote{y{[}i+1{]}}} if \sphinxcode{\sphinxupquote{where{[}i{]} and where{[}i+1{]}}}. Note that this definition implies that an isolated \sphinxstyleemphasis{True} value between two \sphinxstyleemphasis{False} values in \sphinxstyleemphasis{where} will not result in filling. Both sides of the \sphinxstyleemphasis{True} position remain unfilled due to the adjacent \sphinxstyleemphasis{False} values. \item[{\sphinxstylestrong{interpolate}}] \leavevmode{[}bool, optional{]} This option is only relvant if \sphinxstyleemphasis{where} is used and the two curves are crossing each other. Semantically, \sphinxstyleemphasis{where} is often used for \sphinxstyleemphasis{x1} \textgreater{} \sphinxstyleemphasis{x2} or similar. By default, the nodes of the polygon defining the filled region will only be placed at the positions in the \sphinxstyleemphasis{y} array. Such a polygon cannot describe the above semantics close to the intersection. The y-sections containing the intersecion are simply clipped. Setting \sphinxstyleemphasis{interpolate} to \sphinxstyleemphasis{True} will calculate the actual interscection point and extend the filled region up to this point. \item[{\sphinxstylestrong{step}}] \leavevmode{[}\{‘pre’, ‘post’, ‘mid’\}, optional{]} Define \sphinxstyleemphasis{step} if the filling should be a step function, i.e. constant in between \sphinxstyleemphasis{y}. The value determines where the step will occur: \begin{itemize} \item {} ‘pre’: The y value is continued constantly to the left from every \sphinxstyleemphasis{x} position, i.e. the interval \sphinxcode{\sphinxupquote{(x{[}i-1{]}, x{[}i{]}{]}}} has the value \sphinxcode{\sphinxupquote{y{[}i{]}}}. \item {} ‘post’: The y value is continued constantly to the right from every \sphinxstyleemphasis{x} position, i.e. the interval \sphinxcode{\sphinxupquote{{[}x{[}i{]}, x{[}i+1{]})}} has the value \sphinxcode{\sphinxupquote{y{[}i{]}}}. \item {} ‘mid’: Steps occur half-way between the \sphinxstyleemphasis{x} positions. \end{itemize} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{{}`.PolyCollection{}`}}] \leavevmode A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} containing the plotted polygons. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode All other keyword arguments are passed on to {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}}. They control the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Polygon}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or antialiaseds & Boolean or sequence of booleans \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{array}}}}} & ndarray \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}} & a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cmap}}}}} & a colormap or registered colormap name \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color arg or sequence of rgba tuples \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or edgecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or facecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or dashes or linestyles & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or linewidths or lw & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_norm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{norm}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offset\_position}}}}} & {[} ‘screen’ \textbar{} ‘data’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offsets}}}}} & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_urls}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{urls}}}}} & List{[}str{]} or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.fill_between:matplotlib.axes.Axes.fill_between}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill\_between}}}}}}] \leavevmode Fill between two sets of y-values. \end{description} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘where’, ‘x1’, ‘x2’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.bar} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.bar:matplotlib-axes-axes-bar}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.bar::doc}}\index{bar() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.bar:matplotlib.axes.Axes.bar}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{bar}}}{\emph{*args}, \emph{data=None}, \emph{**kwargs}}{} Make a bar plot. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{bar}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{align}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{bar}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{align}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{bar}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{n}{bottom}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{align}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} The bars are positioned at \sphinxstyleemphasis{x} with the given \sphinxstyleemphasis{align} ment. Their dimensions are given by \sphinxstyleemphasis{width} and \sphinxstyleemphasis{height}. The vertical baseline is \sphinxstyleemphasis{bottom} (default 0). Each of \sphinxstyleemphasis{x}, \sphinxstyleemphasis{height}, \sphinxstyleemphasis{width}, and \sphinxstyleemphasis{bottom} may either be a scalar applying to all bars, or it may be a sequence of length N providing a separate value for each bar. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}sequence of scalars{]} The x coordinates of the bars. See also \sphinxstyleemphasis{align} for the alignment of the bars to the coordinates. \item[{\sphinxstylestrong{height}}] \leavevmode{[}scalar or sequence of scalars{]} The height(s) of the bars. \item[{\sphinxstylestrong{width}}] \leavevmode{[}scalar or array-like, optional{]} The width(s) of the bars (default: 0.8). \item[{\sphinxstylestrong{bottom}}] \leavevmode{[}scalar or array-like, optional{]} The y coordinate(s) of the bars bases (default: 0). \item[{\sphinxstylestrong{align}}] \leavevmode{[}\{‘center’, ‘edge’\}, optional, default: ‘center’{]} Alignment of the bars to the \sphinxstyleemphasis{x} coordinates: \begin{itemize} \item {} ‘center’: Center the base on the \sphinxstyleemphasis{x} positions. \item {} ‘edge’: Align the left edges of the bars with the \sphinxstyleemphasis{x} positions. \end{itemize} To align the bars on the right edge pass a negative \sphinxstyleemphasis{width} and \sphinxcode{\sphinxupquote{align='edge'}}. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{{}`.BarContainer{}`}}] \leavevmode Container with all the bars and optionally errorbars. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{color}}] \leavevmode{[}scalar or array-like, optional{]} The colors of the bar faces. \item[{\sphinxstylestrong{edgecolor}}] \leavevmode{[}scalar or array-like, optional{]} The colors of the bar edges. \item[{\sphinxstylestrong{linewidth}}] \leavevmode{[}scalar or array-like, optional{]} Width of the bar edge(s). If 0, don’t draw edges. \item[{\sphinxstylestrong{tick\_label}}] \leavevmode{[}string or array-like, optional{]} The tick labels of the bars. Default: None (Use default numeric labels.) \item[{\sphinxstylestrong{xerr, yerr}}] \leavevmode{[}scalar or array-like of shape(N,) or shape(2,N), optional{]} If not \sphinxstyleemphasis{None}, add horizontal / vertical errorbars to the bar tips. The values are +/- sizes relative to the data: \begin{itemize} \item {} scalar: symmetric +/- values for all bars \item {} shape(N,): symmetric +/- values for each bar \item {} shape(2,N): separate + and - values for each bar \end{itemize} Default: None \item[{\sphinxstylestrong{ecolor}}] \leavevmode{[}scalar or array-like, optional, default: ‘black’{]} The line color of the errorbars. \item[{\sphinxstylestrong{capsize}}] \leavevmode{[}scalar, optional{]} The length of the error bar caps in points. Default: None, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"errorbar.capsize"{]}}}. \item[{\sphinxstylestrong{error\_kw}}] \leavevmode{[}dict, optional{]} Dictionary of kwargs to be passed to the {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.errorbar:matplotlib.axes.Axes.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar}}}}} method. Values of \sphinxstyleemphasis{ecolor} or \sphinxstyleemphasis{capsize} defined here take precedence over the independent kwargs. \item[{\sphinxstylestrong{log}}] \leavevmode{[}bool, optional, default: False{]} If \sphinxstyleemphasis{True}, set the y-axis to be log scale. \item[{\sphinxstylestrong{orientation}}] \leavevmode{[}\{‘vertical’, ‘horizontal’\}, optional{]} \sphinxstyleemphasis{This is for internal use only.} Please use {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.barh:matplotlib.axes.Axes.barh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{barh}}}}} for horizontal bar plots. Default: ‘vertical’. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.barh:matplotlib.axes.Axes.barh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{barh}}}}}}] \leavevmode Plot a horizontal bar plot. \end{description} \paragraph{Notes} The optional arguments \sphinxstyleemphasis{color}, \sphinxstyleemphasis{edgecolor}, \sphinxstyleemphasis{linewidth}, \sphinxstyleemphasis{xerr}, and \sphinxstyleemphasis{yerr} can be either scalars or sequences of length equal to the number of bars. This enables you to use bar as the basis for stacked bar charts, or candlestick plots. Detail: \sphinxstyleemphasis{xerr} and \sphinxstyleemphasis{yerr} are passed directly to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.errorbar:matplotlib.axes.Axes.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar()}}}}}, so they can also have shape 2xN for independent specification of lower and upper errors. Other optional kwargs: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘bottom’, ‘color’, ‘ecolor’, ‘edgecolor’, ‘height’, ‘left’, ‘linewidth’, ‘tick\_label’, ‘width’, ‘x’, ‘xerr’, ‘y’, ‘yerr’. \item {} All positional arguments. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.barh} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.barh:matplotlib-axes-axes-barh}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.barh::doc}}\index{barh() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.barh:matplotlib.axes.Axes.barh}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{barh}}}{\emph{*args}, \emph{**kwargs}}{} Make a horizontal bar plot. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{bar}\PYG{p}{(}\PYG{n}{y}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{align}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{bar}\PYG{p}{(}\PYG{n}{y}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{align}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{bar}\PYG{p}{(}\PYG{n}{y}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{n}{left}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{align}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} The bars are positioned at \sphinxstyleemphasis{y} with the given \sphinxstyleemphasis{align}. Their dimensions are given by \sphinxstyleemphasis{width} and \sphinxstyleemphasis{height}. The horizontal baseline is \sphinxstyleemphasis{left} (default 0). Each of \sphinxstyleemphasis{y}, \sphinxstyleemphasis{width}, \sphinxstyleemphasis{height}, and \sphinxstyleemphasis{left} may either be a scalar applying to all bars, or it may be a sequence of length N providing a separate value for each bar. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar or array-like{]} The y coordinates of the bars. See also \sphinxstyleemphasis{align} for the alignment of the bars to the coordinates. \item[{\sphinxstylestrong{width}}] \leavevmode{[}scalar or array-like{]} The width(s) of the bars. \item[{\sphinxstylestrong{height}}] \leavevmode{[}sequence of scalars, optional, default: 0.8{]} The heights of the bars. \item[{\sphinxstylestrong{left}}] \leavevmode{[}sequence of scalars{]} The x coordinates of the left sides of the bars (default: 0). \item[{\sphinxstylestrong{align}}] \leavevmode{[}\{‘center’, ‘edge’\}, optional, default: ‘center’{]} Alignment of the base to the \sphinxstyleemphasis{y} coordinates*: \begin{itemize} \item {} ‘center’: Center the bars on the \sphinxstyleemphasis{y} positions. \item {} ‘edge’: Align the bottom edges of the bars with the \sphinxstyleemphasis{y} positions. \end{itemize} To align the bars on the top edge pass a negative \sphinxstyleemphasis{height} and \sphinxcode{\sphinxupquote{align='edge'}}. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{{}`.BarContainer{}`}}] \leavevmode Container with all the bars and optionally errorbars. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{color}}] \leavevmode{[}scalar or array-like, optional{]} The colors of the bar faces. \item[{\sphinxstylestrong{edgecolor}}] \leavevmode{[}scalar or array-like, optional{]} The colors of the bar edges. \item[{\sphinxstylestrong{linewidth}}] \leavevmode{[}scalar or array-like, optional{]} Width of the bar edge(s). If 0, don’t draw edges. \item[{\sphinxstylestrong{tick\_label}}] \leavevmode{[}string or array-like, optional{]} The tick labels of the bars. Default: None (Use default numeric labels.) \item[{\sphinxstylestrong{xerr, yerr}}] \leavevmode{[}scalar or array-like of shape(N,) or shape(2,N), optional{]} If not \sphinxcode{\sphinxupquote{None}}, add horizontal / vertical errorbars to the bar tips. The values are +/- sizes relative to the data: \begin{itemize} \item {} scalar: symmetric +/- values for all bars \item {} shape(N,): symmetric +/- values for each bar \item {} shape(2,N): separate + and - values for each bar \end{itemize} Default: None \item[{\sphinxstylestrong{ecolor}}] \leavevmode{[}scalar or array-like, optional, default: ‘black’{]} The line color of the errorbars. \item[{\sphinxstylestrong{capsize}}] \leavevmode{[}scalar, optional{]} The length of the error bar caps in points. Default: None, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"errorbar.capsize"{]}}}. \item[{\sphinxstylestrong{error\_kw}}] \leavevmode{[}dict, optional{]} Dictionary of kwargs to be passed to the {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.errorbar:matplotlib.axes.Axes.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar}}}}} method. Values of \sphinxstyleemphasis{ecolor} or \sphinxstyleemphasis{capsize} defined here take precedence over the independent kwargs. \item[{\sphinxstylestrong{log}}] \leavevmode{[}bool, optional, default: False{]} If \sphinxcode{\sphinxupquote{True}}, set the x-axis to be log scale. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.bar:matplotlib.axes.Axes.bar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bar}}}}}}] \leavevmode Plot a vertical bar plot. \end{description} \paragraph{Notes} The optional arguments \sphinxstyleemphasis{color}, \sphinxstyleemphasis{edgecolor}, \sphinxstyleemphasis{linewidth}, \sphinxstyleemphasis{xerr}, and \sphinxstyleemphasis{yerr} can be either scalars or sequences of length equal to the number of bars. This enables you to use bar as the basis for stacked bar charts, or candlestick plots. Detail: \sphinxstyleemphasis{xerr} and \sphinxstyleemphasis{yerr} are passed directly to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.errorbar:matplotlib.axes.Axes.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar()}}}}}, so they can also have shape 2xN for independent specification of lower and upper errors. Other optional kwargs: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.stem} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.stem:matplotlib-axes-axes-stem}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.stem::doc}}\index{stem() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.stem:matplotlib.axes.Axes.stem}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{stem}}}{\emph{*args}, \emph{data=None}, \emph{**kwargs}}{} Create a stem plot. A stem plot plots vertical lines at each \sphinxstyleemphasis{x} location from the baseline to \sphinxstyleemphasis{y}, and places a marker there. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{stem}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{,}\PYG{p}{]} \PYG{n}{y}\PYG{p}{,} \PYG{n}{linefmt}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{markerfmt}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{basefmt}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)} \end{sphinxVerbatim} The x-positions are optional. The formats may be provided either as positional or as keyword-arguments. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}array-like, optional{]} The x-positions of the stems. Default: (0, 1, …, len(y) - 1). \item[{\sphinxstylestrong{y}}] \leavevmode{[}array-like{]} The y-values of the stem heads. \item[{\sphinxstylestrong{linefmt}}] \leavevmode{[}str, optional{]} A string defining the properties of the vertical lines. Usually, this will be a color or a color and a linestyle: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Character &\sphinxstyletheadfamily Line Style \\ \hline \sphinxcode{\sphinxupquote{'-'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} & dash-dot line \\ \hline \sphinxcode{\sphinxupquote{':'}} & dotted line \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Default: ‘C0-‘, i.e. solid line with the first color of the color cycle. Note: While it is technically possible to specify valid formats other than color or color and linestyle (e.g. ‘rx’ or ‘-.’), this is beyond the intention of the method and will most likely not result in a reasonable reasonable plot. \item[{\sphinxstylestrong{markerfmt}}] \leavevmode{[}str, optional{]} A string defining the properties of the markers at the stem heads. Default: ‘C0o’, i.e. filled circles with the first color of the color cycle. \item[{\sphinxstylestrong{basefmt}}] \leavevmode{[}str, optional{]} A format string defining the properties of the baseline. Default: ‘C3-‘ (‘C2-‘ in classic mode). \item[{\sphinxstylestrong{bottom}}] \leavevmode{[}float, optional, default: 0{]} The y-position of the baseline. \item[{\sphinxstylestrong{label}}] \leavevmode{[}str, optional, default: None{]} The label to use for the stems in legends. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{:class:{}`\textasciitilde{}matplotlib.container.StemContainer{}`}}] \leavevmode The stemcontainer may be treated like a tuple (\sphinxstyleemphasis{markerline}, \sphinxstyleemphasis{stemlines}, \sphinxstyleemphasis{baseline}) \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode No other parameters are supported. They are currently ignored silently for backward compatibility. This behavior is deprecated. Future versions will not accept any other parameters and will raise a TypeError instead. \end{description} \end{description}\end{quote} \paragraph{Notes} \sphinxstrong{See also:} The MATLAB function \sphinxhref{http://www.mathworks.com/help/techdoc/ref/stem.html}{stem} which inspired this method. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All positional and all keyword arguments. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.eventplot} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.eventplot:matplotlib-axes-axes-eventplot}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.eventplot::doc}}\index{eventplot() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.eventplot:matplotlib.axes.Axes.eventplot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{eventplot}}}{\emph{positions}, \emph{orientation='horizontal'}, \emph{lineoffsets=1}, \emph{linelengths=1}, \emph{linewidths=None}, \emph{colors=None}, \emph{linestyles='solid'}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Plot identical parallel lines at the given positions. \sphinxstyleemphasis{positions} should be a 1D or 2D array-like object, with each row corresponding to a row or column of lines. This type of plot is commonly used in neuroscience for representing neural events, where it is usually called a spike raster, dot raster, or raster plot. However, it is useful in any situation where you wish to show the timing or position of multiple sets of discrete events, such as the arrival times of people to a business on each day of the month or the date of hurricanes each year of the last century. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{positions}}] \leavevmode{[}1D or 2D array-like object{]} Each value is an event. If \sphinxstyleemphasis{positions} is a 2D array-like, each row corresponds to a row or a column of lines (depending on the \sphinxstyleemphasis{orientation} parameter). \item[{\sphinxstylestrong{orientation}}] \leavevmode{[}\{‘horizontal’, ‘vertical’\}, optional{]} Controls the direction of the event collections: \begin{itemize} \item {} ‘horizontal’ : the lines are arranged horizontally in rows, and are vertical. \item {} ‘vertical’ : the lines are arranged vertically in columns, and are horizontal. \end{itemize} \item[{\sphinxstylestrong{lineoffsets}}] \leavevmode{[}scalar or sequence of scalars, optional, default: 1{]} The offset of the center of the lines from the origin, in the direction orthogonal to \sphinxstyleemphasis{orientation}. \item[{\sphinxstylestrong{linelengths}}] \leavevmode{[}scalar or sequence of scalars, optional, default: 1{]} The total height of the lines (i.e. the lines stretches from \sphinxcode{\sphinxupquote{lineoffset - linelength/2}} to \sphinxcode{\sphinxupquote{lineoffset + linelength/2}}). \item[{\sphinxstylestrong{linewidths}}] \leavevmode{[}scalar, scalar sequence or None, optional, default: None{]} The line width(s) of the event lines, in points. If it is None, defaults to its rcParams setting. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}color, sequence of colors or None, optional, default: None{]} The color(s) of the event lines. If it is None, defaults to its rcParams setting. \item[{\sphinxstylestrong{linestyles}}] \leavevmode{[}str or tuple or a sequence of such values, optional{]} Default is ‘solid’. Valid strings are {[}‘solid’, ‘dashed’, ‘dashdot’, ‘dotted’, ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’{]}. Dash tuples should be of the form: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxstyleemphasis{onoffseq} is an even length tuple of on and off ink in points. \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}optional{]} Other keyword arguments are line collection properties. See {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} for a list of the valid properties. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A list of :class:{}`matplotlib.collections.EventCollection{}` objects that}}] \leavevmode \item[{\sphinxstylestrong{were added.}}] \leavevmode \end{description} \end{description}\end{quote} \paragraph{Notes} For \sphinxstyleemphasis{linelengths}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{colors}, and \sphinxstyleemphasis{linestyles}, if only a single value is given, that value is applied to all lines. If an array-like is given, it must have the same length as \sphinxstyleemphasis{positions}, and each value will be applied to the corresponding row of the array. \paragraph{Examples} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{eventplot_demo}.pdf} \end{figure} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘colors’, ‘linelengths’, ‘lineoffsets’, ‘linestyles’, ‘linewidths’, ‘positions’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.pie} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pie:matplotlib-axes-axes-pie}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pie::doc}}\index{pie() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pie:matplotlib.axes.Axes.pie}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{pie}}}{\emph{x}, \emph{explode=None}, \emph{labels=None}, \emph{colors=None}, \emph{autopct=None}, \emph{pctdistance=0.6}, \emph{shadow=False}, \emph{labeldistance=1.1}, \emph{startangle=None}, \emph{radius=None}, \emph{counterclock=True}, \emph{wedgeprops=None}, \emph{textprops=None}, \emph{center=(0}, \emph{0)}, \emph{frame=False}, \emph{rotatelabels=False}, \emph{*}, \emph{data=None}}{} Plot a pie chart. Make a pie chart of array \sphinxstyleemphasis{x}. The fractional area of each wedge is given by \sphinxcode{\sphinxupquote{x/sum(x)}}. If \sphinxcode{\sphinxupquote{sum(x) \textless{} 1}}, then the values of \sphinxstyleemphasis{x} give the fractional area directly and the array will not be normalized. The resulting pie will have an empty wedge of size \sphinxcode{\sphinxupquote{1 - sum(x)}}. The wedges are plotted counterclockwise, by default starting from the x-axis. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}array-like{]} The wedge sizes. \item[{\sphinxstylestrong{explode}}] \leavevmode{[}array-like, optional, default: None{]} If not \sphinxstyleemphasis{None}, is a \sphinxcode{\sphinxupquote{len(x)}} array which specifies the fraction of the radius with which to offset each wedge. \item[{\sphinxstylestrong{labels}}] \leavevmode{[}list, optional, default: None{]} A sequence of strings providing the labels for each wedge \item[{\sphinxstylestrong{colors}}] \leavevmode{[}array-like, optional, default: None{]} A sequence of matplotlib color args through which the pie chart will cycle. If \sphinxstyleemphasis{None}, will use the colors in the currently active cycle. \item[{\sphinxstylestrong{autopct}}] \leavevmode{[}None (default), string, or function, optional{]} If not \sphinxstyleemphasis{None}, is a string or function used to label the wedges with their numeric value. The label will be placed inside the wedge. If it is a format string, the label will be \sphinxcode{\sphinxupquote{fmt\%pct}}. If it is a function, it will be called. \item[{\sphinxstylestrong{pctdistance}}] \leavevmode{[}float, optional, default: 0.6{]} The ratio between the center of each pie slice and the start of the text generated by \sphinxstyleemphasis{autopct}. Ignored if \sphinxstyleemphasis{autopct} is \sphinxstyleemphasis{None}. \item[{\sphinxstylestrong{shadow}}] \leavevmode{[}bool, optional, default: False{]} Draw a shadow beneath the pie. \item[{\sphinxstylestrong{labeldistance}}] \leavevmode{[}float, optional, default: 1.1{]} The radial distance at which the pie labels are drawn \item[{\sphinxstylestrong{startangle}}] \leavevmode{[}float, optional, default: None{]} If not \sphinxstyleemphasis{None}, rotates the start of the pie chart by \sphinxstyleemphasis{angle} degrees counterclockwise from the x-axis. \item[{\sphinxstylestrong{radius}}] \leavevmode{[}float, optional, default: None{]} The radius of the pie, if \sphinxstyleemphasis{radius} is \sphinxstyleemphasis{None} it will be set to 1. \item[{\sphinxstylestrong{counterclock}}] \leavevmode{[}bool, optional, default: True{]} Specify fractions direction, clockwise or counterclockwise. \item[{\sphinxstylestrong{wedgeprops}}] \leavevmode{[}dict, optional, default: None{]} Dict of arguments passed to the wedge objects making the pie. For example, you can pass in \sphinxcode{\sphinxupquote{wedgeprops = \{'linewidth': 3\}}} to set the width of the wedge border lines equal to 3. For more details, look at the doc/arguments of the wedge object. By default \sphinxcode{\sphinxupquote{clip\_on=False}}. \item[{\sphinxstylestrong{textprops}}] \leavevmode{[}dict, optional, default: None{]} Dict of arguments to pass to the text objects. \item[{\sphinxstylestrong{center}}] \leavevmode{[}list of float, optional, default: (0, 0){]} Center position of the chart. Takes value (0, 0) or is a sequence of 2 scalars. \item[{\sphinxstylestrong{frame}}] \leavevmode{[}bool, optional, default: False{]} Plot axes frame with the chart if true. \item[{\sphinxstylestrong{rotatelabels}}] \leavevmode{[}bool, optional, default: False{]} Rotate each label to the angle of the corresponding slice if true. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{patches}}] \leavevmode{[}list{]} A sequence of {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Wedge:matplotlib.patches.Wedge}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.Wedge}}}}} instances \item[{\sphinxstylestrong{texts}}] \leavevmode{[}list{]} A list of the label {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}} instances. \item[{\sphinxstylestrong{autotexts}}] \leavevmode{[}list{]} A list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances for the numeric labels. This will only be returned if the parameter \sphinxstyleemphasis{autopct} is not \sphinxstyleemphasis{None}. \end{description} \end{description}\end{quote} \paragraph{Notes} The pie chart will probably look best if the figure and axes are square, or the Axes aspect is equal. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘colors’, ‘explode’, ‘labels’, ‘x’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.stackplot} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.stackplot:matplotlib-axes-axes-stackplot}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.stackplot::doc}}\index{stackplot() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.stackplot:matplotlib.axes.Axes.stackplot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{stackplot}}}{\emph{x}, \emph{*args}, \emph{data=None}, \emph{**kwargs}}{} Draws a stacked area plot. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1d array of dimension N{]} \item[{\sphinxstylestrong{y}}] \leavevmode{[}2d array (dimension MxN), or sequence of 1d arrays (each dimension 1xN){]} The data is assumed to be unstacked. Each of the following calls is legal: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{stackplot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} where y is MxN} \PYG{n}{stackplot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{n}{y3}\PYG{p}{,} \PYG{n}{y4}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} where y1, y2, y3, y4, are all 1xNm} \end{sphinxVerbatim} \item[{\sphinxstylestrong{baseline}}] \leavevmode{[}{[}‘zero’ \textbar{} ‘sym’ \textbar{} ‘wiggle’ \textbar{} ‘weighted\_wiggle’{]}{]} Method used to calculate the baseline: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{'zero'}}: Constant zero baseline, i.e. a simple stacked plot. \item {} \sphinxcode{\sphinxupquote{'sym'}}: Symmetric around zero and is sometimes called ‘ThemeRiver’. \item {} \sphinxcode{\sphinxupquote{'wiggle'}}: Minimizes the sum of the squared slopes. \item {} \sphinxcode{\sphinxupquote{'weighted\_wiggle'}}: Does the same but weights to account for size of each layer. It is also called ‘Streamgraph’-layout. More details can be found at \sphinxurl{http://leebyron.com/streamgraph/}. \end{itemize} \item[{\sphinxstylestrong{labels}}] \leavevmode{[}Length N sequence of strings{]} Labels to assign to each data series. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}Length N sequence of colors{]} A list or tuple of colors. These will be cycled through and used to colour the stacked areas. \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode All other keyword arguments are passed to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.fill_between:matplotlib.axes.Axes.fill_between}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.fill\_between()}}}}}. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{list of {}`.PolyCollection{}`}}] \leavevmode A list of {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} instances, one for each element in the stacked area plot. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.broken\_barh} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.broken_barh:matplotlib-axes-axes-broken-barh}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.broken_barh::doc}}\index{broken\_barh() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.broken_barh:matplotlib.axes.Axes.broken_barh}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{broken\_barh}}}{\emph{xranges}, \emph{yrange}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Plot a horizontal sequence of rectangles. A rectangle is drawn for each element of \sphinxstyleemphasis{xranges}. All rectangles have the same vertical position and size defined by \sphinxstyleemphasis{yrange}. This is a convenience function for instantiating a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BrokenBarHCollection}}}}}, adding it to the axes and autoscaling the view. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{xranges}}] \leavevmode{[}sequence of tuples (\sphinxstyleemphasis{xmin}, \sphinxstyleemphasis{xwidth}){]} The x-positions and extends of the rectangles. For each tuple (\sphinxstyleemphasis{xmin}, \sphinxstyleemphasis{xwidth}) a rectangle is drawn from \sphinxstyleemphasis{xmin} to \sphinxstyleemphasis{xmin} + \sphinxstyleemphasis{xwidth}. \item[{\sphinxstylestrong{yranges}}] \leavevmode{[}(\sphinxstyleemphasis{ymin}, \sphinxstyleemphasis{ymax}){]} The y-position and extend for all the rectangles. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{:class:{}`matplotlib.collections.BrokenBarHCollection{}`}}] \leavevmode \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BrokenBarHCollection}}}}} properties{]} Each \sphinxstyleemphasis{kwarg} can be either a single argument applying to all rectangles, e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{facecolors}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{black}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} or a sequence of arguments over which is cycled, e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{facecolors}\PYG{o}{=}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{black}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{blue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} would create interleaving black and blue rectangles. Supported keywords: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or antialiaseds & Boolean or sequence of booleans \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{array}}}}} & ndarray \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}} & a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cmap}}}}} & a colormap or registered colormap name \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color arg or sequence of rgba tuples \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or edgecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or facecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or dashes or linestyles & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or linewidths or lw & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_norm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{norm}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offset\_position}}}}} & {[} ‘screen’ \textbar{} ‘data’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offsets}}}}} & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_urls}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{urls}}}}} & List{[}str{]} or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All positional and all keyword arguments. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.vlines} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.vlines:matplotlib-axes-axes-vlines}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.vlines::doc}}\index{vlines() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.vlines:matplotlib.axes.Axes.vlines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{vlines}}}{\emph{x}, \emph{ymin}, \emph{ymax}, \emph{colors='k'}, \emph{linestyles='solid'}, \emph{label=''}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Plot vertical lines. Plot vertical lines at each \sphinxstyleemphasis{x} from \sphinxstyleemphasis{ymin} to \sphinxstyleemphasis{ymax}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar or 1D array\_like{]} x-indexes where to plot the lines. \item[{\sphinxstylestrong{ymin, ymax}}] \leavevmode{[}scalar or 1D array\_like{]} Respective beginning and end of each line. If scalars are provided, all lines will have same length. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}array\_like of colors, optional, default: ‘k’{]} \item[{\sphinxstylestrong{linestyles}}] \leavevmode{[}{[}‘solid’ \textbar{} ‘dashed’ \textbar{} ‘dashdot’ \textbar{} ‘dotted’{]}, optional{]} \item[{\sphinxstylestrong{label}}] \leavevmode{[}string, optional, default: ‘’{]} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lines}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}}{]} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} properties.{]} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hlines:matplotlib.axes.Axes.hlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hlines}}}}}}] \leavevmode horizontal lines \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.axvline:matplotlib.axes.Axes.axvline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axvline}}}}}}] \leavevmode vertical line across the axes \item[{\sphinxcode{\sphinxupquote{}}}] \leavevmode In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: * All arguments with the following names: ‘colors’, ‘x’, ‘ymax’, ‘ymin’. \end{description} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.hlines} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.hlines:matplotlib-axes-axes-hlines}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.hlines::doc}}\index{hlines() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.hlines:matplotlib.axes.Axes.hlines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{hlines}}}{\emph{y}, \emph{xmin}, \emph{xmax}, \emph{colors='k'}, \emph{linestyles='solid'}, \emph{label=''}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Plot horizontal lines at each \sphinxstyleemphasis{y} from \sphinxstyleemphasis{xmin} to \sphinxstyleemphasis{xmax}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar or sequence of scalar{]} y-indexes where to plot the lines. \item[{\sphinxstylestrong{xmin, xmax}}] \leavevmode{[}scalar or 1D array\_like{]} Respective beginning and end of each line. If scalars are provided, all lines will have same length. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}array\_like of colors, optional, default: ‘k’{]} \item[{\sphinxstylestrong{linestyles}}] \leavevmode{[}{[}‘solid’ \textbar{} ‘dashed’ \textbar{} ‘dashdot’ \textbar{} ‘dotted’{]}, optional{]} \item[{\sphinxstylestrong{label}}] \leavevmode{[}string, optional, default: ‘’{]} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lines}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}}{]} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} properties.{]} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.vlines:matplotlib.axes.Axes.vlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{vlines}}}}}}] \leavevmode vertical lines \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.axhline:matplotlib.axes.Axes.axhline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axhline}}}}}}] \leavevmode horizontal line across the axes \item[{\sphinxcode{\sphinxupquote{}}}] \leavevmode In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: * All arguments with the following names: ‘colors’, ‘xmax’, ‘xmin’, ‘y’. \end{description} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.fill} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.fill:matplotlib-axes-axes-fill}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.fill::doc}}\index{fill() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.fill:matplotlib.axes.Axes.fill}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{fill}}}{\emph{*args}, \emph{data=None}, \emph{**kwargs}}{} Plot filled polygons. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{args}}] \leavevmode{[}sequence of x, y, {[}color{]}{]} Each polygon is defined by the lists of \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} positions of its nodes, optionally followed by by a \sphinxstyleemphasis{color} specifier. See {\hyperref[\detokenize{api/colors_api:module-matplotlib.colors}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors}}}}} for supported color specifiers. The standard color cycle is used for polygons without a color specifier. You can plot multiple polygons by providing multiple \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}, \sphinxstyleemphasis{{[}color{]}} groups. For example, each of the following is legal: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{fill}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} a polygon with default color} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{fill}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{b}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} a blue polygon} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{fill}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{x2}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} two polygons} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{fill}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{b}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{x2}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} a blue and a red polygon} \end{sphinxVerbatim} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{a list of :class:{}`\textasciitilde{}matplotlib.patches.Polygon{}`}}] \leavevmode \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Polygon}}}}} properties{]} \end{description} \end{description}\end{quote} \paragraph{Notes} Use {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.fill_between:matplotlib.axes.Axes.fill_between}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill\_between()}}}}} if you would like to fill the region between two curves. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{Spans} \label{\detokenize{api/axes_api:spans}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.axhline:matplotlib.axes.Axes.axhline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.axhline}}}}} & Add a horizontal line across the axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.axhspan:matplotlib.axes.Axes.axhspan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.axhspan}}}}} & Add a horizontal span (rectangle) across the axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.axvline:matplotlib.axes.Axes.axvline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.axvline}}}}} & Add a vertical line across the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.axvspan:matplotlib.axes.Axes.axvspan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.axvspan}}}}} & Add a vertical span (rectangle) across the axes. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axes.Axes.axhline} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axhline:matplotlib-axes-axes-axhline}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axhline::doc}}\index{axhline() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axhline:matplotlib.axes.Axes.axhline}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{axhline}}}{\emph{y=0}, \emph{xmin=0}, \emph{xmax=1}, \emph{**kwargs}}{} Add a horizontal line across the axis. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar, optional, default: 0{]} y position in data coordinates of the horizontal line. \item[{\sphinxstylestrong{xmin}}] \leavevmode{[}scalar, optional, default: 0{]} Should be between 0 and 1, 0 being the far left of the plot, 1 the far right of the plot. \item[{\sphinxstylestrong{xmax}}] \leavevmode{[}scalar, optional, default: 1{]} Should be between 0 and 1, 0 being the far left of the plot, 1 the far right of the plot. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{:class:{}`\textasciitilde{}matplotlib.lines.Line2D{}`}}] \leavevmode \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Valid kwargs are {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties, with the exception of ‘transform’: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hlines:matplotlib.axes.Axes.hlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hlines}}}}}}] \leavevmode Add horizontal lines in data coordinates. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.axhspan:matplotlib.axes.Axes.axhspan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axhspan}}}}}}] \leavevmode Add a horizontal span (rectangle) across the axis. \end{description} \paragraph{Examples} \begin{itemize} \item {} draw a thick red hline at ‘y’ = 0 that spans the xrange: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axhline}\PYG{p}{(}\PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \item {} draw a default hline at ‘y’ = 1 that spans the xrange: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axhline}\PYG{p}{(}\PYG{n}{y}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{)} \end{sphinxVerbatim} \item {} draw a default hline at ‘y’ = .5 that spans the middle half of the xrange: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axhline}\PYG{p}{(}\PYG{n}{y}\PYG{o}{=}\PYG{o}{.}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{n}{xmin}\PYG{o}{=}\PYG{l+m+mf}{0.25}\PYG{p}{,} \PYG{n}{xmax}\PYG{o}{=}\PYG{l+m+mf}{0.75}\PYG{p}{)} \end{sphinxVerbatim} \end{itemize} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.axhspan} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axhspan:matplotlib-axes-axes-axhspan}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axhspan::doc}}\index{axhspan() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axhspan:matplotlib.axes.Axes.axhspan}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{axhspan}}}{\emph{ymin}, \emph{ymax}, \emph{xmin=0}, \emph{xmax=1}, \emph{**kwargs}}{} Add a horizontal span (rectangle) across the axis. Draw a horizontal span (rectangle) from \sphinxstyleemphasis{ymin} to \sphinxstyleemphasis{ymax}. With the default values of \sphinxstyleemphasis{xmin} = 0 and \sphinxstyleemphasis{xmax} = 1, this always spans the xrange, regardless of the xlim settings, even if you change them, e.g., with the {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim:matplotlib.axes.Axes.set_xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xlim()}}}}} command. That is, the horizontal extent is in axes coords: 0=left, 0.5=middle, 1.0=right but the \sphinxstyleemphasis{y} location is in data coordinates. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ymin}}] \leavevmode{[}float{]} Lower limit of the horizontal span in data units. \item[{\sphinxstylestrong{ymax}}] \leavevmode{[}float{]} Upper limit of the horizontal span in data units. \item[{\sphinxstylestrong{xmin}}] \leavevmode{[}float, optional, default: 0{]} Lower limit of the vertical span in axes (relative 0-1) units. \item[{\sphinxstylestrong{xmax}}] \leavevmode{[}float, optional, default: 1{]} Upper limit of the vertical span in axes (relative 0-1) units. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Polygon}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Polygon}}}}}{]} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Polygon}}}}} properties.{]} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.axvspan:matplotlib.axes.Axes.axvspan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axvspan}}}}}}] \leavevmode Add a vertical span across the axes. \end{description} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.axvline} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axvline:matplotlib-axes-axes-axvline}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axvline::doc}}\index{axvline() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axvline:matplotlib.axes.Axes.axvline}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{axvline}}}{\emph{x=0}, \emph{ymin=0}, \emph{ymax=1}, \emph{**kwargs}}{} Add a vertical line across the axes. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar, optional, default: 0{]} x position in data coordinates of the vertical line. \item[{\sphinxstylestrong{ymin}}] \leavevmode{[}scalar, optional, default: 0{]} Should be between 0 and 1, 0 being the bottom of the plot, 1 the top of the plot. \item[{\sphinxstylestrong{ymax}}] \leavevmode{[}scalar, optional, default: 1{]} Should be between 0 and 1, 0 being the bottom of the plot, 1 the top of the plot. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{:class:{}`\textasciitilde{}matplotlib.lines.Line2D{}`}}] \leavevmode \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Valid kwargs are {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties, with the exception of ‘transform’: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.vlines:matplotlib.axes.Axes.vlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{vlines}}}}}}] \leavevmode Add vertical lines in data coordinates. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.axvspan:matplotlib.axes.Axes.axvspan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axvspan}}}}}}] \leavevmode Add a vertical span (rectangle) across the axis. \end{description} \paragraph{Examples} \begin{itemize} \item {} draw a thick red vline at \sphinxstyleemphasis{x} = 0 that spans the yrange: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axvline}\PYG{p}{(}\PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \item {} draw a default vline at \sphinxstyleemphasis{x} = 1 that spans the yrange: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axvline}\PYG{p}{(}\PYG{n}{x}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{)} \end{sphinxVerbatim} \item {} draw a default vline at \sphinxstyleemphasis{x} = .5 that spans the middle half of the yrange: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axvline}\PYG{p}{(}\PYG{n}{x}\PYG{o}{=}\PYG{o}{.}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{n}{ymin}\PYG{o}{=}\PYG{l+m+mf}{0.25}\PYG{p}{,} \PYG{n}{ymax}\PYG{o}{=}\PYG{l+m+mf}{0.75}\PYG{p}{)} \end{sphinxVerbatim} \end{itemize} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.axvspan} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axvspan:matplotlib-axes-axes-axvspan}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axvspan::doc}}\index{axvspan() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axvspan:matplotlib.axes.Axes.axvspan}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{axvspan}}}{\emph{xmin}, \emph{xmax}, \emph{ymin=0}, \emph{ymax=1}, \emph{**kwargs}}{} Add a vertical span (rectangle) across the axes. Draw a vertical span (rectangle) from \sphinxcode{\sphinxupquote{xmin}} to \sphinxcode{\sphinxupquote{xmax}}. With the default values of \sphinxcode{\sphinxupquote{ymin}} = 0 and \sphinxcode{\sphinxupquote{ymax}} = 1. This always spans the yrange, regardless of the ylim settings, even if you change them, e.g., with the {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:matplotlib.axes.Axes.set_ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_ylim()}}}}} command. That is, the vertical extent is in axes coords: 0=bottom, 0.5=middle, 1.0=top but the y location is in data coordinates. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{xmin}}] \leavevmode{[}scalar{]} Number indicating the first X-axis coordinate of the vertical span rectangle in data units. \item[{\sphinxstylestrong{xmax}}] \leavevmode{[}scalar{]} Number indicating the second X-axis coordinate of the vertical span rectangle in data units. \item[{\sphinxstylestrong{ymin}}] \leavevmode{[}scalar, optional{]} Number indicating the first Y-axis coordinate of the vertical span rectangle in relative Y-axis units (0-1). Default to 0. \item[{\sphinxstylestrong{ymax}}] \leavevmode{[}scalar, optional{]} Number indicating the second Y-axis coordinate of the vertical span rectangle in relative Y-axis units (0-1). Default to 1. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rectangle}}] \leavevmode{[}matplotlib.patches.Polygon{]} Vertical span (rectangle) from (xmin, ymin) to (xmax, ymax). \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode Optional parameters are properties of the class matplotlib.patches.Polygon. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.axhspan:matplotlib.axes.Axes.axhspan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axhspan}}}}}}] \leavevmode Add a horizontal span across the axes. \end{description} \paragraph{Examples} Draw a vertical, green, translucent rectangle from x = 1.25 to x = 1.55 that spans the yrange of the axes. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axvspan}\PYG{p}{(}\PYG{l+m+mf}{1.25}\PYG{p}{,} \PYG{l+m+mf}{1.55}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsection{Spectral} \label{\detokenize{api/axes_api:spectral}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.acorr:matplotlib.axes.Axes.acorr}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.acorr}}}}} & Plot the autocorrelation of \sphinxstyleemphasis{x}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.angle_spectrum:matplotlib.axes.Axes.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.angle\_spectrum}}}}} & Plot the angle spectrum. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.cohere:matplotlib.axes.Axes.cohere}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.cohere}}}}} & Plot the coherence between \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.csd:matplotlib.axes.Axes.csd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.csd}}}}} & Plot the cross-spectral density. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.magnitude_spectrum:matplotlib.axes.Axes.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.magnitude\_spectrum}}}}} & Plot the magnitude spectrum. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.phase_spectrum:matplotlib.axes.Axes.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.phase\_spectrum}}}}} & Plot the phase spectrum. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.psd:matplotlib.axes.Axes.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.psd}}}}} & Plot the power spectral density. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.specgram:matplotlib.axes.Axes.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.specgram}}}}} & Plot a spectrogram. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.xcorr:matplotlib.axes.Axes.xcorr}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.xcorr}}}}} & Plot the cross correlation between \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axes.Axes.acorr} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.acorr:matplotlib-axes-axes-acorr}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.acorr::doc}}\index{acorr() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.acorr:matplotlib.axes.Axes.acorr}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{acorr}}}{\emph{x}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Plot the autocorrelation of \sphinxstyleemphasis{x}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}sequence of scalar{]} \item[{\sphinxstylestrong{hold}}] \leavevmode{[}bool, optional, \sphinxstyleemphasis{deprecated}, default: True{]} \item[{\sphinxstylestrong{detrend}}] \leavevmode{[}callable, optional, default: \sphinxcode{\sphinxupquote{mlab.detrend\_none}}{]} \sphinxstyleemphasis{x} is detrended by the \sphinxstyleemphasis{detrend} callable. Default is no normalization. \item[{\sphinxstylestrong{normed}}] \leavevmode{[}bool, optional, default: True{]} If \sphinxcode{\sphinxupquote{True}}, input vectors are normalised to unit length. \item[{\sphinxstylestrong{usevlines}}] \leavevmode{[}bool, optional, default: True{]} If \sphinxcode{\sphinxupquote{True}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.vlines:matplotlib.axes.Axes.vlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.vlines}}}}} is used to plot the vertical lines from the origin to the acorr. Otherwise, {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.plot}}}}} is used. \item[{\sphinxstylestrong{maxlags}}] \leavevmode{[}integer, optional, default: 10{]} Number of lags to show. If \sphinxcode{\sphinxupquote{None}}, will return all \sphinxcode{\sphinxupquote{2 * len(x) - 1}} lags. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lags}}] \leavevmode{[}array (lenth \sphinxcode{\sphinxupquote{2*maxlags+1}}){]} lag vector. \item[{\sphinxstylestrong{c}}] \leavevmode{[}array (length \sphinxcode{\sphinxupquote{2*maxlags+1}}){]} auto correlation vector. \item[{\sphinxstylestrong{line}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}}{]} {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} added to the axes of the correlation. \begin{quote} {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} if \sphinxstyleemphasis{usevlines} is True {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} if \sphinxstyleemphasis{usevlines} is False \end{quote} \item[{\sphinxstylestrong{b}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} or None{]} Horizontal line at 0 if \sphinxstyleemphasis{usevlines} is True None \sphinxstyleemphasis{usevlines} is False \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{linestyle}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} prop, optional, default: None{]} Only used if usevlines is \sphinxcode{\sphinxupquote{False}}. \item[{\sphinxstylestrong{marker}}] \leavevmode{[}string, optional, default: ‘o’{]} \end{description} \end{description}\end{quote} \paragraph{Notes} The cross correlation is performed with \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.correlate.html\#numpy.correlate}{\sphinxcode{\sphinxupquote{numpy.correlate()}}} with \sphinxcode{\sphinxupquote{mode = 2}}. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.angle\_spectrum} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.angle_spectrum:matplotlib-axes-axes-angle-spectrum}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.angle_spectrum::doc}}\index{angle\_spectrum() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.angle_spectrum:matplotlib.axes.Axes.angle_spectrum}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{angle\_spectrum}}}{\emph{x}, \emph{Fs=None}, \emph{Fc=None}, \emph{window=None}, \emph{pad\_to=None}, \emph{sides=None}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Plot the angle spectrum. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{angle\PYGZus{}spectrum}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{Fs}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{Fc}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{window}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{window\PYGZus{}hanning}\PYG{p}{,} \PYG{n}{pad\PYGZus{}to}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{sides}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Compute the angle spectrum (wrapped phase spectrum) of \sphinxstyleemphasis{x}. Data is padded to a length of \sphinxstyleemphasis{pad\_to} and the windowing function \sphinxstyleemphasis{window} is applied to the signal. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1-D array or sequence{]} Array or sequence containing the data \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see \sphinxcode{\sphinxupquote{window\_hanning()}}, \sphinxcode{\sphinxupquote{window\_none()}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is \sphinxcode{\sphinxupquote{window\_hanning()}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to the length of the input signal (i.e. no padding). \item[{\sphinxstylestrong{Fc}}] \leavevmode{[}integer{]} The center frequency of \sphinxstyleemphasis{x} (defaults to 0), which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{spectrum}}] \leavevmode{[}1-D array{]} The values for the angle spectrum in radians (real valued) \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the elements in \sphinxstyleemphasis{spectrum} \item[{\sphinxstylestrong{line}}] \leavevmode{[}a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instance{]} The line created by this function \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Keyword arguments control the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.magnitude_spectrum:matplotlib.axes.Axes.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.angle_spectrum:matplotlib.axes.Axes.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}} plots the magnitudes of the corresponding frequencies. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.phase_spectrum:matplotlib.axes.Axes.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.phase_spectrum:matplotlib.axes.Axes.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}} plots the unwrapped version of this function. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.specgram:matplotlib.axes.Axes.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.specgram:matplotlib.axes.Axes.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}} can plot the angle spectrum of segments within the signal in a colormap. \end{description} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.cohere} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.cohere:matplotlib-axes-axes-cohere}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.cohere::doc}}\index{cohere() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.cohere:matplotlib.axes.Axes.cohere}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{cohere}}}{\emph{x}, \emph{y}, \emph{NFFT=256}, \emph{Fs=2}, \emph{Fc=0}, \emph{detrend=\textless{}function detrend\_none\textgreater{}}, \emph{window=\textless{}function window\_hanning\textgreater{}}, \emph{noverlap=0}, \emph{pad\_to=None}, \emph{sides='default'}, \emph{scale\_by\_freq=None}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Plot the coherence between \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. Plot the coherence between \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. Coherence is the normalized cross spectral density: \begin{equation}C_{xy} = \frac{|P_{xy}|^2}{P_{xx}P_{yy}}\end{equation}\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see \sphinxcode{\sphinxupquote{window\_hanning()}}, \sphinxcode{\sphinxupquote{window\_none()}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is \sphinxcode{\sphinxupquote{window\_hanning()}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. This can be different from \sphinxstyleemphasis{NFFT}, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to \sphinxstyleemphasis{NFFT} \item[{\sphinxstylestrong{NFFT}}] \leavevmode{[}integer{]} The number of data points used in each block for the FFT. A power 2 is most efficient. The default value is 256. This should \sphinxstyleemphasis{NOT} be used to get zero padding, or the scaling of the result will be incorrect. Use \sphinxstyleemphasis{pad\_to} for this instead. \item[{\sphinxstylestrong{detrend}}] \leavevmode{[}\{‘default’, ‘constant’, ‘mean’, ‘linear’, ‘none’\} or callable{]} The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the \sphinxstyleemphasis{detrend} parameter is a vector, in matplotlib is it a function. The \sphinxcode{\sphinxupquote{pylab}} module defines \sphinxcode{\sphinxupquote{detrend\_none()}}, \sphinxcode{\sphinxupquote{detrend\_mean()}}, and \sphinxcode{\sphinxupquote{detrend\_linear()}}, but you can use a custom function as well. You can also use a string to choose one of the functions. ‘default’, ‘constant’, and ‘mean’ call \sphinxcode{\sphinxupquote{detrend\_mean()}}. ‘linear’ calls \sphinxcode{\sphinxupquote{detrend\_linear()}}. ‘none’ calls \sphinxcode{\sphinxupquote{detrend\_none()}}. \item[{\sphinxstylestrong{scale\_by\_freq}}] \leavevmode{[}boolean, optional{]} Specifies whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz\textasciicircum{}-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. \item[{\sphinxstylestrong{noverlap}}] \leavevmode{[}integer{]} The number of points of overlap between blocks. The default value is 0 (no overlap). \item[{\sphinxstylestrong{Fc}}] \leavevmode{[}integer{]} The center frequency of \sphinxstyleemphasis{x} (defaults to 0), which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{The return value is a tuple (*Cxy*, *f*), where *f* are the}}] \leavevmode \item[{\sphinxstylestrong{frequencies of the coherence vector.}}] \leavevmode \item[{\sphinxstylestrong{kwargs are applied to the lines.}}] \leavevmode \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Keyword arguments control the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \paragraph{References} Bendat \& Piersol \textendash{} Random Data: Analysis and Measurement Procedures, John Wiley \& Sons (1986) \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.csd} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.csd:matplotlib-axes-axes-csd}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.csd::doc}}\index{csd() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.csd:matplotlib.axes.Axes.csd}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{csd}}}{\emph{x}, \emph{y}, \emph{NFFT=None}, \emph{Fs=None}, \emph{Fc=None}, \emph{detrend=None}, \emph{window=None}, \emph{noverlap=None}, \emph{pad\_to=None}, \emph{sides=None}, \emph{scale\_by\_freq=None}, \emph{return\_line=None}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Plot the cross-spectral density. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{csd}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{NFFT}\PYG{o}{=}\PYG{l+m+mi}{256}\PYG{p}{,} \PYG{n}{Fs}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{Fc}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{detrend}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{detrend\PYGZus{}none}\PYG{p}{,} \PYG{n}{window}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{window\PYGZus{}hanning}\PYG{p}{,} \PYG{n}{noverlap}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{pad\PYGZus{}to}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{sides}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{scale\PYGZus{}by\PYGZus{}freq}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{return\PYGZus{}line}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} The cross spectral density $P_{xy}$ by Welch’s average periodogram method. The vectors \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} are divided into \sphinxstyleemphasis{NFFT} length segments. Each segment is detrended by function \sphinxstyleemphasis{detrend} and windowed by function \sphinxstyleemphasis{window}. \sphinxstyleemphasis{noverlap} gives the length of the overlap between segments. The product of the direct FFTs of \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} are averaged over each segment to compute $P_{xy}$, with a scaling to correct for power loss due to windowing. If len(\sphinxstyleemphasis{x}) \textless{} \sphinxstyleemphasis{NFFT} or len(\sphinxstyleemphasis{y}) \textless{} \sphinxstyleemphasis{NFFT}, they will be zero padded to \sphinxstyleemphasis{NFFT}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}1-D arrays or sequences{]} Arrays or sequences containing the data \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see \sphinxcode{\sphinxupquote{window\_hanning()}}, \sphinxcode{\sphinxupquote{window\_none()}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is \sphinxcode{\sphinxupquote{window\_hanning()}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. This can be different from \sphinxstyleemphasis{NFFT}, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to \sphinxstyleemphasis{NFFT} \item[{\sphinxstylestrong{NFFT}}] \leavevmode{[}integer{]} The number of data points used in each block for the FFT. A power 2 is most efficient. The default value is 256. This should \sphinxstyleemphasis{NOT} be used to get zero padding, or the scaling of the result will be incorrect. Use \sphinxstyleemphasis{pad\_to} for this instead. \item[{\sphinxstylestrong{detrend}}] \leavevmode{[}\{‘default’, ‘constant’, ‘mean’, ‘linear’, ‘none’\} or callable{]} The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the \sphinxstyleemphasis{detrend} parameter is a vector, in matplotlib is it a function. The \sphinxcode{\sphinxupquote{pylab}} module defines \sphinxcode{\sphinxupquote{detrend\_none()}}, \sphinxcode{\sphinxupquote{detrend\_mean()}}, and \sphinxcode{\sphinxupquote{detrend\_linear()}}, but you can use a custom function as well. You can also use a string to choose one of the functions. ‘default’, ‘constant’, and ‘mean’ call \sphinxcode{\sphinxupquote{detrend\_mean()}}. ‘linear’ calls \sphinxcode{\sphinxupquote{detrend\_linear()}}. ‘none’ calls \sphinxcode{\sphinxupquote{detrend\_none()}}. \item[{\sphinxstylestrong{scale\_by\_freq}}] \leavevmode{[}boolean, optional{]} Specifies whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz\textasciicircum{}-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. \item[{\sphinxstylestrong{noverlap}}] \leavevmode{[}integer{]} The number of points of overlap between segments. The default value is 0 (no overlap). \item[{\sphinxstylestrong{Fc}}] \leavevmode{[}integer{]} The center frequency of \sphinxstyleemphasis{x} (defaults to 0), which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband. \item[{\sphinxstylestrong{return\_line}}] \leavevmode{[}bool{]} Whether to include the line object plotted in the returned values. Default is False. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Pxy}}] \leavevmode{[}1-D array{]} The values for the cross spectrum \sphinxcode{\sphinxupquote{P\_\{xy\}}} before scaling (complex valued) \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the elements in \sphinxstyleemphasis{Pxy} \item[{\sphinxstylestrong{line}}] \leavevmode{[}a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instance{]} The line created by this function. Only returned if \sphinxstyleemphasis{return\_line} is True. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Keyword arguments control the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.psd:matplotlib.axes.Axes.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.psd:matplotlib.axes.Axes.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}} is the equivalent to setting y=x. \end{description} \paragraph{Notes} For plotting, the power is plotted as $10\log_{10}(P_{xy})$ for decibels, though \sphinxcode{\sphinxupquote{P\_\{xy\}}} itself is returned. \paragraph{References} Bendat \& Piersol \textendash{} Random Data: Analysis and Measurement Procedures, John Wiley \& Sons (1986) \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.magnitude\_spectrum} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.magnitude_spectrum:matplotlib-axes-axes-magnitude-spectrum}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.magnitude_spectrum::doc}}\index{magnitude\_spectrum() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.magnitude_spectrum:matplotlib.axes.Axes.magnitude_spectrum}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{magnitude\_spectrum}}}{\emph{x}, \emph{Fs=None}, \emph{Fc=None}, \emph{window=None}, \emph{pad\_to=None}, \emph{sides=None}, \emph{scale=None}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Plot the magnitude spectrum. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{magnitude\PYGZus{}spectrum}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{Fs}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{Fc}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{window}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{window\PYGZus{}hanning}\PYG{p}{,} \PYG{n}{pad\PYGZus{}to}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{sides}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Compute the magnitude spectrum of \sphinxstyleemphasis{x}. Data is padded to a length of \sphinxstyleemphasis{pad\_to} and the windowing function \sphinxstyleemphasis{window} is applied to the signal. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1-D array or sequence{]} Array or sequence containing the data \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see \sphinxcode{\sphinxupquote{window\_hanning()}}, \sphinxcode{\sphinxupquote{window\_none()}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is \sphinxcode{\sphinxupquote{window\_hanning()}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to the length of the input signal (i.e. no padding). \item[{\sphinxstylestrong{scale}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘linear’ \textbar{} ‘dB’ {]}{]} The scaling of the values in the \sphinxstyleemphasis{spec}. ‘linear’ is no scaling. ‘dB’ returns the values in dB scale, i.e., the dB amplitude (20 * log10). ‘default’ is ‘linear’. \item[{\sphinxstylestrong{Fc}}] \leavevmode{[}integer{]} The center frequency of \sphinxstyleemphasis{x} (defaults to 0), which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{spectrum}}] \leavevmode{[}1-D array{]} The values for the magnitude spectrum before scaling (real valued) \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the elements in \sphinxstyleemphasis{spectrum} \item[{\sphinxstylestrong{line}}] \leavevmode{[}a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instance{]} The line created by this function \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Keyword arguments control the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.psd:matplotlib.axes.Axes.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.psd:matplotlib.axes.Axes.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}} plots the power spectral density.{}`. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.angle_spectrum:matplotlib.axes.Axes.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.angle_spectrum:matplotlib.axes.Axes.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}} plots the angles of the corresponding frequencies. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.phase_spectrum:matplotlib.axes.Axes.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.phase_spectrum:matplotlib.axes.Axes.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}} plots the phase (unwrapped angle) of the corresponding frequencies. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.specgram:matplotlib.axes.Axes.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.specgram:matplotlib.axes.Axes.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}} can plot the magnitude spectrum of segments within the signal in a colormap. \end{description} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.phase\_spectrum} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.phase_spectrum:matplotlib-axes-axes-phase-spectrum}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.phase_spectrum::doc}}\index{phase\_spectrum() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.phase_spectrum:matplotlib.axes.Axes.phase_spectrum}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{phase\_spectrum}}}{\emph{x}, \emph{Fs=None}, \emph{Fc=None}, \emph{window=None}, \emph{pad\_to=None}, \emph{sides=None}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Plot the phase spectrum. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{phase\PYGZus{}spectrum}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{Fs}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{Fc}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{window}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{window\PYGZus{}hanning}\PYG{p}{,} \PYG{n}{pad\PYGZus{}to}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{sides}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Compute the phase spectrum (unwrapped angle spectrum) of \sphinxstyleemphasis{x}. Data is padded to a length of \sphinxstyleemphasis{pad\_to} and the windowing function \sphinxstyleemphasis{window} is applied to the signal. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1-D array or sequence{]} Array or sequence containing the data \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see \sphinxcode{\sphinxupquote{window\_hanning()}}, \sphinxcode{\sphinxupquote{window\_none()}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is \sphinxcode{\sphinxupquote{window\_hanning()}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to the length of the input signal (i.e. no padding). \item[{\sphinxstylestrong{Fc}}] \leavevmode{[}integer{]} The center frequency of \sphinxstyleemphasis{x} (defaults to 0), which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{spectrum}}] \leavevmode{[}1-D array{]} The values for the phase spectrum in radians (real valued) \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the elements in \sphinxstyleemphasis{spectrum} \item[{\sphinxstylestrong{line}}] \leavevmode{[}a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instance{]} The line created by this function \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Keyword arguments control the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.magnitude_spectrum:matplotlib.axes.Axes.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.magnitude_spectrum:matplotlib.axes.Axes.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}} plots the magnitudes of the corresponding frequencies. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.angle_spectrum:matplotlib.axes.Axes.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.angle_spectrum:matplotlib.axes.Axes.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}} plots the wrapped version of this function. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.specgram:matplotlib.axes.Axes.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.specgram:matplotlib.axes.Axes.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}} can plot the phase spectrum of segments within the signal in a colormap. \end{description} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.psd} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.psd:matplotlib-axes-axes-psd}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.psd::doc}}\index{psd() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.psd:matplotlib.axes.Axes.psd}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{psd}}}{\emph{x}, \emph{NFFT=None}, \emph{Fs=None}, \emph{Fc=None}, \emph{detrend=None}, \emph{window=None}, \emph{noverlap=None}, \emph{pad\_to=None}, \emph{sides=None}, \emph{scale\_by\_freq=None}, \emph{return\_line=None}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Plot the power spectral density. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{psd}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{NFFT}\PYG{o}{=}\PYG{l+m+mi}{256}\PYG{p}{,} \PYG{n}{Fs}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{Fc}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{detrend}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{detrend\PYGZus{}none}\PYG{p}{,} \PYG{n}{window}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{window\PYGZus{}hanning}\PYG{p}{,} \PYG{n}{noverlap}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{pad\PYGZus{}to}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{sides}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{scale\PYGZus{}by\PYGZus{}freq}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{return\PYGZus{}line}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} The power spectral density $P_{xx}$ by Welch’s average periodogram method. The vector \sphinxstyleemphasis{x} is divided into \sphinxstyleemphasis{NFFT} length segments. Each segment is detrended by function \sphinxstyleemphasis{detrend} and windowed by function \sphinxstyleemphasis{window}. \sphinxstyleemphasis{noverlap} gives the length of the overlap between segments. The $|\mathrm{fft}(i)|^2$ of each segment $i$ are averaged to compute $P_{xx}$, with a scaling to correct for power loss due to windowing. If len(\sphinxstyleemphasis{x}) \textless{} \sphinxstyleemphasis{NFFT}, it will be zero padded to \sphinxstyleemphasis{NFFT}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1-D array or sequence{]} Array or sequence containing the data \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see \sphinxcode{\sphinxupquote{window\_hanning()}}, \sphinxcode{\sphinxupquote{window\_none()}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is \sphinxcode{\sphinxupquote{window\_hanning()}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. This can be different from \sphinxstyleemphasis{NFFT}, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to \sphinxstyleemphasis{NFFT} \item[{\sphinxstylestrong{NFFT}}] \leavevmode{[}integer{]} The number of data points used in each block for the FFT. A power 2 is most efficient. The default value is 256. This should \sphinxstyleemphasis{NOT} be used to get zero padding, or the scaling of the result will be incorrect. Use \sphinxstyleemphasis{pad\_to} for this instead. \item[{\sphinxstylestrong{detrend}}] \leavevmode{[}\{‘default’, ‘constant’, ‘mean’, ‘linear’, ‘none’\} or callable{]} The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the \sphinxstyleemphasis{detrend} parameter is a vector, in matplotlib is it a function. The \sphinxcode{\sphinxupquote{pylab}} module defines \sphinxcode{\sphinxupquote{detrend\_none()}}, \sphinxcode{\sphinxupquote{detrend\_mean()}}, and \sphinxcode{\sphinxupquote{detrend\_linear()}}, but you can use a custom function as well. You can also use a string to choose one of the functions. ‘default’, ‘constant’, and ‘mean’ call \sphinxcode{\sphinxupquote{detrend\_mean()}}. ‘linear’ calls \sphinxcode{\sphinxupquote{detrend\_linear()}}. ‘none’ calls \sphinxcode{\sphinxupquote{detrend\_none()}}. \item[{\sphinxstylestrong{scale\_by\_freq}}] \leavevmode{[}boolean, optional{]} Specifies whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz\textasciicircum{}-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. \item[{\sphinxstylestrong{noverlap}}] \leavevmode{[}integer{]} The number of points of overlap between segments. The default value is 0 (no overlap). \item[{\sphinxstylestrong{Fc}}] \leavevmode{[}integer{]} The center frequency of \sphinxstyleemphasis{x} (defaults to 0), which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband. \item[{\sphinxstylestrong{return\_line}}] \leavevmode{[}bool{]} Whether to include the line object plotted in the returned values. Default is False. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Pxx}}] \leavevmode{[}1-D array{]} The values for the power spectrum \sphinxcode{\sphinxupquote{P\_\{xx\}}} before scaling (real valued) \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the elements in \sphinxstyleemphasis{Pxx} \item[{\sphinxstylestrong{line}}] \leavevmode{[}a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instance{]} The line created by this function. Only returned if \sphinxstyleemphasis{return\_line} is True. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Keyword arguments control the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.specgram:matplotlib.axes.Axes.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.specgram:matplotlib.axes.Axes.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}} differs in the default overlap; in not returning the mean of the segment periodograms; in returning the times of the segments; and in plotting a colormap instead of a line. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.magnitude_spectrum:matplotlib.axes.Axes.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.magnitude_spectrum:matplotlib.axes.Axes.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}} plots the magnitude spectrum. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.csd:matplotlib.axes.Axes.csd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{csd()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.csd:matplotlib.axes.Axes.csd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{csd()}}}}} plots the spectral density between two signals. \end{description} \paragraph{Notes} For plotting, the power is plotted as $10\log_{10}(P_{xx})$ for decibels, though \sphinxstyleemphasis{Pxx} itself is returned. \paragraph{References} Bendat \& Piersol \textendash{} Random Data: Analysis and Measurement Procedures, John Wiley \& Sons (1986) \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.specgram} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.specgram:matplotlib-axes-axes-specgram}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.specgram::doc}}\index{specgram() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.specgram:matplotlib.axes.Axes.specgram}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{specgram}}}{\emph{x}, \emph{NFFT=None}, \emph{Fs=None}, \emph{Fc=None}, \emph{detrend=None}, \emph{window=None}, \emph{noverlap=None}, \emph{cmap=None}, \emph{xextent=None}, \emph{pad\_to=None}, \emph{sides=None}, \emph{scale\_by\_freq=None}, \emph{mode=None}, \emph{scale=None}, \emph{vmin=None}, \emph{vmax=None}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Plot a spectrogram. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{specgram}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{NFFT}\PYG{o}{=}\PYG{l+m+mi}{256}\PYG{p}{,} \PYG{n}{Fs}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{Fc}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{detrend}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{detrend\PYGZus{}none}\PYG{p}{,} \PYG{n}{window}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{window\PYGZus{}hanning}\PYG{p}{,} \PYG{n}{noverlap}\PYG{o}{=}\PYG{l+m+mi}{128}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{xextent}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{pad\PYGZus{}to}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{sides}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{scale\PYGZus{}by\PYGZus{}freq}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{mode}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{scale}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Compute and plot a spectrogram of data in \sphinxstyleemphasis{x}. Data are split into \sphinxstyleemphasis{NFFT} length segments and the spectrum of each section is computed. The windowing function \sphinxstyleemphasis{window} is applied to each segment, and the amount of overlap of each segment is specified with \sphinxstyleemphasis{noverlap}. The spectrogram is plotted as a colormap (using imshow). \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1-D array or sequence{]} Array or sequence containing the data. \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see \sphinxcode{\sphinxupquote{window\_hanning()}}, \sphinxcode{\sphinxupquote{window\_none()}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is \sphinxcode{\sphinxupquote{window\_hanning()}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. This can be different from \sphinxstyleemphasis{NFFT}, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to \sphinxstyleemphasis{NFFT} \item[{\sphinxstylestrong{NFFT}}] \leavevmode{[}integer{]} The number of data points used in each block for the FFT. A power 2 is most efficient. The default value is 256. This should \sphinxstyleemphasis{NOT} be used to get zero padding, or the scaling of the result will be incorrect. Use \sphinxstyleemphasis{pad\_to} for this instead. \item[{\sphinxstylestrong{detrend}}] \leavevmode{[}\{‘default’, ‘constant’, ‘mean’, ‘linear’, ‘none’\} or callable{]} The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the \sphinxstyleemphasis{detrend} parameter is a vector, in matplotlib is it a function. The \sphinxcode{\sphinxupquote{pylab}} module defines \sphinxcode{\sphinxupquote{detrend\_none()}}, \sphinxcode{\sphinxupquote{detrend\_mean()}}, and \sphinxcode{\sphinxupquote{detrend\_linear()}}, but you can use a custom function as well. You can also use a string to choose one of the functions. ‘default’, ‘constant’, and ‘mean’ call \sphinxcode{\sphinxupquote{detrend\_mean()}}. ‘linear’ calls \sphinxcode{\sphinxupquote{detrend\_linear()}}. ‘none’ calls \sphinxcode{\sphinxupquote{detrend\_none()}}. \item[{\sphinxstylestrong{scale\_by\_freq}}] \leavevmode{[}boolean, optional{]} Specifies whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz\textasciicircum{}-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. \item[{\sphinxstylestrong{mode}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘psd’ \textbar{} ‘magnitude’ \textbar{} ‘angle’ \textbar{} ‘phase’ {]}{]} What sort of spectrum to use. Default is ‘psd’, which takes the power spectral density. ‘complex’ returns the complex-valued frequency spectrum. ‘magnitude’ returns the magnitude spectrum. ‘angle’ returns the phase spectrum without unwrapping. ‘phase’ returns the phase spectrum with unwrapping. \item[{\sphinxstylestrong{noverlap}}] \leavevmode{[}integer{]} The number of points of overlap between blocks. The default value is 128. \item[{\sphinxstylestrong{scale}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘linear’ \textbar{} ‘dB’ {]}{]} The scaling of the values in the \sphinxstyleemphasis{spec}. ‘linear’ is no scaling. ‘dB’ returns the values in dB scale. When \sphinxstyleemphasis{mode} is ‘psd’, this is dB power (10 * log10). Otherwise this is dB amplitude (20 * log10). ‘default’ is ‘dB’ if \sphinxstyleemphasis{mode} is ‘psd’ or ‘magnitude’ and ‘linear’ otherwise. This must be ‘linear’ if \sphinxstyleemphasis{mode} is ‘angle’ or ‘phase’. \item[{\sphinxstylestrong{Fc}}] \leavevmode{[}integer{]} The center frequency of \sphinxstyleemphasis{x} (defaults to 0), which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband. \item[{\sphinxstylestrong{cmap :}}] \leavevmode A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap}}}}} instance; if \sphinxstyleemphasis{None}, use default determined by rc \item[{\sphinxstylestrong{xextent}}] \leavevmode{[}{[}None \textbar{} (xmin, xmax){]}{]} The image extent along the x-axis. The default sets \sphinxstyleemphasis{xmin} to the left border of the first bin (\sphinxstyleemphasis{spectrum} column) and \sphinxstyleemphasis{xmax} to the right border of the last bin. Note that for \sphinxstyleemphasis{noverlap\textgreater{}0} the width of the bins is smaller than those of the segments. \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Additional kwargs are passed on to imshow which makes the specgram image \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{spectrum}}] \leavevmode{[}2-D array{]} Columns are the periodograms of successive segments. \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the rows in \sphinxstyleemphasis{spectrum}. \item[{\sphinxstylestrong{t}}] \leavevmode{[}1-D array{]} The times corresponding to midpoints of segments (i.e., the columns in \sphinxstyleemphasis{spectrum}). \item[{\sphinxstylestrong{im}}] \leavevmode{[}instance of class {\hyperref[\detokenize{api/image_api:matplotlib.image.AxesImage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AxesImage}}}}}{]} The image created by imshow containing the spectrogram \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.psd:matplotlib.axes.Axes.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.psd:matplotlib.axes.Axes.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}} differs in the default overlap; in returning the mean of the segment periodograms; in not returning times; and in generating a line plot instead of colormap. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.magnitude_spectrum:matplotlib.axes.Axes.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}}}] \leavevmode A single spectrum, similar to having a single segment when \sphinxstyleemphasis{mode} is ‘magnitude’. Plots a line instead of a colormap. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.angle_spectrum:matplotlib.axes.Axes.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}}}] \leavevmode A single spectrum, similar to having a single segment when \sphinxstyleemphasis{mode} is ‘angle’. Plots a line instead of a colormap. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.phase_spectrum:matplotlib.axes.Axes.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}}}] \leavevmode A single spectrum, similar to having a single segment when \sphinxstyleemphasis{mode} is ‘phase’. Plots a line instead of a colormap. \end{description} \paragraph{Notes} The parameters \sphinxstyleemphasis{detrend} and \sphinxstyleemphasis{scale\_by\_freq} do only apply when \sphinxstyleemphasis{mode} is set to ‘psd’. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.xcorr} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.xcorr:matplotlib-axes-axes-xcorr}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.xcorr::doc}}\index{xcorr() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.xcorr:matplotlib.axes.Axes.xcorr}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{xcorr}}}{\emph{x}, \emph{y}, \emph{normed=True}, \emph{detrend=\textless{}function detrend\_none\textgreater{}}, \emph{usevlines=True}, \emph{maxlags=10}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Plot the cross correlation between \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. The correlation with lag k is defined as sum\_n x{[}n+k{]} * conj(y{[}n{]}). \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}sequence of scalars of length n{]} \item[{\sphinxstylestrong{y}}] \leavevmode{[}sequence of scalars of length n{]} \item[{\sphinxstylestrong{hold}}] \leavevmode{[}bool, optional, \sphinxstyleemphasis{deprecated}, default: True{]} \item[{\sphinxstylestrong{detrend}}] \leavevmode{[}callable, optional, default: \sphinxcode{\sphinxupquote{mlab.detrend\_none}}{]} \sphinxstyleemphasis{x} is detrended by the \sphinxstyleemphasis{detrend} callable. Default is no normalization. \item[{\sphinxstylestrong{normed}}] \leavevmode{[}bool, optional, default: True{]} If \sphinxcode{\sphinxupquote{True}}, input vectors are normalised to unit length. \item[{\sphinxstylestrong{usevlines}}] \leavevmode{[}bool, optional, default: True{]} If \sphinxcode{\sphinxupquote{True}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.vlines:matplotlib.axes.Axes.vlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.vlines}}}}} is used to plot the vertical lines from the origin to the acorr. Otherwise, {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.plot}}}}} is used. \item[{\sphinxstylestrong{maxlags}}] \leavevmode{[}int, optional{]} Number of lags to show. If None, will return all \sphinxcode{\sphinxupquote{2 * len(x) - 1}} lags. Default is 10. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lags}}] \leavevmode{[}array (lenth \sphinxcode{\sphinxupquote{2*maxlags+1}}){]} lag vector. \item[{\sphinxstylestrong{c}}] \leavevmode{[}array (length \sphinxcode{\sphinxupquote{2*maxlags+1}}){]} auto correlation vector. \item[{\sphinxstylestrong{line}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}}{]} {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} added to the axes of the correlation \begin{quote} {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} if \sphinxstyleemphasis{usevlines} is True {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} if \sphinxstyleemphasis{usevlines} is False \end{quote} \item[{\sphinxstylestrong{b}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} or None{]} Horizontal line at 0 if \sphinxstyleemphasis{usevlines} is True None \sphinxstyleemphasis{usevlines} is False \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{linestyle}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} property, optional{]} Only used if usevlines is \sphinxcode{\sphinxupquote{False}}. \item[{\sphinxstylestrong{marker}}] \leavevmode{[}string, optional{]} Default is ‘o’. \end{description} \end{description}\end{quote} \paragraph{Notes} The cross correlation is performed with \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.correlate.html\#numpy.correlate}{\sphinxcode{\sphinxupquote{numpy.correlate()}}} with \sphinxcode{\sphinxupquote{mode = 2}}. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{Statistics} \label{\detokenize{api/axes_api:statistics}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.boxplot:matplotlib.axes.Axes.boxplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.boxplot}}}}} & Make a box and whisker plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.violinplot:matplotlib.axes.Axes.violinplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.violinplot}}}}} & Make a violin plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.violin:matplotlib.axes.Axes.violin}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.violin}}}}} & Drawing function for violin plots. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.bxp:matplotlib.axes.Axes.bxp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.bxp}}}}} & Drawing function for box and whisker plots. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axes.Axes.boxplot} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.boxplot:matplotlib-axes-axes-boxplot}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.boxplot::doc}}\index{boxplot() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.boxplot:matplotlib.axes.Axes.boxplot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{boxplot}}}{\emph{x}, \emph{notch=None}, \emph{sym=None}, \emph{vert=None}, \emph{whis=None}, \emph{positions=None}, \emph{widths=None}, \emph{patch\_artist=None}, \emph{bootstrap=None}, \emph{usermedians=None}, \emph{conf\_intervals=None}, \emph{meanline=None}, \emph{showmeans=None}, \emph{showcaps=None}, \emph{showbox=None}, \emph{showfliers=None}, \emph{boxprops=None}, \emph{labels=None}, \emph{flierprops=None}, \emph{medianprops=None}, \emph{meanprops=None}, \emph{capprops=None}, \emph{whiskerprops=None}, \emph{manage\_xticks=True}, \emph{autorange=False}, \emph{zorder=None}, \emph{*}, \emph{data=None}}{} Make a box and whisker plot. Make a box and whisker plot for each column of \sphinxcode{\sphinxupquote{x}} or each vector in sequence \sphinxcode{\sphinxupquote{x}}. The box extends from the lower to upper quartile values of the data, with a line at the median. The whiskers extend from the box to show the range of the data. Flier points are those past the end of the whiskers. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}Array or a sequence of vectors.{]} The input data. \item[{\sphinxstylestrong{notch}}] \leavevmode{[}bool, optional (False){]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, will produce a notched box plot. Otherwise, a rectangular boxplot is produced. The notches represent the confidence interval (CI) around the median. See the entry for the \sphinxcode{\sphinxupquote{bootstrap}} parameter for information regarding how the locations of the notches are computed. \begin{sphinxadmonition}{note}{Note:} In cases where the values of the CI are less than the lower quartile or greater than the upper quartile, the notches will extend beyond the box, giving it a distinctive “flipped” appearance. This is expected behavior and consistent with other statistical visualization packages. \end{sphinxadmonition} \item[{\sphinxstylestrong{sym}}] \leavevmode{[}str, optional{]} The default symbol for flier points. Enter an empty string (‘’) if you don’t want to show fliers. If \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, then the fliers default to ‘b+’ If you want more control use the flierprops kwarg. \item[{\sphinxstylestrong{vert}}] \leavevmode{[}bool, optional (True){]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} (default), makes the boxes vertical. If \sphinxhref{https://docs.python.org/3/library/constants.html\#False}{\sphinxcode{\sphinxupquote{False}}}, everything is drawn horizontally. \item[{\sphinxstylestrong{whis}}] \leavevmode{[}float, sequence, or string (default = 1.5){]} As a float, determines the reach of the whiskers to the beyond the first and third quartiles. In other words, where IQR is the interquartile range (\sphinxcode{\sphinxupquote{Q3-Q1}}), the upper whisker will extend to last datum less than \sphinxcode{\sphinxupquote{Q3 + whis*IQR}}). Similarly, the lower whisker will extend to the first datum greater than \sphinxcode{\sphinxupquote{Q1 - whis*IQR}}. Beyond the whiskers, data are considered outliers and are plotted as individual points. Set this to an unreasonably high value to force the whiskers to show the min and max values. Alternatively, set this to an ascending sequence of percentile (e.g., {[}5, 95{]}) to set the whiskers at specific percentiles of the data. Finally, \sphinxcode{\sphinxupquote{whis}} can be the string \sphinxcode{\sphinxupquote{'range'}} to force the whiskers to the min and max of the data. \item[{\sphinxstylestrong{bootstrap}}] \leavevmode{[}int, optional{]} Specifies whether to bootstrap the confidence intervals around the median for notched boxplots. If \sphinxcode{\sphinxupquote{bootstrap}} is None, no bootstrapping is performed, and notches are calculated using a Gaussian-based asymptotic approximation (see McGill, R., Tukey, J.W., and Larsen, W.A., 1978, and Kendall and Stuart, 1967). Otherwise, bootstrap specifies the number of times to bootstrap the median to determine its 95\% confidence intervals. Values between 1000 and 10000 are recommended. \item[{\sphinxstylestrong{usermedians}}] \leavevmode{[}array-like, optional{]} An array or sequence whose first dimension (or length) is compatible with \sphinxcode{\sphinxupquote{x}}. This overrides the medians computed by matplotlib for each element of \sphinxcode{\sphinxupquote{usermedians}} that is not \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}. When an element of \sphinxcode{\sphinxupquote{usermedians}} is None, the median will be computed by matplotlib as normal. \item[{\sphinxstylestrong{conf\_intervals}}] \leavevmode{[}array-like, optional{]} Array or sequence whose first dimension (or length) is compatible with \sphinxcode{\sphinxupquote{x}} and whose second dimension is 2. When the an element of \sphinxcode{\sphinxupquote{conf\_intervals}} is not None, the notch locations computed by matplotlib are overridden (provided \sphinxcode{\sphinxupquote{notch}} is \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}). When an element of \sphinxcode{\sphinxupquote{conf\_intervals}} is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, the notches are computed by the method specified by the other kwargs (e.g., \sphinxcode{\sphinxupquote{bootstrap}}). \item[{\sphinxstylestrong{positions}}] \leavevmode{[}array-like, optional{]} Sets the positions of the boxes. The ticks and limits are automatically set to match the positions. Defaults to \sphinxcode{\sphinxupquote{range(1, N+1)}} where N is the number of boxes to be drawn. \item[{\sphinxstylestrong{widths}}] \leavevmode{[}scalar or array-like{]} Sets the width of each box either with a scalar or a sequence. The default is 0.5, or \sphinxcode{\sphinxupquote{0.15*(distance between extreme positions)}}, if that is smaller. \item[{\sphinxstylestrong{patch\_artist}}] \leavevmode{[}bool, optional (False){]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#False}{\sphinxcode{\sphinxupquote{False}}} produces boxes with the Line2D artist. Otherwise, boxes and drawn with Patch artists. \item[{\sphinxstylestrong{labels}}] \leavevmode{[}sequence, optional{]} Labels for each dataset. Length must be compatible with dimensions of \sphinxcode{\sphinxupquote{x}}. \item[{\sphinxstylestrong{manage\_xticks}}] \leavevmode{[}bool, optional (True){]} If the function should adjust the xlim and xtick locations. \item[{\sphinxstylestrong{autorange}}] \leavevmode{[}bool, optional (False){]} When \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} and the data are distributed such that the 25th and 75th percentiles are equal, \sphinxcode{\sphinxupquote{whis}} is set to \sphinxcode{\sphinxupquote{'range'}} such that the whisker ends are at the minimum and maximum of the data. \item[{\sphinxstylestrong{meanline}}] \leavevmode{[}bool, optional (False){]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} (and \sphinxcode{\sphinxupquote{showmeans}} is \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}), will try to render the mean as a line spanning the full width of the box according to \sphinxcode{\sphinxupquote{meanprops}} (see below). Not recommended if \sphinxcode{\sphinxupquote{shownotches}} is also True. Otherwise, means will be shown as points. \item[{\sphinxstylestrong{zorder}}] \leavevmode{[}scalar, optional (None){]} Sets the zorder of the boxplot. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{result}}] \leavevmode{[}dict{]} A dictionary mapping each component of the boxplot to a list of the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.lines.Line2D}}}}} instances created. That dictionary has the following keys (assuming vertical boxplots): \begin{itemize} \item {} \sphinxcode{\sphinxupquote{boxes}}: the main body of the boxplot showing the quartiles and the median’s confidence intervals if enabled. \item {} \sphinxcode{\sphinxupquote{medians}}: horizontal lines at the median of each box. \item {} \sphinxcode{\sphinxupquote{whiskers}}: the vertical lines extending to the most extreme, non-outlier data points. \item {} \sphinxcode{\sphinxupquote{caps}}: the horizontal lines at the ends of the whiskers. \item {} \sphinxcode{\sphinxupquote{fliers}}: points representing data that extend beyond the whiskers (fliers). \item {} \sphinxcode{\sphinxupquote{means}}: points or lines representing the means. \end{itemize} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{showcaps}}] \leavevmode{[}bool, optional (True){]} Show the caps on the ends of whiskers. \item[{\sphinxstylestrong{showbox}}] \leavevmode{[}bool, optional (True){]} Show the central box. \item[{\sphinxstylestrong{showfliers}}] \leavevmode{[}bool, optional (True){]} Show the outliers beyond the caps. \item[{\sphinxstylestrong{showmeans}}] \leavevmode{[}bool, optional (False){]} Show the arithmetic means. \item[{\sphinxstylestrong{capprops}}] \leavevmode{[}dict, optional (None){]} Specifies the style of the caps. \item[{\sphinxstylestrong{boxprops}}] \leavevmode{[}dict, optional (None){]} Specifies the style of the box. \item[{\sphinxstylestrong{whiskerprops}}] \leavevmode{[}dict, optional (None){]} Specifies the style of the whiskers. \item[{\sphinxstylestrong{flierprops}}] \leavevmode{[}dict, optional (None){]} Specifies the style of the fliers. \item[{\sphinxstylestrong{medianprops}}] \leavevmode{[}dict, optional (None){]} Specifies the style of the median. \item[{\sphinxstylestrong{meanprops}}] \leavevmode{[}dict, optional (None){]} Specifies the style of the mean. \end{description} \end{description}\end{quote} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All positional and all keyword arguments. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.violinplot} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.violinplot:matplotlib-axes-axes-violinplot}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.violinplot::doc}}\index{violinplot() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.violinplot:matplotlib.axes.Axes.violinplot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{violinplot}}}{\emph{dataset}, \emph{positions=None}, \emph{vert=True}, \emph{widths=0.5}, \emph{showmeans=False}, \emph{showextrema=True}, \emph{showmedians=False}, \emph{points=100}, \emph{bw\_method=None}, \emph{*}, \emph{data=None}}{} Make a violin plot. Make a violin plot for each column of \sphinxstyleemphasis{dataset} or each vector in sequence \sphinxstyleemphasis{dataset}. Each filled area extends to represent the entire data range, with optional lines at the mean, the median, the minimum, and the maximum. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{dataset}}] \leavevmode{[}Array or a sequence of vectors.{]} The input data. \item[{\sphinxstylestrong{positions}}] \leavevmode{[}array-like, default = {[}1, 2, …, n{]}{]} Sets the positions of the violins. The ticks and limits are automatically set to match the positions. \item[{\sphinxstylestrong{vert}}] \leavevmode{[}bool, default = True.{]} If true, creates a vertical violin plot. Otherwise, creates a horizontal violin plot. \item[{\sphinxstylestrong{widths}}] \leavevmode{[}array-like, default = 0.5{]} Either a scalar or a vector that sets the maximal width of each violin. The default is 0.5, which uses about half of the available horizontal space. \item[{\sphinxstylestrong{showmeans}}] \leavevmode{[}bool, default = False{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, will toggle rendering of the means. \item[{\sphinxstylestrong{showextrema}}] \leavevmode{[}bool, default = True{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, will toggle rendering of the extrema. \item[{\sphinxstylestrong{showmedians}}] \leavevmode{[}bool, default = False{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, will toggle rendering of the medians. \item[{\sphinxstylestrong{points}}] \leavevmode{[}scalar, default = 100{]} Defines the number of points to evaluate each of the gaussian kernel density estimations at. \item[{\sphinxstylestrong{bw\_method}}] \leavevmode{[}str, scalar or callable, optional{]} The method used to calculate the estimator bandwidth. This can be ‘scott’, ‘silverman’, a scalar constant or a callable. If a scalar, this will be used directly as \sphinxcode{\sphinxupquote{kde.factor}}. If a callable, it should take a \sphinxcode{\sphinxupquote{GaussianKDE}} instance as its only parameter and return a scalar. If None (default), ‘scott’ is used. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{result}}] \leavevmode{[}dict{]} A dictionary mapping each component of the violinplot to a list of the corresponding collection instances created. The dictionary has the following keys: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{bodies}}: A list of the {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.PolyCollection}}}}} instances containing the filled area of each violin. \item {} \sphinxcode{\sphinxupquote{cmeans}}: A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} instance created to identify the mean values of each of the violin’s distribution. \item {} \sphinxcode{\sphinxupquote{cmins}}: A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} instance created to identify the bottom of each violin’s distribution. \item {} \sphinxcode{\sphinxupquote{cmaxes}}: A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} instance created to identify the top of each violin’s distribution. \item {} \sphinxcode{\sphinxupquote{cbars}}: A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} instance created to identify the centers of each violin’s distribution. \item {} \sphinxcode{\sphinxupquote{cmedians}}: A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} instance created to identify the median values of each of the violin’s distribution. \end{itemize} \end{description} \end{description}\end{quote} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘dataset’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.violin} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.violin:matplotlib-axes-axes-violin}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.violin::doc}}\index{violin() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.violin:matplotlib.axes.Axes.violin}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{violin}}}{\emph{vpstats}, \emph{positions=None}, \emph{vert=True}, \emph{widths=0.5}, \emph{showmeans=False}, \emph{showextrema=True}, \emph{showmedians=False}}{} Drawing function for violin plots. Draw a violin plot for each column of \sphinxcode{\sphinxupquote{vpstats}}. Each filled area extends to represent the entire data range, with optional lines at the mean, the median, the minimum, and the maximum. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{vpstats}}] \leavevmode{[}list of dicts{]} A list of dictionaries containing stats for each violin plot. Required keys are: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{coords}}: A list of scalars containing the coordinates that the violin’s kernel density estimate were evaluated at. \item {} \sphinxcode{\sphinxupquote{vals}}: A list of scalars containing the values of the kernel density estimate at each of the coordinates given in \sphinxstyleemphasis{coords}. \item {} \sphinxcode{\sphinxupquote{mean}}: The mean value for this violin’s dataset. \item {} \sphinxcode{\sphinxupquote{median}}: The median value for this violin’s dataset. \item {} \sphinxcode{\sphinxupquote{min}}: The minimum value for this violin’s dataset. \item {} \sphinxcode{\sphinxupquote{max}}: The maximum value for this violin’s dataset. \end{itemize} \item[{\sphinxstylestrong{positions}}] \leavevmode{[}array-like, default = {[}1, 2, …, n{]}{]} Sets the positions of the violins. The ticks and limits are automatically set to match the positions. \item[{\sphinxstylestrong{vert}}] \leavevmode{[}bool, default = True.{]} If true, plots the violins veritcally. Otherwise, plots the violins horizontally. \item[{\sphinxstylestrong{widths}}] \leavevmode{[}array-like, default = 0.5{]} Either a scalar or a vector that sets the maximal width of each violin. The default is 0.5, which uses about half of the available horizontal space. \item[{\sphinxstylestrong{showmeans}}] \leavevmode{[}bool, default = False{]} If true, will toggle rendering of the means. \item[{\sphinxstylestrong{showextrema}}] \leavevmode{[}bool, default = True{]} If true, will toggle rendering of the extrema. \item[{\sphinxstylestrong{showmedians}}] \leavevmode{[}bool, default = False{]} If true, will toggle rendering of the medians. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{result}}] \leavevmode{[}dict{]} A dictionary mapping each component of the violinplot to a list of the corresponding collection instances created. The dictionary has the following keys: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{bodies}}: A list of the {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.PolyCollection}}}}} instances containing the filled area of each violin. \item {} \sphinxcode{\sphinxupquote{cmeans}}: A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} instance created to identify the mean values of each of the violin’s distribution. \item {} \sphinxcode{\sphinxupquote{cmins}}: A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} instance created to identify the bottom of each violin’s distribution. \item {} \sphinxcode{\sphinxupquote{cmaxes}}: A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} instance created to identify the top of each violin’s distribution. \item {} \sphinxcode{\sphinxupquote{cbars}}: A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} instance created to identify the centers of each violin’s distribution. \item {} \sphinxcode{\sphinxupquote{cmedians}}: A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} instance created to identify the median values of each of the violin’s distribution. \end{itemize} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.bxp} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.bxp:matplotlib-axes-axes-bxp}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.bxp::doc}}\index{bxp() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.bxp:matplotlib.axes.Axes.bxp}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{bxp}}}{\emph{bxpstats}, \emph{positions=None}, \emph{widths=None}, \emph{vert=True}, \emph{patch\_artist=False}, \emph{shownotches=False}, \emph{showmeans=False}, \emph{showcaps=True}, \emph{showbox=True}, \emph{showfliers=True}, \emph{boxprops=None}, \emph{whiskerprops=None}, \emph{flierprops=None}, \emph{medianprops=None}, \emph{capprops=None}, \emph{meanprops=None}, \emph{meanline=False}, \emph{manage\_xticks=True}, \emph{zorder=None}}{} Drawing function for box and whisker plots. Make a box and whisker plot for each column of \sphinxstyleemphasis{x} or each vector in sequence \sphinxstyleemphasis{x}. The box extends from the lower to upper quartile values of the data, with a line at the median. The whiskers extend from the box to show the range of the data. Flier points are those past the end of the whiskers. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{bxpstats}}] \leavevmode{[}list of dicts{]} A list of dictionaries containing stats for each boxplot. Required keys are: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{med}}: The median (scalar float). \item {} \sphinxcode{\sphinxupquote{q1}}: The first quartile (25th percentile) (scalar float). \item {} \sphinxcode{\sphinxupquote{q3}}: The third quartile (75th percentile) (scalar float). \item {} \sphinxcode{\sphinxupquote{whislo}}: Lower bound of the lower whisker (scalar float). \item {} \sphinxcode{\sphinxupquote{whishi}}: Upper bound of the upper whisker (scalar float). \end{itemize} Optional keys are: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{mean}}: The mean (scalar float). Needed if \sphinxcode{\sphinxupquote{showmeans=True}}. \item {} \sphinxcode{\sphinxupquote{fliers}}: Data beyond the whiskers (sequence of floats). Needed if \sphinxcode{\sphinxupquote{showfliers=True}}. \item {} \sphinxcode{\sphinxupquote{cilo}} \& \sphinxcode{\sphinxupquote{cihi}}: Lower and upper confidence intervals about the median. Needed if \sphinxcode{\sphinxupquote{shownotches=True}}. \item {} \sphinxcode{\sphinxupquote{label}}: Name of the dataset (string). If available, this will be used a tick label for the boxplot \end{itemize} \item[{\sphinxstylestrong{positions}}] \leavevmode{[}array-like, default = {[}1, 2, …, n{]}{]} Sets the positions of the boxes. The ticks and limits are automatically set to match the positions. \item[{\sphinxstylestrong{widths}}] \leavevmode{[}array-like, default = None{]} Either a scalar or a vector and sets the width of each box. The default is \sphinxcode{\sphinxupquote{0.15*(distance between extreme positions)}}, clipped to no less than 0.15 and no more than 0.5. \item[{\sphinxstylestrong{vert}}] \leavevmode{[}bool, default = False{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} (default), makes the boxes vertical. If \sphinxhref{https://docs.python.org/3/library/constants.html\#False}{\sphinxcode{\sphinxupquote{False}}}, makes horizontal boxes. \item[{\sphinxstylestrong{patch\_artist}}] \leavevmode{[}bool, default = False{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#False}{\sphinxcode{\sphinxupquote{False}}} produces boxes with the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} artist. If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} produces boxes with the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} artist. \item[{\sphinxstylestrong{shownotches}}] \leavevmode{[}bool, default = False{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#False}{\sphinxcode{\sphinxupquote{False}}} (default), produces a rectangular box plot. If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, will produce a notched box plot \item[{\sphinxstylestrong{showmeans}}] \leavevmode{[}bool, default = False{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, will toggle on the rendering of the means \item[{\sphinxstylestrong{showcaps}}] \leavevmode{[}bool, default = True{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, will toggle on the rendering of the caps \item[{\sphinxstylestrong{showbox}}] \leavevmode{[}bool, default = True{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, will toggle on the rendering of the box \item[{\sphinxstylestrong{showfliers}}] \leavevmode{[}bool, default = True{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, will toggle on the rendering of the fliers \item[{\sphinxstylestrong{boxprops}}] \leavevmode{[}dict or None (default){]} If provided, will set the plotting style of the boxes \item[{\sphinxstylestrong{whiskerprops}}] \leavevmode{[}dict or None (default){]} If provided, will set the plotting style of the whiskers \item[{\sphinxstylestrong{capprops}}] \leavevmode{[}dict or None (default){]} If provided, will set the plotting style of the caps \item[{\sphinxstylestrong{flierprops}}] \leavevmode{[}dict or None (default){]} If provided will set the plotting style of the fliers \item[{\sphinxstylestrong{medianprops}}] \leavevmode{[}dict or None (default){]} If provided, will set the plotting style of the medians \item[{\sphinxstylestrong{meanprops}}] \leavevmode{[}dict or None (default){]} If provided, will set the plotting style of the means \item[{\sphinxstylestrong{meanline}}] \leavevmode{[}bool, default = False{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} (and \sphinxstyleemphasis{showmeans} is \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}), will try to render the mean as a line spanning the full width of the box according to \sphinxstyleemphasis{meanprops}. Not recommended if \sphinxstyleemphasis{shownotches} is also True. Otherwise, means will be shown as points. \item[{\sphinxstylestrong{manage\_xticks}}] \leavevmode{[}bool, default = True{]} If the function should adjust the xlim and xtick locations. \item[{\sphinxstylestrong{zorder}}] \leavevmode{[}scalar, default = None{]} The zorder of the resulting boxplot \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{result}}] \leavevmode{[}dict{]} A dictionary mapping each component of the boxplot to a list of the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.lines.Line2D}}}}} instances created. That dictionary has the following keys (assuming vertical boxplots): \begin{itemize} \item {} \sphinxcode{\sphinxupquote{boxes}}: the main body of the boxplot showing the quartiles and the median’s confidence intervals if enabled. \item {} \sphinxcode{\sphinxupquote{medians}}: horizontal lines at the median of each box. \item {} \sphinxcode{\sphinxupquote{whiskers}}: the vertical lines extending to the most extreme, non-outlier data points. \item {} \sphinxcode{\sphinxupquote{caps}}: the horizontal lines at the ends of the whiskers. \item {} \sphinxcode{\sphinxupquote{fliers}}: points representing data that extend beyond the whiskers (fliers). \item {} \sphinxcode{\sphinxupquote{means}}: points or lines representing the means. \end{itemize} \end{description} \end{description}\end{quote} \paragraph{Examples} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{bxp_00_00}.pdf} \end{figure} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{bxp_01_00}.pdf} \end{figure} \end{fulllineitems} \subsection{Binned} \label{\detokenize{api/axes_api:binned}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hexbin:matplotlib.axes.Axes.hexbin}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.hexbin}}}}} & Make a hexagonal binning plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hist:matplotlib.axes.Axes.hist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.hist}}}}} & Plot a histogram. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hist2d:matplotlib.axes.Axes.hist2d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.hist2d}}}}} & Make a 2D histogram plot. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axes.Axes.hexbin} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.hexbin:matplotlib-axes-axes-hexbin}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.hexbin::doc}}\index{hexbin() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.hexbin:matplotlib.axes.Axes.hexbin}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{hexbin}}}{\emph{x}, \emph{y}, \emph{C=None}, \emph{gridsize=100}, \emph{bins=None}, \emph{xscale='linear'}, \emph{yscale='linear'}, \emph{extent=None}, \emph{cmap=None}, \emph{norm=None}, \emph{vmin=None}, \emph{vmax=None}, \emph{alpha=None}, \emph{linewidths=None}, \emph{edgecolors='face'}, \emph{reduce\_C\_function=\textless{}function mean\textgreater{}}, \emph{mincnt=None}, \emph{marginals=False}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Make a hexagonal binning plot. Make a hexagonal binning plot of \sphinxstyleemphasis{x} versus \sphinxstyleemphasis{y}, where \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} are 1-D sequences of the same length, \sphinxstyleemphasis{N}. If \sphinxstyleemphasis{C} is \sphinxstyleemphasis{None} (the default), this is a histogram of the number of occurrences of the observations at (x{[}i{]},y{[}i{]}). If \sphinxstyleemphasis{C} is specified, it specifies values at the coordinate (x{[}i{]},y{[}i{]}). These values are accumulated for each hexagonal bin and then reduced according to \sphinxstyleemphasis{reduce\_C\_function}, which defaults to numpy’s mean function (np.mean). (If \sphinxstyleemphasis{C} is specified, it must also be a 1-D sequence of the same length as \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}.) \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}array or masked array{]} \item[{\sphinxstylestrong{C}}] \leavevmode{[}array or masked array, optional, default is \sphinxstyleemphasis{None}{]} \item[{\sphinxstylestrong{gridsize}}] \leavevmode{[}int or (int, int), optional, default is 100{]} The number of hexagons in the \sphinxstyleemphasis{x}-direction, default is 100. The corresponding number of hexagons in the \sphinxstyleemphasis{y}-direction is chosen such that the hexagons are approximately regular. Alternatively, gridsize can be a tuple with two elements specifying the number of hexagons in the \sphinxstyleemphasis{x}-direction and the \sphinxstyleemphasis{y}-direction. \item[{\sphinxstylestrong{bins}}] \leavevmode{[}\{‘log’\} or int or sequence, optional, default is \sphinxstyleemphasis{None}{]} If \sphinxstyleemphasis{None}, no binning is applied; the color of each hexagon directly corresponds to its count value. If ‘log’, use a logarithmic scale for the color map. Internally, $log_{10}(i+1)$ is used to determine the hexagon color. If an integer, divide the counts in the specified number of bins, and color the hexagons accordingly. If a sequence of values, the values of the lower bound of the bins to be used. \item[{\sphinxstylestrong{xscale}}] \leavevmode{[}\{‘linear’, ‘log’\}, optional, default is ‘linear’{]} Use a linear or log10 scale on the horizontal axis. \item[{\sphinxstylestrong{yscale}}] \leavevmode{[}\{‘linear’, ‘log’\}, optional, default is ‘linear’{]} Use a linear or log10 scale on the vertical axis. \item[{\sphinxstylestrong{mincnt}}] \leavevmode{[}int \textgreater{} 0, optional, default is \sphinxstyleemphasis{None}{]} If not \sphinxstyleemphasis{None}, only display cells with more than \sphinxstyleemphasis{mincnt} number of points in the cell \item[{\sphinxstylestrong{marginals}}] \leavevmode{[}bool, optional, default is \sphinxstyleemphasis{False}{]} if marginals is \sphinxstyleemphasis{True}, plot the marginal density as colormapped rectagles along the bottom of the x-axis and left of the y-axis \item[{\sphinxstylestrong{extent}}] \leavevmode{[}scalar, optional, default is \sphinxstyleemphasis{None}{]} The limits of the bins. The default assigns the limits based on \sphinxstyleemphasis{gridsize}, \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}, \sphinxstyleemphasis{xscale} and \sphinxstyleemphasis{yscale}. If \sphinxstyleemphasis{xscale} or \sphinxstyleemphasis{yscale} is set to ‘log’, the limits are expected to be the exponent for a power of 10. E.g. for x-limits of 1 and 50 in ‘linear’ scale and y-limits of 10 and 1000 in ‘log’ scale, enter (1, 50, 1, 3). Order of scalars is (left, right, bottom, top). \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{object}}] \leavevmode a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} instance; use {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_array()}}}}} on this {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} to get the counts in each hexagon. If \sphinxstyleemphasis{marginals} is \sphinxstyleemphasis{True}, horizontal bar and vertical bar (both PolyCollections) will be attached to the return collection as attributes \sphinxstyleemphasis{hbar} and \sphinxstyleemphasis{vbar}. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}object, optional, default is \sphinxstyleemphasis{None}{]} a {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap}}}}} instance. If \sphinxstyleemphasis{None}, defaults to rc \sphinxcode{\sphinxupquote{image.cmap}}. \item[{\sphinxstylestrong{norm}}] \leavevmode{[}object, optional, default is \sphinxstyleemphasis{None}{]} {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance is used to scale luminance data to 0,1. \item[{\sphinxstylestrong{vmin, vmax}}] \leavevmode{[}scalar, optional, default is \sphinxstyleemphasis{None}{]} \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} are used in conjunction with \sphinxstyleemphasis{norm} to normalize luminance data. If \sphinxstyleemphasis{None}, the min and max of the color array \sphinxstyleemphasis{C} are used. Note if you pass a norm instance your settings for \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} will be ignored. \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}scalar between 0 and 1, optional, default is \sphinxstyleemphasis{None}{]} the alpha value for the patches \item[{\sphinxstylestrong{linewidths}}] \leavevmode{[}scalar, optional, default is \sphinxstyleemphasis{None}{]} If \sphinxstyleemphasis{None}, defaults to 1.0. \item[{\sphinxstylestrong{edgecolors}}] \leavevmode{[}\{‘face’, ‘none’, \sphinxstyleemphasis{None}\} or color, optional{]} If ‘face’ (the default), draws the edges in the same color as the fill color. If ‘none’, no edge is drawn; this can sometimes lead to unsightly unpainted pixels between the hexagons. If \sphinxstyleemphasis{None}, draws outlines in the default color. If a matplotlib color arg, draws outlines in the specified color. \end{description} \end{description}\end{quote} \paragraph{Notes} The standard descriptions of all the {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Collection}}}}} parameters: \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or antialiaseds & Boolean or sequence of booleans \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{array}}}}} & ndarray \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}} & a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cmap}}}}} & a colormap or registered colormap name \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color arg or sequence of rgba tuples \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or edgecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or facecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or dashes or linestyles & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or linewidths or lw & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_norm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{norm}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offset\_position}}}}} & {[} ‘screen’ \textbar{} ‘data’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offsets}}}}} & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_urls}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{urls}}}}} & List{[}str{]} or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.hist} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.hist:matplotlib-axes-axes-hist}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.hist::doc}}\index{hist() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.hist:matplotlib.axes.Axes.hist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{hist}}}{\emph{x}, \emph{bins=None}, \emph{range=None}, \emph{density=None}, \emph{weights=None}, \emph{cumulative=False}, \emph{bottom=None}, \emph{histtype='bar'}, \emph{align='mid'}, \emph{orientation='vertical'}, \emph{rwidth=None}, \emph{log=False}, \emph{color=None}, \emph{label=None}, \emph{stacked=False}, \emph{normed=None}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Plot a histogram. Compute and draw the histogram of \sphinxstyleemphasis{x}. The return value is a tuple (\sphinxstyleemphasis{n}, \sphinxstyleemphasis{bins}, \sphinxstyleemphasis{patches}) or ({[}\sphinxstyleemphasis{n0}, \sphinxstyleemphasis{n1}, …{]}, \sphinxstyleemphasis{bins}, {[}\sphinxstyleemphasis{patches0}, \sphinxstyleemphasis{patches1},…{]}) if the input contains multiple data. Multiple data can be provided via \sphinxstyleemphasis{x} as a list of datasets of potentially different length ({[}\sphinxstyleemphasis{x0}, \sphinxstyleemphasis{x1}, …{]}), or as a 2-D ndarray in which each column is a dataset. Note that the ndarray form is transposed relative to the list form. Masked arrays are not supported at present. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}(n,) array or sequence of (n,) arrays{]} Input values, this takes either a single array or a sequence of arrays which are not required to be of the same length \item[{\sphinxstylestrong{bins}}] \leavevmode{[}integer or sequence or ‘auto’, optional{]} If an integer is given, \sphinxcode{\sphinxupquote{bins + 1}} bin edges are calculated and returned, consistent with \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html\#numpy.histogram}{\sphinxcode{\sphinxupquote{numpy.histogram()}}}. If \sphinxcode{\sphinxupquote{bins}} is a sequence, gives bin edges, including left edge of first bin and right edge of last bin. In this case, \sphinxcode{\sphinxupquote{bins}} is returned unmodified. All but the last (righthand-most) bin is half-open. In other words, if \sphinxcode{\sphinxupquote{bins}} is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{]} \end{sphinxVerbatim} then the first bin is \sphinxcode{\sphinxupquote{{[}1, 2)}} (including 1, but excluding 2) and the second \sphinxcode{\sphinxupquote{{[}2, 3)}}. The last bin, however, is \sphinxcode{\sphinxupquote{{[}3, 4{]}}}, which \sphinxstyleemphasis{includes} 4. Unequally spaced bins are supported if \sphinxstyleemphasis{bins} is a sequence. If Numpy 1.11 is installed, may also be \sphinxcode{\sphinxupquote{'auto'}}. Default is taken from the rcParam \sphinxcode{\sphinxupquote{hist.bins}}. \item[{\sphinxstylestrong{range}}] \leavevmode{[}tuple or None, optional{]} The lower and upper range of the bins. Lower and upper outliers are ignored. If not provided, \sphinxstyleemphasis{range} is \sphinxcode{\sphinxupquote{(x.min(), x.max())}}. Range has no effect if \sphinxstyleemphasis{bins} is a sequence. If \sphinxstyleemphasis{bins} is a sequence or \sphinxstyleemphasis{range} is specified, autoscaling is based on the specified bin range instead of the range of x. Default is \sphinxcode{\sphinxupquote{None}} \item[{\sphinxstylestrong{density}}] \leavevmode{[}boolean, optional{]} If \sphinxcode{\sphinxupquote{True}}, the first element of the return tuple will be the counts normalized to form a probability density, i.e., the area (or integral) under the histogram will sum to 1. This is achieved by dividing the count by the number of observations times the bin width and not dividing by the total number of observations. If \sphinxstyleemphasis{stacked} is also \sphinxcode{\sphinxupquote{True}}, the sum of the histograms is normalized to 1. Default is \sphinxcode{\sphinxupquote{None}} for both \sphinxstyleemphasis{normed} and \sphinxstyleemphasis{density}. If either is set, then that value will be used. If neither are set, then the args will be treated as \sphinxcode{\sphinxupquote{False}}. If both \sphinxstyleemphasis{density} and \sphinxstyleemphasis{normed} are set an error is raised. \item[{\sphinxstylestrong{weights}}] \leavevmode{[}(n, ) array\_like or None, optional{]} An array of weights, of the same shape as \sphinxstyleemphasis{x}. Each value in \sphinxstyleemphasis{x} only contributes its associated weight towards the bin count (instead of 1). If \sphinxstyleemphasis{normed} or \sphinxstyleemphasis{density} is \sphinxcode{\sphinxupquote{True}}, the weights are normalized, so that the integral of the density over the range remains 1. Default is \sphinxcode{\sphinxupquote{None}} \item[{\sphinxstylestrong{cumulative}}] \leavevmode{[}boolean, optional{]} If \sphinxcode{\sphinxupquote{True}}, then a histogram is computed where each bin gives the counts in that bin plus all bins for smaller values. The last bin gives the total number of datapoints. If \sphinxstyleemphasis{normed} or \sphinxstyleemphasis{density} is also \sphinxcode{\sphinxupquote{True}} then the histogram is normalized such that the last bin equals 1. If \sphinxstyleemphasis{cumulative} evaluates to less than 0 (e.g., -1), the direction of accumulation is reversed. In this case, if \sphinxstyleemphasis{normed} and/or \sphinxstyleemphasis{density} is also \sphinxcode{\sphinxupquote{True}}, then the histogram is normalized such that the first bin equals 1. Default is \sphinxcode{\sphinxupquote{False}} \item[{\sphinxstylestrong{bottom}}] \leavevmode{[}array\_like, scalar, or None{]} Location of the bottom baseline of each bin. If a scalar, the base line for each bin is shifted by the same amount. If an array, each bin is shifted independently and the length of bottom must match the number of bins. If None, defaults to 0. Default is \sphinxcode{\sphinxupquote{None}} \item[{\sphinxstylestrong{histtype}}] \leavevmode{[}\{‘bar’, ‘barstacked’, ‘step’, ‘stepfilled’\}, optional{]} The type of histogram to draw. \begin{itemize} \item {} ‘bar’ is a traditional bar-type histogram. If multiple data are given the bars are arranged side by side. \item {} ‘barstacked’ is a bar-type histogram where multiple data are stacked on top of each other. \item {} ‘step’ generates a lineplot that is by default unfilled. \item {} ‘stepfilled’ generates a lineplot that is by default filled. \end{itemize} Default is ‘bar’ \item[{\sphinxstylestrong{align}}] \leavevmode{[}\{‘left’, ‘mid’, ‘right’\}, optional{]} Controls how the histogram is plotted. \begin{itemize} \item {} ‘left’: bars are centered on the left bin edges. \item {} ‘mid’: bars are centered between the bin edges. \item {} ‘right’: bars are centered on the right bin edges. \end{itemize} Default is ‘mid’ \item[{\sphinxstylestrong{orientation}}] \leavevmode{[}\{‘horizontal’, ‘vertical’\}, optional{]} If ‘horizontal’, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.barh:matplotlib.pyplot.barh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{barh}}}}} will be used for bar-type histograms and the \sphinxstyleemphasis{bottom} kwarg will be the left edges. \item[{\sphinxstylestrong{rwidth}}] \leavevmode{[}scalar or None, optional{]} The relative width of the bars as a fraction of the bin width. If \sphinxcode{\sphinxupquote{None}}, automatically compute the width. Ignored if \sphinxstyleemphasis{histtype} is ‘step’ or ‘stepfilled’. Default is \sphinxcode{\sphinxupquote{None}} \item[{\sphinxstylestrong{log}}] \leavevmode{[}boolean, optional{]} If \sphinxcode{\sphinxupquote{True}}, the histogram axis will be set to a log scale. If \sphinxstyleemphasis{log} is \sphinxcode{\sphinxupquote{True}} and \sphinxstyleemphasis{x} is a 1D array, empty bins will be filtered out and only the non-empty \sphinxcode{\sphinxupquote{(n, bins, patches)}} will be returned. Default is \sphinxcode{\sphinxupquote{False}} \item[{\sphinxstylestrong{color}}] \leavevmode{[}color or array\_like of colors or None, optional{]} Color spec or sequence of color specs, one per dataset. Default (\sphinxcode{\sphinxupquote{None}}) uses the standard line color sequence. Default is \sphinxcode{\sphinxupquote{None}} \item[{\sphinxstylestrong{label}}] \leavevmode{[}string or None, optional{]} String, or sequence of strings to match multiple datasets. Bar charts yield multiple patches per dataset, but only the first gets the label, so that the legend command will work as expected. default is \sphinxcode{\sphinxupquote{None}} \item[{\sphinxstylestrong{stacked}}] \leavevmode{[}boolean, optional{]} If \sphinxcode{\sphinxupquote{True}}, multiple data are stacked on top of each other If \sphinxcode{\sphinxupquote{False}} multiple data are arranged side by side if histtype is ‘bar’ or on top of each other if histtype is ‘step’ Default is \sphinxcode{\sphinxupquote{False}} \item[{\sphinxstylestrong{normed}}] \leavevmode{[}bool, optional{]} Deprecated; use the density keyword argument instead. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{n}}] \leavevmode{[}array or list of arrays{]} The values of the histogram bins. See \sphinxstyleemphasis{normed} or \sphinxstyleemphasis{density} and \sphinxstyleemphasis{weights} for a description of the possible semantics. If input \sphinxstyleemphasis{x} is an array, then this is an array of length \sphinxstyleemphasis{nbins}. If input is a sequence arrays \sphinxcode{\sphinxupquote{{[}data1, data2,..{]}}}, then this is a list of arrays with the values of the histograms for each of the arrays in the same order. \item[{\sphinxstylestrong{bins}}] \leavevmode{[}array{]} The edges of the bins. Length nbins + 1 (nbins left edges and right edge of last bin). Always a single array even when multiple data sets are passed in. \item[{\sphinxstylestrong{patches}}] \leavevmode{[}list or list of lists{]} Silent list of individual patches used to create the histogram or list of such list if multiple input datasets. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} properties{]} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hist2d:matplotlib.axes.Axes.hist2d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hist2d}}}}}}] \leavevmode 2D histograms \end{description} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘weights’, ‘x’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.axes.Axes.hist}}} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.hist:examples-using-matplotlib-axes-axes-hist}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_histogram\_features.py} \end{itemize} \subsubsection{matplotlib.axes.Axes.hist2d} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.hist2d:matplotlib-axes-axes-hist2d}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.hist2d::doc}}\index{hist2d() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.hist2d:matplotlib.axes.Axes.hist2d}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{hist2d}}}{\emph{x}, \emph{y}, \emph{bins=10}, \emph{range=None}, \emph{normed=False}, \emph{weights=None}, \emph{cmin=None}, \emph{cmax=None}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Make a 2D histogram plot. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y: array\_like, shape (n, )}}] \leavevmode Input values \item[{\sphinxstylestrong{bins: {[}None \textbar{} int \textbar{} {[}int, int{]} \textbar{} array\_like \textbar{} {[}array, array{]}{]}}}] \leavevmode The bin specification: \begin{itemize} \item {} If int, the number of bins for the two dimensions (nx=ny=bins). \item {} If {[}int, int{]}, the number of bins in each dimension (nx, ny = bins). \item {} If array\_like, the bin edges for the two dimensions (x\_edges=y\_edges=bins). \item {} If {[}array, array{]}, the bin edges in each dimension (x\_edges, y\_edges = bins). \end{itemize} The default value is 10. \item[{\sphinxstylestrong{range}}] \leavevmode{[}array\_like shape(2, 2), optional, default: None{]} The leftmost and rightmost edges of the bins along each dimension (if not specified explicitly in the bins parameters): {[}{[}xmin, xmax{]}, {[}ymin, ymax{]}{]}. All values outside of this range will be considered outliers and not tallied in the histogram. \item[{\sphinxstylestrong{normed}}] \leavevmode{[}boolean, optional, default: False{]} Normalize histogram. \item[{\sphinxstylestrong{weights}}] \leavevmode{[}array\_like, shape (n, ), optional, default: None{]} An array of values w\_i weighing each sample (x\_i, y\_i). \item[{\sphinxstylestrong{cmin}}] \leavevmode{[}scalar, optional, default: None{]} All bins that has count less than cmin will not be displayed and these count values in the return value count histogram will also be set to nan upon return \item[{\sphinxstylestrong{cmax}}] \leavevmode{[}scalar, optional, default: None{]} All bins that has count more than cmax will not be displayed (set to none before passing to imshow) and these count values in the return value count histogram will also be set to nan upon return \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{h}}] \leavevmode{[}2D array{]} The bi-dimensional histogram of samples x and y. Values in x are histogrammed along the first dimension and values in y are histogrammed along the second dimension. \item[{\sphinxstylestrong{xedges}}] \leavevmode{[}1D array{]} The bin edges along the x axis. \item[{\sphinxstylestrong{yedges}}] \leavevmode{[}1D array{]} The bin edges along the y axis. \item[{\sphinxstylestrong{image}}] \leavevmode{[}AxesImage{]} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}\{Colormap, string\}, optional{]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap}}}}} instance. If not set, use rc settings. \item[{\sphinxstylestrong{norm}}] \leavevmode{[}Normalize, optional{]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance is used to scale luminance data to \sphinxcode{\sphinxupquote{{[}0, 1{]}}}. If not set, defaults to \sphinxcode{\sphinxupquote{Normalize()}}. \item[{\sphinxstylestrong{vmin/vmax}}] \leavevmode{[}\{None, scalar\}, optional{]} Arguments passed to the \sphinxcode{\sphinxupquote{Normalize}} instance. \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}\sphinxcode{\sphinxupquote{0 \textless{}= scalar \textless{}= 1}} or \sphinxcode{\sphinxupquote{None}}, optional{]} The alpha blending value. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hist:matplotlib.axes.Axes.hist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hist}}}}}}] \leavevmode 1D histogram \end{description} \paragraph{Notes} Rendering the histogram with a logarithmic color scale is accomplished by passing a \sphinxcode{\sphinxupquote{colors.LogNorm}} instance to the \sphinxstyleemphasis{norm} keyword argument. Likewise, power-law normalization (similar in effect to gamma correction) can be accomplished with \sphinxcode{\sphinxupquote{colors.PowerNorm}}. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘weights’, ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{Contours} \label{\detokenize{api/axes_api:contours}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.clabel:matplotlib.axes.Axes.clabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.clabel}}}}} & Label a contour plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contour:matplotlib.axes.Axes.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.contour}}}}} & Plot contours. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contourf:matplotlib.axes.Axes.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.contourf}}}}} & Plot contours. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axes.Axes.clabel} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.clabel:matplotlib-axes-axes-clabel}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.clabel::doc}}\index{clabel() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.clabel:matplotlib.axes.Axes.clabel}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{clabel}}}{\emph{CS}, \emph{*args}, \emph{**kwargs}}{} Label a contour plot. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{clabel}\PYG{p}{(}\PYG{n}{cs}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Adds labels to line contours in \sphinxstyleemphasis{cs}, where \sphinxstyleemphasis{cs} is a {\hyperref[\detokenize{api/contour_api:matplotlib.contour.ContourSet}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ContourSet}}}}} object returned by contour. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{clabel}\PYG{p}{(}\PYG{n}{cs}\PYG{p}{,} \PYG{n}{v}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} only labels contours listed in \sphinxstyleemphasis{v}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fontsize}}] \leavevmode{[}string or float, optional{]} Size in points or relative size e.g., ‘smaller’, ‘x-large’. See \sphinxcode{\sphinxupquote{Text.set\_size}} for accepted string values. \item[{\sphinxstylestrong{colors :}}] \leavevmode Color of each label \begin{itemize} \item {} if \sphinxstyleemphasis{None}, the color of each label matches the color of the corresponding contour \item {} if one string color, e.g., \sphinxstyleemphasis{colors} = ‘r’ or \sphinxstyleemphasis{colors} = ‘red’, all labels will be plotted in this color \item {} if a tuple of matplotlib color args (string, float, rgb, etc), different labels will be plotted in different colors in the order specified \end{itemize} \item[{\sphinxstylestrong{inline}}] \leavevmode{[}bool, optional{]} If \sphinxcode{\sphinxupquote{True}} the underlying contour is removed where the label is placed. Default is \sphinxcode{\sphinxupquote{True}}. \item[{\sphinxstylestrong{inline\_spacing}}] \leavevmode{[}float, optional{]} Space in pixels to leave on each side of label when placing inline. Defaults to 5. This spacing will be exact for labels at locations where the contour is straight, less so for labels on curved contours. \item[{\sphinxstylestrong{fmt}}] \leavevmode{[}string or dict, optional{]} A format string for the label. Default is ‘\%1.3f’ Alternatively, this can be a dictionary matching contour levels with arbitrary strings to use for each contour level (i.e., fmt{[}level{]}=string), or it can be any callable, such as a {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Formatter}}}}} instance, that returns a string when called with a numeric contour level. \item[{\sphinxstylestrong{manual}}] \leavevmode{[}bool or iterable, optional{]} If \sphinxcode{\sphinxupquote{True}}, contour labels will be placed manually using mouse clicks. Click the first button near a contour to add a label, click the second button (or potentially both mouse buttons at once) to finish adding labels. The third button can be used to remove the last label added, but only if labels are not inline. Alternatively, the keyboard can be used to select label locations (enter to end label placement, delete or backspace act like the third mouse button, and any other key will select a label location). \sphinxstyleemphasis{manual} can also be an iterable object of x,y tuples. Contour labels will be created as if mouse is clicked at each x,y positions. \item[{\sphinxstylestrong{rightside\_up}}] \leavevmode{[}bool, optional{]} If \sphinxcode{\sphinxupquote{True}}, label rotations will always be plus or minus 90 degrees from level. Default is \sphinxcode{\sphinxupquote{True}}. \item[{\sphinxstylestrong{use\_clabeltext}}] \leavevmode{[}bool, optional{]} If \sphinxcode{\sphinxupquote{True}}, \sphinxcode{\sphinxupquote{ClabelText}} class (instead of \sphinxcode{\sphinxupquote{Text}}) is used to create labels. \sphinxcode{\sphinxupquote{ClabelText}} recalculates rotation angles of texts during the drawing time, therefore this can be used if aspect of the axes changes. Default is \sphinxcode{\sphinxupquote{False}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.contour} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.contour:matplotlib-axes-axes-contour}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.contour::doc}}\index{contour() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.contour:matplotlib.axes.Axes.contour}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{contour}}}{\emph{*args}, \emph{data=None}, \emph{**kwargs}}{} Plot contours. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}} draw contour lines and filled contours, respectively. Except as noted, function signatures and return values are the same for both versions. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}} differs from the MATLAB version in that it does not draw the polygon edges. To draw edges, add line contours with calls to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}}. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{)} \end{sphinxVerbatim} make a contour plot of an array \sphinxstyleemphasis{Z}. The level values are chosen automatically. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{Y}\PYG{p}{,}\PYG{n}{Z}\PYG{p}{)} \end{sphinxVerbatim} \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y} specify the (x, y) coordinates of the surface \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{,}\PYG{n}{N}\PYG{p}{)} \PYG{n}{contour}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{Y}\PYG{p}{,}\PYG{n}{Z}\PYG{p}{,}\PYG{n}{N}\PYG{p}{)} \end{sphinxVerbatim} contour up to \sphinxstyleemphasis{N+1} automatically chosen contour levels (\sphinxstyleemphasis{N} intervals). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{,}\PYG{n}{V}\PYG{p}{)} \PYG{n}{contour}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{Y}\PYG{p}{,}\PYG{n}{Z}\PYG{p}{,}\PYG{n}{V}\PYG{p}{)} \end{sphinxVerbatim} draw contour lines at the values specified in sequence \sphinxstyleemphasis{V}, which must be in increasing order. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contourf}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{V}\PYG{p}{)} \end{sphinxVerbatim} fill the \sphinxcode{\sphinxupquote{len(V)-1}} regions between the values in \sphinxstyleemphasis{V}, which must be in increasing order. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Use keyword args to control colors, linewidth, origin, cmap … see below for more details. \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} must both be 2-D with the same shape as \sphinxstyleemphasis{Z}, or they must both be 1-D such that \sphinxcode{\sphinxupquote{len(X)}} is the number of columns in \sphinxstyleemphasis{Z} and \sphinxcode{\sphinxupquote{len(Y)}} is the number of rows in \sphinxstyleemphasis{Z}. \sphinxcode{\sphinxupquote{C = contour(...)}} returns a {\hyperref[\detokenize{api/contour_api:matplotlib.contour.QuadContourSet}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{QuadContourSet}}}}} object. Optional keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{corner\_mask}: bool, optional}] \leavevmode Enable/disable corner masking, which only has an effect if \sphinxstyleemphasis{Z} is a masked array. If \sphinxcode{\sphinxupquote{False}}, any quad touching a masked point is masked out. If \sphinxcode{\sphinxupquote{True}}, only the triangular corners of quads nearest those points are always masked out, other triangular corners comprising three unmasked points are contoured as usual. Defaults to \sphinxcode{\sphinxupquote{rcParams{[}'contour.corner\_mask'{]}}}, which defaults to \sphinxcode{\sphinxupquote{True}}. \item[{\sphinxstyleemphasis{colors}: {[} \sphinxstyleemphasis{None} \textbar{} string \textbar{} (mpl\_colors) {]}}] \leavevmode If \sphinxstyleemphasis{None}, the colormap specified by cmap will be used. If a string, like ‘r’ or ‘red’, all levels will be plotted in this color. If a tuple of matplotlib color args (string, float, rgb, etc), different levels will be plotted in different colors in the order specified. \item[{\sphinxstyleemphasis{alpha}: float}] \leavevmode The alpha blending value \item[{\sphinxstyleemphasis{cmap}: {[} \sphinxstyleemphasis{None} \textbar{} Colormap {]}}] \leavevmode A cm {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}} instance or \sphinxstyleemphasis{None}. If \sphinxstyleemphasis{cmap} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{colors} is \sphinxstyleemphasis{None}, a default Colormap is used. \item[{\sphinxstyleemphasis{norm}: {[} \sphinxstyleemphasis{None} \textbar{} Normalize {]}}] \leavevmode A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance for scaling data values to colors. If \sphinxstyleemphasis{norm} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{colors} is \sphinxstyleemphasis{None}, the default linear scaling is used. \item[{\sphinxstyleemphasis{vmin}, \sphinxstyleemphasis{vmax}: {[} \sphinxstyleemphasis{None} \textbar{} scalar {]}}] \leavevmode If not \sphinxstyleemphasis{None}, either or both of these values will be supplied to the {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance, overriding the default color scaling based on \sphinxstyleemphasis{levels}. \item[{\sphinxstyleemphasis{levels}: {[}level0, level1, …, leveln{]}}] \leavevmode A list of floating point numbers indicating the level curves to draw, in increasing order; e.g., to draw just the zero contour pass \sphinxcode{\sphinxupquote{levels={[}0{]}}} \item[{\sphinxstyleemphasis{origin}: {[} \sphinxstyleemphasis{None} \textbar{} ‘upper’ \textbar{} ‘lower’ \textbar{} ‘image’ {]}}] \leavevmode If \sphinxstyleemphasis{None}, the first value of \sphinxstyleemphasis{Z} will correspond to the lower left corner, location (0,0). If ‘image’, the rc value for \sphinxcode{\sphinxupquote{image.origin}} will be used. This keyword is not active if \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are specified in the call to contour. \end{description} \sphinxstyleemphasis{extent}: {[} \sphinxstyleemphasis{None} \textbar{} (x0,x1,y0,y1) {]} \begin{quote} If \sphinxstyleemphasis{origin} is not \sphinxstyleemphasis{None}, then \sphinxstyleemphasis{extent} is interpreted as in {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.imshow()}}}}}: it gives the outer pixel boundaries. In this case, the position of Z{[}0,0{]} is the center of the pixel, not a corner. If \sphinxstyleemphasis{origin} is \sphinxstyleemphasis{None}, then (\sphinxstyleemphasis{x0}, \sphinxstyleemphasis{y0}) is the position of Z{[}0,0{]}, and (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) is the position of Z{[}-1,-1{]}. This keyword is not active if \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are specified in the call to contour. \end{quote} \begin{description} \item[{\sphinxstyleemphasis{locator}: {[} \sphinxstyleemphasis{None} \textbar{} ticker.Locator subclass {]}}] \leavevmode If \sphinxstyleemphasis{locator} is \sphinxstyleemphasis{None}, the default {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MaxNLocator}}}}} is used. The locator is used to determine the contour levels if they are not given explicitly via the \sphinxstyleemphasis{V} argument. \item[{\sphinxstyleemphasis{extend}: {[} ‘neither’ \textbar{} ‘both’ \textbar{} ‘min’ \textbar{} ‘max’ {]}}] \leavevmode Unless this is ‘neither’, contour levels are automatically added to one or both ends of the range so that all data are included. These added ranges are then mapped to the special colormap values which default to the ends of the colormap range, but can be set via {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_under}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap.set\_under()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_over}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap.set\_over()}}}}} methods. \item[{\sphinxstyleemphasis{xunits}, \sphinxstyleemphasis{yunits}: {[} \sphinxstyleemphasis{None} \textbar{} registered units {]}}] \leavevmode Override axis units by specifying an instance of a {\hyperref[\detokenize{api/units_api:matplotlib.units.ConversionInterface}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.units.ConversionInterface}}}}}. \item[{\sphinxstyleemphasis{antialiased}: bool}] \leavevmode enable antialiasing, overriding the defaults. For filled contours, the default is \sphinxstyleemphasis{True}. For line contours, it is taken from rcParams{[}‘lines.antialiased’{]}. \item[{\sphinxstyleemphasis{nchunk}: {[} 0 \textbar{} integer {]}}] \leavevmode If 0, no subdivision of the domain. Specify a positive integer to divide the domain into subdomains of \sphinxstyleemphasis{nchunk} by \sphinxstyleemphasis{nchunk} quads. Chunking reduces the maximum length of polygons generated by the contouring algorithm which reduces the rendering workload passed on to the backend and also requires slightly less RAM. It can however introduce rendering artifacts at chunk boundaries depending on the backend, the \sphinxstyleemphasis{antialiased} flag and value of \sphinxstyleemphasis{alpha}. \end{description} \end{quote} contour-only keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{linewidths}: {[} \sphinxstyleemphasis{None} \textbar{} number \textbar{} tuple of numbers {]}}] \leavevmode If \sphinxstyleemphasis{linewidths} is \sphinxstyleemphasis{None}, the default width in \sphinxcode{\sphinxupquote{lines.linewidth}} in \sphinxcode{\sphinxupquote{matplotlibrc}} is used. If a number, all levels will be plotted with this linewidth. If a tuple, different levels will be plotted with different linewidths in the order specified. \item[{\sphinxstyleemphasis{linestyles}: {[} \sphinxstyleemphasis{None} \textbar{} ‘solid’ \textbar{} ‘dashed’ \textbar{} ‘dashdot’ \textbar{} ‘dotted’ {]}}] \leavevmode If \sphinxstyleemphasis{linestyles} is \sphinxstyleemphasis{None}, the default is ‘solid’ unless the lines are monochrome. In that case, negative contours will take their linestyle from the \sphinxcode{\sphinxupquote{matplotlibrc}} \sphinxcode{\sphinxupquote{contour.negative\_linestyle}} setting. \sphinxstyleemphasis{linestyles} can also be an iterable of the above strings specifying a set of linestyles to be used. If this iterable is shorter than the number of contour levels it will be repeated as necessary. \end{description} \end{quote} contourf-only keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{hatches}:}] \leavevmode A list of cross hatch patterns to use on the filled areas. If None, no hatching will be added to the contour. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. \end{description} \end{quote} Note: contourf fills intervals that are closed at the top; that is, for boundaries \sphinxstyleemphasis{z1} and \sphinxstyleemphasis{z2}, the filled region is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{z1} \PYG{o}{\PYGZlt{}} \PYG{n}{z} \PYG{o}{\PYGZlt{}}\PYG{o}{=} \PYG{n}{z2} \end{sphinxVerbatim} There is one exception: if the lowest boundary coincides with the minimum value of the \sphinxstyleemphasis{z} array, then that minimum value will be included in the lowest interval. \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.axes.Axes.contour}}} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.contour:examples-using-matplotlib-axes-axes-contour}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_irregulardatagrid.py} \end{itemize} \subsubsection{matplotlib.axes.Axes.contourf} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.contourf:matplotlib-axes-axes-contourf}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.contourf::doc}}\index{contourf() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.contourf:matplotlib.axes.Axes.contourf}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{contourf}}}{\emph{*args}, \emph{data=None}, \emph{**kwargs}}{} Plot contours. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}} draw contour lines and filled contours, respectively. Except as noted, function signatures and return values are the same for both versions. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}} differs from the MATLAB version in that it does not draw the polygon edges. To draw edges, add line contours with calls to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}}. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{)} \end{sphinxVerbatim} make a contour plot of an array \sphinxstyleemphasis{Z}. The level values are chosen automatically. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{Y}\PYG{p}{,}\PYG{n}{Z}\PYG{p}{)} \end{sphinxVerbatim} \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y} specify the (x, y) coordinates of the surface \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{,}\PYG{n}{N}\PYG{p}{)} \PYG{n}{contour}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{Y}\PYG{p}{,}\PYG{n}{Z}\PYG{p}{,}\PYG{n}{N}\PYG{p}{)} \end{sphinxVerbatim} contour up to \sphinxstyleemphasis{N+1} automatically chosen contour levels (\sphinxstyleemphasis{N} intervals). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{,}\PYG{n}{V}\PYG{p}{)} \PYG{n}{contour}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{Y}\PYG{p}{,}\PYG{n}{Z}\PYG{p}{,}\PYG{n}{V}\PYG{p}{)} \end{sphinxVerbatim} draw contour lines at the values specified in sequence \sphinxstyleemphasis{V}, which must be in increasing order. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contourf}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{V}\PYG{p}{)} \end{sphinxVerbatim} fill the \sphinxcode{\sphinxupquote{len(V)-1}} regions between the values in \sphinxstyleemphasis{V}, which must be in increasing order. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Use keyword args to control colors, linewidth, origin, cmap … see below for more details. \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} must both be 2-D with the same shape as \sphinxstyleemphasis{Z}, or they must both be 1-D such that \sphinxcode{\sphinxupquote{len(X)}} is the number of columns in \sphinxstyleemphasis{Z} and \sphinxcode{\sphinxupquote{len(Y)}} is the number of rows in \sphinxstyleemphasis{Z}. \sphinxcode{\sphinxupquote{C = contour(...)}} returns a {\hyperref[\detokenize{api/contour_api:matplotlib.contour.QuadContourSet}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{QuadContourSet}}}}} object. Optional keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{corner\_mask}: bool, optional}] \leavevmode Enable/disable corner masking, which only has an effect if \sphinxstyleemphasis{Z} is a masked array. If \sphinxcode{\sphinxupquote{False}}, any quad touching a masked point is masked out. If \sphinxcode{\sphinxupquote{True}}, only the triangular corners of quads nearest those points are always masked out, other triangular corners comprising three unmasked points are contoured as usual. Defaults to \sphinxcode{\sphinxupquote{rcParams{[}'contour.corner\_mask'{]}}}, which defaults to \sphinxcode{\sphinxupquote{True}}. \item[{\sphinxstyleemphasis{colors}: {[} \sphinxstyleemphasis{None} \textbar{} string \textbar{} (mpl\_colors) {]}}] \leavevmode If \sphinxstyleemphasis{None}, the colormap specified by cmap will be used. If a string, like ‘r’ or ‘red’, all levels will be plotted in this color. If a tuple of matplotlib color args (string, float, rgb, etc), different levels will be plotted in different colors in the order specified. \item[{\sphinxstyleemphasis{alpha}: float}] \leavevmode The alpha blending value \item[{\sphinxstyleemphasis{cmap}: {[} \sphinxstyleemphasis{None} \textbar{} Colormap {]}}] \leavevmode A cm {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}} instance or \sphinxstyleemphasis{None}. If \sphinxstyleemphasis{cmap} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{colors} is \sphinxstyleemphasis{None}, a default Colormap is used. \item[{\sphinxstyleemphasis{norm}: {[} \sphinxstyleemphasis{None} \textbar{} Normalize {]}}] \leavevmode A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance for scaling data values to colors. If \sphinxstyleemphasis{norm} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{colors} is \sphinxstyleemphasis{None}, the default linear scaling is used. \item[{\sphinxstyleemphasis{vmin}, \sphinxstyleemphasis{vmax}: {[} \sphinxstyleemphasis{None} \textbar{} scalar {]}}] \leavevmode If not \sphinxstyleemphasis{None}, either or both of these values will be supplied to the {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance, overriding the default color scaling based on \sphinxstyleemphasis{levels}. \item[{\sphinxstyleemphasis{levels}: {[}level0, level1, …, leveln{]}}] \leavevmode A list of floating point numbers indicating the level curves to draw, in increasing order; e.g., to draw just the zero contour pass \sphinxcode{\sphinxupquote{levels={[}0{]}}} \item[{\sphinxstyleemphasis{origin}: {[} \sphinxstyleemphasis{None} \textbar{} ‘upper’ \textbar{} ‘lower’ \textbar{} ‘image’ {]}}] \leavevmode If \sphinxstyleemphasis{None}, the first value of \sphinxstyleemphasis{Z} will correspond to the lower left corner, location (0,0). If ‘image’, the rc value for \sphinxcode{\sphinxupquote{image.origin}} will be used. This keyword is not active if \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are specified in the call to contour. \end{description} \sphinxstyleemphasis{extent}: {[} \sphinxstyleemphasis{None} \textbar{} (x0,x1,y0,y1) {]} \begin{quote} If \sphinxstyleemphasis{origin} is not \sphinxstyleemphasis{None}, then \sphinxstyleemphasis{extent} is interpreted as in {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.imshow()}}}}}: it gives the outer pixel boundaries. In this case, the position of Z{[}0,0{]} is the center of the pixel, not a corner. If \sphinxstyleemphasis{origin} is \sphinxstyleemphasis{None}, then (\sphinxstyleemphasis{x0}, \sphinxstyleemphasis{y0}) is the position of Z{[}0,0{]}, and (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) is the position of Z{[}-1,-1{]}. This keyword is not active if \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are specified in the call to contour. \end{quote} \begin{description} \item[{\sphinxstyleemphasis{locator}: {[} \sphinxstyleemphasis{None} \textbar{} ticker.Locator subclass {]}}] \leavevmode If \sphinxstyleemphasis{locator} is \sphinxstyleemphasis{None}, the default {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MaxNLocator}}}}} is used. The locator is used to determine the contour levels if they are not given explicitly via the \sphinxstyleemphasis{V} argument. \item[{\sphinxstyleemphasis{extend}: {[} ‘neither’ \textbar{} ‘both’ \textbar{} ‘min’ \textbar{} ‘max’ {]}}] \leavevmode Unless this is ‘neither’, contour levels are automatically added to one or both ends of the range so that all data are included. These added ranges are then mapped to the special colormap values which default to the ends of the colormap range, but can be set via {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_under}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap.set\_under()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_over}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap.set\_over()}}}}} methods. \item[{\sphinxstyleemphasis{xunits}, \sphinxstyleemphasis{yunits}: {[} \sphinxstyleemphasis{None} \textbar{} registered units {]}}] \leavevmode Override axis units by specifying an instance of a {\hyperref[\detokenize{api/units_api:matplotlib.units.ConversionInterface}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.units.ConversionInterface}}}}}. \item[{\sphinxstyleemphasis{antialiased}: bool}] \leavevmode enable antialiasing, overriding the defaults. For filled contours, the default is \sphinxstyleemphasis{True}. For line contours, it is taken from rcParams{[}‘lines.antialiased’{]}. \item[{\sphinxstyleemphasis{nchunk}: {[} 0 \textbar{} integer {]}}] \leavevmode If 0, no subdivision of the domain. Specify a positive integer to divide the domain into subdomains of \sphinxstyleemphasis{nchunk} by \sphinxstyleemphasis{nchunk} quads. Chunking reduces the maximum length of polygons generated by the contouring algorithm which reduces the rendering workload passed on to the backend and also requires slightly less RAM. It can however introduce rendering artifacts at chunk boundaries depending on the backend, the \sphinxstyleemphasis{antialiased} flag and value of \sphinxstyleemphasis{alpha}. \end{description} \end{quote} contour-only keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{linewidths}: {[} \sphinxstyleemphasis{None} \textbar{} number \textbar{} tuple of numbers {]}}] \leavevmode If \sphinxstyleemphasis{linewidths} is \sphinxstyleemphasis{None}, the default width in \sphinxcode{\sphinxupquote{lines.linewidth}} in \sphinxcode{\sphinxupquote{matplotlibrc}} is used. If a number, all levels will be plotted with this linewidth. If a tuple, different levels will be plotted with different linewidths in the order specified. \item[{\sphinxstyleemphasis{linestyles}: {[} \sphinxstyleemphasis{None} \textbar{} ‘solid’ \textbar{} ‘dashed’ \textbar{} ‘dashdot’ \textbar{} ‘dotted’ {]}}] \leavevmode If \sphinxstyleemphasis{linestyles} is \sphinxstyleemphasis{None}, the default is ‘solid’ unless the lines are monochrome. In that case, negative contours will take their linestyle from the \sphinxcode{\sphinxupquote{matplotlibrc}} \sphinxcode{\sphinxupquote{contour.negative\_linestyle}} setting. \sphinxstyleemphasis{linestyles} can also be an iterable of the above strings specifying a set of linestyles to be used. If this iterable is shorter than the number of contour levels it will be repeated as necessary. \end{description} \end{quote} contourf-only keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{hatches}:}] \leavevmode A list of cross hatch patterns to use on the filled areas. If None, no hatching will be added to the contour. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. \end{description} \end{quote} Note: contourf fills intervals that are closed at the top; that is, for boundaries \sphinxstyleemphasis{z1} and \sphinxstyleemphasis{z2}, the filled region is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{z1} \PYG{o}{\PYGZlt{}} \PYG{n}{z} \PYG{o}{\PYGZlt{}}\PYG{o}{=} \PYG{n}{z2} \end{sphinxVerbatim} There is one exception: if the lowest boundary coincides with the minimum value of the \sphinxstyleemphasis{z} array, then that minimum value will be included in the lowest interval. \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.axes.Axes.contourf}}} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.contourf:examples-using-matplotlib-axes-axes-contourf}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_pcolormesh\_levels.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_irregulardatagrid.py} \end{itemize} \subsection{Array} \label{\detokenize{api/axes_api:array}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.imshow:matplotlib.axes.Axes.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.imshow}}}}} & Display an image on the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.matshow:matplotlib.axes.Axes.matshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.matshow}}}}} & Plot a matrix or array as an image. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolor:matplotlib.axes.Axes.pcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.pcolor}}}}} & Create a pseudocolor plot of a 2-D array. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolorfast:matplotlib.axes.Axes.pcolorfast}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.pcolorfast}}}}} & pseudocolor plot of a 2-D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolormesh:matplotlib.axes.Axes.pcolormesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.pcolormesh}}}}} & Plot a quadrilateral mesh. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.spy:matplotlib.axes.Axes.spy}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.spy}}}}} & Plot the sparsity pattern on a 2-D array. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axes.Axes.imshow} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.imshow:matplotlib-axes-axes-imshow}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.imshow::doc}}\index{imshow() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.imshow:matplotlib.axes.Axes.imshow}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{imshow}}}{\emph{X}, \emph{cmap=None}, \emph{norm=None}, \emph{aspect=None}, \emph{interpolation=None}, \emph{alpha=None}, \emph{vmin=None}, \emph{vmax=None}, \emph{origin=None}, \emph{extent=None}, \emph{shape=None}, \emph{filternorm=1}, \emph{filterrad=4.0}, \emph{imlim=None}, \emph{resample=None}, \emph{url=None}, \emph{*}, \emph{data=None}, \emph{**kwargs}}{} Display an image on the axes. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{X}}] \leavevmode{[}array\_like, shape (n, m) or (n, m, 3) or (n, m, 4){]} Display the image in \sphinxcode{\sphinxupquote{X}} to current axes. \sphinxcode{\sphinxupquote{X}} may be an array or a PIL image. If \sphinxcode{\sphinxupquote{X}} is an array, it can have the following shapes and types: \begin{itemize} \item {} MxN \textendash{} values to be mapped (float or int) \item {} MxNx3 \textendash{} RGB (float or uint8) \item {} MxNx4 \textendash{} RGBA (float or uint8) \end{itemize} MxN arrays are mapped to colors based on the \sphinxcode{\sphinxupquote{norm}} (mapping scalar to scalar) and the \sphinxcode{\sphinxupquote{cmap}} (mapping the normed scalar to a color). Elements of RGB and RGBA arrays represent pixels of an MxN image. All values should be in the range {[}0 .. 1{]} for floats or {[}0 .. 255{]} for integers. Out-of-range values will be clipped to these bounds. \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}}, optional, default: None{]} If None, default to rc \sphinxcode{\sphinxupquote{image.cmap}} value. \sphinxcode{\sphinxupquote{cmap}} is ignored if \sphinxcode{\sphinxupquote{X}} is 3-D, directly specifying RGB(A) values. \item[{\sphinxstylestrong{aspect}}] \leavevmode{[}{[}‘auto’ \textbar{} ‘equal’ \textbar{} scalar{]}, optional, default: None{]} If ‘auto’, changes the image aspect ratio to match that of the axes. If ‘equal’, and \sphinxcode{\sphinxupquote{extent}} is None, changes the axes aspect ratio to match that of the image. If \sphinxcode{\sphinxupquote{extent}} is not \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, the axes aspect ratio is changed to match that of the extent. If None, default to rc \sphinxcode{\sphinxupquote{image.aspect}} value. \item[{\sphinxstylestrong{interpolation}}] \leavevmode{[}string, optional, default: None{]} Acceptable values are ‘none’, ‘nearest’, ‘bilinear’, ‘bicubic’, ‘spline16’, ‘spline36’, ‘hanning’, ‘hamming’, ‘hermite’, ‘kaiser’, ‘quadric’, ‘catrom’, ‘gaussian’, ‘bessel’, ‘mitchell’, ‘sinc’, ‘lanczos’ If \sphinxcode{\sphinxupquote{interpolation}} is None, default to rc \sphinxcode{\sphinxupquote{image.interpolation}}. See also the \sphinxcode{\sphinxupquote{filternorm}} and \sphinxcode{\sphinxupquote{filterrad}} parameters. If \sphinxcode{\sphinxupquote{interpolation}} is ‘none’, then no interpolation is performed on the Agg, ps and pdf backends. Other backends will fall back to ‘nearest’. \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}, optional, default: None{]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} instance is used to scale a 2-D float \sphinxcode{\sphinxupquote{X}} input to the (0, 1) range for input to the \sphinxcode{\sphinxupquote{cmap}}. If \sphinxcode{\sphinxupquote{norm}} is None, use the default func:\sphinxcode{\sphinxupquote{normalize}}. If \sphinxcode{\sphinxupquote{norm}} is an instance of {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.NoNorm:matplotlib.colors.NoNorm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{NoNorm}}}}}, \sphinxcode{\sphinxupquote{X}} must be an array of integers that index directly into the lookup table of the \sphinxcode{\sphinxupquote{cmap}}. \item[{\sphinxstylestrong{vmin, vmax}}] \leavevmode{[}scalar, optional, default: None{]} \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} are used in conjunction with norm to normalize luminance data. Note if you pass a \sphinxcode{\sphinxupquote{norm}} instance, your settings for \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} will be ignored. \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}scalar, optional, default: None{]} The alpha blending value, between 0 (transparent) and 1 (opaque). The \sphinxcode{\sphinxupquote{alpha}} argument is ignored for RGBA input data. \item[{\sphinxstylestrong{origin}}] \leavevmode{[}{[}‘upper’ \textbar{} ‘lower’{]}, optional, default: None{]} Place the {[}0,0{]} index of the array in the upper left or lower left corner of the axes. If None, default to rc \sphinxcode{\sphinxupquote{image.origin}}. \item[{\sphinxstylestrong{extent}}] \leavevmode{[}scalars (left, right, bottom, top), optional, default: None{]} The location, in data-coordinates, of the lower-left and upper-right corners. If \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, the image is positioned such that the pixel centers fall on zero-based (row, column) indices. \item[{\sphinxstylestrong{shape}}] \leavevmode{[}scalars (columns, rows), optional, default: None{]} For raw buffer images \item[{\sphinxstylestrong{filternorm}}] \leavevmode{[}scalar, optional, default: 1{]} A parameter for the antigrain image resize filter. From the antigrain documentation, if \sphinxcode{\sphinxupquote{filternorm}} = 1, the filter normalizes integer values and corrects the rounding errors. It doesn’t do anything with the source floating point values, it corrects only integers according to the rule of 1.0 which means that any sum of pixel weights must be equal to 1.0. So, the filter function must produce a graph of the proper shape. \item[{\sphinxstylestrong{filterrad}}] \leavevmode{[}scalar, optional, default: 4.0{]} The filter radius for filters that have a radius parameter, i.e. when interpolation is one of: ‘sinc’, ‘lanczos’ or ‘blackman’ \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{image}}] \leavevmode{[}{\hyperref[\detokenize{api/image_api:matplotlib.image.AxesImage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AxesImage}}}}}{]} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} properties.{]} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.matshow:matplotlib.axes.Axes.matshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matshow}}}}}}] \leavevmode Plot a matrix or an array as an image. \end{description} \paragraph{Notes} Unless \sphinxstyleemphasis{extent} is used, pixel centers will be located at integer coordinates. In other words: the origin will coincide with the center of pixel (0, 0). Two typical representations are used for RGB images with an alpha channel: \begin{itemize} \item {} Straight (unassociated) alpha: R, G, and B channels represent the color of the pixel, disregarding its opacity. \item {} Premultiplied (associated) alpha: R, G, and B channels represent the color of the pixel, adjusted for its opacity by multiplication. \end{itemize} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow}}}}} expects RGB images adopting the straight (unassociated) alpha representation. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All positional and all keyword arguments. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.axes.Axes.imshow}}} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.imshow:examples-using-matplotlib-axes-axes-imshow}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_annotated\_heatmap.py} \end{itemize} \subsubsection{matplotlib.axes.Axes.matshow} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.matshow:matplotlib-axes-axes-matshow}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.matshow::doc}}\index{matshow() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.matshow:matplotlib.axes.Axes.matshow}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{matshow}}}{\emph{Z}, \emph{**kwargs}}{} Plot a matrix or array as an image. The matrix will be shown the way it would be printed, with the first row at the top. Row and column numbering is zero-based. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Z}}] \leavevmode{[}array\_like shape (n, m){]} The matrix to be displayed. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{image}}] \leavevmode{[}{\hyperref[\detokenize{api/image_api:matplotlib.image.AxesImage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AxesImage}}}}}{]} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.imshow:matplotlib.axes.Axes.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow}}}}} arguments{]} Sets \sphinxcode{\sphinxupquote{origin}} to ‘upper’, ‘interpolation’ to ‘nearest’ and ‘aspect’ to equal. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.imshow:matplotlib.axes.Axes.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow}}}}}}] \leavevmode plot an image \end{description} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.pcolor} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolor:matplotlib-axes-axes-pcolor}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolor::doc}}\index{pcolor() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolor:matplotlib.axes.Axes.pcolor}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{pcolor}}}{\emph{*args}, \emph{data=None}, \emph{**kwargs}}{} Create a pseudocolor plot of a 2-D array. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{pcolor}\PYG{p}{(}\PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{pcolor}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} pcolor can be very slow for large arrays; consider using the similar but much faster {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolormesh:matplotlib.pyplot.pcolormesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolormesh()}}}}} instead. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{C}}] \leavevmode{[}array\_like{]} An array of color values. \item[{\sphinxstylestrong{X, Y}}] \leavevmode{[}array\_like, optional{]} If given, specify the (x, y) coordinates of the colored quadrilaterals; the quadrilateral for \sphinxcode{\sphinxupquote{C{[}i,j{]}}} has corners at: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{X}\PYG{p}{[}\PYG{n}{i}\PYG{p}{,} \PYG{n}{j}\PYG{p}{]}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{[}\PYG{n}{i}\PYG{p}{,} \PYG{n}{j}\PYG{p}{]}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{n}{X}\PYG{p}{[}\PYG{n}{i}\PYG{p}{,} \PYG{n}{j}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{[}\PYG{n}{i}\PYG{p}{,} \PYG{n}{j}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{n}{X}\PYG{p}{[}\PYG{n}{i}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{j}\PYG{p}{]}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{[}\PYG{n}{i}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{j}\PYG{p}{]}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{n}{X}\PYG{p}{[}\PYG{n}{i}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{j}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{[}\PYG{n}{i}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{j}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} Ideally the dimensions of \sphinxcode{\sphinxupquote{X}} and \sphinxcode{\sphinxupquote{Y}} should be one greater than those of \sphinxcode{\sphinxupquote{C}}; if the dimensions are the same, then the last row and column of \sphinxcode{\sphinxupquote{C}} will be ignored. Note that the column index corresponds to the x-coordinate, and the row index corresponds to y; for details, see the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:axes-pcolor-grid-orientation}]{\sphinxcrossref{\DUrole{std,std-ref}{Grid Orientation}}}} section below. If either or both of \sphinxcode{\sphinxupquote{X}} and \sphinxcode{\sphinxupquote{Y}} are 1-D arrays or column vectors, they will be expanded as needed into the appropriate 2-D arrays, making a rectangular grid. \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}}, optional, default: None{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, default to rc settings. \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}}, optional, default: None{]} An instance is used to scale luminance data to (0, 1). If \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, defaults to \sphinxcode{\sphinxupquote{normalize()}}. \item[{\sphinxstylestrong{vmin, vmax}}] \leavevmode{[}scalar, optional, default: None{]} \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} are used in conjunction with \sphinxcode{\sphinxupquote{norm}} to normalize luminance data. If either is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, it is autoscaled to the respective min or max of the color array \sphinxcode{\sphinxupquote{C}}. If not \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, \sphinxcode{\sphinxupquote{vmin}} or \sphinxcode{\sphinxupquote{vmax}} passed in here override any pre-existing values supplied in the \sphinxcode{\sphinxupquote{norm}} instance. \item[{\sphinxstylestrong{edgecolors}}] \leavevmode{[}\{None, ‘none’, color, color sequence\}{]} If None, the rc setting is used by default. If ‘none’, edges will not be visible. An mpl color or sequence of colors will set the edge color. \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}scalar, optional, default: None{]} The alpha blending value, between 0 (transparent) and 1 (opaque). \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool, optional, default: False{]} Whether to snap the mesh to pixel boundaries. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{collection}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.Collection}}}}}{]} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{antialiaseds}}] \leavevmode{[}bool, optional, default: False{]} The default \sphinxcode{\sphinxupquote{antialiaseds}} is False if the default \sphinxcode{\sphinxupquote{edgecolors="none"}} is used. This eliminates artificial lines at patch boundaries, and works regardless of the value of alpha. If \sphinxcode{\sphinxupquote{edgecolors}} is not “none”, then the default \sphinxcode{\sphinxupquote{antialiaseds}} is taken from \sphinxcode{\sphinxupquote{rcParams{[}"patch.antialiased"{]}}}, which defaults to True. Stroking the edges may be preferred if \sphinxcode{\sphinxupquote{alpha}} is 1, but will cause artifacts otherwise. \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Any unused keyword arguments are passed along to the {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} constructor: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or antialiaseds & Boolean or sequence of booleans \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{array}}}}} & ndarray \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}} & a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cmap}}}}} & a colormap or registered colormap name \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color arg or sequence of rgba tuples \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or edgecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or facecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or dashes or linestyles & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or linewidths or lw & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_norm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{norm}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offset\_position}}}}} & {[} ‘screen’ \textbar{} ‘data’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offsets}}}}} & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_urls}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{urls}}}}} & List{[}str{]} or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolormesh:matplotlib.axes.Axes.pcolormesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolormesh}}}}}}] \leavevmode for an explanation of the differences between pcolor and pcolormesh. \end{description} \paragraph{Notes} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolor:axes-pcolor-grid-orientation}} \sphinxcode{\sphinxupquote{X}}, \sphinxcode{\sphinxupquote{Y}} and \sphinxcode{\sphinxupquote{C}} may be masked arrays. If either C{[}i, j{]}, or one of the vertices surrounding C{[}i,j{]} (\sphinxcode{\sphinxupquote{X}} or \sphinxcode{\sphinxupquote{Y}} at {[}i, j{]}, {[}i+1, j{]}, {[}i, j+1{]}, {[}i+1, j+1{]}) is masked, nothing is plotted. The grid orientation follows the MATLAB convention: an array \sphinxcode{\sphinxupquote{C}} with shape (nrows, ncolumns) is plotted with the column number as \sphinxcode{\sphinxupquote{X}} and the row number as \sphinxcode{\sphinxupquote{Y}}, increasing up; hence it is plotted the way the array would be printed, except that the \sphinxcode{\sphinxupquote{Y}} axis is reversed. That is, \sphinxcode{\sphinxupquote{C}} is taken as \sphinxcode{\sphinxupquote{C}} (y, x). Similarly for \sphinxcode{\sphinxupquote{meshgrid()}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{)} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{)} \PYG{n}{X}\PYG{p}{,} \PYG{n}{Y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{meshgrid}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \end{sphinxVerbatim} is equivalent to: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{X} \PYG{o}{=} \PYG{n}{array}\PYG{p}{(}\PYG{p}{[}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{]}\PYG{p}{]}\PYG{p}{)} \PYG{n}{Y} \PYG{o}{=} \PYG{n}{array}\PYG{p}{(}\PYG{p}{[}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} so if you have: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{C} \PYG{o}{=} \PYG{n}{rand}\PYG{p}{(}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)}\PYG{p}{,} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} then you need to transpose C: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{pcolor}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{C}\PYG{o}{.}\PYG{n}{T}\PYG{p}{)} \end{sphinxVerbatim} or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{pcolor}\PYG{p}{(}\PYG{n}{C}\PYG{o}{.}\PYG{n}{T}\PYG{p}{)} \end{sphinxVerbatim} MATLAB {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolor:matplotlib.axes.Axes.pcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolor()}}}}} always discards the last row and column of \sphinxcode{\sphinxupquote{C}}, but Matplotlib displays the last row and column if \sphinxcode{\sphinxupquote{X}} and \sphinxcode{\sphinxupquote{Y}} are not specified, or if \sphinxcode{\sphinxupquote{X}} and \sphinxcode{\sphinxupquote{Y}} have one more row and column than \sphinxcode{\sphinxupquote{C}}. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All positional and all keyword arguments. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.pcolorfast} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolorfast:matplotlib-axes-axes-pcolorfast}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolorfast::doc}}\index{pcolorfast() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolorfast:matplotlib.axes.Axes.pcolorfast}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{pcolorfast}}}{\emph{*args}, \emph{data=None}, \emph{**kwargs}}{} pseudocolor plot of a 2-D array Experimental; this is a pcolor-type method that provides the fastest possible rendering with the Agg backend, and that can handle any quadrilateral grid. It supports only flat shading (no outlines), it lacks support for log scaling of the axes, and it does not have a pyplot wrapper. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolorfast}\PYG{p}{(}\PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolorfast}\PYG{p}{(}\PYG{n}{xr}\PYG{p}{,} \PYG{n}{yr}\PYG{p}{,} \PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolorfast}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{pcolorfast}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} C is the 2D array of color values corresponding to quadrilateral cells. Let (nr, nc) be its shape. C may be a masked array. \sphinxcode{\sphinxupquote{ax.pcolorfast(C, **kwargs)}} is equivalent to \sphinxcode{\sphinxupquote{ax.pcolorfast({[}0,nc{]}, {[}0,nr{]}, C, **kwargs)}} \sphinxstyleemphasis{xr}, \sphinxstyleemphasis{yr} specify the ranges of \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} corresponding to the rectangular region bounding \sphinxstyleemphasis{C}. If: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{xr} \PYG{o}{=} \PYG{p}{[}\PYG{n}{x0}\PYG{p}{,} \PYG{n}{x1}\PYG{p}{]} \end{sphinxVerbatim} and: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{yr} \PYG{o}{=} \PYG{p}{[}\PYG{n}{y0}\PYG{p}{,}\PYG{n}{y1}\PYG{p}{]} \end{sphinxVerbatim} then \sphinxstyleemphasis{x} goes from \sphinxstyleemphasis{x0} to \sphinxstyleemphasis{x1} as the second index of \sphinxstyleemphasis{C} goes from 0 to \sphinxstyleemphasis{nc}, etc. (\sphinxstyleemphasis{x0}, \sphinxstyleemphasis{y0}) is the outermost corner of cell (0,0), and (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) is the outermost corner of cell (\sphinxstyleemphasis{nr}-1, \sphinxstyleemphasis{nc}-1). All cells are rectangles of the same size. This is the fastest version. \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} are monotonic 1D arrays of length \sphinxstyleemphasis{nc} +1 and \sphinxstyleemphasis{nr} +1, respectively, giving the x and y boundaries of the cells. Hence the cells are rectangular but the grid may be nonuniform. The speed is intermediate. (The grid is checked, and if found to be uniform the fast version is used.) \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are 2D arrays with shape (\sphinxstyleemphasis{nr} +1, \sphinxstyleemphasis{nc} +1) that specify the (x,y) coordinates of the corners of the colored quadrilaterals; the quadrilateral for C{[}i,j{]} has corners at (X{[}i,j{]},Y{[}i,j{]}), (X{[}i,j+1{]},Y{[}i,j+1{]}), (X{[}i+1,j{]},Y{[}i+1,j{]}), (X{[}i+1,j+1{]},Y{[}i+1,j+1{]}). The cells need not be rectangular. This is the most general, but the slowest to render. It may produce faster and more compact output using ps, pdf, and svg backends, however. Note that the column index corresponds to the x-coordinate, and the row index corresponds to y; for details, see {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:axes-pcolor-grid-orientation}]{\sphinxcrossref{\DUrole{std,std-ref}{Grid Orientation}}}}. Optional keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{cmap}: {[} \sphinxstyleemphasis{None} \textbar{} Colormap {]}}] \leavevmode A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap}}}}} instance from cm. If \sphinxstyleemphasis{None}, use rc settings. \item[{\sphinxstyleemphasis{norm}: {[} \sphinxstyleemphasis{None} \textbar{} Normalize {]}}] \leavevmode A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance is used to scale luminance data to 0,1. If \sphinxstyleemphasis{None}, defaults to normalize() \item[{\sphinxstyleemphasis{vmin}/\sphinxstyleemphasis{vmax}: {[} \sphinxstyleemphasis{None} \textbar{} scalar {]}}] \leavevmode \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} are used in conjunction with norm to normalize luminance data. If either are \sphinxstyleemphasis{None}, the min and max of the color array \sphinxstyleemphasis{C} is used. If you pass a norm instance, \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} will be \sphinxstyleemphasis{None}. \item[{\sphinxstyleemphasis{alpha}: \sphinxcode{\sphinxupquote{0 \textless{}= scalar \textless{}= 1}} or \sphinxstyleemphasis{None}}] \leavevmode the alpha blending value \end{description} \end{quote} Return value is an image if a regular or rectangular grid is specified, and a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.QuadMesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{QuadMesh}}}}} collection in the general quadrilateral case. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All positional and all keyword arguments. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.pcolormesh} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolormesh:matplotlib-axes-axes-pcolormesh}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolormesh::doc}}\index{pcolormesh() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolormesh:matplotlib.axes.Axes.pcolormesh}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{pcolormesh}}}{\emph{*args}, \emph{data=None}, \emph{**kwargs}}{} Plot a quadrilateral mesh. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{C}\PYG{p}{)} \PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{C}\PYG{p}{)} \PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Create a pseudocolor plot of a 2-D array. pcolormesh is similar to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:matplotlib.pyplot.pcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolor()}}}}}, but uses a different mechanism and returns a different object; pcolor returns a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} but pcolormesh returns a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.QuadMesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{QuadMesh}}}}}. It is much faster, so it is almost always preferred for large arrays. \sphinxstyleemphasis{C} may be a masked array, but \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} may not. Masked array support is implemented via \sphinxstyleemphasis{cmap} and \sphinxstyleemphasis{norm}; in contrast, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:matplotlib.pyplot.pcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolor()}}}}} simply does not draw quadrilaterals with masked colors or vertices. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{matplotlib.collections.QuadMesh}}] \leavevmode \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}Colormap, optional{]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap}}}}} instance. If \sphinxcode{\sphinxupquote{None}}, use rc settings. \item[{\sphinxstylestrong{norm}}] \leavevmode{[}Normalize, optional{]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance is used to scale luminance data to 0,1. If \sphinxcode{\sphinxupquote{None}}, defaults to \sphinxcode{\sphinxupquote{normalize()}}. \item[{\sphinxstylestrong{vmin, vmax}}] \leavevmode{[}scalar, optional{]} \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} are used in conjunction with \sphinxstyleemphasis{norm} to normalize luminance data. If either is \sphinxcode{\sphinxupquote{None}}, it is autoscaled to the respective min or max of the color array \sphinxstyleemphasis{C}. If not \sphinxcode{\sphinxupquote{None}}, \sphinxstyleemphasis{vmin} or \sphinxstyleemphasis{vmax} passed in here override any pre-existing values supplied in the \sphinxstyleemphasis{norm} instance. \item[{\sphinxstylestrong{shading}}] \leavevmode{[}{[} ‘flat’ \textbar{} ‘gouraud’ {]}, optional{]} ‘flat’ indicates a solid color for each quad. When ‘gouraud’, each quad will be Gouraud shaded. When gouraud shading, \sphinxstyleemphasis{edgecolors} is ignored. \item[{\sphinxstylestrong{edgecolors}}] \leavevmode{[}string, color, color sequence, optional{]}\begin{itemize} \item {} If \sphinxcode{\sphinxupquote{None}}, the rc setting is used by default. \item {} If \sphinxcode{\sphinxupquote{'None'}}, edges will not be visible. \item {} If \sphinxcode{\sphinxupquote{'face'}}, edges will have the same color as the faces. \end{itemize} An mpl color or sequence of colors will also set the edge color. \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}scalar, optional{]} Alpha blending value. Must be between 0 and 1. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:matplotlib.pyplot.pcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.pcolor}}}}}}] \leavevmode For an explanation of the grid orientation ({\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:axes-pcolor-grid-orientation}]{\sphinxcrossref{\DUrole{std,std-ref}{Grid Orientation}}}}) and the expansion of 1-D \sphinxstyleemphasis{X} and/or \sphinxstyleemphasis{Y} to 2-D arrays. \end{description} \paragraph{Notes} kwargs can be used to control the {\hyperref[\detokenize{api/collections_api:matplotlib.collections.QuadMesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.QuadMesh}}}}} properties: \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or antialiaseds & Boolean or sequence of booleans \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{array}}}}} & ndarray \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}} & a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cmap}}}}} & a colormap or registered colormap name \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color arg or sequence of rgba tuples \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or edgecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or facecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or dashes or linestyles & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or linewidths or lw & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_norm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{norm}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offset\_position}}}}} & {[} ‘screen’ \textbar{} ‘data’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offsets}}}}} & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_urls}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{urls}}}}} & List{[}str{]} or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All positional and all keyword arguments. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.axes.Axes.pcolormesh}}} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolormesh:examples-using-matplotlib-axes-axes-pcolormesh}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_pcolormesh\_levels.py} \end{itemize} \subsubsection{matplotlib.axes.Axes.spy} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.spy:matplotlib-axes-axes-spy}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.spy::doc}}\index{spy() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.spy:matplotlib.axes.Axes.spy}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{spy}}}{\emph{Z}, \emph{precision=0}, \emph{marker=None}, \emph{markersize=None}, \emph{aspect='equal'}, \emph{origin='upper'}, \emph{**kwargs}}{} Plot the sparsity pattern on a 2-D array. \sphinxcode{\sphinxupquote{spy(Z)}} plots the sparsity pattern of the 2-D array \sphinxstyleemphasis{Z}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Z}}] \leavevmode{[}sparse array (n, m){]} The array to be plotted. \item[{\sphinxstylestrong{precision}}] \leavevmode{[}float, optional, default: 0{]} If \sphinxstyleemphasis{precision} is 0, any non-zero value will be plotted; else, values of $|Z| > precision$ will be plotted. For \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.spmatrix.html\#scipy.sparse.spmatrix}{\sphinxcode{\sphinxupquote{scipy.sparse.spmatrix}}} instances, there is a special case: if \sphinxstyleemphasis{precision} is ‘present’, any value present in the array will be plotted, even if it is identically zero. \item[{\sphinxstylestrong{origin}}] \leavevmode{[}{[}“upper”, “lower”{]}, optional, default: “upper”{]} Place the {[}0,0{]} index of the array in the upper left or lower left corner of the axes. \item[{\sphinxstylestrong{aspect}}] \leavevmode{[}{[}‘auto’ \textbar{} ‘equal’ \textbar{} scalar{]}, optional, default: “equal”{]} If ‘equal’, and \sphinxcode{\sphinxupquote{extent}} is None, changes the axes aspect ratio to match that of the image. If \sphinxcode{\sphinxupquote{extent}} is not \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, the axes aspect ratio is changed to match that of the extent. If ‘auto’, changes the image aspect ratio to match that of the axes. If None, default to rc \sphinxcode{\sphinxupquote{image.aspect}} value. \item[{\sphinxstylestrong{Two plotting styles are available: image or marker. Both}}] \leavevmode \item[{\sphinxstylestrong{are available for full arrays, but only the marker style}}] \leavevmode \item[{\sphinxstylestrong{works for :class:{}`scipy.sparse.spmatrix{}` instances.}}] \leavevmode \item[{\sphinxstylestrong{If *marker* and *markersize* are *None*, an image will be}}] \leavevmode \item[{\sphinxstylestrong{returned and any remaining kwargs are passed to}}] \leavevmode \item[{\sphinxstylestrong{:func:{}`\textasciitilde{}matplotlib.pyplot.imshow{}`; else, a}}] \leavevmode \item[{\sphinxstylestrong{:class:{}`\textasciitilde{}matplotlib.lines.Line2D{}` object will be returned with}}] \leavevmode \item[{\sphinxstylestrong{the value of marker determining the marker type, and any}}] \leavevmode \item[{\sphinxstylestrong{remaining kwargs passed to the}}] \leavevmode \item[{\sphinxstylestrong{:meth:{}`\textasciitilde{}matplotlib.axes.Axes.plot{}` method.}}] \leavevmode \item[{\sphinxstylestrong{If *marker* and *markersize* are *None*, useful kwargs include:}}] \leavevmode \item[{\sphinxstylestrong{* *cmap*}}] \leavevmode \item[{\sphinxstylestrong{* *alpha*}}] \leavevmode \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.imshow:matplotlib.axes.Axes.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow}}}}}}] \leavevmode for image options. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}}] \leavevmode for plotting options \end{description} \end{fulllineitems} \subsection{Unstructured Triangles} \label{\detokenize{api/axes_api:unstructured-triangles}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.tripcolor:matplotlib.axes.Axes.tripcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.tripcolor}}}}} & Create a pseudocolor plot of an unstructured triangular grid. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.triplot:matplotlib.axes.Axes.triplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.triplot}}}}} & Draw a unstructured triangular grid as lines and/or markers. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.tricontour:matplotlib.axes.Axes.tricontour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.tricontour}}}}} & Draw contours on an unstructured triangular grid. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.tricontourf:matplotlib.axes.Axes.tricontourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.tricontourf}}}}} & Draw contours on an unstructured triangular grid. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axes.Axes.tripcolor} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.tripcolor:matplotlib-axes-axes-tripcolor}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.tripcolor::doc}}\index{tripcolor() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.tripcolor:matplotlib.axes.Axes.tripcolor}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{tripcolor}}}{\emph{*args}, \emph{**kwargs}}{} Create a pseudocolor plot of an unstructured triangular grid. The triangulation can be specified in one of two ways; either: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tripcolor}\PYG{p}{(}\PYG{n}{triangulation}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} where triangulation is a {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.tri.Triangulation}}}}} object, or \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tripcolor}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tripcolor}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tripcolor}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{o}{=}\PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tripcolor}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{mask}\PYG{o}{=}\PYG{n}{mask}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tripcolor}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{n}{mask}\PYG{o}{=}\PYG{n}{mask}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} in which case a Triangulation object will be created. See {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} for a explanation of these possibilities. The next argument must be \sphinxstyleemphasis{C}, the array of color values, either one per point in the triangulation if color values are defined at points, or one per triangle in the triangulation if color values are defined at triangles. If there are the same number of points and triangles in the triangulation it is assumed that color values are defined at points; to force the use of color values at triangles use the kwarg \sphinxcode{\sphinxupquote{facecolors=C}} instead of just \sphinxcode{\sphinxupquote{C}}. \sphinxstyleemphasis{shading} may be ‘flat’ (the default) or ‘gouraud’. If \sphinxstyleemphasis{shading} is ‘flat’ and C values are defined at points, the color values used for each triangle are from the mean C of the triangle’s three points. If \sphinxstyleemphasis{shading} is ‘gouraud’ then color values must be defined at points. The remaining kwargs are the same as for {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolor:matplotlib.axes.Axes.pcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolor()}}}}}. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.triplot} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.triplot:matplotlib-axes-axes-triplot}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.triplot::doc}}\index{triplot() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.triplot:matplotlib.axes.Axes.triplot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{triplot}}}{\emph{*args}, \emph{**kwargs}}{} Draw a unstructured triangular grid as lines and/or markers. The triangulation to plot can be specified in one of two ways; either: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{triplot}\PYG{p}{(}\PYG{n}{triangulation}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} where triangulation is a {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.tri.Triangulation}}}}} object, or \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{triplot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{triplot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{triplot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{o}{=}\PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{triplot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{mask}\PYG{o}{=}\PYG{n}{mask}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{triplot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{n}{mask}\PYG{o}{=}\PYG{n}{mask}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} in which case a Triangulation object will be created. See {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} for a explanation of these possibilities. The remaining args and kwargs are the same as for {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot()}}}}}. Return a list of 2 {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} containing respectively: \begin{itemize} \item {} the lines plotted for triangles edges \item {} the markers plotted for triangles nodes \end{itemize} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.tricontour} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.tricontour:matplotlib-axes-axes-tricontour}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.tricontour::doc}}\index{tricontour() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.tricontour:matplotlib.axes.Axes.tricontour}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{tricontour}}}{\emph{*args}, \emph{**kwargs}}{} Draw contours on an unstructured triangular grid. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tricontour:matplotlib.pyplot.tricontour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tricontour()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tricontourf:matplotlib.pyplot.tricontourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tricontourf()}}}}} draw contour lines and filled contours, respectively. Except as noted, function signatures and return values are the same for both versions. The triangulation can be specified in one of two ways; either: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{triangulation}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} where triangulation is a {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.tri.Triangulation}}}}} object, or \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{o}{=}\PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{mask}\PYG{o}{=}\PYG{n}{mask}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{n}{mask}\PYG{o}{=}\PYG{n}{mask}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} in which case a Triangulation object will be created. See {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} for a explanation of these possibilities. The remaining arguments may be: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxstyleemphasis{Z} is the array of values to contour, one per point in the triangulation. The level values are chosen automatically. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{N}\PYG{p}{)} \end{sphinxVerbatim} contour up to \sphinxstyleemphasis{N+1} automatically chosen contour levels (\sphinxstyleemphasis{N} intervals). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{V}\PYG{p}{)} \end{sphinxVerbatim} draw contour lines at the values specified in sequence \sphinxstyleemphasis{V}, which must be in increasing order. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontourf}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{V}\PYG{p}{)} \end{sphinxVerbatim} fill the (len(\sphinxstyleemphasis{V})-1) regions between the values in \sphinxstyleemphasis{V}, which must be in increasing order. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Use keyword args to control colors, linewidth, origin, cmap … see below for more details. \sphinxcode{\sphinxupquote{C = tricontour(...)}} returns a \sphinxcode{\sphinxupquote{TriContourSet}} object. Optional keyword arguments: \begin{quote} \sphinxstyleemphasis{colors}: {[} \sphinxstyleemphasis{None} \textbar{} string \textbar{} (mpl\_colors) {]} If \sphinxstyleemphasis{None}, the colormap specified by cmap will be used. If a string, like ‘r’ or ‘red’, all levels will be plotted in this color. If a tuple of matplotlib color args (string, float, rgb, etc), different levels will be plotted in different colors in the order specified. \sphinxstyleemphasis{alpha}: float The alpha blending value \sphinxstyleemphasis{cmap}: {[} \sphinxstyleemphasis{None} \textbar{} Colormap {]} A cm {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}} instance or \sphinxstyleemphasis{None}. If \sphinxstyleemphasis{cmap} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{colors} is \sphinxstyleemphasis{None}, a default Colormap is used. \sphinxstyleemphasis{norm}: {[} \sphinxstyleemphasis{None} \textbar{} Normalize {]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance for scaling data values to colors. If \sphinxstyleemphasis{norm} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{colors} is \sphinxstyleemphasis{None}, the default linear scaling is used. \sphinxstyleemphasis{levels} {[}level0, level1, …, leveln{]} A list of floating point numbers indicating the level curves to draw, in increasing order; e.g., to draw just the zero contour pass \sphinxcode{\sphinxupquote{levels={[}0{]}}} \sphinxstyleemphasis{origin}: {[} \sphinxstyleemphasis{None} \textbar{} ‘upper’ \textbar{} ‘lower’ \textbar{} ‘image’ {]} If \sphinxstyleemphasis{None}, the first value of \sphinxstyleemphasis{Z} will correspond to the lower left corner, location (0,0). If ‘image’, the rc value for \sphinxcode{\sphinxupquote{image.origin}} will be used. This keyword is not active if \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are specified in the call to contour. \sphinxstyleemphasis{extent}: {[} \sphinxstyleemphasis{None} \textbar{} (x0,x1,y0,y1) {]} If \sphinxstyleemphasis{origin} is not \sphinxstyleemphasis{None}, then \sphinxstyleemphasis{extent} is interpreted as in {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.imshow()}}}}}: it gives the outer pixel boundaries. In this case, the position of Z{[}0,0{]} is the center of the pixel, not a corner. If \sphinxstyleemphasis{origin} is \sphinxstyleemphasis{None}, then (\sphinxstyleemphasis{x0}, \sphinxstyleemphasis{y0}) is the position of Z{[}0,0{]}, and (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) is the position of Z{[}-1,-1{]}. This keyword is not active if \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are specified in the call to contour. \sphinxstyleemphasis{locator}: {[} \sphinxstyleemphasis{None} \textbar{} ticker.Locator subclass {]} If \sphinxstyleemphasis{locator} is None, the default {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MaxNLocator}}}}} is used. The locator is used to determine the contour levels if they are not given explicitly via the \sphinxstyleemphasis{V} argument. \sphinxstyleemphasis{extend}: {[} ‘neither’ \textbar{} ‘both’ \textbar{} ‘min’ \textbar{} ‘max’ {]} Unless this is ‘neither’, contour levels are automatically added to one or both ends of the range so that all data are included. These added ranges are then mapped to the special colormap values which default to the ends of the colormap range, but can be set via {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_under}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap.set\_under()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_over}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap.set\_over()}}}}} methods. \sphinxstyleemphasis{xunits}, \sphinxstyleemphasis{yunits}: {[} \sphinxstyleemphasis{None} \textbar{} registered units {]} Override axis units by specifying an instance of a {\hyperref[\detokenize{api/units_api:matplotlib.units.ConversionInterface}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.units.ConversionInterface}}}}}. \end{quote} tricontour-only keyword arguments: \begin{quote} \sphinxstyleemphasis{linewidths}: {[} \sphinxstyleemphasis{None} \textbar{} number \textbar{} tuple of numbers {]} If \sphinxstyleemphasis{linewidths} is \sphinxstyleemphasis{None}, the default width in \sphinxcode{\sphinxupquote{lines.linewidth}} in \sphinxcode{\sphinxupquote{matplotlibrc}} is used. If a number, all levels will be plotted with this linewidth. If a tuple, different levels will be plotted with different linewidths in the order specified \sphinxstyleemphasis{linestyles}: {[} \sphinxstyleemphasis{None} \textbar{} ‘solid’ \textbar{} ‘dashed’ \textbar{} ‘dashdot’ \textbar{} ‘dotted’ {]} If \sphinxstyleemphasis{linestyles} is \sphinxstyleemphasis{None}, the ‘solid’ is used. \sphinxstyleemphasis{linestyles} can also be an iterable of the above strings specifying a set of linestyles to be used. If this iterable is shorter than the number of contour levels it will be repeated as necessary. If contour is using a monochrome colormap and the contour level is less than 0, then the linestyle specified in \sphinxcode{\sphinxupquote{contour.negative\_linestyle}} in \sphinxcode{\sphinxupquote{matplotlibrc}} will be used. \end{quote} tricontourf-only keyword arguments: \begin{quote} \sphinxstyleemphasis{antialiased}: bool enable antialiasing \end{quote} Note: tricontourf fills intervals that are closed at the top; that is, for boundaries \sphinxstyleemphasis{z1} and \sphinxstyleemphasis{z2}, the filled region is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{z1} \PYG{o}{\PYGZlt{}} \PYG{n}{z} \PYG{o}{\PYGZlt{}}\PYG{o}{=} \PYG{n}{z2} \end{sphinxVerbatim} There is one exception: if the lowest boundary coincides with the minimum value of the \sphinxstyleemphasis{z} array, then that minimum value will be included in the lowest interval. \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.axes.Axes.tricontour}}} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.tricontour:examples-using-matplotlib-axes-axes-tricontour}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_irregulardatagrid.py} \end{itemize} \subsubsection{matplotlib.axes.Axes.tricontourf} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.tricontourf:matplotlib-axes-axes-tricontourf}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.tricontourf::doc}}\index{tricontourf() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.tricontourf:matplotlib.axes.Axes.tricontourf}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{tricontourf}}}{\emph{*args}, \emph{**kwargs}}{} Draw contours on an unstructured triangular grid. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tricontour:matplotlib.pyplot.tricontour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tricontour()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tricontourf:matplotlib.pyplot.tricontourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tricontourf()}}}}} draw contour lines and filled contours, respectively. Except as noted, function signatures and return values are the same for both versions. The triangulation can be specified in one of two ways; either: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{triangulation}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} where triangulation is a {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.tri.Triangulation}}}}} object, or \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{o}{=}\PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{mask}\PYG{o}{=}\PYG{n}{mask}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{n}{mask}\PYG{o}{=}\PYG{n}{mask}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} in which case a Triangulation object will be created. See {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} for a explanation of these possibilities. The remaining arguments may be: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxstyleemphasis{Z} is the array of values to contour, one per point in the triangulation. The level values are chosen automatically. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{N}\PYG{p}{)} \end{sphinxVerbatim} contour up to \sphinxstyleemphasis{N+1} automatically chosen contour levels (\sphinxstyleemphasis{N} intervals). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{V}\PYG{p}{)} \end{sphinxVerbatim} draw contour lines at the values specified in sequence \sphinxstyleemphasis{V}, which must be in increasing order. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontourf}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{V}\PYG{p}{)} \end{sphinxVerbatim} fill the (len(\sphinxstyleemphasis{V})-1) regions between the values in \sphinxstyleemphasis{V}, which must be in increasing order. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Use keyword args to control colors, linewidth, origin, cmap … see below for more details. \sphinxcode{\sphinxupquote{C = tricontour(...)}} returns a \sphinxcode{\sphinxupquote{TriContourSet}} object. Optional keyword arguments: \begin{quote} \sphinxstyleemphasis{colors}: {[} \sphinxstyleemphasis{None} \textbar{} string \textbar{} (mpl\_colors) {]} If \sphinxstyleemphasis{None}, the colormap specified by cmap will be used. If a string, like ‘r’ or ‘red’, all levels will be plotted in this color. If a tuple of matplotlib color args (string, float, rgb, etc), different levels will be plotted in different colors in the order specified. \sphinxstyleemphasis{alpha}: float The alpha blending value \sphinxstyleemphasis{cmap}: {[} \sphinxstyleemphasis{None} \textbar{} Colormap {]} A cm {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}} instance or \sphinxstyleemphasis{None}. If \sphinxstyleemphasis{cmap} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{colors} is \sphinxstyleemphasis{None}, a default Colormap is used. \sphinxstyleemphasis{norm}: {[} \sphinxstyleemphasis{None} \textbar{} Normalize {]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance for scaling data values to colors. If \sphinxstyleemphasis{norm} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{colors} is \sphinxstyleemphasis{None}, the default linear scaling is used. \sphinxstyleemphasis{levels} {[}level0, level1, …, leveln{]} A list of floating point numbers indicating the level curves to draw, in increasing order; e.g., to draw just the zero contour pass \sphinxcode{\sphinxupquote{levels={[}0{]}}} \sphinxstyleemphasis{origin}: {[} \sphinxstyleemphasis{None} \textbar{} ‘upper’ \textbar{} ‘lower’ \textbar{} ‘image’ {]} If \sphinxstyleemphasis{None}, the first value of \sphinxstyleemphasis{Z} will correspond to the lower left corner, location (0,0). If ‘image’, the rc value for \sphinxcode{\sphinxupquote{image.origin}} will be used. This keyword is not active if \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are specified in the call to contour. \sphinxstyleemphasis{extent}: {[} \sphinxstyleemphasis{None} \textbar{} (x0,x1,y0,y1) {]} If \sphinxstyleemphasis{origin} is not \sphinxstyleemphasis{None}, then \sphinxstyleemphasis{extent} is interpreted as in {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.imshow()}}}}}: it gives the outer pixel boundaries. In this case, the position of Z{[}0,0{]} is the center of the pixel, not a corner. If \sphinxstyleemphasis{origin} is \sphinxstyleemphasis{None}, then (\sphinxstyleemphasis{x0}, \sphinxstyleemphasis{y0}) is the position of Z{[}0,0{]}, and (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) is the position of Z{[}-1,-1{]}. This keyword is not active if \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are specified in the call to contour. \sphinxstyleemphasis{locator}: {[} \sphinxstyleemphasis{None} \textbar{} ticker.Locator subclass {]} If \sphinxstyleemphasis{locator} is None, the default {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MaxNLocator}}}}} is used. The locator is used to determine the contour levels if they are not given explicitly via the \sphinxstyleemphasis{V} argument. \sphinxstyleemphasis{extend}: {[} ‘neither’ \textbar{} ‘both’ \textbar{} ‘min’ \textbar{} ‘max’ {]} Unless this is ‘neither’, contour levels are automatically added to one or both ends of the range so that all data are included. These added ranges are then mapped to the special colormap values which default to the ends of the colormap range, but can be set via {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_under}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap.set\_under()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_over}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap.set\_over()}}}}} methods. \sphinxstyleemphasis{xunits}, \sphinxstyleemphasis{yunits}: {[} \sphinxstyleemphasis{None} \textbar{} registered units {]} Override axis units by specifying an instance of a {\hyperref[\detokenize{api/units_api:matplotlib.units.ConversionInterface}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.units.ConversionInterface}}}}}. \end{quote} tricontour-only keyword arguments: \begin{quote} \sphinxstyleemphasis{linewidths}: {[} \sphinxstyleemphasis{None} \textbar{} number \textbar{} tuple of numbers {]} If \sphinxstyleemphasis{linewidths} is \sphinxstyleemphasis{None}, the default width in \sphinxcode{\sphinxupquote{lines.linewidth}} in \sphinxcode{\sphinxupquote{matplotlibrc}} is used. If a number, all levels will be plotted with this linewidth. If a tuple, different levels will be plotted with different linewidths in the order specified \sphinxstyleemphasis{linestyles}: {[} \sphinxstyleemphasis{None} \textbar{} ‘solid’ \textbar{} ‘dashed’ \textbar{} ‘dashdot’ \textbar{} ‘dotted’ {]} If \sphinxstyleemphasis{linestyles} is \sphinxstyleemphasis{None}, the ‘solid’ is used. \sphinxstyleemphasis{linestyles} can also be an iterable of the above strings specifying a set of linestyles to be used. If this iterable is shorter than the number of contour levels it will be repeated as necessary. If contour is using a monochrome colormap and the contour level is less than 0, then the linestyle specified in \sphinxcode{\sphinxupquote{contour.negative\_linestyle}} in \sphinxcode{\sphinxupquote{matplotlibrc}} will be used. \end{quote} tricontourf-only keyword arguments: \begin{quote} \sphinxstyleemphasis{antialiased}: bool enable antialiasing \end{quote} Note: tricontourf fills intervals that are closed at the top; that is, for boundaries \sphinxstyleemphasis{z1} and \sphinxstyleemphasis{z2}, the filled region is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{z1} \PYG{o}{\PYGZlt{}} \PYG{n}{z} \PYG{o}{\PYGZlt{}}\PYG{o}{=} \PYG{n}{z2} \end{sphinxVerbatim} There is one exception: if the lowest boundary coincides with the minimum value of the \sphinxstyleemphasis{z} array, then that minimum value will be included in the lowest interval. \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.axes.Axes.tricontourf}}} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.tricontourf:examples-using-matplotlib-axes-axes-tricontourf}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_irregulardatagrid.py} \end{itemize} \subsection{Text and Annotations} \label{\detokenize{api/axes_api:text-and-annotations}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.annotate:matplotlib.axes.Axes.annotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.annotate}}}}} & Annotate the point \sphinxcode{\sphinxupquote{xy}} with text \sphinxcode{\sphinxupquote{s}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.text:matplotlib.axes.Axes.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.text}}}}} & Add text to the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.table:matplotlib.axes.Axes.table}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.table}}}}} & Add a table to the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.arrow:matplotlib.axes.Axes.arrow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.arrow}}}}} & Add an arrow to the axes. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axes.Axes.annotate} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.annotate:matplotlib-axes-axes-annotate}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.annotate::doc}}\index{annotate() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.annotate:matplotlib.axes.Axes.annotate}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{annotate}}}{\emph{*args}, \emph{**kwargs}}{} Annotate the point \sphinxcode{\sphinxupquote{xy}} with text \sphinxcode{\sphinxupquote{s}}. Additional kwargs are passed to {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}str{]} The text of the annotation \item[{\sphinxstylestrong{xy}}] \leavevmode{[}iterable{]} Length 2 sequence specifying the \sphinxstyleemphasis{(x,y)} point to annotate \item[{\sphinxstylestrong{xytext}}] \leavevmode{[}iterable, optional{]} Length 2 sequence specifying the \sphinxstyleemphasis{(x,y)} to place the text at. If None, defaults to \sphinxcode{\sphinxupquote{xy}}. \item[{\sphinxstylestrong{xycoords}}] \leavevmode{[}str, Artist, Transform, callable or tuple, optional{]} The coordinate system that \sphinxcode{\sphinxupquote{xy}} is given in. For a \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} the allowed values are: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline ‘figure points’ & points from the lower left of the figure \\ \hline ‘figure pixels’ & pixels from the lower left of the figure \\ \hline ‘figure fraction’ & fraction of figure from lower left \\ \hline ‘axes points’ & points from lower left corner of axes \\ \hline ‘axes pixels’ & pixels from lower left corner of axes \\ \hline ‘axes fraction’ & fraction of axes from lower left \\ \hline ‘data’ & use the coordinate system of the object being annotated (default) \\ \hline ‘polar’ & \sphinxstyleemphasis{(theta,r)} if not native ‘data’ coordinates \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} If a {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} object is passed in the units are fraction if it’s bounding box. If a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} object is passed in use that to transform \sphinxcode{\sphinxupquote{xy}} to screen coordinates If a callable it must take a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RendererBase}}}}} object as input and return a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} or {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} object If a \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#tuple}{\sphinxcode{\sphinxupquote{tuple}}} must be length 2 tuple of str, \sphinxcode{\sphinxupquote{Artist}}, \sphinxcode{\sphinxupquote{Transform}} or callable objects. The first transform is used for the \sphinxstyleemphasis{x} coordinate and the second for \sphinxstyleemphasis{y}. See {\hyperref[\detokenize{tutorials/text/annotations:plotting-guide-annotation}]{\sphinxcrossref{\DUrole{std,std-ref}{Advanced Annotation}}}} for more details. Defaults to \sphinxcode{\sphinxupquote{'data'}} \item[{\sphinxstylestrong{textcoords}}] \leavevmode{[}str, \sphinxcode{\sphinxupquote{Artist}}, \sphinxcode{\sphinxupquote{Transform}}, callable or tuple, optional{]} The coordinate system that \sphinxcode{\sphinxupquote{xytext}} is given, which may be different than the coordinate system used for \sphinxcode{\sphinxupquote{xy}}. All \sphinxcode{\sphinxupquote{xycoords}} values are valid as well as the following strings: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline ‘offset points’ & offset (in points) from the \sphinxstyleemphasis{xy} value \\ \hline ‘offset pixels’ & offset (in pixels) from the \sphinxstyleemphasis{xy} value \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} defaults to the input of \sphinxcode{\sphinxupquote{xycoords}} \item[{\sphinxstylestrong{arrowprops}}] \leavevmode{[}dict, optional{]} If not None, properties used to draw a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrowPatch}}}}} arrow between \sphinxcode{\sphinxupquote{xy}} and \sphinxcode{\sphinxupquote{xytext}}. If \sphinxcode{\sphinxupquote{arrowprops}} does not contain the key \sphinxcode{\sphinxupquote{'arrowstyle'}} the allowed keys are: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Key &\sphinxstyletheadfamily Description \\ \hline width & the width of the arrow in points \\ \hline headwidth & the width of the base of the arrow head in points \\ \hline headlength & the length of the arrow head in points \\ \hline shrink & fraction of total length to ‘shrink’ from both ends \\ \hline ? & any key to {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.FancyArrowPatch}}}}} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} If the \sphinxcode{\sphinxupquote{arrowprops}} contains the key \sphinxcode{\sphinxupquote{'arrowstyle'}} the above keys are forbidden. The allowed values of \sphinxcode{\sphinxupquote{'arrowstyle'}} are: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Name &\sphinxstyletheadfamily Attrs \\ \hline \sphinxcode{\sphinxupquote{'-'}} & None \\ \hline \sphinxcode{\sphinxupquote{'-\textgreater{}'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'-{[}'}} & widthB=1.0,lengthB=0.2,angleB=None \\ \hline \sphinxcode{\sphinxupquote{'\textbar{}-\textbar{}'}} & widthA=1.0,widthB=1.0 \\ \hline \sphinxcode{\sphinxupquote{'-\textbar{}\textgreater{}'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'\textless{}-'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'\textless{}-\textgreater{}'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'\textless{}\textbar{}-'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'\textless{}\textbar{}-\textbar{}\textgreater{}'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'fancy'}} & head\_length=0.4,head\_width=0.4,tail\_width=0.4 \\ \hline \sphinxcode{\sphinxupquote{'simple'}} & head\_length=0.5,head\_width=0.5,tail\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'wedge'}} & tail\_width=0.3,shrink\_factor=0.5 \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Valid keys for {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrowPatch}}}}} are: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Key &\sphinxstyletheadfamily Description \\ \hline arrowstyle & the arrow style \\ \hline connectionstyle & the connection style \\ \hline relpos & default is (0.5, 0.5) \\ \hline patchA & default is bounding box of the text \\ \hline patchB & default is None \\ \hline shrinkA & default is 2 points \\ \hline shrinkB & default is 2 points \\ \hline mutation\_scale & default is text size (in points) \\ \hline mutation\_aspect & default is 1. \\ \hline ? & any key for {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.PathPatch:matplotlib.patches.PathPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.PathPatch}}}}} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Defaults to None \item[{\sphinxstylestrong{annotation\_clip}}] \leavevmode{[}bool, optional{]} Controls the visibility of the annotation when it goes outside the axes area. If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, the annotation will only be drawn when the \sphinxcode{\sphinxupquote{xy}} is inside the axes. If \sphinxhref{https://docs.python.org/3/library/constants.html\#False}{\sphinxcode{\sphinxupquote{False}}}, the annotation will always be drawn regardless of its position. The default is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, which behave as \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} only if \sphinxstyleemphasis{xycoords} is “data”. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Annotation}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.text} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.text:matplotlib-axes-axes-text}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.text::doc}}\index{text() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.text:matplotlib.axes.Axes.text}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{text}}}{\emph{x}, \emph{y}, \emph{s}, \emph{fontdict=None}, \emph{withdash=False}, \emph{**kwargs}}{} Add text to the axes. Add the text \sphinxstyleemphasis{s} to the axes at location \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} in data coordinates. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}scalars{]} The position to place the text. By default, this is in data coordinates. The coordinate system can be changed using the \sphinxstyleemphasis{transform} parameter. \item[{\sphinxstylestrong{s}}] \leavevmode{[}str{]} The text. \item[{\sphinxstylestrong{fontdict}}] \leavevmode{[}dictionary, optional, default: None{]} A dictionary to override the default text properties. If fontdict is None, the defaults are determined by your rc parameters. \item[{\sphinxstylestrong{withdash}}] \leavevmode{[}boolean, optional, default: False{]} Creates a {\hyperref[\detokenize{api/text_api:matplotlib.text.TextWithDash}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TextWithDash}}}}} instance instead of a {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instance. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{text}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}}{]} The created {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instance. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} properties.{]} Other miscellaneous text parameters. \end{description} \end{description}\end{quote} \paragraph{Examples} Individual keyword arguments can be used to override any given parameter: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{text}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{s}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{12}\PYG{p}{)} \end{sphinxVerbatim} The default transform specifies that text is in data coords, alternatively, you can specify text in axis coords (0,0 is lower-left and 1,1 is upper-right). The example below places text in the center of the axes: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{matplotlib}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{g+gp}{... } \PYG{n}{verticalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \end{sphinxVerbatim} You can put a rectangular box around the text instance (e.g., to set a background color) by using the keyword \sphinxcode{\sphinxupquote{bbox}}. \sphinxcode{\sphinxupquote{bbox}} is a dictionary of {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}} properties. For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{text}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{s}\PYG{p}{,} \PYG{n}{bbox}\PYG{o}{=}\PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.table} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.table:matplotlib-axes-axes-table}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.table::doc}}\index{table() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.table:matplotlib.axes.Axes.table}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{table}}}{\emph{**kwargs}}{} Add a table to the current axes. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{table}\PYG{p}{(}\PYG{n}{cellText}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{cellColours}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{cellLoc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{colWidths}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{rowLabels}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{rowColours}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{rowLoc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{left}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{colLabels}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{colColours}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{colLoc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{loc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bottom}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{bbox}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)} \end{sphinxVerbatim} Returns a {\hyperref[\detokenize{api/table_api:matplotlib.table.Table}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.table.Table}}}}} instance. Either \sphinxcode{\sphinxupquote{cellText}} or \sphinxcode{\sphinxupquote{cellColours}} must be provided. For finer grained control over tables, use the {\hyperref[\detokenize{api/table_api:matplotlib.table.Table}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Table}}}}} class and add it to the axes with {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.add_table:matplotlib.axes.Axes.add_table}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_table()}}}}}. Thanks to John Gill for providing the class and table. kwargs control the {\hyperref[\detokenize{api/table_api:matplotlib.table.Table}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Table}}}}} properties: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/table_api:matplotlib.table.Table.set_fontsize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fontsize}}}}} & a float in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.arrow} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.arrow:matplotlib-axes-axes-arrow}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.arrow::doc}}\index{arrow() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.arrow:matplotlib.axes.Axes.arrow}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{arrow}}}{\emph{x}, \emph{y}, \emph{dx}, \emph{dy}, \emph{**kwargs}}{} Add an arrow to the axes. This draws an arrow from \sphinxcode{\sphinxupquote{(x, y)}} to \sphinxcode{\sphinxupquote{(x+dx, y+dy)}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}float{]} The x/y-coordinate of the arrow base. \item[{\sphinxstylestrong{dx, dy}}] \leavevmode{[}float{]} The length of the arrow along x/y-direction. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{arrow}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrow:matplotlib.patches.FancyArrow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrow}}}}}{]} The created {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrow:matplotlib.patches.FancyArrow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrow}}}}} object. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode Optional kwargs (inherited from {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrow:matplotlib.patches.FancyArrow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrow}}}}} patch) control the arrow construction and properties: \item[{\sphinxstylestrong{Constructor arguments}}] \leavevmode\begin{description} \item[{\sphinxstyleemphasis{width}: float (default: 0.001)}] \leavevmode width of full arrow tail \item[{\sphinxstyleemphasis{length\_includes\_head}: bool (default: False)}] \leavevmode True if head is to be counted in calculating the length. \item[{\sphinxstyleemphasis{head\_width}: float or None (default: 3*width)}] \leavevmode total width of the full arrow head \item[{\sphinxstyleemphasis{head\_length}: float or None (default: 1.5 * head\_width)}] \leavevmode length of arrow head \item[{\sphinxstyleemphasis{shape}: {[}‘full’, ‘left’, ‘right’{]} (default: ‘full’)}] \leavevmode draw the left-half, right-half, or full arrow \item[{\sphinxstyleemphasis{overhang}: float (default: 0)}] \leavevmode fraction that the arrow is swept back (0 overhang means triangular shape). Can be negative or greater than one. \item[{\sphinxstyleemphasis{head\_starts\_at\_zero}: bool (default: False)}] \leavevmode if True, the head starts being drawn at coordinate 0 instead of ending at coordinate 0. \end{description} \item[{\sphinxstylestrong{Other valid kwargs (inherited from :class:{}`Patch{}`) are:}}] \leavevmode \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{description} \end{description}\end{quote} \paragraph{Notes} The resulting arrow is affected by the axes aspect ratio and limits. This may produce an arrow whose head is not square with its stem. To create an arrow whose head is square with its stem, use {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.annotate:matplotlib.axes.Axes.annotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{annotate()}}}}} for example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xytext}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{,} \PYG{g+gp}{... } \PYG{n}{arrowprops}\PYG{o}{=}\PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{arrowstyle}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZhy{}\PYGZgt{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsection{Fields} \label{\detokenize{api/axes_api:fields}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.barbs:matplotlib.axes.Axes.barbs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.barbs}}}}} & Plot a 2-D field of barbs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.quiver:matplotlib.axes.Axes.quiver}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.quiver}}}}} & Plot a 2-D field of arrows. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.quiverkey:matplotlib.axes.Axes.quiverkey}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.quiverkey}}}}} & Add a key to a quiver plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.streamplot:matplotlib.axes.Axes.streamplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.streamplot}}}}} & Draws streamlines of a vector flow. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axes.Axes.barbs} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.barbs:matplotlib-axes-axes-barbs}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.barbs::doc}}\index{barbs() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.barbs:matplotlib.axes.Axes.barbs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{barbs}}}{\emph{*args}, \emph{data=None}, \emph{**kw}}{} Plot a 2-D field of barbs. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{barb}\PYG{p}{(}\PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \PYG{n}{barb}\PYG{p}{(}\PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \PYG{n}{barb}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \PYG{n}{barb}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \end{sphinxVerbatim} Arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}:}] \leavevmode The x and y coordinates of the barb locations (default is head of barb; see \sphinxstyleemphasis{pivot} kwarg) \item[{\sphinxstyleemphasis{U}, \sphinxstyleemphasis{V}:}] \leavevmode Give the x and y components of the barb shaft \item[{\sphinxstyleemphasis{C}:}] \leavevmode An optional array used to map colors to the barbs \end{description} \end{quote} All arguments may be 1-D or 2-D arrays or sequences. If \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are absent, they will be generated as a uniform grid. If \sphinxstyleemphasis{U} and \sphinxstyleemphasis{V} are 2-D arrays but \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are 1-D, and if \sphinxcode{\sphinxupquote{len(X)}} and \sphinxcode{\sphinxupquote{len(Y)}} match the column and row dimensions of \sphinxstyleemphasis{U}, then \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} will be expanded with \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.meshgrid.html\#numpy.meshgrid}{\sphinxcode{\sphinxupquote{numpy.meshgrid()}}}. \sphinxstyleemphasis{U}, \sphinxstyleemphasis{V}, \sphinxstyleemphasis{C} may be masked arrays, but masked \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y} are not supported at present. Keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{length}:}] \leavevmode Length of the barb in points; the other parts of the barb are scaled against this. Default is 7. \item[{\sphinxstyleemphasis{pivot}: {[} ‘tip’ \textbar{} ‘middle’ \textbar{} float {]}}] \leavevmode The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name \sphinxstyleemphasis{pivot}. Default is ‘tip’. Can also be a number, which shifts the start of the barb that many points from the origin. \item[{\sphinxstyleemphasis{barbcolor}: {[} color \textbar{} color sequence {]}}] \leavevmode Specifies the color all parts of the barb except any flags. This parameter is analogous to the \sphinxstyleemphasis{edgecolor} parameter for polygons, which can be used instead. However this parameter will override facecolor. \item[{\sphinxstyleemphasis{flagcolor}: {[} color \textbar{} color sequence {]}}] \leavevmode Specifies the color of any flags on the barb. This parameter is analogous to the \sphinxstyleemphasis{facecolor} parameter for polygons, which can be used instead. However this parameter will override facecolor. If this is not set (and \sphinxstyleemphasis{C} has not either) then \sphinxstyleemphasis{flagcolor} will be set to match \sphinxstyleemphasis{barbcolor} so that the barb has a uniform color. If \sphinxstyleemphasis{C} has been set, \sphinxstyleemphasis{flagcolor} has no effect. \item[{\sphinxstyleemphasis{sizes}:}] \leavevmode A dictionary of coefficients specifying the ratio of a given feature to the length of the barb. Only those values one wishes to override need to be included. These features include: \begin{itemize} \item {} ‘spacing’ - space between features (flags, full/half barbs) \item {} ‘height’ - height (distance from shaft to top) of a flag or full barb \item {} ‘width’ - width of a flag, twice the width of a full barb \item {} ‘emptybarb’ - radius of the circle used for low magnitudes \end{itemize} \item[{\sphinxstyleemphasis{fill\_empty}:}] \leavevmode A flag on whether the empty barbs (circles) that are drawn should be filled with the flag color. If they are not filled, they will be drawn such that no color is applied to the center. Default is False \item[{\sphinxstyleemphasis{rounding}:}] \leavevmode A flag to indicate whether the vector magnitude should be rounded when allocating barb components. If True, the magnitude is rounded to the nearest multiple of the half-barb increment. If False, the magnitude is simply truncated to the next lowest multiple. Default is True \item[{\sphinxstyleemphasis{barb\_increments}:}] \leavevmode A dictionary of increments specifying values to associate with different parts of the barb. Only those values one wishes to override need to be included. \begin{itemize} \item {} ‘half’ - half barbs (Default is 5) \item {} ‘full’ - full barbs (Default is 10) \item {} ‘flag’ - flags (default is 50) \end{itemize} \item[{\sphinxstyleemphasis{flip\_barb}:}] \leavevmode Either a single boolean flag or an array of booleans. Single boolean indicates whether the lines and flags should point opposite to normal for all barbs. An array (which should be the same size as the other data arrays) indicates whether to flip for each individual barb. Normal behavior is for the barbs and lines to point right (comes from wind barbs having these features point towards low pressure in the Northern Hemisphere.) Default is False \end{description} \end{quote} Barbs are traditionally used in meteorology as a way to plot the speed and direction of wind observations, but can technically be used to plot any two dimensional vector quantity. As opposed to arrows, which give vector magnitude by the length of the arrow, the barbs give more quantitative information about the vector magnitude by putting slanted lines or a triangle for various increments in magnitude, as show schematically below: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{:} \PYG{o}{/}\PYGZbs{} \PYGZbs{}\PYGZbs{} \PYG{p}{:} \PYG{o}{/} \PYGZbs{} \PYGZbs{}\PYGZbs{} \PYG{p}{:} \PYG{o}{/} \PYGZbs{} \PYGZbs{} \PYGZbs{}\PYGZbs{} \PYG{p}{:} \PYG{o}{/} \PYGZbs{} \PYGZbs{} \PYGZbs{}\PYGZbs{} \PYG{p}{:} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}} \end{sphinxVerbatim} The largest increment is given by a triangle (or “flag”). After those come full lines (barbs). The smallest increment is a half line. There is only, of course, ever at most 1 half line. If the magnitude is small and only needs a single half-line and no full lines or triangles, the half-line is offset from the end of the barb so that it can be easily distinguished from barbs with a single full line. The magnitude for the barb shown above would nominally be 65, using the standard increments of 50, 10, and 5. linewidths and edgecolors can be used to customize the barb. Additional {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} keyword arguments: \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or antialiaseds & Boolean or sequence of booleans \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{array}}}}} & ndarray \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}} & a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cmap}}}}} & a colormap or registered colormap name \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color arg or sequence of rgba tuples \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or edgecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or facecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or dashes or linestyles & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or linewidths or lw & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_norm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{norm}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offset\_position}}}}} & {[} ‘screen’ \textbar{} ‘data’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offsets}}}}} & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_urls}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{urls}}}}} & List{[}str{]} or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All positional and all keyword arguments. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.quiver} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.quiver:matplotlib-axes-axes-quiver}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.quiver::doc}}\index{quiver() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.quiver:matplotlib.axes.Axes.quiver}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{quiver}}}{\emph{*args}, \emph{data=None}, \emph{**kw}}{} Plot a 2-D field of arrows. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{quiver}\PYG{p}{(}\PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \PYG{n}{quiver}\PYG{p}{(}\PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \PYG{n}{quiver}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \PYG{n}{quiver}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \end{sphinxVerbatim} \sphinxstyleemphasis{U} and \sphinxstyleemphasis{V} are the arrow data, \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} set the location of the arrows, and \sphinxstyleemphasis{C} sets the color of the arrows. These arguments may be 1-D or 2-D arrays or sequences. If \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are absent, they will be generated as a uniform grid. If \sphinxstyleemphasis{U} and \sphinxstyleemphasis{V} are 2-D arrays and \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are 1-D, and if \sphinxcode{\sphinxupquote{len(X)}} and \sphinxcode{\sphinxupquote{len(Y)}} match the column and row dimensions of \sphinxstyleemphasis{U}, then \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} will be expanded with \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.meshgrid.html\#numpy.meshgrid}{\sphinxcode{\sphinxupquote{numpy.meshgrid()}}}. The default settings auto-scales the length of the arrows to a reasonable size. To change this behavior see the \sphinxstyleemphasis{scale} and \sphinxstyleemphasis{scale\_units} kwargs. The defaults give a slightly swept-back arrow; to make the head a triangle, make \sphinxstyleemphasis{headaxislength} the same as \sphinxstyleemphasis{headlength}. To make the arrow more pointed, reduce \sphinxstyleemphasis{headwidth} or increase \sphinxstyleemphasis{headlength} and \sphinxstyleemphasis{headaxislength}. To make the head smaller relative to the shaft, scale down all the head parameters. You will probably do best to leave minshaft alone. \sphinxstyleemphasis{linewidths} and \sphinxstyleemphasis{edgecolors} can be used to customize the arrow outlines. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{X}}] \leavevmode{[}1D or 2D array, sequence, optional{]} The x coordinates of the arrow locations \item[{\sphinxstylestrong{Y}}] \leavevmode{[}1D or 2D array, sequence, optional{]} The y coordinates of the arrow locations \item[{\sphinxstylestrong{U}}] \leavevmode{[}1D or 2D array or masked array, sequence{]} The x components of the arrow vectors \item[{\sphinxstylestrong{V}}] \leavevmode{[}1D or 2D array or masked array, sequence{]} The y components of the arrow vectors \item[{\sphinxstylestrong{C}}] \leavevmode{[}1D or 2D array, sequence, optional{]} The arrow colors \item[{\sphinxstylestrong{units}}] \leavevmode{[}{[} ‘width’ \textbar{} ‘height’ \textbar{} ‘dots’ \textbar{} ‘inches’ \textbar{} ‘x’ \textbar{} ‘y’ \textbar{} ‘xy’ {]}{]} The arrow dimensions (except for \sphinxstyleemphasis{length}) are measured in multiples of this unit. ‘width’ or ‘height’: the width or height of the axis ‘dots’ or ‘inches’: pixels or inches, based on the figure dpi ‘x’, ‘y’, or ‘xy’: respectively \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}, or $\sqrt{X^2 + Y^2}$ in data units The arrows scale differently depending on the units. For ‘x’ or ‘y’, the arrows get larger as one zooms in; for other units, the arrow size is independent of the zoom state. For ‘width or ‘height’, the arrow size increases with the width and height of the axes, respectively, when the window is resized; for ‘dots’ or ‘inches’, resizing does not change the arrows. \item[{\sphinxstylestrong{angles}}] \leavevmode{[}{[} ‘uv’ \textbar{} ‘xy’ {]}, array, optional{]} Method for determining the angle of the arrows. Default is ‘uv’. ‘uv’: the arrow axis aspect ratio is 1 so that if \sphinxstyleemphasis{U*==*V} the orientation of the arrow on the plot is 45 degrees counter-clockwise from the horizontal axis (positive to the right). ‘xy’: arrows point from (x,y) to (x+u, y+v). Use this for plotting a gradient field, for example. Alternatively, arbitrary angles may be specified as an array of values in degrees, counter-clockwise from the horizontal axis. Note: inverting a data axis will correspondingly invert the arrows only with \sphinxcode{\sphinxupquote{angles='xy'}}. \item[{\sphinxstylestrong{scale}}] \leavevmode{[}None, float, optional{]} Number of data units per arrow length unit, e.g., m/s per plot width; a smaller scale parameter makes the arrow longer. Default is \sphinxstyleemphasis{None}. If \sphinxstyleemphasis{None}, a simple autoscaling algorithm is used, based on the average vector length and the number of vectors. The arrow length unit is given by the \sphinxstyleemphasis{scale\_units} parameter \item[{\sphinxstylestrong{scale\_units}}] \leavevmode{[}{[} ‘width’ \textbar{} ‘height’ \textbar{} ‘dots’ \textbar{} ‘inches’ \textbar{} ‘x’ \textbar{} ‘y’ \textbar{} ‘xy’ {]}, None, optional{]} If the \sphinxstyleemphasis{scale} kwarg is \sphinxstyleemphasis{None}, the arrow length unit. Default is \sphinxstyleemphasis{None}. e.g. \sphinxstyleemphasis{scale\_units} is ‘inches’, \sphinxstyleemphasis{scale} is 2.0, and \sphinxcode{\sphinxupquote{(u,v) = (1,0)}}, then the vector will be 0.5 inches long. If \sphinxstyleemphasis{scale\_units} is ‘width’/’height’, then the vector will be half the width/height of the axes. If \sphinxstyleemphasis{scale\_units} is ‘x’ then the vector will be 0.5 x-axis units. To plot vectors in the x-y plane, with u and v having the same units as x and y, use \sphinxcode{\sphinxupquote{angles='xy', scale\_units='xy', scale=1}}. \item[{\sphinxstylestrong{width}}] \leavevmode{[}scalar, optional{]} Shaft width in arrow units; default depends on choice of units, above, and number of vectors; a typical starting value is about 0.005 times the width of the plot. \item[{\sphinxstylestrong{headwidth}}] \leavevmode{[}scalar, optional{]} Head width as multiple of shaft width, default is 3 \item[{\sphinxstylestrong{headlength}}] \leavevmode{[}scalar, optional{]} Head length as multiple of shaft width, default is 5 \item[{\sphinxstylestrong{headaxislength}}] \leavevmode{[}scalar, optional{]} Head length at shaft intersection, default is 4.5 \item[{\sphinxstylestrong{minshaft}}] \leavevmode{[}scalar, optional{]} Length below which arrow scales, in units of head length. Do not set this to less than 1, or small arrows will look terrible! Default is 1 \item[{\sphinxstylestrong{minlength}}] \leavevmode{[}scalar, optional{]} Minimum length as a multiple of shaft width; if an arrow length is less than this, plot a dot (hexagon) of this diameter instead. Default is 1. \item[{\sphinxstylestrong{pivot}}] \leavevmode{[}{[} ‘tail’ \textbar{} ‘mid’ \textbar{} ‘middle’ \textbar{} ‘tip’ {]}, optional{]} The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name \sphinxstyleemphasis{pivot}. \item[{\sphinxstylestrong{color}}] \leavevmode{[}{[} color \textbar{} color sequence {]}, optional{]} This is a synonym for the {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} facecolor kwarg. If \sphinxstyleemphasis{C} has been set, \sphinxstyleemphasis{color} has no effect. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.quiverkey:matplotlib.axes.Axes.quiverkey}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{quiverkey}}}}}}] \leavevmode Add a key to a quiver plot \end{description} \paragraph{Notes} Additional {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} keyword arguments: \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or antialiaseds & Boolean or sequence of booleans \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{array}}}}} & ndarray \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}} & a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cmap}}}}} & a colormap or registered colormap name \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color arg or sequence of rgba tuples \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or edgecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or facecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or dashes or linestyles & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or linewidths or lw & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_norm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{norm}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offset\_position}}}}} & {[} ‘screen’ \textbar{} ‘data’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offsets}}}}} & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_urls}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{urls}}}}} & List{[}str{]} or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.quiverkey} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.quiverkey:matplotlib-axes-axes-quiverkey}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.quiverkey::doc}}\index{quiverkey() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.quiverkey:matplotlib.axes.Axes.quiverkey}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{quiverkey}}}{\emph{*args}, \emph{**kw}}{} Add a key to a quiver plot. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{quiverkey}\PYG{p}{(}\PYG{n}{Q}\PYG{p}{,} \PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{U}\PYG{p}{,} \PYG{n}{label}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \end{sphinxVerbatim} Arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{Q}:}] \leavevmode The Quiver instance returned by a call to quiver. \item[{\sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}:}] \leavevmode The location of the key; additional explanation follows. \item[{\sphinxstyleemphasis{U}:}] \leavevmode The length of the key \item[{\sphinxstyleemphasis{label}:}] \leavevmode A string with the length and units of the key \end{description} \end{quote} Keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{angle} = 0}] \leavevmode The angle of the key arrow. Measured in degrees anti-clockwise from the x-axis. \item[{\sphinxstyleemphasis{coordinates} = {[} ‘axes’ \textbar{} ‘figure’ \textbar{} ‘data’ \textbar{} ‘inches’ {]}}] \leavevmode Coordinate system and units for \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}: ‘axes’ and ‘figure’ are normalized coordinate systems with 0,0 in the lower left and 1,1 in the upper right; ‘data’ are the axes data coordinates (used for the locations of the vectors in the quiver plot itself); ‘inches’ is position in the figure in inches, with 0,0 at the lower left corner. \item[{\sphinxstyleemphasis{color}:}] \leavevmode overrides face and edge colors from \sphinxstyleemphasis{Q}. \item[{\sphinxstyleemphasis{labelpos} = {[} ‘N’ \textbar{} ‘S’ \textbar{} ‘E’ \textbar{} ‘W’ {]}}] \leavevmode Position the label above, below, to the right, to the left of the arrow, respectively. \item[{\sphinxstyleemphasis{labelsep}:}] \leavevmode Distance in inches between the arrow and the label. Default is 0.1 \item[{\sphinxstyleemphasis{labelcolor}:}] \leavevmode defaults to default {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} color. \item[{\sphinxstyleemphasis{fontproperties}:}] \leavevmode A dictionary with keyword arguments accepted by the {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FontProperties}}}}} initializer: \sphinxstyleemphasis{family}, \sphinxstyleemphasis{style}, \sphinxstyleemphasis{variant}, \sphinxstyleemphasis{size}, \sphinxstyleemphasis{weight} \end{description} \end{quote} Any additional keyword arguments are used to override vector properties taken from \sphinxstyleemphasis{Q}. The positioning of the key depends on \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}, \sphinxstyleemphasis{coordinates}, and \sphinxstyleemphasis{labelpos}. If \sphinxstyleemphasis{labelpos} is ‘N’ or ‘S’, \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y} give the position of the middle of the key arrow. If \sphinxstyleemphasis{labelpos} is ‘E’, \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y} positions the head, and if \sphinxstyleemphasis{labelpos} is ‘W’, \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y} positions the tail; in either of these two cases, \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y} is somewhere in the middle of the arrow+label key object. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.streamplot} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.streamplot:matplotlib-axes-axes-streamplot}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.streamplot::doc}}\index{streamplot() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.streamplot:matplotlib.axes.Axes.streamplot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{streamplot}}}{\emph{x}, \emph{y}, \emph{u}, \emph{v}, \emph{density=1}, \emph{linewidth=None}, \emph{color=None}, \emph{cmap=None}, \emph{norm=None}, \emph{arrowsize=1}, \emph{arrowstyle='-\textbar{}\textgreater{}'}, \emph{minlength=0.1}, \emph{transform=None}, \emph{zorder=None}, \emph{start\_points=None}, \emph{maxlength=4.0}, \emph{integration\_direction='both'}, \emph{*}, \emph{data=None}}{} Draws streamlines of a vector flow. \begin{description} \item[{\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}}] \leavevmode{[}1d arrays{]} an \sphinxstyleemphasis{evenly spaced} grid. \item[{\sphinxstyleemphasis{u}, \sphinxstyleemphasis{v}}] \leavevmode{[}2d arrays{]} x and y-velocities. Number of rows should match length of y, and the number of columns should match x. \item[{\sphinxstyleemphasis{density}}] \leavevmode{[}float or 2-tuple{]} Controls the closeness of streamlines. When \sphinxcode{\sphinxupquote{density = 1}}, the domain is divided into a 30x30 grid—\sphinxstyleemphasis{density} linearly scales this grid. Each cell in the grid can have, at most, one traversing streamline. For different densities in each direction, use {[}density\_x, density\_y{]}. \item[{\sphinxstyleemphasis{linewidth}}] \leavevmode{[}numeric or 2d array{]} vary linewidth when given a 2d array with the same shape as velocities. \item[{\sphinxstyleemphasis{color}}] \leavevmode{[}matplotlib color code, or 2d array{]} Streamline color. When given an array with the same shape as velocities, \sphinxstyleemphasis{color} values are converted to colors using \sphinxstyleemphasis{cmap}. \item[{\sphinxstyleemphasis{cmap}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}}{]} Colormap used to plot streamlines and arrows. Only necessary when using an array input for \sphinxstyleemphasis{color}. \item[{\sphinxstyleemphasis{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} Normalize object used to scale luminance data to 0, 1. If None, stretch (min, max) to (0, 1). Only necessary when \sphinxstyleemphasis{color} is an array. \item[{\sphinxstyleemphasis{arrowsize}}] \leavevmode{[}float{]} Factor scale arrow size. \item[{\sphinxstyleemphasis{arrowstyle}}] \leavevmode{[}str{]} Arrow style specification. See {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrowPatch}}}}}. \item[{\sphinxstyleemphasis{minlength}}] \leavevmode{[}float{]} Minimum length of streamline in axes coordinates. \item[{\sphinxstyleemphasis{start\_points}: Nx2 array}] \leavevmode Coordinates of starting points for the streamlines. In data coordinates, the same as the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} arrays. \item[{\sphinxstyleemphasis{zorder}}] \leavevmode{[}int{]} any number \item[{\sphinxstyleemphasis{maxlength}}] \leavevmode{[}float{]} Maximum length of streamline in axes coordinates. \item[{\sphinxstyleemphasis{integration\_direction}}] \leavevmode{[}{[}‘forward’, ‘backward’, ‘both’{]}{]} Integrate the streamline in forward, backward or both directions. \end{description} Returns: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{stream\_container}}] \leavevmode{[}StreamplotSet{]} Container object with attributes \begin{itemize} \item {} lines: {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} of streamlines \item {} arrows: collection of {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.FancyArrowPatch}}}}} objects representing arrows half-way along stream lines. \end{itemize} This container will probably change in the future to allow changes to the colormap, alpha, etc. for both lines and arrows, but these changes should be backward compatible. \end{description} \end{quote} \end{fulllineitems} \section{Clearing} \label{\detokenize{api/axes_api:clearing}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.cla:matplotlib.axes.Axes.cla}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.cla}}}}} & Clear the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.clear:matplotlib.axes.Axes.clear}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.clear}}}}} & Clear the axes. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axes.Axes.cla} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.cla:matplotlib-axes-axes-cla}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.cla::doc}}\index{cla() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.cla:matplotlib.axes.Axes.cla}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{cla}}}{}{} Clear the current axes. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.axes.Axes.cla}}} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.cla:examples-using-matplotlib-axes-axes-cla}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_custom\_projection.py} \end{itemize} \subsection{matplotlib.axes.Axes.clear} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.clear:matplotlib-axes-axes-clear}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.clear::doc}}\index{clear() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.clear:matplotlib.axes.Axes.clear}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{clear}}}{}{} Clear the axes. \end{fulllineitems} \section{Appearance} \label{\detokenize{api/axes_api:appearance}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.axis:matplotlib.axes.Axes.axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.axis}}}}} & Set axis properties. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_axis_off:matplotlib.axes.Axes.set_axis_off}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_axis\_off}}}}} & Turn off the axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_axis_on:matplotlib.axes.Axes.set_axis_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_axis\_on}}}}} & Turn on the axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_frame_on:matplotlib.axes.Axes.set_frame_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_frame\_on}}}}} & Set whether the axes rectangle patch is drawn. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_frame_on:matplotlib.axes.Axes.get_frame_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_frame\_on}}}}} & Get whether the axes rectangle patch is drawn. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_axisbelow:matplotlib.axes.Axes.set_axisbelow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_axisbelow}}}}} & Set whether axis ticks and gridlines are above or below most artists. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_axisbelow:matplotlib.axes.Axes.get_axisbelow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_axisbelow}}}}} & Get whether axis ticks and gridlines are above or below most artists. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.grid:matplotlib.axes.Axes.grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.grid}}}}} & Turn the axes grids on or off. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_facecolor:matplotlib.axes.Axes.get_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_facecolor}}}}} & Get the Axes facecolor. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_fc:matplotlib.axes.Axes.get_fc}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_fc}}}}} & Get the Axes facecolor. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_facecolor:matplotlib.axes.Axes.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_facecolor}}}}} & Set the Axes facecolor. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_fc:matplotlib.axes.Axes.set_fc}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_fc}}}}} & Set the Axes facecolor. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axes.Axes.axis} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axis:matplotlib-axes-axes-axis}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axis::doc}}\index{axis() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axis:matplotlib.axes.Axes.axis}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{axis}}}{\emph{*v}, \emph{**kwargs}}{} Set axis properties. Valid signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{,} \PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax} \PYG{o}{=} \PYG{n}{axis}\PYG{p}{(}\PYG{p}{)} \PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{,} \PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax} \PYG{o}{=} \PYG{n}{axis}\PYG{p}{(}\PYG{n}{list\PYGZus{}arg}\PYG{p}{)} \PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{,} \PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax} \PYG{o}{=} \PYG{n}{axis}\PYG{p}{(}\PYG{n}{string\PYGZus{}arg}\PYG{p}{)} \PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{,} \PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax} \PYG{o}{=} \PYG{n}{axis}\PYG{p}{(}\PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{v}}] \leavevmode{[}list of float or \{‘on’, ‘off’, ‘equal’, ‘tight’, ‘scaled’, ‘normal’, ‘auto’, ‘image’, ‘square’\}{]} Optional positional argument Axis data limits set from a list; or a command relating to axes: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Value &\sphinxstyletheadfamily Description \\ \hline ‘on’ & Toggle axis lines and labels on \\ \hline ‘off’ & Toggle axis lines and labels off \\ \hline ‘equal’ & Equal scaling by changing limits \\ \hline ‘scaled’ & Equal scaling by changing box dimensions \\ \hline ‘tight’ & Limits set such that all data is shown \\ \hline ‘auto’ & Automatic scaling, fill rectangle with data \\ \hline ‘normal’ & Same as ‘auto’; deprecated \\ \hline ‘image’ & ‘scaled’ with axis limits equal to data limits \\ \hline ‘square’ & Square plot; similar to ‘scaled’, but initially forcing xmax-xmin = ymax-ymin \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \item[{\sphinxstylestrong{emit}}] \leavevmode{[}bool, optional{]} Passed to set\_\{x,y\}lim functions, if observers are notified of axis limit change \item[{\sphinxstylestrong{xmin, ymin, xmax, ymax}}] \leavevmode{[}float, optional{]} The axis limits to be set \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{xmin, xmax, ymin, ymax}}] \leavevmode{[}float{]} The axis limits \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_axis\_off} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_axis_off:matplotlib-axes-axes-set-axis-off}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_axis_off::doc}}\index{set\_axis\_off() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_axis_off:matplotlib.axes.Axes.set_axis_off}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_axis\_off}}}{}{} Turn off the axis. \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_axis\_on} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_axis_on:matplotlib-axes-axes-set-axis-on}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_axis_on::doc}}\index{set\_axis\_on() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_axis_on:matplotlib.axes.Axes.set_axis_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_axis\_on}}}{}{} Turn on the axis. \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_frame\_on} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_frame_on:matplotlib-axes-axes-set-frame-on}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_frame_on::doc}}\index{set\_frame\_on() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_frame_on:matplotlib.axes.Axes.set_frame_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_frame\_on}}}{\emph{b}}{} Set whether the axes rectangle patch is drawn. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_frame\_on} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_frame_on:matplotlib-axes-axes-get-frame-on}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_frame_on::doc}}\index{get\_frame\_on() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_frame_on:matplotlib.axes.Axes.get_frame_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_frame\_on}}}{}{} Get whether the axes rectangle patch is drawn. \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_axisbelow} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_axisbelow:matplotlib-axes-axes-set-axisbelow}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_axisbelow::doc}}\index{set\_axisbelow() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_axisbelow:matplotlib.axes.Axes.set_axisbelow}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_axisbelow}}}{\emph{b}}{} Set whether axis ticks and gridlines are above or below most artists. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool or ‘line’{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_axisbelow} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_axisbelow:matplotlib-axes-axes-get-axisbelow}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_axisbelow::doc}}\index{get\_axisbelow() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_axisbelow:matplotlib.axes.Axes.get_axisbelow}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_axisbelow}}}{}{} Get whether axis ticks and gridlines are above or below most artists. \end{fulllineitems} \subsection{matplotlib.axes.Axes.grid} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.grid:matplotlib-axes-axes-grid}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.grid::doc}}\index{grid() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.grid:matplotlib.axes.Axes.grid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{grid}}}{\emph{b=None}, \emph{which='major'}, \emph{axis='both'}, \emph{**kwargs}}{} Turn the axes grids on or off. Set the axes grids on or off; \sphinxstyleemphasis{b} is a boolean. If \sphinxstyleemphasis{b} is \sphinxstyleemphasis{None} and \sphinxcode{\sphinxupquote{len(kwargs)==0}}, toggle the grid state. If \sphinxstyleemphasis{kwargs} are supplied, it is assumed that you want a grid and \sphinxstyleemphasis{b} is thus set to \sphinxstyleemphasis{True}. \sphinxstyleemphasis{which} can be ‘major’ (default), ‘minor’, or ‘both’ to control whether major tick grids, minor tick grids, or both are affected. \sphinxstyleemphasis{axis} can be ‘both’ (default), ‘x’, or ‘y’ to control which set of gridlines are drawn. \sphinxstyleemphasis{kwargs} are used to set the grid line properties, e.g.,: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{grid}\PYG{p}{(}\PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linestyle}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \end{sphinxVerbatim} Valid {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} kwargs are \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_facecolor} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_facecolor:matplotlib-axes-axes-get-facecolor}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_facecolor::doc}}\index{get\_facecolor() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_facecolor:matplotlib.axes.Axes.get_facecolor}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{} Get the Axes facecolor. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_fc} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_fc:matplotlib-axes-axes-get-fc}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_fc::doc}}\index{get\_fc() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_fc:matplotlib.axes.Axes.get_fc}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_fc}}}{}{} Get the Axes facecolor. \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_facecolor} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_facecolor:matplotlib-axes-axes-set-facecolor}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_facecolor::doc}}\index{set\_facecolor() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_facecolor:matplotlib.axes.Axes.set_facecolor}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{color}}{} Set the Axes facecolor. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{color}}] \leavevmode{[}color{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_fc} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_fc:matplotlib-axes-axes-set-fc}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_fc::doc}}\index{set\_fc() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_fc:matplotlib.axes.Axes.set_fc}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_fc}}}{\emph{color}}{} Set the Axes facecolor. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{color}}] \leavevmode{[}color{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \section{Property cycle} \label{\detokenize{api/axes_api:property-cycle}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_prop_cycle:matplotlib.axes.Axes.set_prop_cycle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_prop\_cycle}}}}} & Set the property cycle for any future plot commands on this Axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_color_cycle:matplotlib.axes.Axes.set_color_cycle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_color\_cycle}}}}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axes.Axes.set\_prop\_cycle} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_prop_cycle:matplotlib-axes-axes-set-prop-cycle}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_prop_cycle::doc}}\index{set\_prop\_cycle() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_prop_cycle:matplotlib.axes.Axes.set_prop_cycle}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_prop\_cycle}}}{\emph{*args}, \emph{**kwargs}}{} Set the property cycle for any future plot commands on this Axes. set\_prop\_cycle(arg) set\_prop\_cycle(label, itr) set\_prop\_cycle(label1=itr1{[}, label2=itr2{[}, …{]}{]}) Form 1 simply sets given \sphinxcode{\sphinxupquote{Cycler}} object. Form 2 creates and sets a \sphinxcode{\sphinxupquote{Cycler}} from a label and an iterable. Form 3 composes and sets a \sphinxcode{\sphinxupquote{Cycler}} as an inner product of the pairs of keyword arguments. In other words, all of the iterables are cycled simultaneously, as if through zip(). \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{arg}}] \leavevmode{[}Cycler{]} Set the given Cycler. Can also be \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}} to reset to the cycle defined by the current style. \item[{\sphinxstylestrong{label}}] \leavevmode{[}str{]} The property key. Must be a valid \sphinxcode{\sphinxupquote{Artist}} property. For example, ‘color’ or ‘linestyle’. Aliases are allowed, such as ‘c’ for ‘color’ and ‘lw’ for ‘linewidth’. \item[{\sphinxstylestrong{itr}}] \leavevmode{[}iterable{]} Finite-length iterable of the property values. These values are validated and will raise a ValueError if invalid. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_color\_cycle} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_color_cycle:matplotlib-axes-axes-set-color-cycle}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_color_cycle::doc}}\index{set\_color\_cycle() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_color_cycle:matplotlib.axes.Axes.set_color_cycle}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_color\_cycle}}}{\emph{clist}}{}~ \DUrole{versionmodified}{Deprecated since version 1.5: }The set\_color\_cycle function was deprecated in version 1.5. Use {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_prop_cycle:matplotlib.axes.Axes.set_prop_cycle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_prop\_cycle}}}}} instead. Set the color cycle for any future plot commands on this Axes. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clist}}] \leavevmode A list of mpl color specifiers. \end{description} \end{description}\end{quote} \end{fulllineitems} \section{Axis / limits} \label{\detokenize{api/axes_api:axis-limits}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xaxis:matplotlib.axes.Axes.get_xaxis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_xaxis}}}}} & Return the XAxis instance. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yaxis:matplotlib.axes.Axes.get_yaxis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_yaxis}}}}} & Return the YAxis instance. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axes.Axes.get\_xaxis} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xaxis:matplotlib-axes-axes-get-xaxis}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xaxis::doc}}\index{get\_xaxis() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xaxis:matplotlib.axes.Axes.get_xaxis}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_xaxis}}}{}{} Return the XAxis instance. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_yaxis} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yaxis:matplotlib-axes-axes-get-yaxis}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yaxis::doc}}\index{get\_yaxis() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yaxis:matplotlib.axes.Axes.get_yaxis}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_yaxis}}}{}{} Return the YAxis instance. \end{fulllineitems} \subsection{Axis Limits and direction} \label{\detokenize{api/axes_api:axis-limits-and-direction}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.invert_xaxis:matplotlib.axes.Axes.invert_xaxis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.invert\_xaxis}}}}} & Invert the x-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.xaxis_inverted:matplotlib.axes.Axes.xaxis_inverted}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.xaxis\_inverted}}}}} & Return whether the x-axis is inverted. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.invert_yaxis:matplotlib.axes.Axes.invert_yaxis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.invert\_yaxis}}}}} & Invert the y-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.yaxis_inverted:matplotlib.axes.Axes.yaxis_inverted}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.yaxis\_inverted}}}}} & Return whether the y-axis is inverted. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim:matplotlib.axes.Axes.set_xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_xlim}}}}} & Set the data limits for the x-axis \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xlim:matplotlib.axes.Axes.get_xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_xlim}}}}} & Get the x-axis range \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:matplotlib.axes.Axes.set_ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_ylim}}}}} & Set the data limits for the y-axis \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ylim:matplotlib.axes.Axes.get_ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_ylim}}}}} & Get the y-axis range \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.update_datalim:matplotlib.axes.Axes.update_datalim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.update\_datalim}}}}} & Update the data lim bbox with seq of xy tups or equiv. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.update_datalim_bounds:matplotlib.axes.Axes.update_datalim_bounds}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.update\_datalim\_bounds}}}}} & Update the datalim to include the given {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} \sphinxstyleemphasis{bounds} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xbound:matplotlib.axes.Axes.set_xbound}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_xbound}}}}} & Set the lower and upper numerical bounds of the x-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xbound:matplotlib.axes.Axes.get_xbound}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_xbound}}}}} & Return the lower and upper x-axis bounds, in increasing order. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ybound:matplotlib.axes.Axes.set_ybound}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_ybound}}}}} & Set the lower and upper numerical bounds of the y-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ybound:matplotlib.axes.Axes.get_ybound}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_ybound}}}}} & Return the lower and upper y-axis bounds, in increasing order. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axes.Axes.invert\_xaxis} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.invert_xaxis:matplotlib-axes-axes-invert-xaxis}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.invert_xaxis::doc}}\index{invert\_xaxis() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.invert_xaxis:matplotlib.axes.Axes.invert_xaxis}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{invert\_xaxis}}}{}{} Invert the x-axis. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.xaxis\_inverted} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.xaxis_inverted:matplotlib-axes-axes-xaxis-inverted}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.xaxis_inverted::doc}}\index{xaxis\_inverted() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.xaxis_inverted:matplotlib.axes.Axes.xaxis_inverted}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{xaxis\_inverted}}}{}{} Return whether the x-axis is inverted. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.invert\_yaxis} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.invert_yaxis:matplotlib-axes-axes-invert-yaxis}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.invert_yaxis::doc}}\index{invert\_yaxis() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.invert_yaxis:matplotlib.axes.Axes.invert_yaxis}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{invert\_yaxis}}}{}{} Invert the y-axis. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.yaxis\_inverted} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.yaxis_inverted:matplotlib-axes-axes-yaxis-inverted}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.yaxis_inverted::doc}}\index{yaxis\_inverted() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.yaxis_inverted:matplotlib.axes.Axes.yaxis_inverted}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{yaxis\_inverted}}}{}{} Return whether the y-axis is inverted. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.set\_xlim} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim:matplotlib-axes-axes-set-xlim}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim::doc}}\index{set\_xlim() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim:matplotlib.axes.Axes.set_xlim}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_xlim}}}{\emph{left=None}, \emph{right=None}, \emph{emit=True}, \emph{auto=False}, \emph{**kw}}{} Set the data limits for the x-axis \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{left}}] \leavevmode{[}scalar, optional{]} The left xlim (default: None, which leaves the left limit unchanged). \item[{\sphinxstylestrong{right}}] \leavevmode{[}scalar, optional{]} The right xlim (default: None, which leaves the right limit unchanged). \item[{\sphinxstylestrong{emit}}] \leavevmode{[}bool, optional{]} Whether to notify observers of limit change (default: True). \item[{\sphinxstylestrong{auto}}] \leavevmode{[}bool or None, optional{]} Whether to turn on autoscaling of the x-axis. True turns on, False turns off (default action), None leaves unchanged. \item[{\sphinxstylestrong{xlimits}}] \leavevmode{[}tuple, optional{]} The left and right xlims may be passed as the tuple (\sphinxcode{\sphinxupquote{left}}, \sphinxcode{\sphinxupquote{right}}) as the first positional argument (or as the \sphinxcode{\sphinxupquote{left}} keyword argument). \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{xlimits}}] \leavevmode{[}tuple{]} Returns the new x-axis limits as (\sphinxcode{\sphinxupquote{left}}, \sphinxcode{\sphinxupquote{right}}). \end{description} \end{description}\end{quote} \paragraph{Notes} The \sphinxcode{\sphinxupquote{left}} value may be greater than the \sphinxcode{\sphinxupquote{right}} value, in which case the x-axis values will decrease from left to right. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{p}{(}\PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{p}{)}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{left}\PYG{p}{,} \PYG{n}{right} \PYG{o}{=} \PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{p}{)} \end{sphinxVerbatim} One limit may be left unchanged. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{n}{right}\PYG{o}{=}\PYG{n}{right\PYGZus{}lim}\PYG{p}{)} \end{sphinxVerbatim} Limits may be passed in reverse order to flip the direction of the x-axis. For example, suppose \sphinxcode{\sphinxupquote{x}} represents the number of years before present. The x-axis limits might be set like the following so 5000 years ago is on the left of the plot and the present is on the right. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{l+m+mi}{5000}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.axes.Axes.set\_xlim}}} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim:examples-using-matplotlib-axes-axes-set-xlim}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_custom\_projection.py} \end{itemize} \subsubsection{matplotlib.axes.Axes.get\_xlim} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xlim:matplotlib-axes-axes-get-xlim}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xlim::doc}}\index{get\_xlim() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xlim:matplotlib.axes.Axes.get_xlim}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_xlim}}}{}{} Get the x-axis range \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{xlimits}}] \leavevmode{[}tuple{]} Returns the current x-axis limits as the tuple (\sphinxcode{\sphinxupquote{left}}, \sphinxcode{\sphinxupquote{right}}). \end{description} \end{description}\end{quote} \paragraph{Notes} The x-axis may be inverted, in which case the \sphinxcode{\sphinxupquote{left}} value will be greater than the \sphinxcode{\sphinxupquote{right}} value. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.set\_ylim} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:matplotlib-axes-axes-set-ylim}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim::doc}}\index{set\_ylim() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:matplotlib.axes.Axes.set_ylim}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_ylim}}}{\emph{bottom=None}, \emph{top=None}, \emph{emit=True}, \emph{auto=False}, \emph{**kw}}{} Set the data limits for the y-axis \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{bottom}}] \leavevmode{[}scalar, optional{]} The bottom ylim (default: None, which leaves the bottom limit unchanged). \item[{\sphinxstylestrong{top}}] \leavevmode{[}scalar, optional{]} The top ylim (default: None, which leaves the top limit unchanged). \item[{\sphinxstylestrong{emit}}] \leavevmode{[}bool, optional{]} Whether to notify observers of limit change (default: True). \item[{\sphinxstylestrong{auto}}] \leavevmode{[}bool or None, optional{]} Whether to turn on autoscaling of the y-axis. True turns on, False turns off (default action), None leaves unchanged. \item[{\sphinxstylestrong{ylimits}}] \leavevmode{[}tuple, optional{]} The bottom and top yxlims may be passed as the tuple (\sphinxcode{\sphinxupquote{bottom}}, \sphinxcode{\sphinxupquote{top}}) as the first positional argument (or as the \sphinxcode{\sphinxupquote{bottom}} keyword argument). \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ylimits}}] \leavevmode{[}tuple{]} Returns the new y-axis limits as (\sphinxcode{\sphinxupquote{bottom}}, \sphinxcode{\sphinxupquote{top}}). \end{description} \end{description}\end{quote} \paragraph{Notes} The \sphinxcode{\sphinxupquote{bottom}} value may be greater than the \sphinxcode{\sphinxupquote{top}} value, in which case the y-axis values will decrease from bottom to top. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{n}{bottom}\PYG{p}{,} \PYG{n}{top}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{p}{(}\PYG{n}{bottom}\PYG{p}{,} \PYG{n}{top}\PYG{p}{)}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{bottom}\PYG{p}{,} \PYG{n}{top} \PYG{o}{=} \PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{n}{bottom}\PYG{p}{,} \PYG{n}{top}\PYG{p}{)} \end{sphinxVerbatim} One limit may be left unchanged. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{n}{top}\PYG{o}{=}\PYG{n}{top\PYGZus{}lim}\PYG{p}{)} \end{sphinxVerbatim} Limits may be passed in reverse order to flip the direction of the y-axis. For example, suppose \sphinxcode{\sphinxupquote{y}} represents depth of the ocean in m. The y-axis limits might be set like the following so 5000 m depth is at the bottom of the plot and the surface, 0 m, is at the top. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{set\PYGZus{}ylim}\PYG{p}{(}\PYG{l+m+mi}{5000}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.axes.Axes.set\_ylim}}} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:examples-using-matplotlib-axes-axes-set-ylim}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_custom\_projection.py} \end{itemize} \subsubsection{matplotlib.axes.Axes.get\_ylim} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ylim:matplotlib-axes-axes-get-ylim}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ylim::doc}}\index{get\_ylim() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ylim:matplotlib.axes.Axes.get_ylim}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_ylim}}}{}{} Get the y-axis range \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ylimits}}] \leavevmode{[}tuple{]} Returns the current y-axis limits as the tuple (\sphinxcode{\sphinxupquote{bottom}}, \sphinxcode{\sphinxupquote{top}}). \end{description} \end{description}\end{quote} \paragraph{Notes} The y-axis may be inverted, in which case the \sphinxcode{\sphinxupquote{bottom}} value will be greater than the \sphinxcode{\sphinxupquote{top}} value. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.update\_datalim} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.update_datalim:matplotlib-axes-axes-update-datalim}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.update_datalim::doc}}\index{update\_datalim() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.update_datalim:matplotlib.axes.Axes.update_datalim}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{update\_datalim}}}{\emph{xys}, \emph{updatex=True}, \emph{updatey=True}}{} Update the data lim bbox with seq of xy tups or equiv. 2-D array \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.update\_datalim\_bounds} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.update_datalim_bounds:matplotlib-axes-axes-update-datalim-bounds}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.update_datalim_bounds::doc}}\index{update\_datalim\_bounds() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.update_datalim_bounds:matplotlib.axes.Axes.update_datalim_bounds}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{update\_datalim\_bounds}}}{\emph{bounds}}{} Update the datalim to include the given {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} \sphinxstyleemphasis{bounds} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.set\_xbound} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xbound:matplotlib-axes-axes-set-xbound}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xbound::doc}}\index{set\_xbound() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xbound:matplotlib.axes.Axes.set_xbound}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_xbound}}}{\emph{lower=None}, \emph{upper=None}}{} Set the lower and upper numerical bounds of the x-axis. This method will honor axes inversion regardless of parameter order. It will not change the \_autoscaleXon attribute. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_xbound} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xbound:matplotlib-axes-axes-get-xbound}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xbound::doc}}\index{get\_xbound() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xbound:matplotlib.axes.Axes.get_xbound}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_xbound}}}{}{} Return the lower and upper x-axis bounds, in increasing order. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.set\_ybound} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ybound:matplotlib-axes-axes-set-ybound}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ybound::doc}}\index{set\_ybound() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ybound:matplotlib.axes.Axes.set_ybound}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_ybound}}}{\emph{lower=None}, \emph{upper=None}}{} Set the lower and upper numerical bounds of the y-axis. This method will honor axes inversion regardless of parameter order. It will not change the \_autoscaleYon attribute. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_ybound} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ybound:matplotlib-axes-axes-get-ybound}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ybound::doc}}\index{get\_ybound() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ybound:matplotlib.axes.Axes.get_ybound}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_ybound}}}{}{} Return the lower and upper y-axis bounds, in increasing order. \end{fulllineitems} \subsection{Axis Labels, title, and legend} \label{\detokenize{api/axes_api:axis-labels-title-and-legend}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlabel:matplotlib.axes.Axes.set_xlabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_xlabel}}}}} & Set the label for the x-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xlabel:matplotlib.axes.Axes.get_xlabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_xlabel}}}}} & Get the xlabel text string. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylabel:matplotlib.axes.Axes.set_ylabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_ylabel}}}}} & Set the label for the y-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ylabel:matplotlib.axes.Axes.get_ylabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_ylabel}}}}} & Get the ylabel text string. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_title:matplotlib.axes.Axes.set_title}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_title}}}}} & Set a title for the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_title:matplotlib.axes.Axes.get_title}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_title}}}}} & Get an axes title. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.legend:matplotlib.axes.Axes.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.legend}}}}} & Places a legend on the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_legend:matplotlib.axes.Axes.get_legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_legend}}}}} & Return the \sphinxcode{\sphinxupquote{Legend}} instance, or None if no legend is defined. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_legend_handles_labels:matplotlib.axes.Axes.get_legend_handles_labels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_legend\_handles\_labels}}}}} & Return handles and labels for legend \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axes.Axes.set\_xlabel} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlabel:matplotlib-axes-axes-set-xlabel}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlabel::doc}}\index{set\_xlabel() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlabel:matplotlib.axes.Axes.set_xlabel}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_xlabel}}}{\emph{xlabel}, \emph{fontdict=None}, \emph{labelpad=None}, \emph{**kwargs}}{} Set the label for the x-axis. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{xlabel}}] \leavevmode{[}str{]} The label text. \item[{\sphinxstylestrong{labelpad}}] \leavevmode{[}scalar, optional, default: None{]} Spacing in points between the label and the x-axis. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} properties{]} {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} properties control the appearance of the label. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.text:matplotlib.axes.Axes.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text}}}}}}] \leavevmode for information on how override and the optional args work \end{description} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.axes.Axes.set\_xlabel}}} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlabel:examples-using-matplotlib-axes-axes-set-xlabel}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_histogram\_features.py} \end{itemize} \subsubsection{matplotlib.axes.Axes.get\_xlabel} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xlabel:matplotlib-axes-axes-get-xlabel}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xlabel::doc}}\index{get\_xlabel() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xlabel:matplotlib.axes.Axes.get_xlabel}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_xlabel}}}{}{} Get the xlabel text string. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.set\_ylabel} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylabel:matplotlib-axes-axes-set-ylabel}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylabel::doc}}\index{set\_ylabel() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylabel:matplotlib.axes.Axes.set_ylabel}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_ylabel}}}{\emph{ylabel}, \emph{fontdict=None}, \emph{labelpad=None}, \emph{**kwargs}}{} Set the label for the y-axis. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ylabel}}] \leavevmode{[}str{]} The label text. \item[{\sphinxstylestrong{labelpad}}] \leavevmode{[}scalar, optional, default: None{]} Spacing in points between the label and the y-axis. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} properties{]} {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} properties control the appearance of the label. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.text:matplotlib.axes.Axes.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text}}}}}}] \leavevmode for information on how override and the optional args work \end{description} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.axes.Axes.set\_ylabel}}} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylabel:examples-using-matplotlib-axes-axes-set-ylabel}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_histogram\_features.py} \end{itemize} \subsubsection{matplotlib.axes.Axes.get\_ylabel} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ylabel:matplotlib-axes-axes-get-ylabel}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ylabel::doc}}\index{get\_ylabel() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ylabel:matplotlib.axes.Axes.get_ylabel}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_ylabel}}}{}{} Get the ylabel text string. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.set\_title} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_title:matplotlib-axes-axes-set-title}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_title::doc}}\index{set\_title() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_title:matplotlib.axes.Axes.set_title}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_title}}}{\emph{label}, \emph{fontdict=None}, \emph{loc='center'}, \emph{pad=None}, \emph{**kwargs}}{} Set a title for the axes. Set one of the three available axes titles. The available titles are positioned above the axes in the center, flush with the left edge, and flush with the right edge. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{label}}] \leavevmode{[}str{]} Text to use for the title \item[{\sphinxstylestrong{fontdict}}] \leavevmode{[}dict{]} A dictionary controlling the appearance of the title text, the default \sphinxcode{\sphinxupquote{fontdict}} is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{fontsize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes.titlesize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{fontweight}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes.titleweight}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{verticalalignment}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{baseline}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{horizontalalignment}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{loc}\PYG{p}{\PYGZcb{}} \end{sphinxVerbatim} \item[{\sphinxstylestrong{loc}}] \leavevmode{[}\{‘center’, ‘left’, ‘right’\}, str, optional{]} Which title to set, defaults to ‘center’ \item[{\sphinxstylestrong{pad}}] \leavevmode{[}float{]} The offset of the title from the top of the axes, in points. Default is \sphinxcode{\sphinxupquote{None}} to use rcParams{[}‘axes.titlepad’{]}. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{text}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}}{]} The matplotlib text instance representing the title \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} properties{]} Other keyword arguments are text properties, see {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} for a list of valid text properties. \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.axes.Axes.set\_title}}} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_title:examples-using-matplotlib-axes-axes-set-title}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_histogram\_features.py} \end{itemize} \subsubsection{matplotlib.axes.Axes.get\_title} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_title:matplotlib-axes-axes-get-title}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_title::doc}}\index{get\_title() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_title:matplotlib.axes.Axes.get_title}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_title}}}{\emph{loc='center'}}{} Get an axes title. Get one of the three available axes titles. The available titles are positioned above the axes in the center, flush with the left edge, and flush with the right edge. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{loc}}] \leavevmode{[}\{‘center’, ‘left’, ‘right’\}, str, optional{]} Which title to get, defaults to ‘center’. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{title}}] \leavevmode{[}str{]} The title text string. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.legend} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.legend:matplotlib-axes-axes-legend}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.legend::doc}}\index{legend() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.legend:matplotlib.axes.Axes.legend}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{legend}}}{\emph{*args}, \emph{**kwargs}}{} Places a legend on the axes. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{legend}\PYG{p}{(}\PYG{p}{)} \PYG{n}{legend}\PYG{p}{(}\PYG{n}{labels}\PYG{p}{)} \PYG{n}{legend}\PYG{p}{(}\PYG{n}{handles}\PYG{p}{,} \PYG{n}{labels}\PYG{p}{)} \end{sphinxVerbatim} The call signatures correspond to three different ways how to use this method. \sphinxstylestrong{1. Automatic detection of elements to be shown in the legend} The elements to be added to the legend are automatically determined, when you do not pass in any extra arguments. In this case, the labels are taken from the artist. You can specify them either at artist creation or by calling the {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_label()}}}}} method on the artist: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Inline label}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}label}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Label via method}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} Specific lines can be excluded from the automatic legend element selection by defining a label starting with an underscore. This is default for all artists, so calling {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.legend:matplotlib.axes.Axes.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.legend}}}}} without any arguments and without setting the labels manually will result in no legend being drawn. \sphinxstylestrong{2. Labeling existing plot elements} To make a legend for lines which already exist on the axes (via plot for instance), simply call this function with an iterable of strings, one for each legend item. For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{A simple line}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} Note: This way of using is discouraged, because the relation between plot elements and labels is only implicit by their order and can easily be mixed up. \sphinxstylestrong{3. Explicitly defining the elements in the legend} For full control of which artists have a legend entry, it is possible to pass an iterable of legend artists followed by an iterable of legend labels respectively: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{legend}\PYG{p}{(}\PYG{p}{(}\PYG{n}{line1}\PYG{p}{,} \PYG{n}{line2}\PYG{p}{,} \PYG{n}{line3}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label3}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{handles}}] \leavevmode{[}sequence of {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}}, optional{]} A list of Artists (lines, patches) to be added to the legend. Use this together with \sphinxstyleemphasis{labels}, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient. The length of handles and labels should be the same in this case. If they are not, they are truncated to the smaller length. \item[{\sphinxstylestrong{labels}}] \leavevmode{[}sequence of strings, optional{]} A list of labels to show next to the artists. Use this together with \sphinxstyleemphasis{handles}, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{:class:{}`matplotlib.legend.Legend{}` instance}}] \leavevmode \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{loc}}] \leavevmode{[}int or string or pair of floats, default: ‘upper right’{]} The location of the legend. Possible codes are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Location String &\sphinxstyletheadfamily Location Code \\ \hline ‘best’ & 0 \\ \hline ‘upper right’ & 1 \\ \hline ‘upper left’ & 2 \\ \hline ‘lower left’ & 3 \\ \hline ‘lower right’ & 4 \\ \hline ‘right’ & 5 \\ \hline ‘center left’ & 6 \\ \hline ‘center right’ & 7 \\ \hline ‘lower center’ & 8 \\ \hline ‘upper center’ & 9 \\ \hline ‘center’ & 10 \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} Alternatively can be a 2-tuple giving \sphinxcode{\sphinxupquote{x, y}} of the lower-left corner of the legend in axes coordinates (in which case \sphinxcode{\sphinxupquote{bbox\_to\_anchor}} will be ignored). \item[{\sphinxstylestrong{bbox\_to\_anchor}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BboxBase}}}}} or pair of floats{]} Specify any arbitrary location for the legend in \sphinxcode{\sphinxupquote{bbox\_transform}} coordinates (default Axes coordinates). For example, to put the legend’s upper right hand corner in the center of the axes the following keywords can be used: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{loc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{upper right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{bbox\PYGZus{}to\PYGZus{}anchor}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)} \end{sphinxVerbatim} \item[{\sphinxstylestrong{ncol}}] \leavevmode{[}integer{]} The number of columns that the legend has. Default is 1. \item[{\sphinxstylestrong{prop}}] \leavevmode{[}None or {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}} or dict{]} The font properties of the legend. If None (default), the current {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcParams}}}}} will be used. \item[{\sphinxstylestrong{fontsize}}] \leavevmode{[}int or float or \{‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’\}{]} Controls the font size of the legend. If the value is numeric the size will be the absolute font size in points. String values are relative to the current default font size. This argument is only used if \sphinxcode{\sphinxupquote{prop}} is not specified. \item[{\sphinxstylestrong{numpoints}}] \leavevmode{[}None or int{]} The number of marker points in the legend when creating a legend entry for a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} (line). Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.numpoints"{]}}}. \item[{\sphinxstylestrong{scatterpoints}}] \leavevmode{[}None or int{]} The number of marker points in the legend when creating a legend entry for a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PathCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathCollection}}}}} (scatter plot). Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.scatterpoints"{]}}}. \item[{\sphinxstylestrong{scatteryoffsets}}] \leavevmode{[}iterable of floats{]} The vertical offset (relative to the font size) for the markers created for a scatter plot legend entry. 0.0 is at the base the legend text, and 1.0 is at the top. To draw all markers at the same height, set to \sphinxcode{\sphinxupquote{{[}0.5{]}}}. Default is \sphinxcode{\sphinxupquote{{[}0.375, 0.5, 0.3125{]}}}. \item[{\sphinxstylestrong{markerscale}}] \leavevmode{[}None or int or float{]} The relative size of legend markers compared with the originally drawn ones. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.markerscale"{]}}}. \item[{\sphinxstylestrong{markerfirst}}] \leavevmode{[}bool{]} If \sphinxstyleemphasis{True}, legend marker is placed to the left of the legend label. If \sphinxstyleemphasis{False}, legend marker is placed to the right of the legend label. Default is \sphinxstyleemphasis{True}. \item[{\sphinxstylestrong{frameon}}] \leavevmode{[}None or bool{]} Control whether the legend should be drawn on a patch (frame). Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.frameon"{]}}}. \item[{\sphinxstylestrong{fancybox}}] \leavevmode{[}None or bool{]} Control whether round edges should be enabled around the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyBboxPatch}}}}} which makes up the legend’s background. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.fancybox"{]}}}. \item[{\sphinxstylestrong{shadow}}] \leavevmode{[}None or bool{]} Control whether to draw a shadow behind the legend. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.shadow"{]}}}. \item[{\sphinxstylestrong{framealpha}}] \leavevmode{[}None or float{]} Control the alpha transparency of the legend’s background. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.framealpha"{]}}}. If shadow is activated and \sphinxstyleemphasis{framealpha} is \sphinxcode{\sphinxupquote{None}}, the default value is ignored. \item[{\sphinxstylestrong{facecolor}}] \leavevmode{[}None or “inherit” or a color spec{]} Control the legend’s background color. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.facecolor"{]}}}. If \sphinxcode{\sphinxupquote{"inherit"}}, it will take \sphinxcode{\sphinxupquote{rcParams{[}"axes.facecolor"{]}}}. \item[{\sphinxstylestrong{edgecolor}}] \leavevmode{[}None or “inherit” or a color spec{]} Control the legend’s background patch edge color. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.edgecolor"{]}}} If \sphinxcode{\sphinxupquote{"inherit"}}, it will take \sphinxcode{\sphinxupquote{rcParams{[}"axes.edgecolor"{]}}}. \item[{\sphinxstylestrong{mode}}] \leavevmode{[}\{“expand”, None\}{]} If \sphinxcode{\sphinxupquote{mode}} is set to \sphinxcode{\sphinxupquote{"expand"}} the legend will be horizontally expanded to fill the axes area (or \sphinxcode{\sphinxupquote{bbox\_to\_anchor}} if defines the legend’s size). \item[{\sphinxstylestrong{bbox\_transform}}] \leavevmode{[}None or {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} The transform for the bounding box (\sphinxcode{\sphinxupquote{bbox\_to\_anchor}}). For a value of \sphinxcode{\sphinxupquote{None}} (default) the Axes’ \sphinxcode{\sphinxupquote{transAxes}} transform will be used. \item[{\sphinxstylestrong{title}}] \leavevmode{[}str or None{]} The legend’s title. Default is no title (\sphinxcode{\sphinxupquote{None}}). \item[{\sphinxstylestrong{borderpad}}] \leavevmode{[}float or None{]} The fractional whitespace inside the legend border. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.borderpad"{]}}}. \item[{\sphinxstylestrong{labelspacing}}] \leavevmode{[}float or None{]} The vertical space between the legend entries. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.labelspacing"{]}}}. \item[{\sphinxstylestrong{handlelength}}] \leavevmode{[}float or None{]} The length of the legend handles. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.handlelength"{]}}}. \item[{\sphinxstylestrong{handletextpad}}] \leavevmode{[}float or None{]} The pad between the legend handle and text. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.handletextpad"{]}}}. \item[{\sphinxstylestrong{borderaxespad}}] \leavevmode{[}float or None{]} The pad between the axes and legend border. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.borderaxespad"{]}}}. \item[{\sphinxstylestrong{columnspacing}}] \leavevmode{[}float or None{]} The spacing between columns. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.columnspacing"{]}}}. \item[{\sphinxstylestrong{handler\_map}}] \leavevmode{[}dict or None{]} The custom dictionary mapping instances or types to a legend handler. This \sphinxcode{\sphinxupquote{handler\_map}} updates the default handler map found at {\hyperref[\detokenize{api/legend_api:matplotlib.legend.Legend.get_legend_handler_map}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.legend.Legend.get\_legend\_handler\_map()}}}}}. \end{description} \end{description}\end{quote} \paragraph{Notes} Not all kinds of artist are supported by the legend command. See {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Legend guide}}}} for details. \paragraph{Examples} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{legend}.pdf} \end{figure} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_legend} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_legend:matplotlib-axes-axes-get-legend}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_legend::doc}}\index{get\_legend() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_legend:matplotlib.axes.Axes.get_legend}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_legend}}}{}{} Return the \sphinxcode{\sphinxupquote{Legend}} instance, or None if no legend is defined. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_legend\_handles\_labels} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_legend_handles_labels:matplotlib-axes-axes-get-legend-handles-labels}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_legend_handles_labels::doc}}\index{get\_legend\_handles\_labels() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_legend_handles_labels:matplotlib.axes.Axes.get_legend_handles_labels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_legend\_handles\_labels}}}{\emph{legend\_handler\_map=None}}{} Return handles and labels for legend \sphinxcode{\sphinxupquote{ax.legend()}} is equivalent to \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{h}\PYG{p}{,} \PYG{n}{l} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}legend\PYGZus{}handles\PYGZus{}labels}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{n}{h}\PYG{p}{,} \PYG{n}{l}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsection{Axis scales} \label{\detokenize{api/axes_api:axis-scales}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xscale:matplotlib.axes.Axes.set_xscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_xscale}}}}} & Set the x-axis scale. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xscale:matplotlib.axes.Axes.get_xscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_xscale}}}}} & Return the xaxis scale string: linear, log, logit, symlog \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yscale:matplotlib.axes.Axes.set_yscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_yscale}}}}} & Set the y-axis scale. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yscale:matplotlib.axes.Axes.get_yscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_yscale}}}}} & Return the yaxis scale string: linear, log, logit, symlog \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axes.Axes.set\_xscale} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xscale:matplotlib-axes-axes-set-xscale}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xscale::doc}}\index{set\_xscale() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xscale:matplotlib.axes.Axes.set_xscale}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_xscale}}}{\emph{value}, \emph{**kwargs}}{} Set the x-axis scale. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{value}}] \leavevmode{[}\{“linear”, “log”, “symlog”, “logit”\}{]} scaling strategy to apply \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LinearScale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LinearScale}}}}}}] \leavevmode linear transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogTransform}}}}}}] \leavevmode log transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.SymmetricalLogTransform}}}}}}] \leavevmode symlog transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogisticTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogisticTransform}}}}}}] \leavevmode logit transform \end{description} \paragraph{Notes} Different kwargs are accepted, depending on the scale. See the {\hyperref[\detokenize{api/scale_api:module-matplotlib.scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scale}}}}} module for more information. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_xscale} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xscale:matplotlib-axes-axes-get-xscale}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xscale::doc}}\index{get\_xscale() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xscale:matplotlib.axes.Axes.get_xscale}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_xscale}}}{}{} Return the xaxis scale string: linear, log, logit, symlog \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.set\_yscale} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yscale:matplotlib-axes-axes-set-yscale}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yscale::doc}}\index{set\_yscale() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yscale:matplotlib.axes.Axes.set_yscale}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_yscale}}}{\emph{value}, \emph{**kwargs}}{} Set the y-axis scale. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{value}}] \leavevmode{[}\{“linear”, “log”, “symlog”, “logit”\}{]} scaling strategy to apply \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LinearScale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LinearScale}}}}}}] \leavevmode linear transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogTransform}}}}}}] \leavevmode log transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.SymmetricalLogTransform}}}}}}] \leavevmode symlog transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogisticTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogisticTransform}}}}}}] \leavevmode logit transform \end{description} \paragraph{Notes} Different kwargs are accepted, depending on the scale. See the {\hyperref[\detokenize{api/scale_api:module-matplotlib.scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scale}}}}} module for more information. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_yscale} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yscale:matplotlib-axes-axes-get-yscale}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yscale::doc}}\index{get\_yscale() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yscale:matplotlib.axes.Axes.get_yscale}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_yscale}}}{}{} Return the yaxis scale string: linear, log, logit, symlog \end{fulllineitems} \subsection{Autoscaling and margins} \label{\detokenize{api/axes_api:autoscaling-and-margins}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.use_sticky_edges:matplotlib.axes.Axes.use_sticky_edges}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.use\_sticky\_edges}}}}} & When autoscaling, whether to obey all \sphinxcode{\sphinxupquote{Artist.sticky\_edges}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.margins:matplotlib.axes.Axes.margins}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.margins}}}}} & Set or retrieve autoscaling margins. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xmargin:matplotlib.axes.Axes.set_xmargin}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_xmargin}}}}} & Set padding of X data limits prior to autoscaling. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ymargin:matplotlib.axes.Axes.set_ymargin}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_ymargin}}}}} & Set padding of Y data limits prior to autoscaling. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.relim}}}}} & Recompute the data limits based on current artists. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.autoscale:matplotlib.axes.Axes.autoscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.autoscale}}}}} & Autoscale the axis view to the data (toggle). \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.autoscale_view:matplotlib.axes.Axes.autoscale_view}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.autoscale\_view}}}}} & Autoscale the view limits using the data limits. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_autoscale_on:matplotlib.axes.Axes.set_autoscale_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_autoscale\_on}}}}} & Set whether autoscaling is applied on plot commands \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_autoscale_on:matplotlib.axes.Axes.get_autoscale_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_autoscale\_on}}}}} & Get whether autoscaling is applied for both axes on plot commands \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_autoscalex_on:matplotlib.axes.Axes.set_autoscalex_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_autoscalex\_on}}}}} & Set whether autoscaling for the x-axis is applied on plot commands \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_autoscalex_on:matplotlib.axes.Axes.get_autoscalex_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_autoscalex\_on}}}}} & Get whether autoscaling for the x-axis is applied on plot commands \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_autoscaley_on:matplotlib.axes.Axes.set_autoscaley_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_autoscaley\_on}}}}} & Set whether autoscaling for the y-axis is applied on plot commands \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_autoscaley_on:matplotlib.axes.Axes.get_autoscaley_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_autoscaley\_on}}}}} & Get whether autoscaling for the y-axis is applied on plot commands \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axes.Axes.use\_sticky\_edges} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.use_sticky_edges:matplotlib-axes-axes-use-sticky-edges}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.use_sticky_edges::doc}}\index{use\_sticky\_edges (matplotlib.axes.Axes attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.use_sticky_edges:matplotlib.axes.Axes.use_sticky_edges}}\pysigline{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{use\_sticky\_edges}}} When autoscaling, whether to obey all \sphinxcode{\sphinxupquote{Artist.sticky\_edges}}. Default is \sphinxcode{\sphinxupquote{True}}. Setting this to \sphinxcode{\sphinxupquote{False}} ensures that the specified margins will be applied, even if the plot includes an image, for example, which would otherwise force a view limit to coincide with its data limit. The changing this property does not change the plot until {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.autoscale:matplotlib.axes.Axes.autoscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{autoscale}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.autoscale_view:matplotlib.axes.Axes.autoscale_view}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{autoscale\_view}}}}} is called. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.margins} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.margins:matplotlib-axes-axes-margins}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.margins::doc}}\index{margins() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.margins:matplotlib.axes.Axes.margins}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{margins}}}{\emph{*args}, \emph{**kw}}{} Set or retrieve autoscaling margins. signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{margins}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} returns xmargin, ymargin \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{margins}\PYG{p}{(}\PYG{n}{margin}\PYG{p}{)} \PYG{n}{margins}\PYG{p}{(}\PYG{n}{xmargin}\PYG{p}{,} \PYG{n}{ymargin}\PYG{p}{)} \PYG{n}{margins}\PYG{p}{(}\PYG{n}{x}\PYG{o}{=}\PYG{n}{xmargin}\PYG{p}{,} \PYG{n}{y}\PYG{o}{=}\PYG{n}{ymargin}\PYG{p}{)} \PYG{n}{margins}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{tight}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{)} \end{sphinxVerbatim} All three forms above set the xmargin and ymargin parameters. All keyword parameters are optional. A single argument specifies both xmargin and ymargin. The padding added to the end of each interval is \sphinxstyleemphasis{margin} times the data interval. The \sphinxstyleemphasis{margin} must be a float in the range {[}0, 1{]}. The \sphinxstyleemphasis{tight} parameter is passed to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.autoscale_view:matplotlib.axes.Axes.autoscale_view}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{autoscale\_view()}}}}} , which is executed after a margin is changed; the default here is \sphinxstyleemphasis{True}, on the assumption that when margins are specified, no additional padding to match tick marks is usually desired. Setting \sphinxstyleemphasis{tight} to \sphinxstyleemphasis{None} will preserve the previous setting. Specifying any margin changes only the autoscaling; for example, if \sphinxstyleemphasis{xmargin} is not None, then \sphinxstyleemphasis{xmargin} times the X data interval will be added to each end of that interval before it is used in autoscaling. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.set\_xmargin} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xmargin:matplotlib-axes-axes-set-xmargin}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xmargin::doc}}\index{set\_xmargin() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xmargin:matplotlib.axes.Axes.set_xmargin}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_xmargin}}}{\emph{m}}{} Set padding of X data limits prior to autoscaling. \sphinxstyleemphasis{m} times the data interval will be added to each end of that interval before it is used in autoscaling. For example, if your data is in the range {[}0, 2{]}, a factor of \sphinxcode{\sphinxupquote{m = 0.1}} will result in a range {[}-0.2, 2.2{]}. Negative values -0.5 \textless{} m \textless{} 0 will result in clipping of the data range. I.e. for a data range {[}0, 2{]}, a factor of \sphinxcode{\sphinxupquote{m = -0.1}} will result in a range {[}0.2, 1.8{]}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{m}}] \leavevmode{[}float greater than -0.5{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.set\_ymargin} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ymargin:matplotlib-axes-axes-set-ymargin}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ymargin::doc}}\index{set\_ymargin() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ymargin:matplotlib.axes.Axes.set_ymargin}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_ymargin}}}{\emph{m}}{} Set padding of Y data limits prior to autoscaling. \sphinxstyleemphasis{m} times the data interval will be added to each end of that interval before it is used in autoscaling. For example, if your data is in the range {[}0, 2{]}, a factor of \sphinxcode{\sphinxupquote{m = 0.1}} will result in a range {[}-0.2, 2.2{]}. Negative values -0.5 \textless{} m \textless{} 0 will result in clipping of the data range. I.e. for a data range {[}0, 2{]}, a factor of \sphinxcode{\sphinxupquote{m = -0.1}} will result in a range {[}0.2, 1.8{]}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{m}}] \leavevmode{[}float greater than -0.5{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.relim} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib-axes-axes-relim}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.relim::doc}}\index{relim() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{relim}}}{\emph{visible\_only=False}}{} Recompute the data limits based on current artists. If you want to exclude invisible artists from the calculation, set \sphinxcode{\sphinxupquote{visible\_only=True}} At present, {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Collection}}}}} instances are not supported. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.autoscale} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.autoscale:matplotlib-axes-axes-autoscale}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.autoscale::doc}}\index{autoscale() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.autoscale:matplotlib.axes.Axes.autoscale}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{autoscale}}}{\emph{enable=True}, \emph{axis='both'}, \emph{tight=None}}{} Autoscale the axis view to the data (toggle). Convenience method for simple axis view autoscaling. It turns autoscaling on or off, and then, if autoscaling for either axis is on, it performs the autoscaling on the specified axis or axes. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{enable}}] \leavevmode{[}bool or None, optional{]} True (default) turns autoscaling on, False turns it off. None leaves the autoscaling state unchanged. \item[{\sphinxstylestrong{axis}}] \leavevmode{[}{[}‘both’ \textbar{} ‘x’ \textbar{} ‘y’{]}, optional{]} which axis to operate on; default is ‘both’ \item[{\sphinxstylestrong{tight: bool or None, optional}}] \leavevmode If True, set view limits to data limits; if False, let the locator and margins expand the view limits; if None, use tight scaling if the only artist is an image, otherwise treat \sphinxstyleemphasis{tight} as False. The \sphinxstyleemphasis{tight} setting is retained for future autoscaling until it is explicitly changed. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.autoscale\_view} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.autoscale_view:matplotlib-axes-axes-autoscale-view}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.autoscale_view::doc}}\index{autoscale\_view() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.autoscale_view:matplotlib.axes.Axes.autoscale_view}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{autoscale\_view}}}{\emph{tight=None}, \emph{scalex=True}, \emph{scaley=True}}{} Autoscale the view limits using the data limits. You can selectively autoscale only a single axis, e.g., the xaxis by setting \sphinxstyleemphasis{scaley} to \sphinxstyleemphasis{False}. The autoscaling preserves any axis direction reversal that has already been done. If \sphinxstyleemphasis{tight} is \sphinxstyleemphasis{False}, the axis major locator will be used to expand the view limits if rcParams{[}‘axes.autolimit\_mode’{]} is ‘round\_numbers’. Note that any margins that are in effect will be applied first, regardless of whether \sphinxstyleemphasis{tight} is \sphinxstyleemphasis{True} or \sphinxstyleemphasis{False}. Specifying \sphinxstyleemphasis{tight} as \sphinxstyleemphasis{True} or \sphinxstyleemphasis{False} saves the setting as a private attribute of the Axes; specifying it as \sphinxstyleemphasis{None} (the default) applies the previously saved value. The data limits are not updated automatically when artist data are changed after the artist has been added to an Axes instance. In that case, use {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} prior to calling autoscale\_view. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.set\_autoscale\_on} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_autoscale_on:matplotlib-axes-axes-set-autoscale-on}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_autoscale_on::doc}}\index{set\_autoscale\_on() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_autoscale_on:matplotlib.axes.Axes.set_autoscale_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_autoscale\_on}}}{\emph{b}}{} Set whether autoscaling is applied on plot commands \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_autoscale\_on} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_autoscale_on:matplotlib-axes-axes-get-autoscale-on}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_autoscale_on::doc}}\index{get\_autoscale\_on() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_autoscale_on:matplotlib.axes.Axes.get_autoscale_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_autoscale\_on}}}{}{} Get whether autoscaling is applied for both axes on plot commands \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.set\_autoscalex\_on} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_autoscalex_on:matplotlib-axes-axes-set-autoscalex-on}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_autoscalex_on::doc}}\index{set\_autoscalex\_on() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_autoscalex_on:matplotlib.axes.Axes.set_autoscalex_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_autoscalex\_on}}}{\emph{b}}{} Set whether autoscaling for the x-axis is applied on plot commands \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_autoscalex\_on} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_autoscalex_on:matplotlib-axes-axes-get-autoscalex-on}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_autoscalex_on::doc}}\index{get\_autoscalex\_on() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_autoscalex_on:matplotlib.axes.Axes.get_autoscalex_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_autoscalex\_on}}}{}{} Get whether autoscaling for the x-axis is applied on plot commands \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.set\_autoscaley\_on} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_autoscaley_on:matplotlib-axes-axes-set-autoscaley-on}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_autoscaley_on::doc}}\index{set\_autoscaley\_on() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_autoscaley_on:matplotlib.axes.Axes.set_autoscaley_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_autoscaley\_on}}}{\emph{b}}{} Set whether autoscaling for the y-axis is applied on plot commands \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_autoscaley\_on} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_autoscaley_on:matplotlib-axes-axes-get-autoscaley-on}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_autoscaley_on::doc}}\index{get\_autoscaley\_on() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_autoscaley_on:matplotlib.axes.Axes.get_autoscaley_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_autoscaley\_on}}}{}{} Get whether autoscaling for the y-axis is applied on plot commands \end{fulllineitems} \subsection{Aspect ratio} \label{\detokenize{api/axes_api:aspect-ratio}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.apply_aspect:matplotlib.axes.Axes.apply_aspect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.apply\_aspect}}}}} & Adjust the Axes for a specified data aspect ratio. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_aspect:matplotlib.axes.Axes.set_aspect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_aspect}}}}} & Set the aspect of the axis scaling, i.e. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_aspect:matplotlib.axes.Axes.get_aspect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_aspect}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_adjustable:matplotlib.axes.Axes.set_adjustable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_adjustable}}}}} & Define which parameter the Axes will change to achieve a given aspect. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_adjustable:matplotlib.axes.Axes.get_adjustable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_adjustable}}}}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axes.Axes.apply\_aspect} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.apply_aspect:matplotlib-axes-axes-apply-aspect}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.apply_aspect::doc}}\index{apply\_aspect() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.apply_aspect:matplotlib.axes.Axes.apply_aspect}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{apply\_aspect}}}{\emph{position=None}}{} Adjust the Axes for a specified data aspect ratio. Depending on {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_adjustable:matplotlib.axes.Axes.get_adjustable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_adjustable}}}}} this will modify either the Axes box (position) or the view limits. In the former case, {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_anchor:matplotlib.axes.Axes.get_anchor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_anchor}}}}} will affect the position. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_aspect:matplotlib.axes.Axes.set_aspect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_aspect}}}}}}] \leavevmode for a description of aspect ratio handling. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_adjustable:matplotlib.axes.Axes.set_adjustable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_adjustable}}}}}}] \leavevmode defining the parameter to adjust in order to meet the required aspect. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_anchor:matplotlib.axes.Axes.set_anchor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_anchor}}}}}}] \leavevmode defining the position in case of extra space. \end{description} \paragraph{Notes} This is called automatically when each Axes is drawn. You may need to call it yourself if you need to update the Axes position and/or view limits before the Figure is drawn. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.set\_aspect} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_aspect:matplotlib-axes-axes-set-aspect}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_aspect::doc}}\index{set\_aspect() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_aspect:matplotlib.axes.Axes.set_aspect}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_aspect}}}{\emph{aspect}, \emph{adjustable=None}, \emph{anchor=None}, \emph{share=False}}{} Set the aspect of the axis scaling, i.e. the ratio of y-unit to x-unit. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{aspect}}] \leavevmode{[}{[}‘auto’ \textbar{} ‘equal’{]} or num{]} Possible values: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily value &\sphinxstyletheadfamily description \\ \hline ‘auto’ & automatic; fill the position rectangle with data \\ \hline ‘equal’ & same scaling from data to plot units for x and y \\ \hline num & a circle will be stretched such that the height is num times the width. aspect=1 is the same as aspect=’equal’. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \item[{\sphinxstylestrong{adjustable}}] \leavevmode{[}None or {[}‘box’ \textbar{} ‘datalim’{]}, optional{]} If not \sphinxcode{\sphinxupquote{None}}, this defines which parameter will be adjusted to meet the required aspect. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_adjustable:matplotlib.axes.Axes.set_adjustable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_adjustable}}}}} for further details. \item[{\sphinxstylestrong{anchor}}] \leavevmode{[}None or str or 2-tuple of float, optional{]} If not \sphinxcode{\sphinxupquote{None}}, this defines where the Axes will be drawn if there is extra space due to aspect constraints. The most common way to to specify the anchor are abbreviations of cardinal directions: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily value &\sphinxstyletheadfamily description \\ \hline ‘C’ & centered \\ \hline ‘SW’ & lower left corner \\ \hline ‘S’ & middle of bottom edge \\ \hline ‘SE’ & lower right corner \\ \hline etc. &\\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_anchor:matplotlib.axes.Axes.set_anchor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_anchor}}}}} for further details. \item[{\sphinxstylestrong{share}}] \leavevmode{[}bool, optional{]} If \sphinxcode{\sphinxupquote{True}}, apply the settings to all shared Axes. Default is \sphinxcode{\sphinxupquote{False}}. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_adjustable:matplotlib.axes.Axes.set_adjustable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_adjustable}}}}}}] \leavevmode defining the parameter to adjust in order to meet the required aspect. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_anchor:matplotlib.axes.Axes.set_anchor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_anchor}}}}}}] \leavevmode defining the position in case of extra space. \end{description} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_aspect} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_aspect:matplotlib-axes-axes-get-aspect}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_aspect::doc}}\index{get\_aspect() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_aspect:matplotlib.axes.Axes.get_aspect}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_aspect}}}{}{}~ \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.set\_adjustable} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_adjustable:matplotlib-axes-axes-set-adjustable}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_adjustable::doc}}\index{set\_adjustable() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_adjustable:matplotlib.axes.Axes.set_adjustable}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_adjustable}}}{\emph{adjustable}, \emph{share=False}}{} Define which parameter the Axes will change to achieve a given aspect. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{adjustable}}] \leavevmode{[}{[}‘box’ \textbar{} ‘datalim’{]}{]} If ‘box’, change the physical dimensions of the Axes. If ‘datalim’, change the \sphinxcode{\sphinxupquote{x}} or \sphinxcode{\sphinxupquote{y}} data limits. \item[{\sphinxstylestrong{share}}] \leavevmode{[}bool, optional{]} If \sphinxcode{\sphinxupquote{True}}, apply the settings to all shared Axes. Default is \sphinxcode{\sphinxupquote{False}}. \item[{\sphinxstylestrong{.. ACCEPTS: {[} ‘box’ \textbar{} ‘datalim’{]}}}] \leavevmode \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_aspect:matplotlib.axes.Axes.set_aspect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_aspect}}}}}}] \leavevmode for a description of aspect handling. \end{description} \paragraph{Notes} Shared Axes (of which twinned Axes are a special case) impose restrictions on how aspect ratios can be imposed. For twinned Axes, use ‘datalim’. For Axes that share both x and y, use ‘box’. Otherwise, either ‘datalim’ or ‘box’ may be used. These limitations are partly a requirement to avoid over-specification, and partly a result of the particular implementation we are currently using, in which the adjustments for aspect ratios are done sequentially and independently on each Axes as it is drawn. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_adjustable} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_adjustable:matplotlib-axes-axes-get-adjustable}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_adjustable::doc}}\index{get\_adjustable() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_adjustable:matplotlib.axes.Axes.get_adjustable}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_adjustable}}}{}{}~ \end{fulllineitems} \subsection{Ticks and tick labels} \label{\detokenize{api/axes_api:ticks-and-tick-labels}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xticks:matplotlib.axes.Axes.set_xticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_xticks}}}}} & Set the x ticks with list of \sphinxstyleemphasis{ticks} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xticks:matplotlib.axes.Axes.get_xticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_xticks}}}}} & Return the x ticks as a list of locations \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xticklabels:matplotlib.axes.Axes.set_xticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_xticklabels}}}}} & Set the x-tick labels with list of string labels. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xticklabels:matplotlib.axes.Axes.get_xticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_xticklabels}}}}} & Get the x tick labels as a list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xmajorticklabels:matplotlib.axes.Axes.get_xmajorticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_xmajorticklabels}}}}} & Get the major x tick labels. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xminorticklabels:matplotlib.axes.Axes.get_xminorticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_xminorticklabels}}}}} & Get the minor x tick labels. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xgridlines:matplotlib.axes.Axes.get_xgridlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_xgridlines}}}}} & Get the x grid lines as a list of \sphinxcode{\sphinxupquote{Line2D}} instances. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xticklines:matplotlib.axes.Axes.get_xticklines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_xticklines}}}}} & Get the x tick lines as a list of \sphinxcode{\sphinxupquote{Line2D}} instances. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.xaxis_date:matplotlib.axes.Axes.xaxis_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.xaxis\_date}}}}} & Sets up x-axis ticks and labels that treat the x data as dates. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yticks:matplotlib.axes.Axes.set_yticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_yticks}}}}} & Set the y ticks with list of \sphinxstyleemphasis{ticks} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yticks:matplotlib.axes.Axes.get_yticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_yticks}}}}} & Return the y ticks as a list of locations \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yticklabels:matplotlib.axes.Axes.set_yticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_yticklabels}}}}} & Set the y-tick labels with list of strings labels. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yticklabels:matplotlib.axes.Axes.get_yticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_yticklabels}}}}} & Get the x tick labels as a list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ymajorticklabels:matplotlib.axes.Axes.get_ymajorticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_ymajorticklabels}}}}} & Get the major y tick labels. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yminorticklabels:matplotlib.axes.Axes.get_yminorticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_yminorticklabels}}}}} & Get the minor y tick labels. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ygridlines:matplotlib.axes.Axes.get_ygridlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_ygridlines}}}}} & Get the y grid lines as a list of \sphinxcode{\sphinxupquote{Line2D}} instances. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yticklines:matplotlib.axes.Axes.get_yticklines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_yticklines}}}}} & Get the y tick lines as a list of \sphinxcode{\sphinxupquote{Line2D}} instances. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.yaxis_date:matplotlib.axes.Axes.yaxis_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.yaxis\_date}}}}} & Sets up y-axis ticks and labels that treat the y data as dates. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.minorticks_off:matplotlib.axes.Axes.minorticks_off}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.minorticks\_off}}}}} & Remove minor ticks from the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.minorticks_on:matplotlib.axes.Axes.minorticks_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.minorticks\_on}}}}} & Add autoscaling minor ticks to the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.ticklabel_format:matplotlib.axes.Axes.ticklabel_format}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.ticklabel\_format}}}}} & Change the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarFormatter}}}}} used by default for linear axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.tick_params:matplotlib.axes.Axes.tick_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.tick\_params}}}}} & Change the appearance of ticks, tick labels, and gridlines. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.locator_params:matplotlib.axes.Axes.locator_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.locator\_params}}}}} & Control behavior of tick locators. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axes.Axes.set\_xticks} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xticks:matplotlib-axes-axes-set-xticks}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xticks::doc}}\index{set\_xticks() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xticks:matplotlib.axes.Axes.set_xticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_xticks}}}{\emph{ticks}, \emph{minor=False}}{} Set the x ticks with list of \sphinxstyleemphasis{ticks} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ticks}}] \leavevmode{[}list{]} List of x-axis tick locations. \item[{\sphinxstylestrong{minor}}] \leavevmode{[}bool, optional{]} If \sphinxcode{\sphinxupquote{False}} sets major ticks, if \sphinxcode{\sphinxupquote{True}} sets minor ticks. Default is \sphinxcode{\sphinxupquote{False}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_xticks} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xticks:matplotlib-axes-axes-get-xticks}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xticks::doc}}\index{get\_xticks() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xticks:matplotlib.axes.Axes.get_xticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_xticks}}}{\emph{minor=False}}{} Return the x ticks as a list of locations \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.set\_xticklabels} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xticklabels:matplotlib-axes-axes-set-xticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xticklabels::doc}}\index{set\_xticklabels() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xticklabels:matplotlib.axes.Axes.set_xticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_xticklabels}}}{\emph{labels}, \emph{fontdict=None}, \emph{minor=False}, \emph{**kwargs}}{} Set the x-tick labels with list of string labels. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{labels}}] \leavevmode{[}list of str{]} List of string labels. \item[{\sphinxstylestrong{fontdict}}] \leavevmode{[}dict, optional{]} A dictionary controlling the appearance of the ticklabels. The default \sphinxcode{\sphinxupquote{fontdict}} is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{fontsize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes.titlesize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{fontweight}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes.titleweight}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{verticalalignment}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{baseline}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{horizontalalignment}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{loc}\PYG{p}{\PYGZcb{}} \end{sphinxVerbatim} \item[{\sphinxstylestrong{minor}}] \leavevmode{[}bool, optional{]} Whether to set the minor ticklabels rather than the major ones. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A list of {}`\textasciitilde{}.text.Text{}` instances.}}] \leavevmode \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} properties.{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_xticklabels} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xticklabels:matplotlib-axes-axes-get-xticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xticklabels::doc}}\index{get\_xticklabels() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xticklabels:matplotlib.axes.Axes.get_xticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_xticklabels}}}{\emph{minor=False}, \emph{which=None}}{} Get the x tick labels as a list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{minor}}] \leavevmode{[}bool, optional{]} If True return the minor ticklabels, else return the major ticklabels. \item[{\sphinxstylestrong{which}}] \leavevmode{[}None, (‘minor’, ‘major’, ‘both’){]} Overrides \sphinxcode{\sphinxupquote{minor}}. Selects which ticklabels to return \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ret}}] \leavevmode{[}list{]} List of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_xmajorticklabels} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xmajorticklabels:matplotlib-axes-axes-get-xmajorticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xmajorticklabels::doc}}\index{get\_xmajorticklabels() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xmajorticklabels:matplotlib.axes.Axes.get_xmajorticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_xmajorticklabels}}}{}{} Get the major x tick labels. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{labels}}] \leavevmode{[}list{]} List of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_xminorticklabels} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xminorticklabels:matplotlib-axes-axes-get-xminorticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xminorticklabels::doc}}\index{get\_xminorticklabels() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xminorticklabels:matplotlib.axes.Axes.get_xminorticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_xminorticklabels}}}{}{} Get the minor x tick labels. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{labels}}] \leavevmode{[}list{]} List of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_xgridlines} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xgridlines:matplotlib-axes-axes-get-xgridlines}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xgridlines::doc}}\index{get\_xgridlines() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xgridlines:matplotlib.axes.Axes.get_xgridlines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_xgridlines}}}{}{} Get the x grid lines as a list of \sphinxcode{\sphinxupquote{Line2D}} instances. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_xticklines} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xticklines:matplotlib-axes-axes-get-xticklines}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xticklines::doc}}\index{get\_xticklines() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xticklines:matplotlib.axes.Axes.get_xticklines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_xticklines}}}{}{} Get the x tick lines as a list of \sphinxcode{\sphinxupquote{Line2D}} instances. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.xaxis\_date} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.xaxis_date:matplotlib-axes-axes-xaxis-date}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.xaxis_date::doc}}\index{xaxis\_date() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.xaxis_date:matplotlib.axes.Axes.xaxis_date}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{xaxis\_date}}}{\emph{tz=None}}{} Sets up x-axis ticks and labels that treat the x data as dates. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{tz}}] \leavevmode{[}string or \sphinxcode{\sphinxupquote{tzinfo}} instance, optional{]} Timezone string or timezone. Defaults to rc value. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.set\_yticks} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yticks:matplotlib-axes-axes-set-yticks}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yticks::doc}}\index{set\_yticks() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yticks:matplotlib.axes.Axes.set_yticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_yticks}}}{\emph{ticks}, \emph{minor=False}}{} Set the y ticks with list of \sphinxstyleemphasis{ticks} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ticks}}] \leavevmode{[}sequence{]} List of y-axis tick locations \item[{\sphinxstylestrong{minor}}] \leavevmode{[}bool, optional{]} If \sphinxcode{\sphinxupquote{False}} sets major ticks, if \sphinxcode{\sphinxupquote{True}} sets minor ticks. Default is \sphinxcode{\sphinxupquote{False}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_yticks} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yticks:matplotlib-axes-axes-get-yticks}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yticks::doc}}\index{get\_yticks() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yticks:matplotlib.axes.Axes.get_yticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_yticks}}}{\emph{minor=False}}{} Return the y ticks as a list of locations \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.set\_yticklabels} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yticklabels:matplotlib-axes-axes-set-yticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yticklabels::doc}}\index{set\_yticklabels() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yticklabels:matplotlib.axes.Axes.set_yticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_yticklabels}}}{\emph{labels}, \emph{fontdict=None}, \emph{minor=False}, \emph{**kwargs}}{} Set the y-tick labels with list of strings labels. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{labels}}] \leavevmode{[}list of str{]} list of string labels \item[{\sphinxstylestrong{fontdict}}] \leavevmode{[}dict, optional{]} A dictionary controlling the appearance of the ticklabels. The default \sphinxcode{\sphinxupquote{fontdict}} is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{fontsize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes.titlesize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{fontweight}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes.titleweight}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{verticalalignment}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{baseline}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{horizontalalignment}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{loc}\PYG{p}{\PYGZcb{}} \end{sphinxVerbatim} \item[{\sphinxstylestrong{minor}}] \leavevmode{[}bool, optional{]} Whether to set the minor ticklabels rather than the major ones. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A list of {}`\textasciitilde{}.text.Text{}` instances.}}] \leavevmode \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} properties.{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_yticklabels} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yticklabels:matplotlib-axes-axes-get-yticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yticklabels::doc}}\index{get\_yticklabels() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yticklabels:matplotlib.axes.Axes.get_yticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_yticklabels}}}{\emph{minor=False}, \emph{which=None}}{} Get the x tick labels as a list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{minor}}] \leavevmode{[}bool{]} If True return the minor ticklabels, else return the major ticklabels \item[{\sphinxstylestrong{which}}] \leavevmode{[}None, (‘minor’, ‘major’, ‘both’){]} Overrides \sphinxcode{\sphinxupquote{minor}}. Selects which ticklabels to return \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ret}}] \leavevmode{[}list{]} List of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_ymajorticklabels} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ymajorticklabels:matplotlib-axes-axes-get-ymajorticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ymajorticklabels::doc}}\index{get\_ymajorticklabels() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ymajorticklabels:matplotlib.axes.Axes.get_ymajorticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_ymajorticklabels}}}{}{} Get the major y tick labels. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{labels}}] \leavevmode{[}list{]} List of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_yminorticklabels} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yminorticklabels:matplotlib-axes-axes-get-yminorticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yminorticklabels::doc}}\index{get\_yminorticklabels() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yminorticklabels:matplotlib.axes.Axes.get_yminorticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_yminorticklabels}}}{}{} Get the minor y tick labels. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{labels}}] \leavevmode{[}list{]} List of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_ygridlines} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ygridlines:matplotlib-axes-axes-get-ygridlines}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ygridlines::doc}}\index{get\_ygridlines() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ygridlines:matplotlib.axes.Axes.get_ygridlines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_ygridlines}}}{}{} Get the y grid lines as a list of \sphinxcode{\sphinxupquote{Line2D}} instances. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.get\_yticklines} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yticklines:matplotlib-axes-axes-get-yticklines}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yticklines::doc}}\index{get\_yticklines() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yticklines:matplotlib.axes.Axes.get_yticklines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_yticklines}}}{}{} Get the y tick lines as a list of \sphinxcode{\sphinxupquote{Line2D}} instances. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.yaxis\_date} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.yaxis_date:matplotlib-axes-axes-yaxis-date}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.yaxis_date::doc}}\index{yaxis\_date() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.yaxis_date:matplotlib.axes.Axes.yaxis_date}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{yaxis\_date}}}{\emph{tz=None}}{} Sets up y-axis ticks and labels that treat the y data as dates. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{tz}}] \leavevmode{[}string or \sphinxcode{\sphinxupquote{tzinfo}} instance, optional{]} Timezone string or timezone. Defaults to rc value. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.minorticks\_off} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.minorticks_off:matplotlib-axes-axes-minorticks-off}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.minorticks_off::doc}}\index{minorticks\_off() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.minorticks_off:matplotlib.axes.Axes.minorticks_off}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{minorticks\_off}}}{}{} Remove minor ticks from the axes. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.minorticks\_on} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.minorticks_on:matplotlib-axes-axes-minorticks-on}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.minorticks_on::doc}}\index{minorticks\_on() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.minorticks_on:matplotlib.axes.Axes.minorticks_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{minorticks\_on}}}{}{} Add autoscaling minor ticks to the axes. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.ticklabel\_format} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.ticklabel_format:matplotlib-axes-axes-ticklabel-format}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.ticklabel_format::doc}}\index{ticklabel\_format() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.ticklabel_format:matplotlib.axes.Axes.ticklabel_format}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{ticklabel\_format}}}{\emph{**kwargs}}{} Change the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarFormatter}}}}} used by default for linear axes. Optional keyword arguments: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Keyword &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{style} & {[} ‘sci’ (or ‘scientific’) \textbar{} ‘plain’ {]} plain turns off scientific notation \\ \hline \sphinxstyleemphasis{scilimits} & (m, n), pair of integers; if \sphinxstyleemphasis{style} is ‘sci’, scientific notation will be used for numbers outside the range 10{}`m{}`:sup: to 10{}`n{}`:sup:. Use (0,0) to include all numbers. \\ \hline \sphinxstyleemphasis{useOffset} & {[} bool \textbar{} offset {]}; if True, the offset will be calculated as needed; if False, no offset will be used; if a numeric offset is specified, it will be used. \\ \hline \sphinxstyleemphasis{axis} & {[} ‘x’ \textbar{} ‘y’ \textbar{} ‘both’ {]} \\ \hline \sphinxstyleemphasis{useLocale} & If True, format the number according to the current locale. This affects things such as the character used for the decimal separator. If False, use C-style (English) formatting. The default setting is controlled by the axes.formatter.use\_locale rcparam. \\ \hline \sphinxstyleemphasis{useMathText} & If True, render the offset and scientific notation in mathtext \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} Only the major ticks are affected. If the method is called when the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarFormatter}}}}} is not the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Formatter}}}}} being used, an \sphinxhref{https://docs.python.org/3/library/exceptions.html\#AttributeError}{\sphinxcode{\sphinxupquote{AttributeError}}} will be raised. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.tick\_params} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.tick_params:matplotlib-axes-axes-tick-params}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.tick_params::doc}}\index{tick\_params() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.tick_params:matplotlib.axes.Axes.tick_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{tick\_params}}}{\emph{axis='both'}, \emph{**kwargs}}{} Change the appearance of ticks, tick labels, and gridlines. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{axis}}] \leavevmode{[}\{‘x’, ‘y’, ‘both’\}, optional{]} Which axis to apply the parameters to. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{axis}}] \leavevmode{[}\{‘x’, ‘y’, ‘both’\}{]} Axis on which to operate; default is ‘both’. \item[{\sphinxstylestrong{reset}}] \leavevmode{[}bool{]} If \sphinxstyleemphasis{True}, set all parameters to defaults before processing other keyword arguments. Default is \sphinxstyleemphasis{False}. \item[{\sphinxstylestrong{which}}] \leavevmode{[}\{‘major’, ‘minor’, ‘both’\}{]} Default is ‘major’; apply arguments to \sphinxstyleemphasis{which} ticks. \item[{\sphinxstylestrong{direction}}] \leavevmode{[}\{‘in’, ‘out’, ‘inout’\}{]} Puts ticks inside the axes, outside the axes, or both. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float{]} Tick length in points. \item[{\sphinxstylestrong{width}}] \leavevmode{[}float{]} Tick width in points. \item[{\sphinxstylestrong{color}}] \leavevmode{[}color{]} Tick color; accepts any mpl color spec. \item[{\sphinxstylestrong{pad}}] \leavevmode{[}float{]} Distance in points between tick and label. \item[{\sphinxstylestrong{labelsize}}] \leavevmode{[}float or str{]} Tick label font size in points or as a string (e.g., ‘large’). \item[{\sphinxstylestrong{labelcolor}}] \leavevmode{[}color{]} Tick label color; mpl color spec. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}color{]} Changes the tick color and the label color to the same value: mpl color spec. \item[{\sphinxstylestrong{zorder}}] \leavevmode{[}float{]} Tick and label zorder. \item[{\sphinxstylestrong{bottom, top, left, right}}] \leavevmode{[}bool{]} Whether to draw the respective ticks. \item[{\sphinxstylestrong{labelbottom, labeltop, labelleft, labelright}}] \leavevmode{[}bool{]} Whether to draw the respective tick labels. \item[{\sphinxstylestrong{labelrotation}}] \leavevmode{[}float{]} Tick label rotation \item[{\sphinxstylestrong{grid\_color}}] \leavevmode{[}color{]} Changes the gridline color to the given mpl color spec. \item[{\sphinxstylestrong{grid\_alpha}}] \leavevmode{[}float{]} Transparency of gridlines: 0 (transparent) to 1 (opaque). \item[{\sphinxstylestrong{grid\_linewidth}}] \leavevmode{[}float{]} Width of gridlines in points. \item[{\sphinxstylestrong{grid\_linestyle}}] \leavevmode{[}string{]} Any valid {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} line style spec. \end{description} \end{description}\end{quote} \paragraph{Examples} Usage \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{tick\PYGZus{}params}\PYG{p}{(}\PYG{n}{direction}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{out}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{length}\PYG{o}{=}\PYG{l+m+mi}{6}\PYG{p}{,} \PYG{n}{width}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{colors}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{grid\PYGZus{}color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{grid\PYGZus{}alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \end{sphinxVerbatim} This will make all major ticks be red, pointing out of the box, and with dimensions 6 points by 2 points. Tick labels will also be red. Gridlines will be red and translucent. \end{fulllineitems} \subsubsection{matplotlib.axes.Axes.locator\_params} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.locator_params:matplotlib-axes-axes-locator-params}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.locator_params::doc}}\index{locator\_params() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.locator_params:matplotlib.axes.Axes.locator_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{locator\_params}}}{\emph{axis='both'}, \emph{tight=None}, \emph{**kwargs}}{} Control behavior of tick locators. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{axis}}] \leavevmode{[}{[}‘both’ \textbar{} ‘x’ \textbar{} ‘y’{]}, optional{]} The axis on which to operate. \item[{\sphinxstylestrong{tight}}] \leavevmode{[}bool or None, optional{]} Parameter passed to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.autoscale_view:matplotlib.axes.Axes.autoscale_view}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{autoscale\_view()}}}}}. Default is None, for no change. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kw :}}] \leavevmode Remaining keyword arguments are passed to directly to the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator.set_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_params()}}}}} method. \item[{\sphinxstylestrong{Typically one might want to reduce the maximum number}}] \leavevmode \item[{\sphinxstylestrong{of ticks and use tight bounds when plotting small}}] \leavevmode \item[{\sphinxstylestrong{subplots, for example::}}] \leavevmode ax.locator\_params(tight=True, nbins=4) \item[{\sphinxstylestrong{Because the locator is involved in autoscaling,}}] \leavevmode \item[{\sphinxstylestrong{:meth:{}`autoscale\_view{}` is called automatically after}}] \leavevmode \item[{\sphinxstylestrong{the parameters are changed.}}] \leavevmode \item[{\sphinxstylestrong{This presently works only for the}}] \leavevmode \item[{\sphinxstylestrong{:class:{}`\textasciitilde{}matplotlib.ticker.MaxNLocator{}` used}}] \leavevmode \item[{\sphinxstylestrong{by default on linear axes, but it may be generalized.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \section{Units} \label{\detokenize{api/axes_api:units}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.convert_xunits:matplotlib.axes.Axes.convert_xunits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.convert\_xunits}}}}} & For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.convert_yunits:matplotlib.axes.Axes.convert_yunits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.convert\_yunits}}}}} & For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.have_units:matplotlib.axes.Axes.have_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.have\_units}}}}} & Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axes.Axes.convert\_xunits} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.convert_xunits:matplotlib-axes-axes-convert-xunits}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.convert_xunits::doc}}\index{convert\_xunits() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.convert_xunits:matplotlib.axes.Axes.convert_xunits}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \subsection{matplotlib.axes.Axes.convert\_yunits} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.convert_yunits:matplotlib-axes-axes-convert-yunits}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.convert_yunits::doc}}\index{convert\_yunits() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.convert_yunits:matplotlib.axes.Axes.convert_yunits}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \subsection{matplotlib.axes.Axes.have\_units} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.have_units:matplotlib-axes-axes-have-units}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.have_units::doc}}\index{have\_units() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.have_units:matplotlib.axes.Axes.have_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \section{Adding Artists} \label{\detokenize{api/axes_api:adding-artists}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.add_artist:matplotlib.axes.Axes.add_artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.add\_artist}}}}} & Add any {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} to the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.add_collection:matplotlib.axes.Axes.add_collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.add\_collection}}}}} & Add a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Collection}}}}} instance to the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.add_container:matplotlib.axes.Axes.add_container}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.add\_container}}}}} & Add a {\hyperref[\detokenize{api/container_api:matplotlib.container.Container}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Container}}}}} instance to the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.add_image:matplotlib.axes.Axes.add_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.add\_image}}}}} & Add a {\hyperref[\detokenize{api/image_api:matplotlib.image.AxesImage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AxesImage}}}}} to the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.add_line:matplotlib.axes.Axes.add_line}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.add\_line}}}}} & Add a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} to the list of plot lines \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.add_patch:matplotlib.axes.Axes.add_patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.add\_patch}}}}} & Add a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \sphinxstyleemphasis{p} to the list of axes patches; the clipbox will be set to the Axes clipping box. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.add_table:matplotlib.axes.Axes.add_table}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.add\_table}}}}} & Add a {\hyperref[\detokenize{api/table_api:matplotlib.table.Table}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Table}}}}} instance to the list of axes tables \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axes.Axes.add\_artist} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_artist:matplotlib-axes-axes-add-artist}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_artist::doc}}\index{add\_artist() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_artist:matplotlib.axes.Axes.add_artist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{add\_artist}}}{\emph{a}}{} Add any {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} to the axes. Use {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.add_artist:matplotlib.axes.Axes.add_artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_artist}}}}} only for artists for which there is no dedicated “add” method; and if necessary, use a method such as {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.update_datalim:matplotlib.axes.Axes.update_datalim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{update\_datalim}}}}} to manually update the dataLim if the artist is to be included in autoscaling. Returns the artist. \end{fulllineitems} \subsection{matplotlib.axes.Axes.add\_collection} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_collection:matplotlib-axes-axes-add-collection}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_collection::doc}}\index{add\_collection() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_collection:matplotlib.axes.Axes.add_collection}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{add\_collection}}}{\emph{collection}, \emph{autolim=True}}{} Add a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Collection}}}}} instance to the axes. Returns the collection. \end{fulllineitems} \subsection{matplotlib.axes.Axes.add\_container} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_container:matplotlib-axes-axes-add-container}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_container::doc}}\index{add\_container() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_container:matplotlib.axes.Axes.add_container}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{add\_container}}}{\emph{container}}{} Add a {\hyperref[\detokenize{api/container_api:matplotlib.container.Container}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Container}}}}} instance to the axes. Returns the collection. \end{fulllineitems} \subsection{matplotlib.axes.Axes.add\_image} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_image:matplotlib-axes-axes-add-image}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_image::doc}}\index{add\_image() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_image:matplotlib.axes.Axes.add_image}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{add\_image}}}{\emph{image}}{} Add a {\hyperref[\detokenize{api/image_api:matplotlib.image.AxesImage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AxesImage}}}}} to the axes. Returns the image. \end{fulllineitems} \subsection{matplotlib.axes.Axes.add\_line} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_line:matplotlib-axes-axes-add-line}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_line::doc}}\index{add\_line() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_line:matplotlib.axes.Axes.add_line}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{add\_line}}}{\emph{line}}{} Add a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} to the list of plot lines Returns the line. \end{fulllineitems} \subsection{matplotlib.axes.Axes.add\_patch} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_patch:matplotlib-axes-axes-add-patch}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_patch::doc}}\index{add\_patch() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_patch:matplotlib.axes.Axes.add_patch}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{add\_patch}}}{\emph{p}}{} Add a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \sphinxstyleemphasis{p} to the list of axes patches; the clipbox will be set to the Axes clipping box. If the transform is not set, it will be set to \sphinxcode{\sphinxupquote{transData}}. Returns the patch. \end{fulllineitems} \subsection{matplotlib.axes.Axes.add\_table} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_table:matplotlib-axes-axes-add-table}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_table::doc}}\index{add\_table() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_table:matplotlib.axes.Axes.add_table}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{add\_table}}}{\emph{tab}}{} Add a {\hyperref[\detokenize{api/table_api:matplotlib.table.Table}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Table}}}}} instance to the list of axes tables \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{tab: {}`matplotlib.table.Table{}`}}] \leavevmode Table instance \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{{}`matplotlib.table.Table{}`: the table.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \section{Twinning} \label{\detokenize{api/axes_api:twinning}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.twinx:matplotlib.axes.Axes.twinx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.twinx}}}}} & Create a twin Axes sharing the xaxis \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.twiny:matplotlib.axes.Axes.twiny}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.twiny}}}}} & Create a twin Axes sharing the yaxis \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_shared_x_axes:matplotlib.axes.Axes.get_shared_x_axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_shared\_x\_axes}}}}} & Return a reference to the shared axes Grouper object for x axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_shared_y_axes:matplotlib.axes.Axes.get_shared_y_axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_shared\_y\_axes}}}}} & Return a reference to the shared axes Grouper object for y axes. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axes.Axes.twinx} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.twinx:matplotlib-axes-axes-twinx}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.twinx::doc}}\index{twinx() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.twinx:matplotlib.axes.Axes.twinx}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{twinx}}}{}{} Create a twin Axes sharing the xaxis Create a new Axes instance with an invisible x-axis and an independent y-axis positioned opposite to the original one (i.e. at right). The x-axis autoscale setting will be inherited from the original Axes. To ensure that the tick marks of both y-axes align, see {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LinearLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LinearLocator}}}}} \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ax\_twin}}] \leavevmode{[}Axes{]} The newly created Axes instance \end{description} \end{description}\end{quote} \paragraph{Notes} For those who are ‘picking’ artists while using twinx, pick events are only called for the artists in the top-most axes. \end{fulllineitems} \subsection{matplotlib.axes.Axes.twiny} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.twiny:matplotlib-axes-axes-twiny}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.twiny::doc}}\index{twiny() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.twiny:matplotlib.axes.Axes.twiny}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{twiny}}}{}{} Create a twin Axes sharing the yaxis Create a new Axes instance with an invisible y-axis and an independent x-axis positioned opposite to the original one (i.e. at top). The y-axis autoscale setting will be inherited from the original Axes. To ensure that the tick marks of both x-axes align, see {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LinearLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LinearLocator}}}}} \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ax\_twin}}] \leavevmode{[}Axes{]} The newly created Axes instance \end{description} \end{description}\end{quote} \paragraph{Notes} For those who are ‘picking’ artists while using twiny, pick events are only called for the artists in the top-most axes. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_shared\_x\_axes} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_shared_x_axes:matplotlib-axes-axes-get-shared-x-axes}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_shared_x_axes::doc}}\index{get\_shared\_x\_axes() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_shared_x_axes:matplotlib.axes.Axes.get_shared_x_axes}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_shared\_x\_axes}}}{}{} Return a reference to the shared axes Grouper object for x axes. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_shared\_y\_axes} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_shared_y_axes:matplotlib-axes-axes-get-shared-y-axes}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_shared_y_axes::doc}}\index{get\_shared\_y\_axes() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_shared_y_axes:matplotlib.axes.Axes.get_shared_y_axes}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_shared\_y\_axes}}}{}{} Return a reference to the shared axes Grouper object for y axes. \end{fulllineitems} \section{Axes Position} \label{\detokenize{api/axes_api:axes-position}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_anchor:matplotlib.axes.Axes.get_anchor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_anchor}}}}} & Get the anchor location. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_anchor:matplotlib.axes.Axes.set_anchor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_anchor}}}}} & Define the anchor location. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_axes_locator:matplotlib.axes.Axes.get_axes_locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_axes\_locator}}}}} & Return the axes\_locator. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_axes_locator:matplotlib.axes.Axes.set_axes_locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_axes\_locator}}}}} & Set the axes locator. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.reset_position:matplotlib.axes.Axes.reset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.reset\_position}}}}} & Reset the active position to the original position. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_position:matplotlib.axes.Axes.get_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_position}}}}} & Get a copy of the axes rectangle as a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_position:matplotlib.axes.Axes.set_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_position}}}}} & Set the axes position. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axes.Axes.get\_anchor} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_anchor:matplotlib-axes-axes-get-anchor}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_anchor::doc}}\index{get\_anchor() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_anchor:matplotlib.axes.Axes.get_anchor}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_anchor}}}{}{} Get the anchor location. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_anchor:matplotlib.axes.Axes.set_anchor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_anchor}}}}}}] \leavevmode for a description of the anchor. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_aspect:matplotlib.axes.Axes.set_aspect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_aspect}}}}}}] \leavevmode for a description of aspect handling. \end{description} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_anchor} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_anchor:matplotlib-axes-axes-set-anchor}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_anchor::doc}}\index{set\_anchor() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_anchor:matplotlib.axes.Axes.set_anchor}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_anchor}}}{\emph{anchor}, \emph{share=False}}{} Define the anchor location. The actual drawing area (active position) of the Axes may be smaller than the Bbox (original position) when a fixed aspect is required. The anchor defines where the drawing area will be located within the available space. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{anchor}}] \leavevmode{[}str or 2-tuple of floats{]} The anchor position may be either: \begin{itemize} \item {} a sequence (\sphinxstyleemphasis{cx}, \sphinxstyleemphasis{cy}). \sphinxstyleemphasis{cx} and \sphinxstyleemphasis{cy} may range from 0 to 1, where 0 is left or bottom and 1 is right or top. \item {} a string using cardinal directions as abbreviation: \begin{itemize} \item {} ‘C’ for centered \item {} ‘S’ (south) for bottom-center \item {} ‘SW’ (south west) for bottom-left \item {} etc. \end{itemize} Here is an overview of the possible positions: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline ‘NW’ & ‘N’ & ‘NE’ \\ \hline ‘W’ & ‘C’ & ‘E’ \\ \hline ‘SW’ & ‘S’ & ‘SE’ \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{itemize} \item[{\sphinxstylestrong{share}}] \leavevmode{[}bool, optional{]} If \sphinxcode{\sphinxupquote{True}}, apply the settings to all shared Axes. Default is \sphinxcode{\sphinxupquote{False}}. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_aspect:matplotlib.axes.Axes.set_aspect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_aspect}}}}}}] \leavevmode for a description of aspect handling. \end{description} \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_axes\_locator} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_axes_locator:matplotlib-axes-axes-get-axes-locator}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_axes_locator::doc}}\index{get\_axes\_locator() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_axes_locator:matplotlib.axes.Axes.get_axes_locator}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_axes\_locator}}}{}{} Return the axes\_locator. \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_axes\_locator} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_axes_locator:matplotlib-axes-axes-set-axes-locator}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_axes_locator::doc}}\index{set\_axes\_locator() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_axes_locator:matplotlib.axes.Axes.set_axes_locator}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_axes\_locator}}}{\emph{locator}}{} Set the axes locator. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{locator}}] \leavevmode{[}callable{]} A locator function, which takes an axes and a renderer and returns a bbox. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.reset\_position} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.reset_position:matplotlib-axes-axes-reset-position}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.reset_position::doc}}\index{reset\_position() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.reset_position:matplotlib.axes.Axes.reset_position}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{reset\_position}}}{}{} Reset the active position to the original position. This resets the a possible position change due to aspect constraints. For an explanation of the positions see {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_position:matplotlib.axes.Axes.set_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_position}}}}}. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_position} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_position:matplotlib-axes-axes-get-position}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_position::doc}}\index{get\_position() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_position:matplotlib.axes.Axes.get_position}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_position}}}{\emph{original=False}}{} Get a copy of the axes rectangle as a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{original}}] \leavevmode{[}bool{]} If \sphinxcode{\sphinxupquote{True}}, return the original position. Otherwise return the active position. For an explanation of the positions see {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_position:matplotlib.axes.Axes.set_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_position}}}}}. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{pos}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_position} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_position:matplotlib-axes-axes-set-position}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_position::doc}}\index{set\_position() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_position:matplotlib.axes.Axes.set_position}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_position}}}{\emph{pos}, \emph{which='both'}}{} Set the axes position. Axes have two position attributes. The ‘original’ position is the position allocated for the Axes. The ‘active’ position is the position the Axes is actually drawn at. These positions are usually the same unless a fixed aspect is set to the Axes. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_aspect:matplotlib.axes.Axes.set_aspect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_aspect}}}}} for details. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{pos}}] \leavevmode{[}{[}left, bottom, width, height{]} or {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} The new position of the in {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} coordinates. \item[{\sphinxstylestrong{which}}] \leavevmode{[}{[}‘both’ \textbar{} ‘active’ \textbar{} ‘original’{]}, optional{]} Determines which position variables to change. \end{description} \end{description}\end{quote} \end{fulllineitems} \section{Async/Event based} \label{\detokenize{api/axes_api:async-event-based}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.stale:matplotlib.axes.Axes.stale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.stale}}}}} & If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.pchanged:matplotlib.axes.Axes.pchanged}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.pchanged}}}}} & Fire an event when property changed, calling all of the registered callbacks. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.add_callback:matplotlib.axes.Axes.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.add\_callback}}}}} & Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.remove_callback:matplotlib.axes.Axes.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.remove\_callback}}}}} & Remove a callback based on its \sphinxstyleemphasis{id}. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axes.Axes.stale} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.stale:matplotlib-axes-axes-stale}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.stale::doc}}\index{stale (matplotlib.axes.Axes attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.stale:matplotlib.axes.Axes.stale}}\pysigline{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \subsection{matplotlib.axes.Axes.pchanged} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pchanged:matplotlib-axes-axes-pchanged}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pchanged::doc}}\index{pchanged() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pchanged:matplotlib.axes.Axes.pchanged}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \subsection{matplotlib.axes.Axes.add\_callback} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_callback:matplotlib-axes-axes-add-callback}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_callback::doc}}\index{add\_callback() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.add_callback:matplotlib.axes.Axes.add_callback}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.remove_callback:matplotlib.axes.Axes.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \subsection{matplotlib.axes.Axes.remove\_callback} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.remove_callback:matplotlib-axes-axes-remove-callback}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.remove_callback::doc}}\index{remove\_callback() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.remove_callback:matplotlib.axes.Axes.remove_callback}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.add_callback:matplotlib.axes.Axes.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \section{Interactive} \label{\detokenize{api/axes_api:interactive}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.can_pan:matplotlib.axes.Axes.can_pan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.can\_pan}}}}} & Return \sphinxstyleemphasis{True} if this axes supports any pan/zoom button functionality. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.can_zoom:matplotlib.axes.Axes.can_zoom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.can\_zoom}}}}} & Return \sphinxstyleemphasis{True} if this axes supports the zoom box button functionality. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_navigate:matplotlib.axes.Axes.get_navigate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_navigate}}}}} & Get whether the axes responds to navigation commands \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_navigate:matplotlib.axes.Axes.set_navigate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_navigate}}}}} & Set whether the axes responds to navigation toolbar commands \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_navigate_mode:matplotlib.axes.Axes.get_navigate_mode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_navigate\_mode}}}}} & Get the navigation toolbar button status: ‘PAN’, ‘ZOOM’, or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_navigate_mode:matplotlib.axes.Axes.set_navigate_mode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_navigate\_mode}}}}} & Set the navigation toolbar button status; \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.start_pan:matplotlib.axes.Axes.start_pan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.start\_pan}}}}} & Called when a pan operation has started. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.drag_pan:matplotlib.axes.Axes.drag_pan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.drag\_pan}}}}} & Called when the mouse moves during a pan operation. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.end_pan:matplotlib.axes.Axes.end_pan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.end\_pan}}}}} & Called when a pan operation completes (when the mouse button is up.) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.format_coord:matplotlib.axes.Axes.format_coord}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.format\_coord}}}}} & Return a format string formatting the \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} coord \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.format_cursor_data:matplotlib.axes.Axes.format_cursor_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.format\_cursor\_data}}}}} & Return \sphinxstyleemphasis{cursor data} string formatted. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.format_xdata:matplotlib.axes.Axes.format_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.format\_xdata}}}}} & Return \sphinxstyleemphasis{x} string formatted. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.format_ydata:matplotlib.axes.Axes.format_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.format\_ydata}}}}} & Return y string formatted. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.mouseover:matplotlib.axes.Axes.mouseover}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.mouseover}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.in_axes:matplotlib.axes.Axes.in_axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.in\_axes}}}}} & Return \sphinxstyleemphasis{True} if the given \sphinxstyleemphasis{mouseevent} (in display coords) is in the Axes \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.pick:matplotlib.axes.Axes.pick}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.pick}}}}} & Trigger pick event \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.pickable:matplotlib.axes.Axes.pickable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.pickable}}}}} & Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_picker:matplotlib.axes.Axes.get_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_picker}}}}} & Return the picker object used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_picker:matplotlib.axes.Axes.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_picker}}}}} & Set the epsilon for picking used by this artist \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_contains:matplotlib.axes.Axes.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_contains}}}}} & Replace the contains test used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_contains:matplotlib.axes.Axes.get_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_contains}}}}} & Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contains:matplotlib.axes.Axes.contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.contains}}}}} & Test whether the mouse event occurred in the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contains_point:matplotlib.axes.Axes.contains_point}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.contains\_point}}}}} & Returns \sphinxstyleemphasis{True} if the point (tuple of x,y) is inside the axes (the area defined by the its patch). \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_cursor_data:matplotlib.axes.Axes.get_cursor_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_cursor\_data}}}}} & Get the cursor data for a given event. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_cursor_props:matplotlib.axes.Axes.get_cursor_props}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_cursor\_props}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_cursor_props:matplotlib.axes.Axes.set_cursor_props}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_cursor\_props}}}}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axes.Axes.can\_pan} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.can_pan:matplotlib-axes-axes-can-pan}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.can_pan::doc}}\index{can\_pan() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.can_pan:matplotlib.axes.Axes.can_pan}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{can\_pan}}}{}{} Return \sphinxstyleemphasis{True} if this axes supports any pan/zoom button functionality. \end{fulllineitems} \subsection{matplotlib.axes.Axes.can\_zoom} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.can_zoom:matplotlib-axes-axes-can-zoom}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.can_zoom::doc}}\index{can\_zoom() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.can_zoom:matplotlib.axes.Axes.can_zoom}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{can\_zoom}}}{}{} Return \sphinxstyleemphasis{True} if this axes supports the zoom box button functionality. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_navigate} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_navigate:matplotlib-axes-axes-get-navigate}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_navigate::doc}}\index{get\_navigate() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_navigate:matplotlib.axes.Axes.get_navigate}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_navigate}}}{}{} Get whether the axes responds to navigation commands \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_navigate} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_navigate:matplotlib-axes-axes-set-navigate}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_navigate::doc}}\index{set\_navigate() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_navigate:matplotlib.axes.Axes.set_navigate}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_navigate}}}{\emph{b}}{} Set whether the axes responds to navigation toolbar commands \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_navigate\_mode} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_navigate_mode:matplotlib-axes-axes-get-navigate-mode}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_navigate_mode::doc}}\index{get\_navigate\_mode() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_navigate_mode:matplotlib.axes.Axes.get_navigate_mode}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_navigate\_mode}}}{}{} Get the navigation toolbar button status: ‘PAN’, ‘ZOOM’, or None \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_navigate\_mode} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_navigate_mode:matplotlib-axes-axes-set-navigate-mode}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_navigate_mode::doc}}\index{set\_navigate\_mode() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_navigate_mode:matplotlib.axes.Axes.set_navigate_mode}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_navigate\_mode}}}{\emph{b}}{} Set the navigation toolbar button status; \begin{sphinxadmonition}{warning}{Warning:} this is not a user-API function. \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.axes.Axes.start\_pan} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.start_pan:matplotlib-axes-axes-start-pan}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.start_pan::doc}}\index{start\_pan() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.start_pan:matplotlib.axes.Axes.start_pan}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{start\_pan}}}{\emph{x}, \emph{y}, \emph{button}}{} Called when a pan operation has started. \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} are the mouse coordinates in display coords. button is the mouse button number: \begin{itemize} \item {} 1: LEFT \item {} 2: MIDDLE \item {} 3: RIGHT \end{itemize} \begin{sphinxadmonition}{note}{Note:} Intended to be overridden by new projection types. \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.axes.Axes.drag\_pan} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.drag_pan:matplotlib-axes-axes-drag-pan}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.drag_pan::doc}}\index{drag\_pan() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.drag_pan:matplotlib.axes.Axes.drag_pan}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{drag\_pan}}}{\emph{button}, \emph{key}, \emph{x}, \emph{y}}{} Called when the mouse moves during a pan operation. \sphinxstyleemphasis{button} is the mouse button number: \begin{itemize} \item {} 1: LEFT \item {} 2: MIDDLE \item {} 3: RIGHT \end{itemize} \sphinxstyleemphasis{key} is a “shift” key \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} are the mouse coordinates in display coords. \begin{sphinxadmonition}{note}{Note:} Intended to be overridden by new projection types. \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.axes.Axes.end\_pan} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.end_pan:matplotlib-axes-axes-end-pan}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.end_pan::doc}}\index{end\_pan() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.end_pan:matplotlib.axes.Axes.end_pan}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{end\_pan}}}{}{} Called when a pan operation completes (when the mouse button is up.) \begin{sphinxadmonition}{note}{Note:} Intended to be overridden by new projection types. \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.axes.Axes.format\_coord} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.format_coord:matplotlib-axes-axes-format-coord}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.format_coord::doc}}\index{format\_coord() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.format_coord:matplotlib.axes.Axes.format_coord}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{format\_coord}}}{\emph{x}, \emph{y}}{} Return a format string formatting the \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} coord \end{fulllineitems} \subsection{matplotlib.axes.Axes.format\_cursor\_data} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.format_cursor_data:matplotlib-axes-axes-format-cursor-data}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.format_cursor_data::doc}}\index{format\_cursor\_data() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.format_cursor_data:matplotlib.axes.Axes.format_cursor_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \subsection{matplotlib.axes.Axes.format\_xdata} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.format_xdata:matplotlib-axes-axes-format-xdata}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.format_xdata::doc}}\index{format\_xdata() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.format_xdata:matplotlib.axes.Axes.format_xdata}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{format\_xdata}}}{\emph{x}}{} Return \sphinxstyleemphasis{x} string formatted. This function will use the attribute self.fmt\_xdata if it is callable, else will fall back on the xaxis major formatter \end{fulllineitems} \subsection{matplotlib.axes.Axes.format\_ydata} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.format_ydata:matplotlib-axes-axes-format-ydata}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.format_ydata::doc}}\index{format\_ydata() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.format_ydata:matplotlib.axes.Axes.format_ydata}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{format\_ydata}}}{\emph{y}}{} Return y string formatted. This function will use the \sphinxcode{\sphinxupquote{fmt\_ydata}} attribute if it is callable, else will fall back on the yaxis major formatter \end{fulllineitems} \subsection{matplotlib.axes.Axes.mouseover} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.mouseover:matplotlib-axes-axes-mouseover}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.mouseover::doc}}\index{mouseover (matplotlib.axes.Axes attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.mouseover:matplotlib.axes.Axes.mouseover}}\pysigline{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \subsection{matplotlib.axes.Axes.in\_axes} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.in_axes:matplotlib-axes-axes-in-axes}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.in_axes::doc}}\index{in\_axes() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.in_axes:matplotlib.axes.Axes.in_axes}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{in\_axes}}}{\emph{mouseevent}}{} Return \sphinxstyleemphasis{True} if the given \sphinxstyleemphasis{mouseevent} (in display coords) is in the Axes \end{fulllineitems} \subsection{matplotlib.axes.Axes.pick} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pick:matplotlib-axes-axes-pick}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pick::doc}}\index{pick() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pick:matplotlib.axes.Axes.pick}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{pick}}}{\emph{*args}}{} Trigger pick event Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{pick}\PYG{p}{(}\PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} each child artist will fire a pick event if mouseevent is over the artist and the artist has picker set \end{fulllineitems} \subsection{matplotlib.axes.Axes.pickable} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pickable:matplotlib-axes-axes-pickable}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pickable::doc}}\index{pickable() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.pickable:matplotlib.axes.Axes.pickable}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_picker} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_picker:matplotlib-axes-axes-get-picker}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_picker::doc}}\index{get\_picker() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_picker:matplotlib.axes.Axes.get_picker}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_picker} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_picker:matplotlib-axes-axes-set-picker}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_picker::doc}}\index{set\_picker() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_picker:matplotlib.axes.Axes.set_picker}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_contains} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_contains:matplotlib-axes-axes-set-contains}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_contains::doc}}\index{set\_contains() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_contains:matplotlib.axes.Axes.set_contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_contains} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_contains:matplotlib-axes-axes-get-contains}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_contains::doc}}\index{get\_contains() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_contains:matplotlib.axes.Axes.get_contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \subsection{matplotlib.axes.Axes.contains} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.contains:matplotlib-axes-axes-contains}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.contains::doc}}\index{contains() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.contains:matplotlib.axes.Axes.contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the axes. Returns \sphinxstyleemphasis{True} / \sphinxstyleemphasis{False}, \{\} \end{fulllineitems} \subsection{matplotlib.axes.Axes.contains\_point} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.contains_point:matplotlib-axes-axes-contains-point}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.contains_point::doc}}\index{contains\_point() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.contains_point:matplotlib.axes.Axes.contains_point}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{contains\_point}}}{\emph{point}}{} Returns \sphinxstyleemphasis{True} if the point (tuple of x,y) is inside the axes (the area defined by the its patch). A pixel coordinate is required. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_cursor\_data} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_cursor_data:matplotlib-axes-axes-get-cursor-data}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_cursor_data::doc}}\index{get\_cursor\_data() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_cursor_data:matplotlib.axes.Axes.get_cursor_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_cursor\_props} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_cursor_props:matplotlib-axes-axes-get-cursor-props}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_cursor_props::doc}}\index{get\_cursor\_props() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_cursor_props:matplotlib.axes.Axes.get_cursor_props}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_cursor\_props}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The get\_cursor\_props function was deprecated in version 2.1. Return the cursor propertiess as a (\sphinxstyleemphasis{linewidth}, \sphinxstyleemphasis{color}) tuple, where \sphinxstyleemphasis{linewidth} is a float and \sphinxstyleemphasis{color} is an RGBA tuple \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_cursor\_props} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_cursor_props:matplotlib-axes-axes-set-cursor-props}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_cursor_props::doc}}\index{set\_cursor\_props() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_cursor_props:matplotlib.axes.Axes.set_cursor_props}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_cursor\_props}}}{\emph{*args}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The set\_cursor\_props function was deprecated in version 2.1. Set the cursor property as \begin{quote} Call signature \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}cursor\PYGZus{}props}\PYG{p}{(}\PYG{n}{linewidth}\PYG{p}{,} \PYG{n}{color}\PYG{p}{)} \end{sphinxVerbatim} or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}cursor\PYGZus{}props}\PYG{p}{(}\PYG{p}{(}\PYG{n}{linewidth}\PYG{p}{,} \PYG{n}{color}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} ACCEPTS: a (\sphinxstyleemphasis{float}, \sphinxstyleemphasis{color}) tuple \end{quote} \end{fulllineitems} \section{Children} \label{\detokenize{api/axes_api:children}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_children:matplotlib.axes.Axes.get_children}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_children}}}}} & return a list of child artists \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_images:matplotlib.axes.Axes.get_images}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_images}}}}} & return a list of Axes images contained by the Axes \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_lines:matplotlib.axes.Axes.get_lines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_lines}}}}} & Return a list of lines contained by the Axes \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.findobj:matplotlib.axes.Axes.findobj}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.findobj}}}}} & Find artist objects. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axes.Axes.get\_children} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_children:matplotlib-axes-axes-get-children}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_children::doc}}\index{get\_children() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_children:matplotlib.axes.Axes.get_children}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} return a list of child artists \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_images} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_images:matplotlib-axes-axes-get-images}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_images::doc}}\index{get\_images() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_images:matplotlib.axes.Axes.get_images}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_images}}}{}{} return a list of Axes images contained by the Axes \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_lines} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_lines:matplotlib-axes-axes-get-lines}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_lines::doc}}\index{get\_lines() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_lines:matplotlib.axes.Axes.get_lines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_lines}}}{}{} Return a list of lines contained by the Axes \end{fulllineitems} \subsection{matplotlib.axes.Axes.findobj} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.findobj:matplotlib-axes-axes-findobj}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.findobj::doc}}\index{findobj() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.findobj:matplotlib.axes.Axes.findobj}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \section{Drawing} \label{\detokenize{api/axes_api:drawing}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.draw:matplotlib.axes.Axes.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.draw}}}}} & Draw everything (plot lines, axes, labels) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.draw_artist:matplotlib.axes.Axes.draw_artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.draw\_artist}}}}} & This method can only be used after an initial draw which caches the renderer. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.redraw_in_frame:matplotlib.axes.Axes.redraw_in_frame}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.redraw\_in\_frame}}}}} & This method can only be used after an initial draw which caches the renderer. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_renderer_cache:matplotlib.axes.Axes.get_renderer_cache}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_renderer\_cache}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_rasterization_zorder:matplotlib.axes.Axes.get_rasterization_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_rasterization\_zorder}}}}} & Return the zorder value below which artists will be rasterized. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_rasterization_zorder:matplotlib.axes.Axes.set_rasterization_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_rasterization\_zorder}}}}} & \begin{quote}\begin{description} \item[{Parameters}] \leavevmode \end{description}\end{quote} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_window_extent:matplotlib.axes.Axes.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_window\_extent}}}}} & get the axes bounding box in display space; \sphinxstyleemphasis{args} and \sphinxstyleemphasis{kwargs} are empty \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_tightbbox:matplotlib.axes.Axes.get_tightbbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_tightbbox}}}}} & Return the tight bounding box of the axes. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axes.Axes.draw} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.draw:matplotlib-axes-axes-draw}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.draw::doc}}\index{draw() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.draw:matplotlib.axes.Axes.draw}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer=None}, \emph{inframe=False}}{} Draw everything (plot lines, axes, labels) \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.axes.Axes.draw}}} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.draw:examples-using-matplotlib-axes-axes-draw}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_baseline\_test.py} \end{itemize} \subsection{matplotlib.axes.Axes.draw\_artist} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.draw_artist:matplotlib-axes-axes-draw-artist}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.draw_artist::doc}}\index{draw\_artist() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.draw_artist:matplotlib.axes.Axes.draw_artist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{draw\_artist}}}{\emph{a}}{} This method can only be used after an initial draw which caches the renderer. It is used to efficiently update Axes data (axis ticks, labels, etc are not updated) \end{fulllineitems} \subsection{matplotlib.axes.Axes.redraw\_in\_frame} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.redraw_in_frame:matplotlib-axes-axes-redraw-in-frame}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.redraw_in_frame::doc}}\index{redraw\_in\_frame() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.redraw_in_frame:matplotlib.axes.Axes.redraw_in_frame}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{redraw\_in\_frame}}}{}{} This method can only be used after an initial draw which caches the renderer. It is used to efficiently update Axes data (axis ticks, labels, etc are not updated) \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_renderer\_cache} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_renderer_cache:matplotlib-axes-axes-get-renderer-cache}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_renderer_cache::doc}}\index{get\_renderer\_cache() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_renderer_cache:matplotlib.axes.Axes.get_renderer_cache}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_renderer\_cache}}}{}{}~ \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_rasterization\_zorder} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_rasterization_zorder:matplotlib-axes-axes-get-rasterization-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_rasterization_zorder::doc}}\index{get\_rasterization\_zorder() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_rasterization_zorder:matplotlib.axes.Axes.get_rasterization_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_rasterization\_zorder}}}{}{} Return the zorder value below which artists will be rasterized. \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_rasterization\_zorder} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_rasterization_zorder:matplotlib-axes-axes-set-rasterization-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_rasterization_zorder::doc}}\index{set\_rasterization\_zorder() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_rasterization_zorder:matplotlib.axes.Axes.set_rasterization_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_rasterization\_zorder}}}{\emph{z}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{z}}] \leavevmode{[}float or None{]} zorder below which artists are rasterized. \sphinxcode{\sphinxupquote{None}} means that artists do not get rasterized based on zorder. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_window\_extent} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_window_extent:matplotlib-axes-axes-get-window-extent}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_window_extent::doc}}\index{get\_window\_extent() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_window_extent:matplotlib.axes.Axes.get_window_extent}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{*args}, \emph{**kwargs}}{} get the axes bounding box in display space; \sphinxstyleemphasis{args} and \sphinxstyleemphasis{kwargs} are empty \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_tightbbox} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_tightbbox:matplotlib-axes-axes-get-tightbbox}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_tightbbox::doc}}\index{get\_tightbbox() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_tightbbox:matplotlib.axes.Axes.get_tightbbox}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_tightbbox}}}{\emph{renderer}, \emph{call\_axes\_locator=True}}{} Return the tight bounding box of the axes. The dimension of the Bbox in canvas coordinate. If \sphinxstyleemphasis{call\_axes\_locator} is \sphinxstyleemphasis{False}, it does not call the \_axes\_locator attribute, which is necessary to get the correct bounding box. \sphinxcode{\sphinxupquote{call\_axes\_locator==False}} can be used if the caller is only intereted in the relative size of the tightbbox compared to the axes bbox. \end{fulllineitems} \section{Bulk property manipulation} \label{\detokenize{api/axes_api:bulk-property-manipulation}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set:matplotlib.axes.Axes.set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set}}}}} & A property batch setter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.update:matplotlib.axes.Axes.update}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.update}}}}} & Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.properties:matplotlib.axes.Axes.properties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.properties}}}}} & return a dictionary mapping property name -\textgreater{} value for all Artist props \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.update_from:matplotlib.axes.Axes.update_from}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.update\_from}}}}} & Copy properties from \sphinxstyleemphasis{other} to \sphinxstyleemphasis{self}. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axes.Axes.set} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set:matplotlib-axes-axes-set}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set::doc}}\index{set() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set:matplotlib.axes.Axes.set}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \subsection{matplotlib.axes.Axes.update} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.update:matplotlib-axes-axes-update}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.update::doc}}\index{update() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.update:matplotlib.axes.Axes.update}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \subsection{matplotlib.axes.Axes.properties} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.properties:matplotlib-axes-axes-properties}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.properties::doc}}\index{properties() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.properties:matplotlib.axes.Axes.properties}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \subsection{matplotlib.axes.Axes.update\_from} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.update_from:matplotlib-axes-axes-update-from}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.update_from::doc}}\index{update\_from() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.update_from:matplotlib.axes.Axes.update_from}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} Copy properties from \sphinxstyleemphasis{other} to \sphinxstyleemphasis{self}. \end{fulllineitems} \section{General Artist Properties} \label{\detokenize{api/axes_api:general-artist-properties}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_agg_filter:matplotlib.axes.Axes.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_agg\_filter}}}}} & Set the agg filter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_alpha:matplotlib.axes.Axes.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_alpha}}}}} & Set the alpha value used for blending - not supported on all backends. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_animated:matplotlib.axes.Axes.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_animated}}}}} & Set the artist’s animation state. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_clip_box:matplotlib.axes.Axes.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_clip\_box}}}}} & Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_clip_on:matplotlib.axes.Axes.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_clip\_on}}}}} & Set whether artist uses clipping. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_clip_path:matplotlib.axes.Axes.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_clip\_path}}}}} & Set the artist’s clip path, which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_gid:matplotlib.axes.Axes.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_gid}}}}} & Sets the (group) id for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_label:matplotlib.axes.Axes.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_label}}}}} & Set the label to \sphinxstyleemphasis{s} for auto legend. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_path_effects:matplotlib.axes.Axes.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_path\_effects}}}}} & Set the path effects. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_rasterized:matplotlib.axes.Axes.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_rasterized}}}}} & Force rasterized (bitmap) drawing in vector backend output. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_sketch_params:matplotlib.axes.Axes.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_sketch\_params}}}}} & Sets the sketch parameters. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_snap:matplotlib.axes.Axes.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_snap}}}}} & Sets the snap setting which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_transform:matplotlib.axes.Axes.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_transform}}}}} & Set the artist transform. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_url:matplotlib.axes.Axes.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_url}}}}} & Sets the url for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_visible:matplotlib.axes.Axes.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_visible}}}}} & Set the artist’s visibility. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_zorder:matplotlib.axes.Axes.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_zorder}}}}} & Set the zorder for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_agg_filter:matplotlib.axes.Axes.get_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_agg\_filter}}}}} & Return filter function to be used for agg filter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_alpha:matplotlib.axes.Axes.get_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_alpha}}}}} & Return the alpha value used for blending - not supported on all backends \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_animated:matplotlib.axes.Axes.get_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_animated}}}}} & Return the artist’s animated state \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_clip_box:matplotlib.axes.Axes.get_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_clip\_box}}}}} & Return artist clipbox \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_clip_on:matplotlib.axes.Axes.get_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_clip\_on}}}}} & Return whether artist uses clipping \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_clip_path:matplotlib.axes.Axes.get_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_clip\_path}}}}} & Return artist clip path \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_gid:matplotlib.axes.Axes.get_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_gid}}}}} & Returns the group id. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_label:matplotlib.axes.Axes.get_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_label}}}}} & Get the label used for this artist in the legend. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_path_effects:matplotlib.axes.Axes.get_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_path\_effects}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_rasterized:matplotlib.axes.Axes.get_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_rasterized}}}}} & Return whether the artist is to be rasterized. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_sketch_params:matplotlib.axes.Axes.get_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_sketch\_params}}}}} & Returns the sketch parameters for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_snap:matplotlib.axes.Axes.get_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_snap}}}}} & Returns the snap setting which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_transform:matplotlib.axes.Axes.get_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_transform}}}}} & Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_url:matplotlib.axes.Axes.get_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_url}}}}} & Returns the url. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_visible:matplotlib.axes.Axes.get_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_visible}}}}} & Return the artist’s visiblity \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_zorder:matplotlib.axes.Axes.get_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_zorder}}}}} & Return the artist’s zorder. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.axes:matplotlib.axes.Axes.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.axes}}}}} & The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_figure:matplotlib.axes.Axes.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_figure}}}}} & Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} for this {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_figure:matplotlib.axes.Axes.get_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_figure}}}}} & Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axes.Axes.set\_agg\_filter} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_agg_filter:matplotlib-axes-axes-set-agg-filter}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_agg_filter::doc}}\index{set\_agg\_filter() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_agg_filter:matplotlib.axes.Axes.set_agg_filter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_alpha} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_alpha:matplotlib-axes-axes-set-alpha}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_alpha::doc}}\index{set\_alpha() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_alpha:matplotlib.axes.Axes.set_alpha}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha value used for blending - not supported on all backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_animated} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_animated:matplotlib-axes-axes-set-animated}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_animated::doc}}\index{set\_animated() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_animated:matplotlib.axes.Axes.set_animated}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_clip\_box} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_clip_box:matplotlib-axes-axes-set-clip-box}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_clip_box::doc}}\index{set\_clip\_box() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_clip_box:matplotlib.axes.Axes.set_clip_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_clip\_on} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_clip_on:matplotlib-axes-axes-set-clip-on}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_clip_on::doc}}\index{set\_clip\_on() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_clip_on:matplotlib.axes.Axes.set_clip_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_clip\_path} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_clip_path:matplotlib-axes-axes-set-clip-path}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_clip_path::doc}}\index{set\_clip\_path() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_clip_path:matplotlib.axes.Axes.set_clip_path}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_gid} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_gid:matplotlib-axes-axes-set-gid}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_gid::doc}}\index{set\_gid() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_gid:matplotlib.axes.Axes.set_gid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_label} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_label:matplotlib-axes-axes-set-label}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_label::doc}}\index{set\_label() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_label:matplotlib.axes.Axes.set_label}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_path\_effects} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_path_effects:matplotlib-axes-axes-set-path-effects}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_path_effects::doc}}\index{set\_path\_effects() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_path_effects:matplotlib.axes.Axes.set_path_effects}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_rasterized} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_rasterized:matplotlib-axes-axes-set-rasterized}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_rasterized::doc}}\index{set\_rasterized() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_rasterized:matplotlib.axes.Axes.set_rasterized}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_sketch\_params} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_sketch_params:matplotlib-axes-axes-set-sketch-params}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_sketch_params::doc}}\index{set\_sketch\_params() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_sketch_params:matplotlib.axes.Axes.set_sketch_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_snap} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_snap:matplotlib-axes-axes-set-snap}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_snap::doc}}\index{set\_snap() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_snap:matplotlib.axes.Axes.set_snap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_transform} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_transform:matplotlib-axes-axes-set-transform}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_transform::doc}}\index{set\_transform() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_transform:matplotlib.axes.Axes.set_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_url} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_url:matplotlib-axes-axes-set-url}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_url::doc}}\index{set\_url() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_url:matplotlib.axes.Axes.set_url}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_visible} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_visible:matplotlib-axes-axes-set-visible}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_visible::doc}}\index{set\_visible() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_visible:matplotlib.axes.Axes.set_visible}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_zorder} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_zorder:matplotlib-axes-axes-set-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_zorder::doc}}\index{set\_zorder() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_zorder:matplotlib.axes.Axes.set_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_agg\_filter} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_agg_filter:matplotlib-axes-axes-get-agg-filter}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_agg_filter::doc}}\index{get\_agg\_filter() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_agg_filter:matplotlib.axes.Axes.get_agg_filter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_alpha} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_alpha:matplotlib-axes-axes-get-alpha}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_alpha::doc}}\index{get\_alpha() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_alpha:matplotlib.axes.Axes.get_alpha}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_animated} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_animated:matplotlib-axes-axes-get-animated}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_animated::doc}}\index{get\_animated() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_animated:matplotlib.axes.Axes.get_animated}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_clip\_box} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_clip_box:matplotlib-axes-axes-get-clip-box}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_clip_box::doc}}\index{get\_clip\_box() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_clip_box:matplotlib.axes.Axes.get_clip_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_clip\_on} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_clip_on:matplotlib-axes-axes-get-clip-on}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_clip_on::doc}}\index{get\_clip\_on() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_clip_on:matplotlib.axes.Axes.get_clip_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_clip\_path} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_clip_path:matplotlib-axes-axes-get-clip-path}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_clip_path::doc}}\index{get\_clip\_path() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_clip_path:matplotlib.axes.Axes.get_clip_path}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_gid} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_gid:matplotlib-axes-axes-get-gid}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_gid::doc}}\index{get\_gid() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_gid:matplotlib.axes.Axes.get_gid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_label} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_label:matplotlib-axes-axes-get-label}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_label::doc}}\index{get\_label() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_label:matplotlib.axes.Axes.get_label}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_path\_effects} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_path_effects:matplotlib-axes-axes-get-path-effects}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_path_effects::doc}}\index{get\_path\_effects() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_path_effects:matplotlib.axes.Axes.get_path_effects}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_rasterized} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_rasterized:matplotlib-axes-axes-get-rasterized}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_rasterized::doc}}\index{get\_rasterized() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_rasterized:matplotlib.axes.Axes.get_rasterized}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_sketch\_params} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_sketch_params:matplotlib-axes-axes-get-sketch-params}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_sketch_params::doc}}\index{get\_sketch\_params() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_sketch_params:matplotlib.axes.Axes.get_sketch_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_snap} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_snap:matplotlib-axes-axes-get-snap}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_snap::doc}}\index{get\_snap() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_snap:matplotlib.axes.Axes.get_snap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_transform} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_transform:matplotlib-axes-axes-get-transform}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_transform::doc}}\index{get\_transform() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_transform:matplotlib.axes.Axes.get_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_url} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_url:matplotlib-axes-axes-get-url}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_url::doc}}\index{get\_url() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_url:matplotlib.axes.Axes.get_url}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_visible} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_visible:matplotlib-axes-axes-get-visible}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_visible::doc}}\index{get\_visible() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_visible:matplotlib.axes.Axes.get_visible}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_zorder} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_zorder:matplotlib-axes-axes-get-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_zorder::doc}}\index{get\_zorder() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_zorder:matplotlib.axes.Axes.get_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \subsection{matplotlib.axes.Axes.axes} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axes:matplotlib-axes-axes-axes}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axes::doc}}\index{axes (matplotlib.axes.Axes attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.axes:matplotlib.axes.Axes.axes}}\pysigline{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \subsection{matplotlib.axes.Axes.set\_figure} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_figure:matplotlib-axes-axes-set-figure}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_figure::doc}}\index{set\_figure() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.set_figure:matplotlib.axes.Axes.set_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} for this {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_figure} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_figure:matplotlib-axes-axes-get-figure}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_figure::doc}}\index{get\_figure() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_figure:matplotlib.axes.Axes.get_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \section{Artist Methods} \label{\detokenize{api/axes_api:artist-methods}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.remove:matplotlib.axes.Axes.remove}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.remove}}}}} & Remove the artist from the figure if possible. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.is_transform_set:matplotlib.axes.Axes.is_transform_set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.is\_transform\_set}}}}} & Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axes.Axes.remove} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.remove:matplotlib-axes-axes-remove}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.remove::doc}}\index{remove() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.remove:matplotlib.axes.Axes.remove}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \subsection{matplotlib.axes.Axes.is\_transform\_set} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.is_transform_set:matplotlib-axes-axes-is-transform-set}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.is_transform_set::doc}}\index{is\_transform\_set() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.is_transform_set:matplotlib.axes.Axes.is_transform_set}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \section{Projection} \label{\detokenize{api/axes_api:projection}} Methods used by {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} that must be overridden for non-rectilinear Axes. \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.name:matplotlib.axes.Axes.name}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.name}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xaxis_transform:matplotlib.axes.Axes.get_xaxis_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_xaxis\_transform}}}}} & Get the transformation used for drawing x-axis labels, ticks and gridlines. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yaxis_transform:matplotlib.axes.Axes.get_yaxis_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_yaxis\_transform}}}}} & Get the transformation used for drawing y-axis labels, ticks and gridlines. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_data_ratio:matplotlib.axes.Axes.get_data_ratio}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_data\_ratio}}}}} & Returns the aspect ratio of the raw data. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_data_ratio_log:matplotlib.axes.Axes.get_data_ratio_log}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_data\_ratio\_log}}}}} & Returns the aspect ratio of the raw data in log scale. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xaxis_text1_transform:matplotlib.axes.Axes.get_xaxis_text1_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_xaxis\_text1\_transform}}}}} & Get the transformation used for drawing x-axis labels, which will add the given amount of padding (in points) between the axes and the label. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xaxis_text2_transform:matplotlib.axes.Axes.get_xaxis_text2_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_xaxis\_text2\_transform}}}}} & Get the transformation used for drawing the secondary x-axis labels, which will add the given amount of padding (in points) between the axes and the label. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yaxis_text1_transform:matplotlib.axes.Axes.get_yaxis_text1_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_yaxis\_text1\_transform}}}}} & Get the transformation used for drawing y-axis labels, which will add the given amount of padding (in points) between the axes and the label. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yaxis_text2_transform:matplotlib.axes.Axes.get_yaxis_text2_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_yaxis\_text2\_transform}}}}} & Get the transformation used for drawing the secondary y-axis labels, which will add the given amount of padding (in points) between the axes and the label. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axes.Axes.name} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.name:matplotlib-axes-axes-name}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.name::doc}}\index{name (matplotlib.axes.Axes attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.name:matplotlib.axes.Axes.name}}\pysigline{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{name}}\sphinxbfcode{\sphinxupquote{ = 'rectilinear'}}} \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_xaxis\_transform} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xaxis_transform:matplotlib-axes-axes-get-xaxis-transform}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xaxis_transform::doc}}\index{get\_xaxis\_transform() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xaxis_transform:matplotlib.axes.Axes.get_xaxis_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_xaxis\_transform}}}{\emph{which='grid'}}{} Get the transformation used for drawing x-axis labels, ticks and gridlines. The x-direction is in data coordinates and the y-direction is in axis coordinates. \begin{sphinxadmonition}{note}{Note:} This transformation is primarily used by the {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations. \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_yaxis\_transform} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yaxis_transform:matplotlib-axes-axes-get-yaxis-transform}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yaxis_transform::doc}}\index{get\_yaxis\_transform() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yaxis_transform:matplotlib.axes.Axes.get_yaxis_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_yaxis\_transform}}}{\emph{which='grid'}}{} Get the transformation used for drawing y-axis labels, ticks and gridlines. The x-direction is in axis coordinates and the y-direction is in data coordinates. \begin{sphinxadmonition}{note}{Note:} This transformation is primarily used by the {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations. \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_data\_ratio} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_data_ratio:matplotlib-axes-axes-get-data-ratio}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_data_ratio::doc}}\index{get\_data\_ratio() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_data_ratio:matplotlib.axes.Axes.get_data_ratio}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_data\_ratio}}}{}{} Returns the aspect ratio of the raw data. This method is intended to be overridden by new projection types. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_data\_ratio\_log} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_data_ratio_log:matplotlib-axes-axes-get-data-ratio-log}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_data_ratio_log::doc}}\index{get\_data\_ratio\_log() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_data_ratio_log:matplotlib.axes.Axes.get_data_ratio_log}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_data\_ratio\_log}}}{}{} Returns the aspect ratio of the raw data in log scale. Will be used when both axis scales are in log. \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_xaxis\_text1\_transform} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xaxis_text1_transform:matplotlib-axes-axes-get-xaxis-text1-transform}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xaxis_text1_transform::doc}}\index{get\_xaxis\_text1\_transform() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xaxis_text1_transform:matplotlib.axes.Axes.get_xaxis_text1_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_xaxis\_text1\_transform}}}{\emph{pad\_points}}{} Get the transformation used for drawing x-axis labels, which will add the given amount of padding (in points) between the axes and the label. The x-direction is in data coordinates and the y-direction is in axis coordinates. Returns a 3-tuple of the form: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{transform}\PYG{p}{,} \PYG{n}{valign}\PYG{p}{,} \PYG{n}{halign}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxstyleemphasis{valign} and \sphinxstyleemphasis{halign} are requested alignments for the text. \begin{sphinxadmonition}{note}{Note:} This transformation is primarily used by the {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations. \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_xaxis\_text2\_transform} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xaxis_text2_transform:matplotlib-axes-axes-get-xaxis-text2-transform}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xaxis_text2_transform::doc}}\index{get\_xaxis\_text2\_transform() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xaxis_text2_transform:matplotlib.axes.Axes.get_xaxis_text2_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_xaxis\_text2\_transform}}}{\emph{pad\_points}}{} Get the transformation used for drawing the secondary x-axis labels, which will add the given amount of padding (in points) between the axes and the label. The x-direction is in data coordinates and the y-direction is in axis coordinates. Returns a 3-tuple of the form: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{transform}\PYG{p}{,} \PYG{n}{valign}\PYG{p}{,} \PYG{n}{halign}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxstyleemphasis{valign} and \sphinxstyleemphasis{halign} are requested alignments for the text. \begin{sphinxadmonition}{note}{Note:} This transformation is primarily used by the {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations. \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_yaxis\_text1\_transform} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yaxis_text1_transform:matplotlib-axes-axes-get-yaxis-text1-transform}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yaxis_text1_transform::doc}}\index{get\_yaxis\_text1\_transform() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yaxis_text1_transform:matplotlib.axes.Axes.get_yaxis_text1_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_yaxis\_text1\_transform}}}{\emph{pad\_points}}{} Get the transformation used for drawing y-axis labels, which will add the given amount of padding (in points) between the axes and the label. The x-direction is in axis coordinates and the y-direction is in data coordinates. Returns a 3-tuple of the form: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{transform}\PYG{p}{,} \PYG{n}{valign}\PYG{p}{,} \PYG{n}{halign}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxstyleemphasis{valign} and \sphinxstyleemphasis{halign} are requested alignments for the text. \begin{sphinxadmonition}{note}{Note:} This transformation is primarily used by the {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations. \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_yaxis\_text2\_transform} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yaxis_text2_transform:matplotlib-axes-axes-get-yaxis-text2-transform}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yaxis_text2_transform::doc}}\index{get\_yaxis\_text2\_transform() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yaxis_text2_transform:matplotlib.axes.Axes.get_yaxis_text2_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_yaxis\_text2\_transform}}}{\emph{pad\_points}}{} Get the transformation used for drawing the secondary y-axis labels, which will add the given amount of padding (in points) between the axes and the label. The x-direction is in axis coordinates and the y-direction is in data coordinates. Returns a 3-tuple of the form: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{transform}\PYG{p}{,} \PYG{n}{valign}\PYG{p}{,} \PYG{n}{halign}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxstyleemphasis{valign} and \sphinxstyleemphasis{halign} are requested alignments for the text. \begin{sphinxadmonition}{note}{Note:} This transformation is primarily used by the {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations. \end{sphinxadmonition} \end{fulllineitems} \section{Other} \label{\detokenize{api/axes_api:other}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.zorder:matplotlib.axes.Axes.zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.zorder}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.aname:matplotlib.axes.Axes.aname}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.aname}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_default_bbox_extra_artists:matplotlib.axes.Axes.get_default_bbox_extra_artists}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_default\_bbox\_extra\_artists}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_transformed_clip_path_and_affine:matplotlib.axes.Axes.get_transformed_clip_path_and_affine}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.get\_transformed\_clip\_path\_and\_affine}}}}} & Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.has_data:matplotlib.axes.Axes.has_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.has\_data}}}}} & Return \sphinxstyleemphasis{True} if any artists have been added to axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hold:matplotlib.axes.Axes.hold}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.hold}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.ishold:matplotlib.axes.Axes.ishold}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.ishold}}}}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axes.Axes.zorder} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.zorder:matplotlib-axes-axes-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.zorder::doc}}\index{zorder (matplotlib.axes.Axes attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.zorder:matplotlib.axes.Axes.zorder}}\pysigline{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \subsection{matplotlib.axes.Axes.aname} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.aname:matplotlib-axes-axes-aname}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.aname::doc}}\index{aname (matplotlib.axes.Axes attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.aname:matplotlib.axes.Axes.aname}}\pysigline{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Axes'}}} \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_default\_bbox\_extra\_artists} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_default_bbox_extra_artists:matplotlib-axes-axes-get-default-bbox-extra-artists}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_default_bbox_extra_artists::doc}}\index{get\_default\_bbox\_extra\_artists() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_default_bbox_extra_artists:matplotlib.axes.Axes.get_default_bbox_extra_artists}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_default\_bbox\_extra\_artists}}}{}{}~ \end{fulllineitems} \subsection{matplotlib.axes.Axes.get\_transformed\_clip\_path\_and\_affine} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_transformed_clip_path_and_affine:matplotlib-axes-axes-get-transformed-clip-path-and-affine}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_transformed_clip_path_and_affine::doc}}\index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.get_transformed_clip_path_and_affine:matplotlib.axes.Axes.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \subsection{matplotlib.axes.Axes.has\_data} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.has_data:matplotlib-axes-axes-has-data}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.has_data::doc}}\index{has\_data() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.has_data:matplotlib.axes.Axes.has_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{has\_data}}}{}{} Return \sphinxstyleemphasis{True} if any artists have been added to axes. This should not be used to determine whether the \sphinxstyleemphasis{dataLim} need to be updated, and may not actually be useful for anything. \end{fulllineitems} \subsection{matplotlib.axes.Axes.hold} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.hold:matplotlib-axes-axes-hold}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.hold::doc}}\index{hold() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.hold:matplotlib.axes.Axes.hold}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{hold}}}{\emph{b=None}}{}~ \DUrole{versionmodified}{Deprecated since version 2.0: }axes.hold is deprecated. See the API Changes document (\sphinxurl{http://matplotlib.org/api/api\_changes.html}) for more details. Set the hold state. The \sphinxcode{\sphinxupquote{hold}} mechanism is deprecated and will be removed in v3.0. The behavior will remain consistent with the long-time default value of True. If \sphinxstyleemphasis{hold} is \sphinxstyleemphasis{None} (default), toggle the \sphinxstyleemphasis{hold} state. Else set the \sphinxstyleemphasis{hold} state to boolean value \sphinxstyleemphasis{b}. Examples: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} toggle hold} \PYG{n}{hold}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} turn hold on} \PYG{n}{hold}\PYG{p}{(}\PYG{k+kc}{True}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} turn hold off} \PYG{n}{hold}\PYG{p}{(}\PYG{k+kc}{False}\PYG{p}{)} \end{sphinxVerbatim} When hold is \sphinxstyleemphasis{True}, subsequent plot commands will be added to the current axes. When hold is \sphinxstyleemphasis{False}, the current axes and figure will be cleared on the next plot command \end{fulllineitems} \subsection{matplotlib.axes.Axes.ishold} \label{\detokenize{api/_as_gen/matplotlib.axes.Axes.ishold:matplotlib-axes-axes-ishold}}\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.ishold::doc}}\index{ishold() (matplotlib.axes.Axes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axes.Axes.ishold:matplotlib.axes.Axes.ishold}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axes.}}\sphinxbfcode{\sphinxupquote{ishold}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.0: }The ishold function was deprecated in version 2.0. return the HOLD status of the axes \begin{quote} The {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hold:matplotlib.axes.Axes.hold}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hold}}}}} mechanism is deprecated and will be removed in v3.0. \end{quote} \end{fulllineitems} \section{Inheritance} \label{\detokenize{api/axes_api:inheritance}} \sphinxincludegraphics[]{inheritance-2b54255a4c8166cf38de229e1c3e4c4c48081130.pdf} \chapter{axis and tick API} \label{\detokenize{api/axis_api:axis-and-tick-api}}\label{\detokenize{api/axis_api::doc}} \begin{sphinxShadowBox} \sphinxstyletopictitle{Table of Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{api/axis_api:id1}}{\hyperref[\detokenize{api/axis_api:inheritance}]{\sphinxcrossref{Inheritance}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id2}}{\hyperref[\detokenize{api/axis_api:axis-objects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}} objects}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{api/axis_api:id3}}{\hyperref[\detokenize{api/axis_api:formatters-and-locators}]{\sphinxcrossref{Formatters and Locators}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id4}}{\hyperref[\detokenize{api/axis_api:axis-label}]{\sphinxcrossref{Axis Label}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id5}}{\hyperref[\detokenize{api/axis_api:ticks-tick-labels-and-offset-text}]{\sphinxcrossref{Ticks, tick labels and Offset text}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id6}}{\hyperref[\detokenize{api/axis_api:data-and-view-intervals}]{\sphinxcrossref{Data and view intervals}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id7}}{\hyperref[\detokenize{api/axis_api:rendering-helpers}]{\sphinxcrossref{Rendering helpers}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id8}}{\hyperref[\detokenize{api/axis_api:interactive}]{\sphinxcrossref{Interactive}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id9}}{\hyperref[\detokenize{api/axis_api:units}]{\sphinxcrossref{Units}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id10}}{\hyperref[\detokenize{api/axis_api:incremental-navigation}]{\sphinxcrossref{Incremental navigation}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id11}}{\hyperref[\detokenize{api/axis_api:yaxis-specific}]{\sphinxcrossref{YAxis Specific}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id12}}{\hyperref[\detokenize{api/axis_api:xaxis-specific}]{\sphinxcrossref{XAxis Specific}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id13}}{\hyperref[\detokenize{api/axis_api:other}]{\sphinxcrossref{Other}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id14}}{\hyperref[\detokenize{api/axis_api:discouraged}]{\sphinxcrossref{Discouraged}}} \end{itemize} \item {} \phantomsection\label{\detokenize{api/axis_api:id15}}{\hyperref[\detokenize{api/axis_api:tick-objects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick}} objects}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id16}}{\hyperref[\detokenize{api/axis_api:common-and-inherited-methods}]{\sphinxcrossref{Common and inherited methods}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{api/axis_api:id17}}{\hyperref[\detokenize{api/axis_api:xtick}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick}}}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id18}}{\hyperref[\detokenize{api/axis_api:ytick}]{\sphinxcrossref{YTick}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id19}}{\hyperref[\detokenize{api/axis_api:yaxis}]{\sphinxcrossref{YAxis}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id20}}{\hyperref[\detokenize{api/axis_api:xaxis}]{\sphinxcrossref{XAxis}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id21}}{\hyperref[\detokenize{api/axis_api:inherited-from-artist}]{\sphinxcrossref{Inherited from artist}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{api/axis_api:id22}}{\hyperref[\detokenize{api/axis_api:ticks}]{\sphinxcrossref{Ticks}}} \item {} \phantomsection\label{\detokenize{api/axis_api:id23}}{\hyperref[\detokenize{api/axis_api:axis}]{\sphinxcrossref{Axis}}} \end{itemize} \end{itemize} \end{itemize} \end{sphinxShadowBox} \phantomsection\label{\detokenize{api/axis_api:module-matplotlib.axis}}\index{matplotlib.axis (module)} Classes for the ticks and x and y axis \section{Inheritance} \label{\detokenize{api/axis_api:inheritance}} \sphinxincludegraphics[]{inheritance-569ee9a512bf43cb52de34403392f15a75279e27.pdf} \section{\sphinxstyleliteralintitle{\sphinxupquote{Axis}} objects} \label{\detokenize{api/axis_api:axis-objects}}\index{Axis (class in matplotlib.axis)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/axis_api:matplotlib.axis.Axis}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.axis.}}\sphinxbfcode{\sphinxupquote{Axis}}}{\emph{axes}, \emph{pickradius=15}}{} Public attributes \begin{itemize} \item {} \sphinxcode{\sphinxupquote{axes.transData}} - transform data coords to display coords \item {} \sphinxcode{\sphinxupquote{axes.transAxes}} - transform axis coords to display coords \item {} \sphinxcode{\sphinxupquote{labelpad}} - number of points between the axis and its label \end{itemize} Init the axis with the parent Axes instance \end{fulllineitems} \index{XAxis (class in matplotlib.axis)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/axis_api:matplotlib.axis.XAxis}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.axis.}}\sphinxbfcode{\sphinxupquote{XAxis}}}{\emph{axes}, \emph{pickradius=15}}{} Init the axis with the parent Axes instance \end{fulllineitems} \index{YAxis (class in matplotlib.axis)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/axis_api:matplotlib.axis.YAxis}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.axis.}}\sphinxbfcode{\sphinxupquote{YAxis}}}{\emph{axes}, \emph{pickradius=15}}{} Init the axis with the parent Axes instance \end{fulllineitems} \index{Ticker (class in matplotlib.axis)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/axis_api:matplotlib.axis.Ticker}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.axis.}}\sphinxbfcode{\sphinxupquote{Ticker}}}~ \end{fulllineitems} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.cla:matplotlib.axis.Axis.cla}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.cla}}}}} & clear the current axis \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_scale:matplotlib.axis.Axis.get_scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_scale}}}}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axis.Axis.cla} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.cla:matplotlib-axis-axis-cla}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.cla::doc}}\index{cla() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.cla:matplotlib.axis.Axis.cla}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{cla}}}{}{} clear the current axis \end{fulllineitems} \subsection{matplotlib.axis.Axis.get\_scale} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_scale:matplotlib-axis-axis-get-scale}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_scale::doc}}\index{get\_scale() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_scale:matplotlib.axis.Axis.get_scale}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_scale}}}{}{}~ \end{fulllineitems} \subsection{Formatters and Locators} \label{\detokenize{api/axis_api:formatters-and-locators}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_major_formatter:matplotlib.axis.Axis.get_major_formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_major\_formatter}}}}} & Get the formatter of the major ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_major_locator:matplotlib.axis.Axis.get_major_locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_major\_locator}}}}} & Get the locator of the major ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minor_formatter:matplotlib.axis.Axis.get_minor_formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_minor\_formatter}}}}} & Get the formatter of the minor ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minor_locator:matplotlib.axis.Axis.get_minor_locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_minor\_locator}}}}} & Get the locator of the minor ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_major_formatter:matplotlib.axis.Axis.set_major_formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_major\_formatter}}}}} & Set the formatter of the major ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_major_locator:matplotlib.axis.Axis.set_major_locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_major\_locator}}}}} & Set the locator of the major ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_minor_formatter:matplotlib.axis.Axis.set_minor_formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_minor\_formatter}}}}} & Set the formatter of the minor ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_minor_locator:matplotlib.axis.Axis.set_minor_locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_minor\_locator}}}}} & Set the locator of the minor ticker \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axis.Axis.get\_major\_formatter} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_major_formatter:matplotlib-axis-axis-get-major-formatter}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_major_formatter::doc}}\index{get\_major\_formatter() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_major_formatter:matplotlib.axis.Axis.get_major_formatter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_major\_formatter}}}{}{} Get the formatter of the major ticker \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_major\_locator} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_major_locator:matplotlib-axis-axis-get-major-locator}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_major_locator::doc}}\index{get\_major\_locator() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_major_locator:matplotlib.axis.Axis.get_major_locator}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_major\_locator}}}{}{} Get the locator of the major ticker \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_minor\_formatter} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minor_formatter:matplotlib-axis-axis-get-minor-formatter}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minor_formatter::doc}}\index{get\_minor\_formatter() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minor_formatter:matplotlib.axis.Axis.get_minor_formatter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_minor\_formatter}}}{}{} Get the formatter of the minor ticker \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_minor\_locator} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minor_locator:matplotlib-axis-axis-get-minor-locator}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minor_locator::doc}}\index{get\_minor\_locator() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minor_locator:matplotlib.axis.Axis.get_minor_locator}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_minor\_locator}}}{}{} Get the locator of the minor ticker \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.set\_major\_formatter} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_major_formatter:matplotlib-axis-axis-set-major-formatter}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_major_formatter::doc}}\index{set\_major\_formatter() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_major_formatter:matplotlib.axis.Axis.set_major_formatter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_major\_formatter}}}{\emph{formatter}}{} Set the formatter of the major ticker ACCEPTS: A {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Formatter}}}}} instance \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.set\_major\_locator} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_major_locator:matplotlib-axis-axis-set-major-locator}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_major_locator::doc}}\index{set\_major\_locator() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_major_locator:matplotlib.axis.Axis.set_major_locator}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_major\_locator}}}{\emph{locator}}{} Set the locator of the major ticker ACCEPTS: a {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Locator}}}}} instance \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.set\_minor\_formatter} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_minor_formatter:matplotlib-axis-axis-set-minor-formatter}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_minor_formatter::doc}}\index{set\_minor\_formatter() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_minor_formatter:matplotlib.axis.Axis.set_minor_formatter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_minor\_formatter}}}{\emph{formatter}}{} Set the formatter of the minor ticker ACCEPTS: A {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Formatter}}}}} instance \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.set\_minor\_locator} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_minor_locator:matplotlib-axis-axis-set-minor-locator}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_minor_locator::doc}}\index{set\_minor\_locator() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_minor_locator:matplotlib.axis.Axis.set_minor_locator}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_minor\_locator}}}{\emph{locator}}{} Set the locator of the minor ticker ACCEPTS: a {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Locator}}}}} instance \end{fulllineitems} \subsection{Axis Label} \label{\detokenize{api/axis_api:axis-label}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_label_coords:matplotlib.axis.Axis.set_label_coords}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_label\_coords}}}}} & Set the coordinates of the label. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_label_position:matplotlib.axis.Axis.set_label_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_label\_position}}}}} & Set the label position (top or bottom) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_label_text:matplotlib.axis.Axis.set_label_text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_label\_text}}}}} & Sets the text value of the axis label \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_label_position:matplotlib.axis.Axis.get_label_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_label\_position}}}}} & Return the label position (top or bottom) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_label_text:matplotlib.axis.Axis.get_label_text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_label\_text}}}}} & Get the text of the label \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axis.Axis.set\_label\_coords} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_label_coords:matplotlib-axis-axis-set-label-coords}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_label_coords::doc}}\index{set\_label\_coords() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_label_coords:matplotlib.axis.Axis.set_label_coords}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_label\_coords}}}{\emph{x}, \emph{y}, \emph{transform=None}}{} Set the coordinates of the label. By default, the x coordinate of the y label is determined by the tick label bounding boxes, but this can lead to poor alignment of multiple ylabels if there are multiple axes. Ditto for the y coordinate of the x label. You can also specify the coordinate system of the label with the transform. If None, the default coordinate system will be the axes coordinate system (0,0) is (left,bottom), (0.5, 0.5) is middle, etc \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.set\_label\_position} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_label_position:matplotlib-axis-axis-set-label-position}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_label_position::doc}}\index{set\_label\_position() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_label_position:matplotlib.axis.Axis.set_label_position}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_label\_position}}}{\emph{position}}{} Set the label position (top or bottom) ACCEPTS: {[} ‘top’ \textbar{} ‘bottom’ {]} \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.set\_label\_text} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_label_text:matplotlib-axis-axis-set-label-text}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_label_text::doc}}\index{set\_label\_text() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_label_text:matplotlib.axis.Axis.set_label_text}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_label\_text}}}{\emph{label}, \emph{fontdict=None}, \emph{**kwargs}}{} Sets the text value of the axis label ACCEPTS: A string value for the label \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_label\_position} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_label_position:matplotlib-axis-axis-get-label-position}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_label_position::doc}}\index{get\_label\_position() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_label_position:matplotlib.axis.Axis.get_label_position}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_label\_position}}}{}{} Return the label position (top or bottom) \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_label\_text} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_label_text:matplotlib-axis-axis-get-label-text}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_label_text::doc}}\index{get\_label\_text() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_label_text:matplotlib.axis.Axis.get_label_text}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_label\_text}}}{}{} Get the text of the label \end{fulllineitems} \subsection{Ticks, tick labels and Offset text} \label{\detokenize{api/axis_api:ticks-tick-labels-and-offset-text}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_major_ticks:matplotlib.axis.Axis.get_major_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_major\_ticks}}}}} & get the tick instances; grow as necessary \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_majorticklabels:matplotlib.axis.Axis.get_majorticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_majorticklabels}}}}} & Return a list of Text instances for the major ticklabels \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_majorticklines:matplotlib.axis.Axis.get_majorticklines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_majorticklines}}}}} & Return the major tick lines as a list of Line2D instances \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_majorticklocs:matplotlib.axis.Axis.get_majorticklocs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_majorticklocs}}}}} & Get the major tick locations in data coordinates as a numpy array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minor_ticks:matplotlib.axis.Axis.get_minor_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_minor\_ticks}}}}} & get the minor tick instances; grow as necessary \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minorticklabels:matplotlib.axis.Axis.get_minorticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_minorticklabels}}}}} & Return a list of Text instances for the minor ticklabels \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minorticklines:matplotlib.axis.Axis.get_minorticklines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_minorticklines}}}}} & Return the minor tick lines as a list of Line2D instances \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minorticklocs:matplotlib.axis.Axis.get_minorticklocs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_minorticklocs}}}}} & Get the minor tick locations in data coordinates as a numpy array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_offset_text:matplotlib.axis.Axis.get_offset_text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_offset\_text}}}}} & Return the axis offsetText as a Text instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_tick_padding:matplotlib.axis.Axis.get_tick_padding}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_tick\_padding}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_ticklabels:matplotlib.axis.Axis.get_ticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_ticklabels}}}}} & Get the x tick labels as a list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_ticklines:matplotlib.axis.Axis.get_ticklines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_ticklines}}}}} & Return the tick lines as a list of Line2D instances \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_ticklocs:matplotlib.axis.Axis.get_ticklocs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_ticklocs}}}}} & Get the tick locations in data coordinates as a numpy array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_gridlines:matplotlib.axis.Axis.get_gridlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_gridlines}}}}} & Return the grid lines as a list of Line2D instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.grid:matplotlib.axis.Axis.grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.grid}}}}} & Set the axis grid on or off; b is a boolean. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.iter_ticks:matplotlib.axis.Axis.iter_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.iter\_ticks}}}}} & Iterate through all of the major and minor ticks. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_tick_params:matplotlib.axis.Axis.set_tick_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_tick\_params}}}}} & Set appearance parameters for ticks, ticklabels, and gridlines. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.axis_date:matplotlib.axis.Axis.axis_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.axis\_date}}}}} & Sets up x-axis ticks and labels that treat the x data as dates. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axis.Axis.get\_major\_ticks} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_major_ticks:matplotlib-axis-axis-get-major-ticks}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_major_ticks::doc}}\index{get\_major\_ticks() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_major_ticks:matplotlib.axis.Axis.get_major_ticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_major\_ticks}}}{\emph{numticks=None}}{} get the tick instances; grow as necessary \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_majorticklabels} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_majorticklabels:matplotlib-axis-axis-get-majorticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_majorticklabels::doc}}\index{get\_majorticklabels() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_majorticklabels:matplotlib.axis.Axis.get_majorticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_majorticklabels}}}{}{} Return a list of Text instances for the major ticklabels \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_majorticklines} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_majorticklines:matplotlib-axis-axis-get-majorticklines}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_majorticklines::doc}}\index{get\_majorticklines() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_majorticklines:matplotlib.axis.Axis.get_majorticklines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_majorticklines}}}{}{} Return the major tick lines as a list of Line2D instances \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_majorticklocs} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_majorticklocs:matplotlib-axis-axis-get-majorticklocs}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_majorticklocs::doc}}\index{get\_majorticklocs() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_majorticklocs:matplotlib.axis.Axis.get_majorticklocs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_majorticklocs}}}{}{} Get the major tick locations in data coordinates as a numpy array \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_minor\_ticks} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minor_ticks:matplotlib-axis-axis-get-minor-ticks}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minor_ticks::doc}}\index{get\_minor\_ticks() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minor_ticks:matplotlib.axis.Axis.get_minor_ticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_minor\_ticks}}}{\emph{numticks=None}}{} get the minor tick instances; grow as necessary \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_minorticklabels} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minorticklabels:matplotlib-axis-axis-get-minorticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minorticklabels::doc}}\index{get\_minorticklabels() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minorticklabels:matplotlib.axis.Axis.get_minorticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_minorticklabels}}}{}{} Return a list of Text instances for the minor ticklabels \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_minorticklines} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minorticklines:matplotlib-axis-axis-get-minorticklines}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minorticklines::doc}}\index{get\_minorticklines() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minorticklines:matplotlib.axis.Axis.get_minorticklines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_minorticklines}}}{}{} Return the minor tick lines as a list of Line2D instances \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_minorticklocs} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minorticklocs:matplotlib-axis-axis-get-minorticklocs}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minorticklocs::doc}}\index{get\_minorticklocs() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minorticklocs:matplotlib.axis.Axis.get_minorticklocs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_minorticklocs}}}{}{} Get the minor tick locations in data coordinates as a numpy array \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_offset\_text} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_offset_text:matplotlib-axis-axis-get-offset-text}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_offset_text::doc}}\index{get\_offset\_text() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_offset_text:matplotlib.axis.Axis.get_offset_text}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_offset\_text}}}{}{} Return the axis offsetText as a Text instance \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_tick\_padding} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_tick_padding:matplotlib-axis-axis-get-tick-padding}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_tick_padding::doc}}\index{get\_tick\_padding() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_tick_padding:matplotlib.axis.Axis.get_tick_padding}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_tick\_padding}}}{}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_ticklabels} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_ticklabels:matplotlib-axis-axis-get-ticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_ticklabels::doc}}\index{get\_ticklabels() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_ticklabels:matplotlib.axis.Axis.get_ticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_ticklabels}}}{\emph{minor=False}, \emph{which=None}}{} Get the x tick labels as a list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{minor}}] \leavevmode{[}bool{]} If True return the minor ticklabels, else return the major ticklabels \item[{\sphinxstylestrong{which}}] \leavevmode{[}None, (‘minor’, ‘major’, ‘both’){]} Overrides \sphinxcode{\sphinxupquote{minor}}. Selects which ticklabels to return \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ret}}] \leavevmode{[}list{]} List of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_ticklines} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_ticklines:matplotlib-axis-axis-get-ticklines}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_ticklines::doc}}\index{get\_ticklines() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_ticklines:matplotlib.axis.Axis.get_ticklines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_ticklines}}}{\emph{minor=False}}{} Return the tick lines as a list of Line2D instances \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_ticklocs} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_ticklocs:matplotlib-axis-axis-get-ticklocs}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_ticklocs::doc}}\index{get\_ticklocs() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_ticklocs:matplotlib.axis.Axis.get_ticklocs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_ticklocs}}}{\emph{minor=False}}{} Get the tick locations in data coordinates as a numpy array \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_gridlines} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_gridlines:matplotlib-axis-axis-get-gridlines}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_gridlines::doc}}\index{get\_gridlines() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_gridlines:matplotlib.axis.Axis.get_gridlines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_gridlines}}}{}{} Return the grid lines as a list of Line2D instance \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.grid} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.grid:matplotlib-axis-axis-grid}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.grid::doc}}\index{grid() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.grid:matplotlib.axis.Axis.grid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{grid}}}{\emph{b=None}, \emph{which='major'}, \emph{**kwargs}}{} Set the axis grid on or off; b is a boolean. Use \sphinxstyleemphasis{which} = ‘major’ \textbar{} ‘minor’ \textbar{} ‘both’ to set the grid for major or minor ticks. If \sphinxstyleemphasis{b} is \sphinxstyleemphasis{None} and len(kwargs)==0, toggle the grid state. If \sphinxstyleemphasis{kwargs} are supplied, it is assumed you want the grid on and \sphinxstyleemphasis{b} will be set to True. \sphinxstyleemphasis{kwargs} are used to set the line properties of the grids, e.g., \begin{quote} xax.grid(color=’r’, linestyle=’-‘, linewidth=2) \end{quote} \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.iter\_ticks} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.iter_ticks:matplotlib-axis-axis-iter-ticks}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.iter_ticks::doc}}\index{iter\_ticks() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.iter_ticks:matplotlib.axis.Axis.iter_ticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{iter\_ticks}}}{}{} Iterate through all of the major and minor ticks. \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.set\_tick\_params} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_tick_params:matplotlib-axis-axis-set-tick-params}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_tick_params::doc}}\index{set\_tick\_params() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_tick_params:matplotlib.axis.Axis.set_tick_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_tick\_params}}}{\emph{which='major'}, \emph{reset=False}, \emph{**kw}}{} Set appearance parameters for ticks, ticklabels, and gridlines. For documentation of keyword arguments, see {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.tick_params:matplotlib.axes.Axes.tick_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.tick\_params()}}}}}. \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.axis\_date} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.axis_date:matplotlib-axis-axis-axis-date}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.axis_date::doc}}\index{axis\_date() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.axis_date:matplotlib.axis.Axis.axis_date}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{axis\_date}}}{\emph{tz=None}}{} Sets up x-axis ticks and labels that treat the x data as dates. \sphinxstyleemphasis{tz} is a \sphinxcode{\sphinxupquote{tzinfo}} instance or a timezone string. This timezone is used to create date labels. \end{fulllineitems} \subsection{Data and view intervals} \label{\detokenize{api/axis_api:data-and-view-intervals}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_data_interval:matplotlib.axis.Axis.get_data_interval}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_data\_interval}}}}} & return the Interval instance for this axis data limits \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_view_interval:matplotlib.axis.Axis.get_view_interval}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_view\_interval}}}}} & return the Interval instance for this axis view limits \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_data_interval:matplotlib.axis.Axis.set_data_interval}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_data\_interval}}}}} & set the axis data limits \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_view_interval:matplotlib.axis.Axis.set_view_interval}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_view\_interval}}}}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axis.Axis.get\_data\_interval} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_data_interval:matplotlib-axis-axis-get-data-interval}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_data_interval::doc}}\index{get\_data\_interval() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_data_interval:matplotlib.axis.Axis.get_data_interval}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_data\_interval}}}{}{} return the Interval instance for this axis data limits \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_view\_interval} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_view_interval:matplotlib-axis-axis-get-view-interval}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_view_interval::doc}}\index{get\_view\_interval() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_view_interval:matplotlib.axis.Axis.get_view_interval}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_view\_interval}}}{}{} return the Interval instance for this axis view limits \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.set\_data\_interval} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_data_interval:matplotlib-axis-axis-set-data-interval}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_data_interval::doc}}\index{set\_data\_interval() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_data_interval:matplotlib.axis.Axis.set_data_interval}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_data\_interval}}}{}{} set the axis data limits \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.set\_view\_interval} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_view_interval:matplotlib-axis-axis-set-view-interval}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_view_interval::doc}}\index{set\_view\_interval() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_view_interval:matplotlib.axis.Axis.set_view_interval}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_view\_interval}}}{\emph{vmin}, \emph{vmax}, \emph{ignore=False}}{}~ \end{fulllineitems} \subsection{Rendering helpers} \label{\detokenize{api/axis_api:rendering-helpers}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minpos:matplotlib.axis.Axis.get_minpos}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_minpos}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_tick_space:matplotlib.axis.Axis.get_tick_space}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_tick\_space}}}}} & Return the estimated number of ticks that can fit on the axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_ticklabel_extents:matplotlib.axis.Axis.get_ticklabel_extents}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_ticklabel\_extents}}}}} & Get the extents of the tick labels on either side of the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_tightbbox:matplotlib.axis.Axis.get_tightbbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_tightbbox}}}}} & Return a bounding box that encloses the axis. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axis.Axis.get\_minpos} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minpos:matplotlib-axis-axis-get-minpos}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minpos::doc}}\index{get\_minpos() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_minpos:matplotlib.axis.Axis.get_minpos}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_minpos}}}{}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_tick\_space} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_tick_space:matplotlib-axis-axis-get-tick-space}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_tick_space::doc}}\index{get\_tick\_space() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_tick_space:matplotlib.axis.Axis.get_tick_space}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_tick\_space}}}{}{} Return the estimated number of ticks that can fit on the axis. \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_ticklabel\_extents} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_ticklabel_extents:matplotlib-axis-axis-get-ticklabel-extents}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_ticklabel_extents::doc}}\index{get\_ticklabel\_extents() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_ticklabel_extents:matplotlib.axis.Axis.get_ticklabel_extents}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_ticklabel\_extents}}}{\emph{renderer}}{} Get the extents of the tick labels on either side of the axes. \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_tightbbox} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_tightbbox:matplotlib-axis-axis-get-tightbbox}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_tightbbox::doc}}\index{get\_tightbbox() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_tightbbox:matplotlib.axis.Axis.get_tightbbox}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_tightbbox}}}{\emph{renderer}}{} Return a bounding box that encloses the axis. It only accounts tick labels, axis label, and offsetText. \end{fulllineitems} \subsection{Interactive} \label{\detokenize{api/axis_api:interactive}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_pickradius:matplotlib.axis.Axis.get_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_pickradius}}}}} & Return the depth of the axis used by the picker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_pickradius:matplotlib.axis.Axis.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_pickradius}}}}} & Set the depth of the axis used by the picker \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axis.Axis.get\_pickradius} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_pickradius:matplotlib-axis-axis-get-pickradius}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_pickradius::doc}}\index{get\_pickradius() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_pickradius:matplotlib.axis.Axis.get_pickradius}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{} Return the depth of the axis used by the picker \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.set\_pickradius} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_pickradius:matplotlib-axis-axis-set-pickradius}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_pickradius::doc}}\index{set\_pickradius() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_pickradius:matplotlib.axis.Axis.set_pickradius}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{pickradius}}{} Set the depth of the axis used by the picker ACCEPTS: a distance in points \end{fulllineitems} \subsection{Units} \label{\detokenize{api/axis_api:units}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.convert_units:matplotlib.axis.Axis.convert_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.convert\_units}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_units:matplotlib.axis.Axis.set_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_units}}}}} & set the units for axis \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_units:matplotlib.axis.Axis.get_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_units}}}}} & return the units for axis \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.update_units:matplotlib.axis.Axis.update_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.update\_units}}}}} & introspect \sphinxstyleemphasis{data} for units converter and update the axis.converter instance if necessary. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axis.Axis.convert\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.convert_units:matplotlib-axis-axis-convert-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.convert_units::doc}}\index{convert\_units() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.convert_units:matplotlib.axis.Axis.convert_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{convert\_units}}}{\emph{x}}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.set\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_units:matplotlib-axis-axis-set-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_units::doc}}\index{set\_units() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_units:matplotlib.axis.Axis.set_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_units}}}{\emph{u}}{} set the units for axis ACCEPTS: a units tag \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_units:matplotlib-axis-axis-get-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_units::doc}}\index{get\_units() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_units:matplotlib.axis.Axis.get_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_units}}}{}{} return the units for axis \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.update\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.update_units:matplotlib-axis-axis-update-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.update_units::doc}}\index{update\_units() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.update_units:matplotlib.axis.Axis.update_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{update\_units}}}{\emph{data}}{} introspect \sphinxstyleemphasis{data} for units converter and update the axis.converter instance if necessary. Return \sphinxstyleemphasis{True} if \sphinxstyleemphasis{data} is registered for unit conversion. \end{fulllineitems} \subsection{Incremental navigation} \label{\detokenize{api/axis_api:incremental-navigation}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.pan:matplotlib.axis.Axis.pan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.pan}}}}} & Pan \sphinxstyleemphasis{numsteps} (can be positive or negative) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.zoom:matplotlib.axis.Axis.zoom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.zoom}}}}} & Zoom in/out on axis; if \sphinxstyleemphasis{direction} is \textgreater{}0 zoom in, else zoom out \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axis.Axis.pan} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.pan:matplotlib-axis-axis-pan}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.pan::doc}}\index{pan() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.pan:matplotlib.axis.Axis.pan}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{pan}}}{\emph{numsteps}}{} Pan \sphinxstyleemphasis{numsteps} (can be positive or negative) \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.zoom} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.zoom:matplotlib-axis-axis-zoom}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.zoom::doc}}\index{zoom() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.zoom:matplotlib.axis.Axis.zoom}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{zoom}}}{\emph{direction}}{} Zoom in/out on axis; if \sphinxstyleemphasis{direction} is \textgreater{}0 zoom in, else zoom out \end{fulllineitems} \subsection{YAxis Specific} \label{\detokenize{api/axis_api:yaxis-specific}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.axis_name:matplotlib.axis.YAxis.axis_name}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.axis\_name}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_text_widths:matplotlib.axis.YAxis.get_text_widths}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_text\_widths}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticks_position:matplotlib.axis.YAxis.get_ticks_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_ticks\_position}}}}} & Return the ticks position (left, right, both or unknown) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_offset_position:matplotlib.axis.YAxis.set_offset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_offset\_position}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_ticks_position:matplotlib.axis.YAxis.set_ticks_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_ticks\_position}}}}} & Set the ticks position (left, right, both, default or none) ‘both’ sets the ticks to appear on both positions, but does not change the tick labels. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.tick_left:matplotlib.axis.YAxis.tick_left}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.tick\_left}}}}} & Move ticks and ticklabels (if present) to the left of the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.tick_right:matplotlib.axis.YAxis.tick_right}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.tick\_right}}}}} & Move ticks and ticklabels (if present) to the right of the axes. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axis.YAxis.axis\_name} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.axis_name:matplotlib-axis-yaxis-axis-name}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.axis_name::doc}}\index{axis\_name (matplotlib.axis.YAxis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.axis_name:matplotlib.axis.YAxis.axis_name}}\pysigline{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{axis\_name}}\sphinxbfcode{\sphinxupquote{ = 'y'}}} \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_text\_widths} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_text_widths:matplotlib-axis-yaxis-get-text-widths}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_text_widths::doc}}\index{get\_text\_widths() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_text_widths:matplotlib.axis.YAxis.get_text_widths}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_text\_widths}}}{\emph{renderer}}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_ticks\_position} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticks_position:matplotlib-axis-yaxis-get-ticks-position}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticks_position::doc}}\index{get\_ticks\_position() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticks_position:matplotlib.axis.YAxis.get_ticks_position}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_ticks\_position}}}{}{} Return the ticks position (left, right, both or unknown) \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_offset\_position} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_offset_position:matplotlib-axis-yaxis-set-offset-position}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_offset_position::doc}}\index{set\_offset\_position() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_offset_position:matplotlib.axis.YAxis.set_offset_position}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_offset\_position}}}{\emph{position}}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_ticks\_position} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_ticks_position:matplotlib-axis-yaxis-set-ticks-position}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_ticks_position::doc}}\index{set\_ticks\_position() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_ticks_position:matplotlib.axis.YAxis.set_ticks_position}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_ticks\_position}}}{\emph{position}}{} Set the ticks position (left, right, both, default or none) ‘both’ sets the ticks to appear on both positions, but does not change the tick labels. ‘default’ resets the tick positions to the default: ticks on both positions, labels at left. ‘none’ can be used if you don’t want any ticks. ‘none’ and ‘both’ affect only the ticks, not the labels. ACCEPTS: {[} ‘left’ \textbar{} ‘right’ \textbar{} ‘both’ \textbar{} ‘default’ \textbar{} ‘none’ {]} \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.tick\_left} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.tick_left:matplotlib-axis-yaxis-tick-left}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.tick_left::doc}}\index{tick\_left() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.tick_left:matplotlib.axis.YAxis.tick_left}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{tick\_left}}}{}{} Move ticks and ticklabels (if present) to the left of the axes. \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.tick\_right} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.tick_right:matplotlib-axis-yaxis-tick-right}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.tick_right::doc}}\index{tick\_right() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.tick_right:matplotlib.axis.YAxis.tick_right}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{tick\_right}}}{}{} Move ticks and ticklabels (if present) to the right of the axes. \end{fulllineitems} \subsection{XAxis Specific} \label{\detokenize{api/axis_api:xaxis-specific}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.axis_name:matplotlib.axis.XAxis.axis_name}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.axis\_name}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_text_heights:matplotlib.axis.XAxis.get_text_heights}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_text\_heights}}}}} & Returns the amount of space one should reserve for text above and below the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticks_position:matplotlib.axis.XAxis.get_ticks_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_ticks\_position}}}}} & Return the ticks position (top, bottom, default or unknown) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_ticks_position:matplotlib.axis.XAxis.set_ticks_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_ticks\_position}}}}} & Set the ticks position (top, bottom, both, default or none) both sets the ticks to appear on both positions, but does not change the tick labels. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.tick_bottom:matplotlib.axis.XAxis.tick_bottom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.tick\_bottom}}}}} & Move ticks and ticklabels (if present) to the bottom of the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.tick_top:matplotlib.axis.XAxis.tick_top}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.tick\_top}}}}} & Move ticks and ticklabels (if present) to the top of the axes. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axis.XAxis.axis\_name} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.axis_name:matplotlib-axis-xaxis-axis-name}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.axis_name::doc}}\index{axis\_name (matplotlib.axis.XAxis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.axis_name:matplotlib.axis.XAxis.axis_name}}\pysigline{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{axis\_name}}\sphinxbfcode{\sphinxupquote{ = 'x'}}} \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_text\_heights} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_text_heights:matplotlib-axis-xaxis-get-text-heights}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_text_heights::doc}}\index{get\_text\_heights() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_text_heights:matplotlib.axis.XAxis.get_text_heights}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_text\_heights}}}{\emph{renderer}}{} Returns the amount of space one should reserve for text above and below the axes. Returns a tuple (above, below) \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_ticks\_position} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticks_position:matplotlib-axis-xaxis-get-ticks-position}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticks_position::doc}}\index{get\_ticks\_position() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticks_position:matplotlib.axis.XAxis.get_ticks_position}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_ticks\_position}}}{}{} Return the ticks position (top, bottom, default or unknown) \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.set\_ticks\_position} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_ticks_position:matplotlib-axis-xaxis-set-ticks-position}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_ticks_position::doc}}\index{set\_ticks\_position() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_ticks_position:matplotlib.axis.XAxis.set_ticks_position}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_ticks\_position}}}{\emph{position}}{} Set the ticks position (top, bottom, both, default or none) both sets the ticks to appear on both positions, but does not change the tick labels. ‘default’ resets the tick positions to the default: ticks on both positions, labels at bottom. ‘none’ can be used if you don’t want any ticks. ‘none’ and ‘both’ affect only the ticks, not the labels. ACCEPTS: {[} ‘top’ \textbar{} ‘bottom’ \textbar{} ‘both’ \textbar{} ‘default’ \textbar{} ‘none’ {]} \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.tick\_bottom} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.tick_bottom:matplotlib-axis-xaxis-tick-bottom}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.tick_bottom::doc}}\index{tick\_bottom() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.tick_bottom:matplotlib.axis.XAxis.tick_bottom}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{tick\_bottom}}}{}{} Move ticks and ticklabels (if present) to the bottom of the axes. \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.tick\_top} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.tick_top:matplotlib-axis-xaxis-tick-top}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.tick_top::doc}}\index{tick\_top() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.tick_top:matplotlib.axis.XAxis.tick_top}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{tick\_top}}}{}{} Move ticks and ticklabels (if present) to the top of the axes. \end{fulllineitems} \subsection{Other} \label{\detokenize{api/axis_api:other}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.OFFSETTEXTPAD:matplotlib.axis.Axis.OFFSETTEXTPAD}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.OFFSETTEXTPAD}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.limit_range_for_scale:matplotlib.axis.Axis.limit_range_for_scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.limit\_range\_for\_scale}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.reset_ticks:matplotlib.axis.Axis.reset_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.reset\_ticks}}}}} & Re-initialize the major and minor Tick lists. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_default_intervals:matplotlib.axis.Axis.set_default_intervals}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_default\_intervals}}}}} & set the default limits for the axis data and view interval if they are not mutated \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_smart_bounds:matplotlib.axis.Axis.get_smart_bounds}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_smart\_bounds}}}}} & get whether the axis has smart bounds \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_smart_bounds:matplotlib.axis.Axis.set_smart_bounds}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_smart\_bounds}}}}} & set the axis to have smart bounds \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axis.Axis.OFFSETTEXTPAD} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.OFFSETTEXTPAD:matplotlib-axis-axis-offsettextpad}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.OFFSETTEXTPAD::doc}}\index{OFFSETTEXTPAD (matplotlib.axis.Axis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.OFFSETTEXTPAD:matplotlib.axis.Axis.OFFSETTEXTPAD}}\pysigline{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{OFFSETTEXTPAD}}\sphinxbfcode{\sphinxupquote{ = 3}}} \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.limit\_range\_for\_scale} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.limit_range_for_scale:matplotlib-axis-axis-limit-range-for-scale}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.limit_range_for_scale::doc}}\index{limit\_range\_for\_scale() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.limit_range_for_scale:matplotlib.axis.Axis.limit_range_for_scale}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{limit\_range\_for\_scale}}}{\emph{vmin}, \emph{vmax}}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.reset\_ticks} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.reset_ticks:matplotlib-axis-axis-reset-ticks}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.reset_ticks::doc}}\index{reset\_ticks() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.reset_ticks:matplotlib.axis.Axis.reset_ticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{reset\_ticks}}}{}{} Re-initialize the major and minor Tick lists. Each list starts with a single fresh Tick. \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.set\_default\_intervals} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_default_intervals:matplotlib-axis-axis-set-default-intervals}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_default_intervals::doc}}\index{set\_default\_intervals() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_default_intervals:matplotlib.axis.Axis.set_default_intervals}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_default\_intervals}}}{}{} set the default limits for the axis data and view interval if they are not mutated \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.get\_smart\_bounds} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_smart_bounds:matplotlib-axis-axis-get-smart-bounds}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_smart_bounds::doc}}\index{get\_smart\_bounds() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_smart_bounds:matplotlib.axis.Axis.get_smart_bounds}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_smart\_bounds}}}{}{} get whether the axis has smart bounds \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.set\_smart\_bounds} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_smart_bounds:matplotlib-axis-axis-set-smart-bounds}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_smart_bounds::doc}}\index{set\_smart\_bounds() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_smart_bounds:matplotlib.axis.Axis.set_smart_bounds}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_smart\_bounds}}}{\emph{value}}{} set the axis to have smart bounds \end{fulllineitems} \subsection{Discouraged} \label{\detokenize{api/axis_api:discouraged}} These methods implicitly use {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.FixedLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FixedLocator}}}}} and {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.FixedFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FixedFormatter}}}}}. They can be convenient, but if not used together may de-couple your tick labels from your data. \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_ticklabels:matplotlib.axis.Axis.set_ticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_ticklabels}}}}} & Set the text values of the tick labels. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_ticks:matplotlib.axis.Axis.set_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_ticks}}}}} & Set the locations of the tick marks from sequence ticks \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axis.Axis.set\_ticklabels} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_ticklabels:matplotlib-axis-axis-set-ticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_ticklabels::doc}}\index{set\_ticklabels() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_ticklabels:matplotlib.axis.Axis.set_ticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_ticklabels}}}{\emph{ticklabels}, \emph{*args}, \emph{**kwargs}}{} Set the text values of the tick labels. Return a list of Text instances. Use \sphinxstyleemphasis{kwarg} \sphinxstyleemphasis{minor=True} to select minor ticks. All other kwargs are used to update the text object properties. As for get\_ticklabels, label1 (left or bottom) is affected for a given tick only if its label1On attribute is True, and similarly for label2. The list of returned label text objects consists of all such label1 objects followed by all such label2 objects. The input \sphinxstyleemphasis{ticklabels} is assumed to match the set of tick locations, regardless of the state of label1On and label2On. ACCEPTS: sequence of strings or Text objects \end{fulllineitems} \subsubsection{matplotlib.axis.Axis.set\_ticks} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_ticks:matplotlib-axis-axis-set-ticks}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_ticks::doc}}\index{set\_ticks() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_ticks:matplotlib.axis.Axis.set_ticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_ticks}}}{\emph{ticks}, \emph{minor=False}}{} Set the locations of the tick marks from sequence ticks ACCEPTS: sequence of floats \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{Tick}} objects} \label{\detokenize{api/axis_api:tick-objects}}\index{Tick (class in matplotlib.axis)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/axis_api:matplotlib.axis.Tick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.axis.}}\sphinxbfcode{\sphinxupquote{Tick}}}{\emph{axes}, \emph{loc}, \emph{label}, \emph{size=None}, \emph{width=None}, \emph{color=None}, \emph{tickdir=None}, \emph{pad=None}, \emph{labelsize=None}, \emph{labelcolor=None}, \emph{zorder=None}, \emph{gridOn=None}, \emph{tick1On=True}, \emph{tick2On=True}, \emph{label1On=True}, \emph{label2On=False}, \emph{major=True}, \emph{labelrotation=0}, \emph{grid\_color=None}, \emph{grid\_linestyle=None}, \emph{grid\_linewidth=None}, \emph{grid\_alpha=None}, \emph{**kw}}{} Abstract base class for the axis ticks, grid lines and labels 1 refers to the bottom of the plot for xticks and the left for yticks 2 refers to the top of the plot for xticks and the right for yticks \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{tick1line}}] \leavevmode{[}Line2D{]} \item[{\sphinxstylestrong{tick2line}}] \leavevmode{[}Line2D{]} \item[{\sphinxstylestrong{gridline}}] \leavevmode{[}Line2D{]} \item[{\sphinxstylestrong{label1}}] \leavevmode{[}Text{]} \item[{\sphinxstylestrong{label2}}] \leavevmode{[}Text{]} \item[{\sphinxstylestrong{gridOn}}] \leavevmode{[}bool{]} Determines whether to draw the tickline. \item[{\sphinxstylestrong{tick1On}}] \leavevmode{[}bool{]} Determines whether to draw the first tickline. \item[{\sphinxstylestrong{tick2On}}] \leavevmode{[}bool{]} Determines whether to draw the second tickline. \item[{\sphinxstylestrong{label1On}}] \leavevmode{[}bool{]} Determines whether to draw the first tick label. \item[{\sphinxstylestrong{label2On}}] \leavevmode{[}bool{]} Determines whether to draw the second tick label. \end{description} \end{description}\end{quote} bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points \end{fulllineitems} \index{XTick (class in matplotlib.axis)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/axis_api:matplotlib.axis.XTick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.axis.}}\sphinxbfcode{\sphinxupquote{XTick}}}{\emph{axes}, \emph{loc}, \emph{label}, \emph{size=None}, \emph{width=None}, \emph{color=None}, \emph{tickdir=None}, \emph{pad=None}, \emph{labelsize=None}, \emph{labelcolor=None}, \emph{zorder=None}, \emph{gridOn=None}, \emph{tick1On=True}, \emph{tick2On=True}, \emph{label1On=True}, \emph{label2On=False}, \emph{major=True}, \emph{labelrotation=0}, \emph{grid\_color=None}, \emph{grid\_linestyle=None}, \emph{grid\_linewidth=None}, \emph{grid\_alpha=None}, \emph{**kw}}{} Contains all the Artists needed to make an x tick - the tick line, the label text and the grid line bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points \end{fulllineitems} \index{YTick (class in matplotlib.axis)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/axis_api:matplotlib.axis.YTick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.axis.}}\sphinxbfcode{\sphinxupquote{YTick}}}{\emph{axes}, \emph{loc}, \emph{label}, \emph{size=None}, \emph{width=None}, \emph{color=None}, \emph{tickdir=None}, \emph{pad=None}, \emph{labelsize=None}, \emph{labelcolor=None}, \emph{zorder=None}, \emph{gridOn=None}, \emph{tick1On=True}, \emph{tick2On=True}, \emph{label1On=True}, \emph{label2On=False}, \emph{major=True}, \emph{labelrotation=0}, \emph{grid\_color=None}, \emph{grid\_linestyle=None}, \emph{grid\_linewidth=None}, \emph{grid\_alpha=None}, \emph{**kw}}{} Contains all the Artists needed to make a Y tick - the tick line, the label text and the grid line bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points \end{fulllineitems} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.apply_tickdir:matplotlib.axis.Tick.apply_tickdir}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.apply\_tickdir}}}}} & Calculate self.\_pad and self.\_tickmarkers \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_loc:matplotlib.axis.Tick.get_loc}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_loc}}}}} & Return the tick location (data coords) as a scalar \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_pad:matplotlib.axis.Tick.get_pad}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_pad}}}}} & Get the value of the tick label pad in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_pad_pixels:matplotlib.axis.Tick.get_pad_pixels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_pad\_pixels}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_tick_padding:matplotlib.axis.Tick.get_tick_padding}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_tick\_padding}}}}} & Get the length of the tick outside of the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_tickdir:matplotlib.axis.Tick.get_tickdir}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_tickdir}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_view_interval:matplotlib.axis.Tick.get_view_interval}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_view\_interval}}}}} & return the view Interval instance for the axis this tick is ticking \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_label1:matplotlib.axis.Tick.set_label1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_label1}}}}} & Set the text of ticklabel \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_label2:matplotlib.axis.Tick.set_label2}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_label2}}}}} & Set the text of ticklabel2 \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_pad:matplotlib.axis.Tick.set_pad}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_pad}}}}} & Set the tick label pad in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.update_position:matplotlib.axis.Tick.update_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.update\_position}}}}} & Set the location of tick in data coords with scalar \sphinxstyleemphasis{loc} \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.axis.Tick.apply\_tickdir} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.apply_tickdir:matplotlib-axis-tick-apply-tickdir}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.apply_tickdir::doc}}\index{apply\_tickdir() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.apply_tickdir:matplotlib.axis.Tick.apply_tickdir}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{apply\_tickdir}}}{\emph{tickdir}}{} Calculate self.\_pad and self.\_tickmarkers \end{fulllineitems} \subsection{matplotlib.axis.Tick.get\_loc} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_loc:matplotlib-axis-tick-get-loc}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_loc::doc}}\index{get\_loc() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_loc:matplotlib.axis.Tick.get_loc}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_loc}}}{}{} Return the tick location (data coords) as a scalar \end{fulllineitems} \subsection{matplotlib.axis.Tick.get\_pad} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_pad:matplotlib-axis-tick-get-pad}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_pad::doc}}\index{get\_pad() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_pad:matplotlib.axis.Tick.get_pad}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_pad}}}{}{} Get the value of the tick label pad in points \end{fulllineitems} \subsection{matplotlib.axis.Tick.get\_pad\_pixels} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_pad_pixels:matplotlib-axis-tick-get-pad-pixels}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_pad_pixels::doc}}\index{get\_pad\_pixels() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_pad_pixels:matplotlib.axis.Tick.get_pad_pixels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_pad\_pixels}}}{}{}~ \end{fulllineitems} \subsection{matplotlib.axis.Tick.get\_tick\_padding} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_tick_padding:matplotlib-axis-tick-get-tick-padding}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_tick_padding::doc}}\index{get\_tick\_padding() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_tick_padding:matplotlib.axis.Tick.get_tick_padding}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_tick\_padding}}}{}{} Get the length of the tick outside of the axes. \end{fulllineitems} \subsection{matplotlib.axis.Tick.get\_tickdir} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_tickdir:matplotlib-axis-tick-get-tickdir}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_tickdir::doc}}\index{get\_tickdir() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_tickdir:matplotlib.axis.Tick.get_tickdir}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_tickdir}}}{}{}~ \end{fulllineitems} \subsection{matplotlib.axis.Tick.get\_view\_interval} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_view_interval:matplotlib-axis-tick-get-view-interval}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_view_interval::doc}}\index{get\_view\_interval() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_view_interval:matplotlib.axis.Tick.get_view_interval}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_view\_interval}}}{}{} return the view Interval instance for the axis this tick is ticking \end{fulllineitems} \subsection{matplotlib.axis.Tick.set\_label1} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_label1:matplotlib-axis-tick-set-label1}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_label1::doc}}\index{set\_label1() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_label1:matplotlib.axis.Tick.set_label1}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_label1}}}{\emph{s}}{} Set the text of ticklabel ACCEPTS: str \end{fulllineitems} \subsection{matplotlib.axis.Tick.set\_label2} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_label2:matplotlib-axis-tick-set-label2}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_label2::doc}}\index{set\_label2() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_label2:matplotlib.axis.Tick.set_label2}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_label2}}}{\emph{s}}{} Set the text of ticklabel2 ACCEPTS: str \end{fulllineitems} \subsection{matplotlib.axis.Tick.set\_pad} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_pad:matplotlib-axis-tick-set-pad}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_pad::doc}}\index{set\_pad() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_pad:matplotlib.axis.Tick.set_pad}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_pad}}}{\emph{val}}{} Set the tick label pad in points ACCEPTS: float \end{fulllineitems} \subsection{matplotlib.axis.Tick.update\_position} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.update_position:matplotlib-axis-tick-update-position}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.update_position::doc}}\index{update\_position() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.update_position:matplotlib.axis.Tick.update_position}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{update\_position}}}{\emph{loc}}{} Set the location of tick in data coords with scalar \sphinxstyleemphasis{loc} \end{fulllineitems} \section{Common and inherited methods} \label{\detokenize{api/axis_api:common-and-inherited-methods}} \subsection{\sphinxstyleliteralintitle{\sphinxupquote{XTick}}} \label{\detokenize{api/axis_api:xtick}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.apply_tickdir:matplotlib.axis.XTick.apply_tickdir}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.apply\_tickdir}}}}} & Calculate self.\_pad and self.\_tickmarkers \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_loc:matplotlib.axis.XTick.get_loc}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_loc}}}}} & Return the tick location (data coords) as a scalar \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_pad:matplotlib.axis.XTick.get_pad}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_pad}}}}} & Get the value of the tick label pad in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_pad_pixels:matplotlib.axis.XTick.get_pad_pixels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_pad\_pixels}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_tick_padding:matplotlib.axis.XTick.get_tick_padding}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_tick\_padding}}}}} & Get the length of the tick outside of the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_tickdir:matplotlib.axis.XTick.get_tickdir}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_tickdir}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_view_interval:matplotlib.axis.XTick.get_view_interval}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_view\_interval}}}}} & return the Interval instance for this axis view limits \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_label1:matplotlib.axis.XTick.set_label1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_label1}}}}} & Set the text of ticklabel \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_label2:matplotlib.axis.XTick.set_label2}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_label2}}}}} & Set the text of ticklabel2 \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_pad:matplotlib.axis.XTick.set_pad}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_pad}}}}} & Set the tick label pad in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.update_position:matplotlib.axis.XTick.update_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.update\_position}}}}} & Set the location of tick in data coords with scalar \sphinxstyleemphasis{loc} \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axis.XTick.apply\_tickdir} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.apply_tickdir:matplotlib-axis-xtick-apply-tickdir}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.apply_tickdir::doc}}\index{apply\_tickdir() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.apply_tickdir:matplotlib.axis.XTick.apply_tickdir}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{apply\_tickdir}}}{\emph{tickdir}}{} Calculate self.\_pad and self.\_tickmarkers \end{fulllineitems} \subsubsection{matplotlib.axis.XTick.get\_loc} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_loc:matplotlib-axis-xtick-get-loc}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_loc::doc}}\index{get\_loc() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_loc:matplotlib.axis.XTick.get_loc}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_loc}}}{}{} Return the tick location (data coords) as a scalar \end{fulllineitems} \subsubsection{matplotlib.axis.XTick.get\_pad} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_pad:matplotlib-axis-xtick-get-pad}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_pad::doc}}\index{get\_pad() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_pad:matplotlib.axis.XTick.get_pad}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_pad}}}{}{} Get the value of the tick label pad in points \end{fulllineitems} \subsubsection{matplotlib.axis.XTick.get\_pad\_pixels} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_pad_pixels:matplotlib-axis-xtick-get-pad-pixels}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_pad_pixels::doc}}\index{get\_pad\_pixels() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_pad_pixels:matplotlib.axis.XTick.get_pad_pixels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_pad\_pixels}}}{}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.XTick.get\_tick\_padding} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_tick_padding:matplotlib-axis-xtick-get-tick-padding}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_tick_padding::doc}}\index{get\_tick\_padding() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_tick_padding:matplotlib.axis.XTick.get_tick_padding}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_tick\_padding}}}{}{} Get the length of the tick outside of the axes. \end{fulllineitems} \subsubsection{matplotlib.axis.XTick.get\_tickdir} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_tickdir:matplotlib-axis-xtick-get-tickdir}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_tickdir::doc}}\index{get\_tickdir() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_tickdir:matplotlib.axis.XTick.get_tickdir}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_tickdir}}}{}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.XTick.get\_view\_interval} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_view_interval:matplotlib-axis-xtick-get-view-interval}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_view_interval::doc}}\index{get\_view\_interval() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_view_interval:matplotlib.axis.XTick.get_view_interval}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_view\_interval}}}{}{} return the Interval instance for this axis view limits \end{fulllineitems} \subsubsection{matplotlib.axis.XTick.set\_label1} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_label1:matplotlib-axis-xtick-set-label1}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_label1::doc}}\index{set\_label1() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_label1:matplotlib.axis.XTick.set_label1}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_label1}}}{\emph{s}}{} Set the text of ticklabel ACCEPTS: str \end{fulllineitems} \subsubsection{matplotlib.axis.XTick.set\_label2} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_label2:matplotlib-axis-xtick-set-label2}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_label2::doc}}\index{set\_label2() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_label2:matplotlib.axis.XTick.set_label2}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_label2}}}{\emph{s}}{} Set the text of ticklabel2 ACCEPTS: str \end{fulllineitems} \subsubsection{matplotlib.axis.XTick.set\_pad} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_pad:matplotlib-axis-xtick-set-pad}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_pad::doc}}\index{set\_pad() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_pad:matplotlib.axis.XTick.set_pad}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_pad}}}{\emph{val}}{} Set the tick label pad in points ACCEPTS: float \end{fulllineitems} \subsubsection{matplotlib.axis.XTick.update\_position} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.update_position:matplotlib-axis-xtick-update-position}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.update_position::doc}}\index{update\_position() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.update_position:matplotlib.axis.XTick.update_position}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{update\_position}}}{\emph{loc}}{} Set the location of tick in data coords with scalar \sphinxstyleemphasis{loc} \end{fulllineitems} \subsection{YTick} \label{\detokenize{api/axis_api:ytick}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.apply_tickdir:matplotlib.axis.YTick.apply_tickdir}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.apply\_tickdir}}}}} & Calculate self.\_pad and self.\_tickmarkers \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_loc:matplotlib.axis.YTick.get_loc}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_loc}}}}} & Return the tick location (data coords) as a scalar \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_pad:matplotlib.axis.YTick.get_pad}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_pad}}}}} & Get the value of the tick label pad in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_pad_pixels:matplotlib.axis.YTick.get_pad_pixels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_pad\_pixels}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_tick_padding:matplotlib.axis.YTick.get_tick_padding}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_tick\_padding}}}}} & Get the length of the tick outside of the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_tickdir:matplotlib.axis.YTick.get_tickdir}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_tickdir}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_view_interval:matplotlib.axis.YTick.get_view_interval}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_view\_interval}}}}} & return the Interval instance for this axis view limits \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_label1:matplotlib.axis.YTick.set_label1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_label1}}}}} & Set the text of ticklabel \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_label2:matplotlib.axis.YTick.set_label2}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_label2}}}}} & Set the text of ticklabel2 \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_pad:matplotlib.axis.YTick.set_pad}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_pad}}}}} & Set the tick label pad in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.update_position:matplotlib.axis.YTick.update_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.update\_position}}}}} & Set the location of tick in data coords with scalar \sphinxstyleemphasis{loc} \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axis.YTick.apply\_tickdir} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.apply_tickdir:matplotlib-axis-ytick-apply-tickdir}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.apply_tickdir::doc}}\index{apply\_tickdir() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.apply_tickdir:matplotlib.axis.YTick.apply_tickdir}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{apply\_tickdir}}}{\emph{tickdir}}{} Calculate self.\_pad and self.\_tickmarkers \end{fulllineitems} \subsubsection{matplotlib.axis.YTick.get\_loc} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_loc:matplotlib-axis-ytick-get-loc}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_loc::doc}}\index{get\_loc() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_loc:matplotlib.axis.YTick.get_loc}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_loc}}}{}{} Return the tick location (data coords) as a scalar \end{fulllineitems} \subsubsection{matplotlib.axis.YTick.get\_pad} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_pad:matplotlib-axis-ytick-get-pad}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_pad::doc}}\index{get\_pad() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_pad:matplotlib.axis.YTick.get_pad}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_pad}}}{}{} Get the value of the tick label pad in points \end{fulllineitems} \subsubsection{matplotlib.axis.YTick.get\_pad\_pixels} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_pad_pixels:matplotlib-axis-ytick-get-pad-pixels}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_pad_pixels::doc}}\index{get\_pad\_pixels() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_pad_pixels:matplotlib.axis.YTick.get_pad_pixels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_pad\_pixels}}}{}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.YTick.get\_tick\_padding} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_tick_padding:matplotlib-axis-ytick-get-tick-padding}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_tick_padding::doc}}\index{get\_tick\_padding() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_tick_padding:matplotlib.axis.YTick.get_tick_padding}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_tick\_padding}}}{}{} Get the length of the tick outside of the axes. \end{fulllineitems} \subsubsection{matplotlib.axis.YTick.get\_tickdir} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_tickdir:matplotlib-axis-ytick-get-tickdir}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_tickdir::doc}}\index{get\_tickdir() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_tickdir:matplotlib.axis.YTick.get_tickdir}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_tickdir}}}{}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.YTick.get\_view\_interval} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_view_interval:matplotlib-axis-ytick-get-view-interval}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_view_interval::doc}}\index{get\_view\_interval() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_view_interval:matplotlib.axis.YTick.get_view_interval}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_view\_interval}}}{}{} return the Interval instance for this axis view limits \end{fulllineitems} \subsubsection{matplotlib.axis.YTick.set\_label1} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_label1:matplotlib-axis-ytick-set-label1}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_label1::doc}}\index{set\_label1() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_label1:matplotlib.axis.YTick.set_label1}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_label1}}}{\emph{s}}{} Set the text of ticklabel ACCEPTS: str \end{fulllineitems} \subsubsection{matplotlib.axis.YTick.set\_label2} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_label2:matplotlib-axis-ytick-set-label2}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_label2::doc}}\index{set\_label2() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_label2:matplotlib.axis.YTick.set_label2}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_label2}}}{\emph{s}}{} Set the text of ticklabel2 ACCEPTS: str \end{fulllineitems} \subsubsection{matplotlib.axis.YTick.set\_pad} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_pad:matplotlib-axis-ytick-set-pad}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_pad::doc}}\index{set\_pad() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_pad:matplotlib.axis.YTick.set_pad}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_pad}}}{\emph{val}}{} Set the tick label pad in points ACCEPTS: float \end{fulllineitems} \subsubsection{matplotlib.axis.YTick.update\_position} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.update_position:matplotlib-axis-ytick-update-position}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.update_position::doc}}\index{update\_position() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.update_position:matplotlib.axis.YTick.update_position}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{update\_position}}}{\emph{loc}}{} Set the location of tick in data coords with scalar \sphinxstyleemphasis{loc} \end{fulllineitems} \subsection{YAxis} \label{\detokenize{api/axis_api:yaxis}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.OFFSETTEXTPAD:matplotlib.axis.YAxis.OFFSETTEXTPAD}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.OFFSETTEXTPAD}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.axis_date:matplotlib.axis.YAxis.axis_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.axis\_date}}}}} & Sets up x-axis ticks and labels that treat the x data as dates. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.cla:matplotlib.axis.YAxis.cla}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.cla}}}}} & clear the current axis \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.convert_units:matplotlib.axis.YAxis.convert_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.convert\_units}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_data_interval:matplotlib.axis.YAxis.get_data_interval}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_data\_interval}}}}} & return the Interval instance for this axis data limits \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_gridlines:matplotlib.axis.YAxis.get_gridlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_gridlines}}}}} & Return the grid lines as a list of Line2D instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_label_position:matplotlib.axis.YAxis.get_label_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_label\_position}}}}} & Return the label position (top or bottom) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_label_text:matplotlib.axis.YAxis.get_label_text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_label\_text}}}}} & Get the text of the label \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_major_formatter:matplotlib.axis.YAxis.get_major_formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_major\_formatter}}}}} & Get the formatter of the major ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_major_locator:matplotlib.axis.YAxis.get_major_locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_major\_locator}}}}} & Get the locator of the major ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_major_ticks:matplotlib.axis.YAxis.get_major_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_major\_ticks}}}}} & get the tick instances; grow as necessary \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_majorticklabels:matplotlib.axis.YAxis.get_majorticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_majorticklabels}}}}} & Return a list of Text instances for the major ticklabels \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_majorticklines:matplotlib.axis.YAxis.get_majorticklines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_majorticklines}}}}} & Return the major tick lines as a list of Line2D instances \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_majorticklocs:matplotlib.axis.YAxis.get_majorticklocs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_majorticklocs}}}}} & Get the major tick locations in data coordinates as a numpy array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minor_formatter:matplotlib.axis.YAxis.get_minor_formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_minor\_formatter}}}}} & Get the formatter of the minor ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minor_locator:matplotlib.axis.YAxis.get_minor_locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_minor\_locator}}}}} & Get the locator of the minor ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minor_ticks:matplotlib.axis.YAxis.get_minor_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_minor\_ticks}}}}} & get the minor tick instances; grow as necessary \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minorticklabels:matplotlib.axis.YAxis.get_minorticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_minorticklabels}}}}} & Return a list of Text instances for the minor ticklabels \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minorticklines:matplotlib.axis.YAxis.get_minorticklines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_minorticklines}}}}} & Return the minor tick lines as a list of Line2D instances \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minorticklocs:matplotlib.axis.YAxis.get_minorticklocs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_minorticklocs}}}}} & Get the minor tick locations in data coordinates as a numpy array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minpos:matplotlib.axis.YAxis.get_minpos}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_minpos}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_offset_text:matplotlib.axis.YAxis.get_offset_text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_offset\_text}}}}} & Return the axis offsetText as a Text instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_pickradius:matplotlib.axis.YAxis.get_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_pickradius}}}}} & Return the depth of the axis used by the picker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_scale:matplotlib.axis.YAxis.get_scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_scale}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_smart_bounds:matplotlib.axis.YAxis.get_smart_bounds}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_smart\_bounds}}}}} & get whether the axis has smart bounds \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_tick_padding:matplotlib.axis.YAxis.get_tick_padding}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_tick\_padding}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_tick_space:matplotlib.axis.YAxis.get_tick_space}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_tick\_space}}}}} & Return the estimated number of ticks that can fit on the axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticklabel_extents:matplotlib.axis.YAxis.get_ticklabel_extents}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_ticklabel\_extents}}}}} & Get the extents of the tick labels on either side of the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticklabels:matplotlib.axis.YAxis.get_ticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_ticklabels}}}}} & Get the x tick labels as a list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticklines:matplotlib.axis.YAxis.get_ticklines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_ticklines}}}}} & Return the tick lines as a list of Line2D instances \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticklocs:matplotlib.axis.YAxis.get_ticklocs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_ticklocs}}}}} & Get the tick locations in data coordinates as a numpy array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_tightbbox:matplotlib.axis.YAxis.get_tightbbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_tightbbox}}}}} & Return a bounding box that encloses the axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_units:matplotlib.axis.YAxis.get_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_units}}}}} & return the units for axis \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_view_interval:matplotlib.axis.YAxis.get_view_interval}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_view\_interval}}}}} & return the Interval instance for this axis view limits \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.grid:matplotlib.axis.YAxis.grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.grid}}}}} & Set the axis grid on or off; b is a boolean. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.iter_ticks:matplotlib.axis.YAxis.iter_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.iter\_ticks}}}}} & Iterate through all of the major and minor ticks. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.limit_range_for_scale:matplotlib.axis.YAxis.limit_range_for_scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.limit\_range\_for\_scale}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.pan:matplotlib.axis.YAxis.pan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.pan}}}}} & Pan \sphinxstyleemphasis{numsteps} (can be positive or negative) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.reset_ticks:matplotlib.axis.YAxis.reset_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.reset\_ticks}}}}} & Re-initialize the major and minor Tick lists. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_data_interval:matplotlib.axis.YAxis.set_data_interval}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_data\_interval}}}}} & set the axis data limits \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_default_intervals:matplotlib.axis.YAxis.set_default_intervals}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_default\_intervals}}}}} & set the default limits for the axis interval if they are not mutated \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_label_coords:matplotlib.axis.YAxis.set_label_coords}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_label\_coords}}}}} & Set the coordinates of the label. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_label_position:matplotlib.axis.YAxis.set_label_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_label\_position}}}}} & Set the label position (left or right) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_label_text:matplotlib.axis.YAxis.set_label_text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_label\_text}}}}} & Sets the text value of the axis label \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_major_formatter:matplotlib.axis.YAxis.set_major_formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_major\_formatter}}}}} & Set the formatter of the major ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_major_locator:matplotlib.axis.YAxis.set_major_locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_major\_locator}}}}} & Set the locator of the major ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_minor_formatter:matplotlib.axis.YAxis.set_minor_formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_minor\_formatter}}}}} & Set the formatter of the minor ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_minor_locator:matplotlib.axis.YAxis.set_minor_locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_minor\_locator}}}}} & Set the locator of the minor ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_pickradius:matplotlib.axis.YAxis.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_pickradius}}}}} & Set the depth of the axis used by the picker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_smart_bounds:matplotlib.axis.YAxis.set_smart_bounds}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_smart\_bounds}}}}} & set the axis to have smart bounds \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_tick_params:matplotlib.axis.YAxis.set_tick_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_tick\_params}}}}} & Set appearance parameters for ticks, ticklabels, and gridlines. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_ticklabels:matplotlib.axis.YAxis.set_ticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_ticklabels}}}}} & Set the text values of the tick labels. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_ticks:matplotlib.axis.YAxis.set_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_ticks}}}}} & Set the locations of the tick marks from sequence ticks \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_units:matplotlib.axis.YAxis.set_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_units}}}}} & set the units for axis \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_view_interval:matplotlib.axis.YAxis.set_view_interval}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_view\_interval}}}}} & If \sphinxstyleemphasis{ignore} is \sphinxstyleemphasis{False}, the order of vmin, vmax does not matter; the original axis orientation will be preserved. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.update_units:matplotlib.axis.YAxis.update_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.update\_units}}}}} & introspect \sphinxstyleemphasis{data} for units converter and update the axis.converter instance if necessary. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.zoom:matplotlib.axis.YAxis.zoom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.zoom}}}}} & Zoom in/out on axis; if \sphinxstyleemphasis{direction} is \textgreater{}0 zoom in, else zoom out \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axis.YAxis.OFFSETTEXTPAD} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.OFFSETTEXTPAD:matplotlib-axis-yaxis-offsettextpad}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.OFFSETTEXTPAD::doc}}\index{OFFSETTEXTPAD (matplotlib.axis.YAxis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.OFFSETTEXTPAD:matplotlib.axis.YAxis.OFFSETTEXTPAD}}\pysigline{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{OFFSETTEXTPAD}}\sphinxbfcode{\sphinxupquote{ = 3}}} \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.axis\_date} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.axis_date:matplotlib-axis-yaxis-axis-date}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.axis_date::doc}}\index{axis\_date() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.axis_date:matplotlib.axis.YAxis.axis_date}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{axis\_date}}}{\emph{tz=None}}{} Sets up x-axis ticks and labels that treat the x data as dates. \sphinxstyleemphasis{tz} is a \sphinxcode{\sphinxupquote{tzinfo}} instance or a timezone string. This timezone is used to create date labels. \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.cla} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.cla:matplotlib-axis-yaxis-cla}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.cla::doc}}\index{cla() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.cla:matplotlib.axis.YAxis.cla}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{cla}}}{}{} clear the current axis \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.convert\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.convert_units:matplotlib-axis-yaxis-convert-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.convert_units::doc}}\index{convert\_units() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.convert_units:matplotlib.axis.YAxis.convert_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{convert\_units}}}{\emph{x}}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_data\_interval} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_data_interval:matplotlib-axis-yaxis-get-data-interval}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_data_interval::doc}}\index{get\_data\_interval() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_data_interval:matplotlib.axis.YAxis.get_data_interval}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_data\_interval}}}{}{} return the Interval instance for this axis data limits \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_gridlines} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_gridlines:matplotlib-axis-yaxis-get-gridlines}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_gridlines::doc}}\index{get\_gridlines() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_gridlines:matplotlib.axis.YAxis.get_gridlines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_gridlines}}}{}{} Return the grid lines as a list of Line2D instance \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_label\_position} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_label_position:matplotlib-axis-yaxis-get-label-position}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_label_position::doc}}\index{get\_label\_position() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_label_position:matplotlib.axis.YAxis.get_label_position}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_label\_position}}}{}{} Return the label position (top or bottom) \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_label\_text} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_label_text:matplotlib-axis-yaxis-get-label-text}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_label_text::doc}}\index{get\_label\_text() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_label_text:matplotlib.axis.YAxis.get_label_text}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_label\_text}}}{}{} Get the text of the label \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_major\_formatter} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_major_formatter:matplotlib-axis-yaxis-get-major-formatter}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_major_formatter::doc}}\index{get\_major\_formatter() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_major_formatter:matplotlib.axis.YAxis.get_major_formatter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_major\_formatter}}}{}{} Get the formatter of the major ticker \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_major\_locator} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_major_locator:matplotlib-axis-yaxis-get-major-locator}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_major_locator::doc}}\index{get\_major\_locator() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_major_locator:matplotlib.axis.YAxis.get_major_locator}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_major\_locator}}}{}{} Get the locator of the major ticker \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_major\_ticks} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_major_ticks:matplotlib-axis-yaxis-get-major-ticks}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_major_ticks::doc}}\index{get\_major\_ticks() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_major_ticks:matplotlib.axis.YAxis.get_major_ticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_major\_ticks}}}{\emph{numticks=None}}{} get the tick instances; grow as necessary \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_majorticklabels} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_majorticklabels:matplotlib-axis-yaxis-get-majorticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_majorticklabels::doc}}\index{get\_majorticklabels() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_majorticklabels:matplotlib.axis.YAxis.get_majorticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_majorticklabels}}}{}{} Return a list of Text instances for the major ticklabels \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_majorticklines} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_majorticklines:matplotlib-axis-yaxis-get-majorticklines}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_majorticklines::doc}}\index{get\_majorticklines() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_majorticklines:matplotlib.axis.YAxis.get_majorticklines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_majorticklines}}}{}{} Return the major tick lines as a list of Line2D instances \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_majorticklocs} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_majorticklocs:matplotlib-axis-yaxis-get-majorticklocs}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_majorticklocs::doc}}\index{get\_majorticklocs() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_majorticklocs:matplotlib.axis.YAxis.get_majorticklocs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_majorticklocs}}}{}{} Get the major tick locations in data coordinates as a numpy array \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_minor\_formatter} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minor_formatter:matplotlib-axis-yaxis-get-minor-formatter}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minor_formatter::doc}}\index{get\_minor\_formatter() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minor_formatter:matplotlib.axis.YAxis.get_minor_formatter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_minor\_formatter}}}{}{} Get the formatter of the minor ticker \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_minor\_locator} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minor_locator:matplotlib-axis-yaxis-get-minor-locator}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minor_locator::doc}}\index{get\_minor\_locator() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minor_locator:matplotlib.axis.YAxis.get_minor_locator}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_minor\_locator}}}{}{} Get the locator of the minor ticker \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_minor\_ticks} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minor_ticks:matplotlib-axis-yaxis-get-minor-ticks}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minor_ticks::doc}}\index{get\_minor\_ticks() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minor_ticks:matplotlib.axis.YAxis.get_minor_ticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_minor\_ticks}}}{\emph{numticks=None}}{} get the minor tick instances; grow as necessary \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_minorticklabels} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minorticklabels:matplotlib-axis-yaxis-get-minorticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minorticklabels::doc}}\index{get\_minorticklabels() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minorticklabels:matplotlib.axis.YAxis.get_minorticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_minorticklabels}}}{}{} Return a list of Text instances for the minor ticklabels \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_minorticklines} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minorticklines:matplotlib-axis-yaxis-get-minorticklines}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minorticklines::doc}}\index{get\_minorticklines() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minorticklines:matplotlib.axis.YAxis.get_minorticklines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_minorticklines}}}{}{} Return the minor tick lines as a list of Line2D instances \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_minorticklocs} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minorticklocs:matplotlib-axis-yaxis-get-minorticklocs}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minorticklocs::doc}}\index{get\_minorticklocs() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minorticklocs:matplotlib.axis.YAxis.get_minorticklocs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_minorticklocs}}}{}{} Get the minor tick locations in data coordinates as a numpy array \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_minpos} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minpos:matplotlib-axis-yaxis-get-minpos}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minpos::doc}}\index{get\_minpos() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_minpos:matplotlib.axis.YAxis.get_minpos}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_minpos}}}{}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_offset\_text} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_offset_text:matplotlib-axis-yaxis-get-offset-text}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_offset_text::doc}}\index{get\_offset\_text() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_offset_text:matplotlib.axis.YAxis.get_offset_text}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_offset\_text}}}{}{} Return the axis offsetText as a Text instance \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_pickradius} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_pickradius:matplotlib-axis-yaxis-get-pickradius}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_pickradius::doc}}\index{get\_pickradius() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_pickradius:matplotlib.axis.YAxis.get_pickradius}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{} Return the depth of the axis used by the picker \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_scale} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_scale:matplotlib-axis-yaxis-get-scale}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_scale::doc}}\index{get\_scale() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_scale:matplotlib.axis.YAxis.get_scale}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_scale}}}{}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_smart\_bounds} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_smart_bounds:matplotlib-axis-yaxis-get-smart-bounds}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_smart_bounds::doc}}\index{get\_smart\_bounds() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_smart_bounds:matplotlib.axis.YAxis.get_smart_bounds}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_smart\_bounds}}}{}{} get whether the axis has smart bounds \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_tick\_padding} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_tick_padding:matplotlib-axis-yaxis-get-tick-padding}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_tick_padding::doc}}\index{get\_tick\_padding() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_tick_padding:matplotlib.axis.YAxis.get_tick_padding}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_tick\_padding}}}{}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_tick\_space} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_tick_space:matplotlib-axis-yaxis-get-tick-space}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_tick_space::doc}}\index{get\_tick\_space() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_tick_space:matplotlib.axis.YAxis.get_tick_space}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_tick\_space}}}{}{} Return the estimated number of ticks that can fit on the axis. \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_ticklabel\_extents} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticklabel_extents:matplotlib-axis-yaxis-get-ticklabel-extents}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticklabel_extents::doc}}\index{get\_ticklabel\_extents() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticklabel_extents:matplotlib.axis.YAxis.get_ticklabel_extents}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_ticklabel\_extents}}}{\emph{renderer}}{} Get the extents of the tick labels on either side of the axes. \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_ticklabels} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticklabels:matplotlib-axis-yaxis-get-ticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticklabels::doc}}\index{get\_ticklabels() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticklabels:matplotlib.axis.YAxis.get_ticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_ticklabels}}}{\emph{minor=False}, \emph{which=None}}{} Get the x tick labels as a list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{minor}}] \leavevmode{[}bool{]} If True return the minor ticklabels, else return the major ticklabels \item[{\sphinxstylestrong{which}}] \leavevmode{[}None, (‘minor’, ‘major’, ‘both’){]} Overrides \sphinxcode{\sphinxupquote{minor}}. Selects which ticklabels to return \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ret}}] \leavevmode{[}list{]} List of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_ticklines} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticklines:matplotlib-axis-yaxis-get-ticklines}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticklines::doc}}\index{get\_ticklines() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticklines:matplotlib.axis.YAxis.get_ticklines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_ticklines}}}{\emph{minor=False}}{} Return the tick lines as a list of Line2D instances \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_ticklocs} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticklocs:matplotlib-axis-yaxis-get-ticklocs}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticklocs::doc}}\index{get\_ticklocs() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_ticklocs:matplotlib.axis.YAxis.get_ticklocs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_ticklocs}}}{\emph{minor=False}}{} Get the tick locations in data coordinates as a numpy array \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_tightbbox} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_tightbbox:matplotlib-axis-yaxis-get-tightbbox}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_tightbbox::doc}}\index{get\_tightbbox() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_tightbbox:matplotlib.axis.YAxis.get_tightbbox}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_tightbbox}}}{\emph{renderer}}{} Return a bounding box that encloses the axis. It only accounts tick labels, axis label, and offsetText. \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_units:matplotlib-axis-yaxis-get-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_units::doc}}\index{get\_units() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_units:matplotlib.axis.YAxis.get_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_units}}}{}{} return the units for axis \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.get\_view\_interval} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_view_interval:matplotlib-axis-yaxis-get-view-interval}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_view_interval::doc}}\index{get\_view\_interval() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_view_interval:matplotlib.axis.YAxis.get_view_interval}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_view\_interval}}}{}{} return the Interval instance for this axis view limits \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.grid} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.grid:matplotlib-axis-yaxis-grid}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.grid::doc}}\index{grid() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.grid:matplotlib.axis.YAxis.grid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{grid}}}{\emph{b=None}, \emph{which='major'}, \emph{**kwargs}}{} Set the axis grid on or off; b is a boolean. Use \sphinxstyleemphasis{which} = ‘major’ \textbar{} ‘minor’ \textbar{} ‘both’ to set the grid for major or minor ticks. If \sphinxstyleemphasis{b} is \sphinxstyleemphasis{None} and len(kwargs)==0, toggle the grid state. If \sphinxstyleemphasis{kwargs} are supplied, it is assumed you want the grid on and \sphinxstyleemphasis{b} will be set to True. \sphinxstyleemphasis{kwargs} are used to set the line properties of the grids, e.g., \begin{quote} xax.grid(color=’r’, linestyle=’-‘, linewidth=2) \end{quote} \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.iter\_ticks} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.iter_ticks:matplotlib-axis-yaxis-iter-ticks}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.iter_ticks::doc}}\index{iter\_ticks() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.iter_ticks:matplotlib.axis.YAxis.iter_ticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{iter\_ticks}}}{}{} Iterate through all of the major and minor ticks. \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.limit\_range\_for\_scale} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.limit_range_for_scale:matplotlib-axis-yaxis-limit-range-for-scale}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.limit_range_for_scale::doc}}\index{limit\_range\_for\_scale() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.limit_range_for_scale:matplotlib.axis.YAxis.limit_range_for_scale}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{limit\_range\_for\_scale}}}{\emph{vmin}, \emph{vmax}}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.pan} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.pan:matplotlib-axis-yaxis-pan}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.pan::doc}}\index{pan() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.pan:matplotlib.axis.YAxis.pan}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{pan}}}{\emph{numsteps}}{} Pan \sphinxstyleemphasis{numsteps} (can be positive or negative) \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.reset\_ticks} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.reset_ticks:matplotlib-axis-yaxis-reset-ticks}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.reset_ticks::doc}}\index{reset\_ticks() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.reset_ticks:matplotlib.axis.YAxis.reset_ticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{reset\_ticks}}}{}{} Re-initialize the major and minor Tick lists. Each list starts with a single fresh Tick. \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_data\_interval} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_data_interval:matplotlib-axis-yaxis-set-data-interval}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_data_interval::doc}}\index{set\_data\_interval() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_data_interval:matplotlib.axis.YAxis.set_data_interval}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_data\_interval}}}{\emph{vmin}, \emph{vmax}, \emph{ignore=False}}{} set the axis data limits \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_default\_intervals} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_default_intervals:matplotlib-axis-yaxis-set-default-intervals}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_default_intervals::doc}}\index{set\_default\_intervals() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_default_intervals:matplotlib.axis.YAxis.set_default_intervals}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_default\_intervals}}}{}{} set the default limits for the axis interval if they are not mutated \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_label\_coords} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_label_coords:matplotlib-axis-yaxis-set-label-coords}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_label_coords::doc}}\index{set\_label\_coords() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_label_coords:matplotlib.axis.YAxis.set_label_coords}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_label\_coords}}}{\emph{x}, \emph{y}, \emph{transform=None}}{} Set the coordinates of the label. By default, the x coordinate of the y label is determined by the tick label bounding boxes, but this can lead to poor alignment of multiple ylabels if there are multiple axes. Ditto for the y coordinate of the x label. You can also specify the coordinate system of the label with the transform. If None, the default coordinate system will be the axes coordinate system (0,0) is (left,bottom), (0.5, 0.5) is middle, etc \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_label\_position} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_label_position:matplotlib-axis-yaxis-set-label-position}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_label_position::doc}}\index{set\_label\_position() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_label_position:matplotlib.axis.YAxis.set_label_position}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_label\_position}}}{\emph{position}}{} Set the label position (left or right) ACCEPTS: {[} ‘left’ \textbar{} ‘right’ {]} \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_label\_text} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_label_text:matplotlib-axis-yaxis-set-label-text}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_label_text::doc}}\index{set\_label\_text() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_label_text:matplotlib.axis.YAxis.set_label_text}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_label\_text}}}{\emph{label}, \emph{fontdict=None}, \emph{**kwargs}}{} Sets the text value of the axis label ACCEPTS: A string value for the label \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_major\_formatter} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_major_formatter:matplotlib-axis-yaxis-set-major-formatter}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_major_formatter::doc}}\index{set\_major\_formatter() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_major_formatter:matplotlib.axis.YAxis.set_major_formatter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_major\_formatter}}}{\emph{formatter}}{} Set the formatter of the major ticker ACCEPTS: A {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Formatter}}}}} instance \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_major\_locator} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_major_locator:matplotlib-axis-yaxis-set-major-locator}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_major_locator::doc}}\index{set\_major\_locator() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_major_locator:matplotlib.axis.YAxis.set_major_locator}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_major\_locator}}}{\emph{locator}}{} Set the locator of the major ticker ACCEPTS: a {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Locator}}}}} instance \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_minor\_formatter} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_minor_formatter:matplotlib-axis-yaxis-set-minor-formatter}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_minor_formatter::doc}}\index{set\_minor\_formatter() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_minor_formatter:matplotlib.axis.YAxis.set_minor_formatter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_minor\_formatter}}}{\emph{formatter}}{} Set the formatter of the minor ticker ACCEPTS: A {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Formatter}}}}} instance \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_minor\_locator} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_minor_locator:matplotlib-axis-yaxis-set-minor-locator}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_minor_locator::doc}}\index{set\_minor\_locator() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_minor_locator:matplotlib.axis.YAxis.set_minor_locator}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_minor\_locator}}}{\emph{locator}}{} Set the locator of the minor ticker ACCEPTS: a {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Locator}}}}} instance \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_pickradius} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_pickradius:matplotlib-axis-yaxis-set-pickradius}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_pickradius::doc}}\index{set\_pickradius() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_pickradius:matplotlib.axis.YAxis.set_pickradius}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{pickradius}}{} Set the depth of the axis used by the picker ACCEPTS: a distance in points \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_smart\_bounds} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_smart_bounds:matplotlib-axis-yaxis-set-smart-bounds}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_smart_bounds::doc}}\index{set\_smart\_bounds() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_smart_bounds:matplotlib.axis.YAxis.set_smart_bounds}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_smart\_bounds}}}{\emph{value}}{} set the axis to have smart bounds \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_tick\_params} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_tick_params:matplotlib-axis-yaxis-set-tick-params}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_tick_params::doc}}\index{set\_tick\_params() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_tick_params:matplotlib.axis.YAxis.set_tick_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_tick\_params}}}{\emph{which='major'}, \emph{reset=False}, \emph{**kw}}{} Set appearance parameters for ticks, ticklabels, and gridlines. For documentation of keyword arguments, see {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.tick_params:matplotlib.axes.Axes.tick_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.tick\_params()}}}}}. \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_ticklabels} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_ticklabels:matplotlib-axis-yaxis-set-ticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_ticklabels::doc}}\index{set\_ticklabels() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_ticklabels:matplotlib.axis.YAxis.set_ticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_ticklabels}}}{\emph{ticklabels}, \emph{*args}, \emph{**kwargs}}{} Set the text values of the tick labels. Return a list of Text instances. Use \sphinxstyleemphasis{kwarg} \sphinxstyleemphasis{minor=True} to select minor ticks. All other kwargs are used to update the text object properties. As for get\_ticklabels, label1 (left or bottom) is affected for a given tick only if its label1On attribute is True, and similarly for label2. The list of returned label text objects consists of all such label1 objects followed by all such label2 objects. The input \sphinxstyleemphasis{ticklabels} is assumed to match the set of tick locations, regardless of the state of label1On and label2On. ACCEPTS: sequence of strings or Text objects \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_ticks} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_ticks:matplotlib-axis-yaxis-set-ticks}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_ticks::doc}}\index{set\_ticks() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_ticks:matplotlib.axis.YAxis.set_ticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_ticks}}}{\emph{ticks}, \emph{minor=False}}{} Set the locations of the tick marks from sequence ticks ACCEPTS: sequence of floats \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_units:matplotlib-axis-yaxis-set-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_units::doc}}\index{set\_units() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_units:matplotlib.axis.YAxis.set_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_units}}}{\emph{u}}{} set the units for axis ACCEPTS: a units tag \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.set\_view\_interval} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_view_interval:matplotlib-axis-yaxis-set-view-interval}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_view_interval::doc}}\index{set\_view\_interval() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_view_interval:matplotlib.axis.YAxis.set_view_interval}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_view\_interval}}}{\emph{vmin}, \emph{vmax}, \emph{ignore=False}}{} If \sphinxstyleemphasis{ignore} is \sphinxstyleemphasis{False}, the order of vmin, vmax does not matter; the original axis orientation will be preserved. In addition, the view limits can be expanded, but will not be reduced. This method is for mpl internal use; for normal use, see {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:matplotlib.axes.Axes.set_ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_ylim()}}}}}. \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.update\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.update_units:matplotlib-axis-yaxis-update-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.update_units::doc}}\index{update\_units() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.update_units:matplotlib.axis.YAxis.update_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{update\_units}}}{\emph{data}}{} introspect \sphinxstyleemphasis{data} for units converter and update the axis.converter instance if necessary. Return \sphinxstyleemphasis{True} if \sphinxstyleemphasis{data} is registered for unit conversion. \end{fulllineitems} \subsubsection{matplotlib.axis.YAxis.zoom} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.zoom:matplotlib-axis-yaxis-zoom}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.zoom::doc}}\index{zoom() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.zoom:matplotlib.axis.YAxis.zoom}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{zoom}}}{\emph{direction}}{} Zoom in/out on axis; if \sphinxstyleemphasis{direction} is \textgreater{}0 zoom in, else zoom out \end{fulllineitems} \subsection{XAxis} \label{\detokenize{api/axis_api:xaxis}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.OFFSETTEXTPAD:matplotlib.axis.XAxis.OFFSETTEXTPAD}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.OFFSETTEXTPAD}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.axis_date:matplotlib.axis.XAxis.axis_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.axis\_date}}}}} & Sets up x-axis ticks and labels that treat the x data as dates. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.cla:matplotlib.axis.XAxis.cla}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.cla}}}}} & clear the current axis \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.convert_units:matplotlib.axis.XAxis.convert_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.convert\_units}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_data_interval:matplotlib.axis.XAxis.get_data_interval}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_data\_interval}}}}} & return the Interval instance for this axis data limits \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_gridlines:matplotlib.axis.XAxis.get_gridlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_gridlines}}}}} & Return the grid lines as a list of Line2D instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_label_position:matplotlib.axis.XAxis.get_label_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_label\_position}}}}} & Return the label position (top or bottom) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_label_text:matplotlib.axis.XAxis.get_label_text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_label\_text}}}}} & Get the text of the label \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_major_formatter:matplotlib.axis.XAxis.get_major_formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_major\_formatter}}}}} & Get the formatter of the major ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_major_locator:matplotlib.axis.XAxis.get_major_locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_major\_locator}}}}} & Get the locator of the major ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_major_ticks:matplotlib.axis.XAxis.get_major_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_major\_ticks}}}}} & get the tick instances; grow as necessary \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_majorticklabels:matplotlib.axis.XAxis.get_majorticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_majorticklabels}}}}} & Return a list of Text instances for the major ticklabels \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_majorticklines:matplotlib.axis.XAxis.get_majorticklines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_majorticklines}}}}} & Return the major tick lines as a list of Line2D instances \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_majorticklocs:matplotlib.axis.XAxis.get_majorticklocs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_majorticklocs}}}}} & Get the major tick locations in data coordinates as a numpy array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minor_formatter:matplotlib.axis.XAxis.get_minor_formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_minor\_formatter}}}}} & Get the formatter of the minor ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minor_locator:matplotlib.axis.XAxis.get_minor_locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_minor\_locator}}}}} & Get the locator of the minor ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minor_ticks:matplotlib.axis.XAxis.get_minor_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_minor\_ticks}}}}} & get the minor tick instances; grow as necessary \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minorticklabels:matplotlib.axis.XAxis.get_minorticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_minorticklabels}}}}} & Return a list of Text instances for the minor ticklabels \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minorticklines:matplotlib.axis.XAxis.get_minorticklines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_minorticklines}}}}} & Return the minor tick lines as a list of Line2D instances \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minorticklocs:matplotlib.axis.XAxis.get_minorticklocs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_minorticklocs}}}}} & Get the minor tick locations in data coordinates as a numpy array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minpos:matplotlib.axis.XAxis.get_minpos}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_minpos}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_offset_text:matplotlib.axis.XAxis.get_offset_text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_offset\_text}}}}} & Return the axis offsetText as a Text instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_pickradius:matplotlib.axis.XAxis.get_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_pickradius}}}}} & Return the depth of the axis used by the picker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_scale:matplotlib.axis.XAxis.get_scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_scale}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_smart_bounds:matplotlib.axis.XAxis.get_smart_bounds}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_smart\_bounds}}}}} & get whether the axis has smart bounds \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_tick_padding:matplotlib.axis.XAxis.get_tick_padding}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_tick\_padding}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_tick_space:matplotlib.axis.XAxis.get_tick_space}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_tick\_space}}}}} & Return the estimated number of ticks that can fit on the axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticklabel_extents:matplotlib.axis.XAxis.get_ticklabel_extents}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_ticklabel\_extents}}}}} & Get the extents of the tick labels on either side of the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticklabels:matplotlib.axis.XAxis.get_ticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_ticklabels}}}}} & Get the x tick labels as a list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticklines:matplotlib.axis.XAxis.get_ticklines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_ticklines}}}}} & Return the tick lines as a list of Line2D instances \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticklocs:matplotlib.axis.XAxis.get_ticklocs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_ticklocs}}}}} & Get the tick locations in data coordinates as a numpy array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_tightbbox:matplotlib.axis.XAxis.get_tightbbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_tightbbox}}}}} & Return a bounding box that encloses the axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_units:matplotlib.axis.XAxis.get_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_units}}}}} & return the units for axis \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_view_interval:matplotlib.axis.XAxis.get_view_interval}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_view\_interval}}}}} & return the Interval instance for this axis view limits \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.grid:matplotlib.axis.XAxis.grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.grid}}}}} & Set the axis grid on or off; b is a boolean. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.iter_ticks:matplotlib.axis.XAxis.iter_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.iter\_ticks}}}}} & Iterate through all of the major and minor ticks. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.limit_range_for_scale:matplotlib.axis.XAxis.limit_range_for_scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.limit\_range\_for\_scale}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.pan:matplotlib.axis.XAxis.pan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.pan}}}}} & Pan \sphinxstyleemphasis{numsteps} (can be positive or negative) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.reset_ticks:matplotlib.axis.XAxis.reset_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.reset\_ticks}}}}} & Re-initialize the major and minor Tick lists. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_data_interval:matplotlib.axis.XAxis.set_data_interval}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_data\_interval}}}}} & set the axis data limits \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_default_intervals:matplotlib.axis.XAxis.set_default_intervals}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_default\_intervals}}}}} & set the default limits for the axis interval if they are not mutated \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_label_coords:matplotlib.axis.XAxis.set_label_coords}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_label\_coords}}}}} & Set the coordinates of the label. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_label_position:matplotlib.axis.XAxis.set_label_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_label\_position}}}}} & Set the label position (top or bottom) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_label_text:matplotlib.axis.XAxis.set_label_text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_label\_text}}}}} & Sets the text value of the axis label \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_major_formatter:matplotlib.axis.XAxis.set_major_formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_major\_formatter}}}}} & Set the formatter of the major ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_major_locator:matplotlib.axis.XAxis.set_major_locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_major\_locator}}}}} & Set the locator of the major ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_minor_formatter:matplotlib.axis.XAxis.set_minor_formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_minor\_formatter}}}}} & Set the formatter of the minor ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_minor_locator:matplotlib.axis.XAxis.set_minor_locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_minor\_locator}}}}} & Set the locator of the minor ticker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_pickradius:matplotlib.axis.XAxis.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_pickradius}}}}} & Set the depth of the axis used by the picker \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_smart_bounds:matplotlib.axis.XAxis.set_smart_bounds}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_smart\_bounds}}}}} & set the axis to have smart bounds \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_tick_params:matplotlib.axis.XAxis.set_tick_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_tick\_params}}}}} & Set appearance parameters for ticks, ticklabels, and gridlines. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_ticklabels:matplotlib.axis.XAxis.set_ticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_ticklabels}}}}} & Set the text values of the tick labels. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_ticks:matplotlib.axis.XAxis.set_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_ticks}}}}} & Set the locations of the tick marks from sequence ticks \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_units:matplotlib.axis.XAxis.set_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_units}}}}} & set the units for axis \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_view_interval:matplotlib.axis.XAxis.set_view_interval}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_view\_interval}}}}} & If \sphinxstyleemphasis{ignore} is \sphinxstyleemphasis{False}, the order of vmin, vmax does not matter; the original axis orientation will be preserved. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.update_units:matplotlib.axis.XAxis.update_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.update\_units}}}}} & introspect \sphinxstyleemphasis{data} for units converter and update the axis.converter instance if necessary. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.zoom:matplotlib.axis.XAxis.zoom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.zoom}}}}} & Zoom in/out on axis; if \sphinxstyleemphasis{direction} is \textgreater{}0 zoom in, else zoom out \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.axis.XAxis.OFFSETTEXTPAD} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.OFFSETTEXTPAD:matplotlib-axis-xaxis-offsettextpad}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.OFFSETTEXTPAD::doc}}\index{OFFSETTEXTPAD (matplotlib.axis.XAxis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.OFFSETTEXTPAD:matplotlib.axis.XAxis.OFFSETTEXTPAD}}\pysigline{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{OFFSETTEXTPAD}}\sphinxbfcode{\sphinxupquote{ = 3}}} \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.axis\_date} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.axis_date:matplotlib-axis-xaxis-axis-date}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.axis_date::doc}}\index{axis\_date() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.axis_date:matplotlib.axis.XAxis.axis_date}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{axis\_date}}}{\emph{tz=None}}{} Sets up x-axis ticks and labels that treat the x data as dates. \sphinxstyleemphasis{tz} is a \sphinxcode{\sphinxupquote{tzinfo}} instance or a timezone string. This timezone is used to create date labels. \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.cla} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.cla:matplotlib-axis-xaxis-cla}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.cla::doc}}\index{cla() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.cla:matplotlib.axis.XAxis.cla}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{cla}}}{}{} clear the current axis \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.convert\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.convert_units:matplotlib-axis-xaxis-convert-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.convert_units::doc}}\index{convert\_units() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.convert_units:matplotlib.axis.XAxis.convert_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{convert\_units}}}{\emph{x}}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_data\_interval} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_data_interval:matplotlib-axis-xaxis-get-data-interval}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_data_interval::doc}}\index{get\_data\_interval() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_data_interval:matplotlib.axis.XAxis.get_data_interval}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_data\_interval}}}{}{} return the Interval instance for this axis data limits \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_gridlines} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_gridlines:matplotlib-axis-xaxis-get-gridlines}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_gridlines::doc}}\index{get\_gridlines() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_gridlines:matplotlib.axis.XAxis.get_gridlines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_gridlines}}}{}{} Return the grid lines as a list of Line2D instance \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_label\_position} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_label_position:matplotlib-axis-xaxis-get-label-position}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_label_position::doc}}\index{get\_label\_position() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_label_position:matplotlib.axis.XAxis.get_label_position}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_label\_position}}}{}{} Return the label position (top or bottom) \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_label\_text} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_label_text:matplotlib-axis-xaxis-get-label-text}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_label_text::doc}}\index{get\_label\_text() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_label_text:matplotlib.axis.XAxis.get_label_text}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_label\_text}}}{}{} Get the text of the label \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_major\_formatter} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_major_formatter:matplotlib-axis-xaxis-get-major-formatter}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_major_formatter::doc}}\index{get\_major\_formatter() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_major_formatter:matplotlib.axis.XAxis.get_major_formatter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_major\_formatter}}}{}{} Get the formatter of the major ticker \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_major\_locator} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_major_locator:matplotlib-axis-xaxis-get-major-locator}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_major_locator::doc}}\index{get\_major\_locator() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_major_locator:matplotlib.axis.XAxis.get_major_locator}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_major\_locator}}}{}{} Get the locator of the major ticker \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_major\_ticks} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_major_ticks:matplotlib-axis-xaxis-get-major-ticks}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_major_ticks::doc}}\index{get\_major\_ticks() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_major_ticks:matplotlib.axis.XAxis.get_major_ticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_major\_ticks}}}{\emph{numticks=None}}{} get the tick instances; grow as necessary \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_majorticklabels} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_majorticklabels:matplotlib-axis-xaxis-get-majorticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_majorticklabels::doc}}\index{get\_majorticklabels() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_majorticklabels:matplotlib.axis.XAxis.get_majorticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_majorticklabels}}}{}{} Return a list of Text instances for the major ticklabels \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_majorticklines} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_majorticklines:matplotlib-axis-xaxis-get-majorticklines}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_majorticklines::doc}}\index{get\_majorticklines() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_majorticklines:matplotlib.axis.XAxis.get_majorticklines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_majorticklines}}}{}{} Return the major tick lines as a list of Line2D instances \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_majorticklocs} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_majorticklocs:matplotlib-axis-xaxis-get-majorticklocs}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_majorticklocs::doc}}\index{get\_majorticklocs() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_majorticklocs:matplotlib.axis.XAxis.get_majorticklocs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_majorticklocs}}}{}{} Get the major tick locations in data coordinates as a numpy array \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_minor\_formatter} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minor_formatter:matplotlib-axis-xaxis-get-minor-formatter}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minor_formatter::doc}}\index{get\_minor\_formatter() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minor_formatter:matplotlib.axis.XAxis.get_minor_formatter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_minor\_formatter}}}{}{} Get the formatter of the minor ticker \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_minor\_locator} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minor_locator:matplotlib-axis-xaxis-get-minor-locator}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minor_locator::doc}}\index{get\_minor\_locator() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minor_locator:matplotlib.axis.XAxis.get_minor_locator}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_minor\_locator}}}{}{} Get the locator of the minor ticker \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_minor\_ticks} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minor_ticks:matplotlib-axis-xaxis-get-minor-ticks}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minor_ticks::doc}}\index{get\_minor\_ticks() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minor_ticks:matplotlib.axis.XAxis.get_minor_ticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_minor\_ticks}}}{\emph{numticks=None}}{} get the minor tick instances; grow as necessary \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_minorticklabels} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minorticklabels:matplotlib-axis-xaxis-get-minorticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minorticklabels::doc}}\index{get\_minorticklabels() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minorticklabels:matplotlib.axis.XAxis.get_minorticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_minorticklabels}}}{}{} Return a list of Text instances for the minor ticklabels \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_minorticklines} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minorticklines:matplotlib-axis-xaxis-get-minorticklines}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minorticklines::doc}}\index{get\_minorticklines() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minorticklines:matplotlib.axis.XAxis.get_minorticklines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_minorticklines}}}{}{} Return the minor tick lines as a list of Line2D instances \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_minorticklocs} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minorticklocs:matplotlib-axis-xaxis-get-minorticklocs}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minorticklocs::doc}}\index{get\_minorticklocs() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minorticklocs:matplotlib.axis.XAxis.get_minorticklocs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_minorticklocs}}}{}{} Get the minor tick locations in data coordinates as a numpy array \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_minpos} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minpos:matplotlib-axis-xaxis-get-minpos}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minpos::doc}}\index{get\_minpos() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_minpos:matplotlib.axis.XAxis.get_minpos}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_minpos}}}{}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_offset\_text} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_offset_text:matplotlib-axis-xaxis-get-offset-text}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_offset_text::doc}}\index{get\_offset\_text() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_offset_text:matplotlib.axis.XAxis.get_offset_text}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_offset\_text}}}{}{} Return the axis offsetText as a Text instance \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_pickradius} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_pickradius:matplotlib-axis-xaxis-get-pickradius}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_pickradius::doc}}\index{get\_pickradius() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_pickradius:matplotlib.axis.XAxis.get_pickradius}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{} Return the depth of the axis used by the picker \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_scale} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_scale:matplotlib-axis-xaxis-get-scale}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_scale::doc}}\index{get\_scale() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_scale:matplotlib.axis.XAxis.get_scale}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_scale}}}{}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_smart\_bounds} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_smart_bounds:matplotlib-axis-xaxis-get-smart-bounds}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_smart_bounds::doc}}\index{get\_smart\_bounds() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_smart_bounds:matplotlib.axis.XAxis.get_smart_bounds}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_smart\_bounds}}}{}{} get whether the axis has smart bounds \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_tick\_padding} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_tick_padding:matplotlib-axis-xaxis-get-tick-padding}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_tick_padding::doc}}\index{get\_tick\_padding() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_tick_padding:matplotlib.axis.XAxis.get_tick_padding}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_tick\_padding}}}{}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_tick\_space} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_tick_space:matplotlib-axis-xaxis-get-tick-space}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_tick_space::doc}}\index{get\_tick\_space() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_tick_space:matplotlib.axis.XAxis.get_tick_space}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_tick\_space}}}{}{} Return the estimated number of ticks that can fit on the axis. \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_ticklabel\_extents} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticklabel_extents:matplotlib-axis-xaxis-get-ticklabel-extents}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticklabel_extents::doc}}\index{get\_ticklabel\_extents() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticklabel_extents:matplotlib.axis.XAxis.get_ticklabel_extents}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_ticklabel\_extents}}}{\emph{renderer}}{} Get the extents of the tick labels on either side of the axes. \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_ticklabels} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticklabels:matplotlib-axis-xaxis-get-ticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticklabels::doc}}\index{get\_ticklabels() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticklabels:matplotlib.axis.XAxis.get_ticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_ticklabels}}}{\emph{minor=False}, \emph{which=None}}{} Get the x tick labels as a list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{minor}}] \leavevmode{[}bool{]} If True return the minor ticklabels, else return the major ticklabels \item[{\sphinxstylestrong{which}}] \leavevmode{[}None, (‘minor’, ‘major’, ‘both’){]} Overrides \sphinxcode{\sphinxupquote{minor}}. Selects which ticklabels to return \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ret}}] \leavevmode{[}list{]} List of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_ticklines} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticklines:matplotlib-axis-xaxis-get-ticklines}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticklines::doc}}\index{get\_ticklines() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticklines:matplotlib.axis.XAxis.get_ticklines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_ticklines}}}{\emph{minor=False}}{} Return the tick lines as a list of Line2D instances \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_ticklocs} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticklocs:matplotlib-axis-xaxis-get-ticklocs}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticklocs::doc}}\index{get\_ticklocs() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_ticklocs:matplotlib.axis.XAxis.get_ticklocs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_ticklocs}}}{\emph{minor=False}}{} Get the tick locations in data coordinates as a numpy array \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_tightbbox} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_tightbbox:matplotlib-axis-xaxis-get-tightbbox}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_tightbbox::doc}}\index{get\_tightbbox() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_tightbbox:matplotlib.axis.XAxis.get_tightbbox}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_tightbbox}}}{\emph{renderer}}{} Return a bounding box that encloses the axis. It only accounts tick labels, axis label, and offsetText. \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_units:matplotlib-axis-xaxis-get-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_units::doc}}\index{get\_units() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_units:matplotlib.axis.XAxis.get_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_units}}}{}{} return the units for axis \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.get\_view\_interval} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_view_interval:matplotlib-axis-xaxis-get-view-interval}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_view_interval::doc}}\index{get\_view\_interval() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_view_interval:matplotlib.axis.XAxis.get_view_interval}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_view\_interval}}}{}{} return the Interval instance for this axis view limits \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.grid} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.grid:matplotlib-axis-xaxis-grid}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.grid::doc}}\index{grid() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.grid:matplotlib.axis.XAxis.grid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{grid}}}{\emph{b=None}, \emph{which='major'}, \emph{**kwargs}}{} Set the axis grid on or off; b is a boolean. Use \sphinxstyleemphasis{which} = ‘major’ \textbar{} ‘minor’ \textbar{} ‘both’ to set the grid for major or minor ticks. If \sphinxstyleemphasis{b} is \sphinxstyleemphasis{None} and len(kwargs)==0, toggle the grid state. If \sphinxstyleemphasis{kwargs} are supplied, it is assumed you want the grid on and \sphinxstyleemphasis{b} will be set to True. \sphinxstyleemphasis{kwargs} are used to set the line properties of the grids, e.g., \begin{quote} xax.grid(color=’r’, linestyle=’-‘, linewidth=2) \end{quote} \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.iter\_ticks} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.iter_ticks:matplotlib-axis-xaxis-iter-ticks}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.iter_ticks::doc}}\index{iter\_ticks() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.iter_ticks:matplotlib.axis.XAxis.iter_ticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{iter\_ticks}}}{}{} Iterate through all of the major and minor ticks. \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.limit\_range\_for\_scale} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.limit_range_for_scale:matplotlib-axis-xaxis-limit-range-for-scale}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.limit_range_for_scale::doc}}\index{limit\_range\_for\_scale() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.limit_range_for_scale:matplotlib.axis.XAxis.limit_range_for_scale}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{limit\_range\_for\_scale}}}{\emph{vmin}, \emph{vmax}}{}~ \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.pan} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.pan:matplotlib-axis-xaxis-pan}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.pan::doc}}\index{pan() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.pan:matplotlib.axis.XAxis.pan}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{pan}}}{\emph{numsteps}}{} Pan \sphinxstyleemphasis{numsteps} (can be positive or negative) \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.reset\_ticks} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.reset_ticks:matplotlib-axis-xaxis-reset-ticks}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.reset_ticks::doc}}\index{reset\_ticks() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.reset_ticks:matplotlib.axis.XAxis.reset_ticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{reset\_ticks}}}{}{} Re-initialize the major and minor Tick lists. Each list starts with a single fresh Tick. \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.set\_data\_interval} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_data_interval:matplotlib-axis-xaxis-set-data-interval}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_data_interval::doc}}\index{set\_data\_interval() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_data_interval:matplotlib.axis.XAxis.set_data_interval}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_data\_interval}}}{\emph{vmin}, \emph{vmax}, \emph{ignore=False}}{} set the axis data limits \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.set\_default\_intervals} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_default_intervals:matplotlib-axis-xaxis-set-default-intervals}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_default_intervals::doc}}\index{set\_default\_intervals() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_default_intervals:matplotlib.axis.XAxis.set_default_intervals}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_default\_intervals}}}{}{} set the default limits for the axis interval if they are not mutated \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.set\_label\_coords} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_label_coords:matplotlib-axis-xaxis-set-label-coords}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_label_coords::doc}}\index{set\_label\_coords() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_label_coords:matplotlib.axis.XAxis.set_label_coords}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_label\_coords}}}{\emph{x}, \emph{y}, \emph{transform=None}}{} Set the coordinates of the label. By default, the x coordinate of the y label is determined by the tick label bounding boxes, but this can lead to poor alignment of multiple ylabels if there are multiple axes. Ditto for the y coordinate of the x label. You can also specify the coordinate system of the label with the transform. If None, the default coordinate system will be the axes coordinate system (0,0) is (left,bottom), (0.5, 0.5) is middle, etc \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.set\_label\_position} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_label_position:matplotlib-axis-xaxis-set-label-position}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_label_position::doc}}\index{set\_label\_position() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_label_position:matplotlib.axis.XAxis.set_label_position}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_label\_position}}}{\emph{position}}{} Set the label position (top or bottom) ACCEPTS: {[} ‘top’ \textbar{} ‘bottom’ {]} \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.set\_label\_text} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_label_text:matplotlib-axis-xaxis-set-label-text}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_label_text::doc}}\index{set\_label\_text() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_label_text:matplotlib.axis.XAxis.set_label_text}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_label\_text}}}{\emph{label}, \emph{fontdict=None}, \emph{**kwargs}}{} Sets the text value of the axis label ACCEPTS: A string value for the label \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.set\_major\_formatter} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_major_formatter:matplotlib-axis-xaxis-set-major-formatter}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_major_formatter::doc}}\index{set\_major\_formatter() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_major_formatter:matplotlib.axis.XAxis.set_major_formatter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_major\_formatter}}}{\emph{formatter}}{} Set the formatter of the major ticker ACCEPTS: A {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Formatter}}}}} instance \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.set\_major\_locator} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_major_locator:matplotlib-axis-xaxis-set-major-locator}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_major_locator::doc}}\index{set\_major\_locator() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_major_locator:matplotlib.axis.XAxis.set_major_locator}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_major\_locator}}}{\emph{locator}}{} Set the locator of the major ticker ACCEPTS: a {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Locator}}}}} instance \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.set\_minor\_formatter} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_minor_formatter:matplotlib-axis-xaxis-set-minor-formatter}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_minor_formatter::doc}}\index{set\_minor\_formatter() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_minor_formatter:matplotlib.axis.XAxis.set_minor_formatter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_minor\_formatter}}}{\emph{formatter}}{} Set the formatter of the minor ticker ACCEPTS: A {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Formatter}}}}} instance \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.set\_minor\_locator} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_minor_locator:matplotlib-axis-xaxis-set-minor-locator}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_minor_locator::doc}}\index{set\_minor\_locator() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_minor_locator:matplotlib.axis.XAxis.set_minor_locator}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_minor\_locator}}}{\emph{locator}}{} Set the locator of the minor ticker ACCEPTS: a {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Locator}}}}} instance \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.set\_pickradius} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_pickradius:matplotlib-axis-xaxis-set-pickradius}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_pickradius::doc}}\index{set\_pickradius() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_pickradius:matplotlib.axis.XAxis.set_pickradius}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{pickradius}}{} Set the depth of the axis used by the picker ACCEPTS: a distance in points \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.set\_smart\_bounds} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_smart_bounds:matplotlib-axis-xaxis-set-smart-bounds}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_smart_bounds::doc}}\index{set\_smart\_bounds() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_smart_bounds:matplotlib.axis.XAxis.set_smart_bounds}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_smart\_bounds}}}{\emph{value}}{} set the axis to have smart bounds \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.set\_tick\_params} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_tick_params:matplotlib-axis-xaxis-set-tick-params}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_tick_params::doc}}\index{set\_tick\_params() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_tick_params:matplotlib.axis.XAxis.set_tick_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_tick\_params}}}{\emph{which='major'}, \emph{reset=False}, \emph{**kw}}{} Set appearance parameters for ticks, ticklabels, and gridlines. For documentation of keyword arguments, see {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.tick_params:matplotlib.axes.Axes.tick_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.tick\_params()}}}}}. \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.set\_ticklabels} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_ticklabels:matplotlib-axis-xaxis-set-ticklabels}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_ticklabels::doc}}\index{set\_ticklabels() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_ticklabels:matplotlib.axis.XAxis.set_ticklabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_ticklabels}}}{\emph{ticklabels}, \emph{*args}, \emph{**kwargs}}{} Set the text values of the tick labels. Return a list of Text instances. Use \sphinxstyleemphasis{kwarg} \sphinxstyleemphasis{minor=True} to select minor ticks. All other kwargs are used to update the text object properties. As for get\_ticklabels, label1 (left or bottom) is affected for a given tick only if its label1On attribute is True, and similarly for label2. The list of returned label text objects consists of all such label1 objects followed by all such label2 objects. The input \sphinxstyleemphasis{ticklabels} is assumed to match the set of tick locations, regardless of the state of label1On and label2On. ACCEPTS: sequence of strings or Text objects \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.set\_ticks} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_ticks:matplotlib-axis-xaxis-set-ticks}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_ticks::doc}}\index{set\_ticks() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_ticks:matplotlib.axis.XAxis.set_ticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_ticks}}}{\emph{ticks}, \emph{minor=False}}{} Set the locations of the tick marks from sequence ticks ACCEPTS: sequence of floats \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.set\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_units:matplotlib-axis-xaxis-set-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_units::doc}}\index{set\_units() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_units:matplotlib.axis.XAxis.set_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_units}}}{\emph{u}}{} set the units for axis ACCEPTS: a units tag \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.set\_view\_interval} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_view_interval:matplotlib-axis-xaxis-set-view-interval}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_view_interval::doc}}\index{set\_view\_interval() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_view_interval:matplotlib.axis.XAxis.set_view_interval}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_view\_interval}}}{\emph{vmin}, \emph{vmax}, \emph{ignore=False}}{} If \sphinxstyleemphasis{ignore} is \sphinxstyleemphasis{False}, the order of vmin, vmax does not matter; the original axis orientation will be preserved. In addition, the view limits can be expanded, but will not be reduced. This method is for mpl internal use; for normal use, see {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim:matplotlib.axes.Axes.set_xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xlim()}}}}}. \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.update\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.update_units:matplotlib-axis-xaxis-update-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.update_units::doc}}\index{update\_units() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.update_units:matplotlib.axis.XAxis.update_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{update\_units}}}{\emph{data}}{} introspect \sphinxstyleemphasis{data} for units converter and update the axis.converter instance if necessary. Return \sphinxstyleemphasis{True} if \sphinxstyleemphasis{data} is registered for unit conversion. \end{fulllineitems} \subsubsection{matplotlib.axis.XAxis.zoom} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.zoom:matplotlib-axis-xaxis-zoom}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.zoom::doc}}\index{zoom() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.zoom:matplotlib.axis.XAxis.zoom}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{zoom}}}{\emph{direction}}{} Zoom in/out on axis; if \sphinxstyleemphasis{direction} is \textgreater{}0 zoom in, else zoom out \end{fulllineitems} \subsection{Inherited from artist} \label{\detokenize{api/axis_api:inherited-from-artist}} \subsubsection{Ticks} \label{\detokenize{api/axis_api:ticks}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.add_callback:matplotlib.axis.Tick.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.add\_callback}}}}} & Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.aname:matplotlib.axis.Tick.aname}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.aname}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.axes:matplotlib.axis.Tick.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.axes}}}}} & The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.contains:matplotlib.axis.Tick.contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.contains}}}}} & Test whether the mouse event occurred in the Tick marks. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.convert_xunits:matplotlib.axis.Tick.convert_xunits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.convert\_xunits}}}}} & For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.convert_yunits:matplotlib.axis.Tick.convert_yunits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.convert\_yunits}}}}} & For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.draw:matplotlib.axis.Tick.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.draw}}}}} & Derived classes drawing method \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.findobj:matplotlib.axis.Tick.findobj}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.findobj}}}}} & Find artist objects. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.format_cursor_data:matplotlib.axis.Tick.format_cursor_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.format\_cursor\_data}}}}} & Return \sphinxstyleemphasis{cursor data} string formatted. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_agg_filter:matplotlib.axis.Tick.get_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_agg\_filter}}}}} & Return filter function to be used for agg filter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_alpha:matplotlib.axis.Tick.get_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_alpha}}}}} & Return the alpha value used for blending - not supported on all backends \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_animated:matplotlib.axis.Tick.get_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_animated}}}}} & Return the artist’s animated state \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_children:matplotlib.axis.Tick.get_children}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_children}}}}} & Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_clip_box:matplotlib.axis.Tick.get_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_clip\_box}}}}} & Return artist clipbox \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_clip_on:matplotlib.axis.Tick.get_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_clip\_on}}}}} & Return whether artist uses clipping \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_clip_path:matplotlib.axis.Tick.get_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_clip\_path}}}}} & Return artist clip path \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_contains:matplotlib.axis.Tick.get_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_contains}}}}} & Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_cursor_data:matplotlib.axis.Tick.get_cursor_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_cursor\_data}}}}} & Get the cursor data for a given event. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_figure:matplotlib.axis.Tick.get_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_figure}}}}} & Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_gid:matplotlib.axis.Tick.get_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_gid}}}}} & Returns the group id. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_label:matplotlib.axis.Tick.get_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_label}}}}} & Get the label used for this artist in the legend. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_path_effects:matplotlib.axis.Tick.get_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_path\_effects}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_picker:matplotlib.axis.Tick.get_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_picker}}}}} & Return the picker object used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_rasterized:matplotlib.axis.Tick.get_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_rasterized}}}}} & Return whether the artist is to be rasterized. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_sketch_params:matplotlib.axis.Tick.get_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_sketch\_params}}}}} & Returns the sketch parameters for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_snap:matplotlib.axis.Tick.get_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_snap}}}}} & Returns the snap setting which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_transform:matplotlib.axis.Tick.get_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_transform}}}}} & Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_transformed_clip_path_and_affine:matplotlib.axis.Tick.get_transformed_clip_path_and_affine}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_transformed\_clip\_path\_and\_affine}}}}} & Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_url:matplotlib.axis.Tick.get_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_url}}}}} & Returns the url. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_visible:matplotlib.axis.Tick.get_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_visible}}}}} & Return the artist’s visiblity \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_window_extent:matplotlib.axis.Tick.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_window\_extent}}}}} & Get the axes bounding box in display space. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.get_zorder:matplotlib.axis.Tick.get_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.get\_zorder}}}}} & Return the artist’s zorder. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.have_units:matplotlib.axis.Tick.have_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.have\_units}}}}} & Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.is_transform_set:matplotlib.axis.Tick.is_transform_set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.is\_transform\_set}}}}} & Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.mouseover:matplotlib.axis.Tick.mouseover}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.mouseover}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.pchanged:matplotlib.axis.Tick.pchanged}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.pchanged}}}}} & Fire an event when property changed, calling all of the registered callbacks. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.pick:matplotlib.axis.Tick.pick}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.pick}}}}} & Process pick event \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.pickable:matplotlib.axis.Tick.pickable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.pickable}}}}} & Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.properties:matplotlib.axis.Tick.properties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.properties}}}}} & return a dictionary mapping property name -\textgreater{} value for all Artist props \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.remove:matplotlib.axis.Tick.remove}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.remove}}}}} & Remove the artist from the figure if possible. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.remove_callback:matplotlib.axis.Tick.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.remove\_callback}}}}} & Remove a callback based on its \sphinxstyleemphasis{id}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set:matplotlib.axis.Tick.set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set}}}}} & A property batch setter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_agg_filter:matplotlib.axis.Tick.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_agg\_filter}}}}} & Set the agg filter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_alpha:matplotlib.axis.Tick.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_alpha}}}}} & Set the alpha value used for blending - not supported on all backends. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_animated:matplotlib.axis.Tick.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_animated}}}}} & Set the artist’s animation state. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_clip_box:matplotlib.axis.Tick.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_clip\_box}}}}} & Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_clip_on:matplotlib.axis.Tick.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_clip\_on}}}}} & Set whether artist uses clipping. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_clip_path:matplotlib.axis.Tick.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_clip\_path}}}}} & Set the artist’s clip path, which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_contains:matplotlib.axis.Tick.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_contains}}}}} & Replace the contains test used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_figure:matplotlib.axis.Tick.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_figure}}}}} & Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_gid:matplotlib.axis.Tick.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_gid}}}}} & Sets the (group) id for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_label:matplotlib.axis.Tick.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_label}}}}} & Set the text of ticklabel \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_path_effects:matplotlib.axis.Tick.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_path\_effects}}}}} & Set the path effects. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_picker:matplotlib.axis.Tick.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_picker}}}}} & Set the epsilon for picking used by this artist \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_rasterized:matplotlib.axis.Tick.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_rasterized}}}}} & Force rasterized (bitmap) drawing in vector backend output. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_sketch_params:matplotlib.axis.Tick.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_sketch\_params}}}}} & Sets the sketch parameters. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_snap:matplotlib.axis.Tick.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_snap}}}}} & Sets the snap setting which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_transform:matplotlib.axis.Tick.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_transform}}}}} & Set the artist transform. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_url:matplotlib.axis.Tick.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_url}}}}} & Sets the url for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_visible:matplotlib.axis.Tick.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_visible}}}}} & Set the artist’s visibility. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.set_zorder:matplotlib.axis.Tick.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.set\_zorder}}}}} & Set the zorder for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.stale:matplotlib.axis.Tick.stale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.stale}}}}} & If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.update:matplotlib.axis.Tick.update}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.update}}}}} & Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.update_from:matplotlib.axis.Tick.update_from}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.update\_from}}}}} & Copy properties from \sphinxstyleemphasis{other} to \sphinxstyleemphasis{self}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.zorder:matplotlib.axis.Tick.zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Tick.zorder}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.add_callback:matplotlib.axis.XTick.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.add\_callback}}}}} & Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.aname:matplotlib.axis.XTick.aname}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.aname}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.axes:matplotlib.axis.XTick.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.axes}}}}} & The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.contains:matplotlib.axis.XTick.contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.contains}}}}} & Test whether the mouse event occurred in the Tick marks. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.convert_xunits:matplotlib.axis.XTick.convert_xunits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.convert\_xunits}}}}} & For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.convert_yunits:matplotlib.axis.XTick.convert_yunits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.convert\_yunits}}}}} & For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.draw:matplotlib.axis.XTick.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.draw}}}}} & Derived classes drawing method \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.findobj:matplotlib.axis.XTick.findobj}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.findobj}}}}} & Find artist objects. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.format_cursor_data:matplotlib.axis.XTick.format_cursor_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.format\_cursor\_data}}}}} & Return \sphinxstyleemphasis{cursor data} string formatted. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_agg_filter:matplotlib.axis.XTick.get_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_agg\_filter}}}}} & Return filter function to be used for agg filter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_alpha:matplotlib.axis.XTick.get_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_alpha}}}}} & Return the alpha value used for blending - not supported on all backends \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_animated:matplotlib.axis.XTick.get_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_animated}}}}} & Return the artist’s animated state \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_children:matplotlib.axis.XTick.get_children}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_children}}}}} & Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_clip_box:matplotlib.axis.XTick.get_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_clip\_box}}}}} & Return artist clipbox \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_clip_on:matplotlib.axis.XTick.get_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_clip\_on}}}}} & Return whether artist uses clipping \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_clip_path:matplotlib.axis.XTick.get_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_clip\_path}}}}} & Return artist clip path \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_contains:matplotlib.axis.XTick.get_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_contains}}}}} & Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_cursor_data:matplotlib.axis.XTick.get_cursor_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_cursor\_data}}}}} & Get the cursor data for a given event. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_figure:matplotlib.axis.XTick.get_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_figure}}}}} & Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_gid:matplotlib.axis.XTick.get_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_gid}}}}} & Returns the group id. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_label:matplotlib.axis.XTick.get_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_label}}}}} & Get the label used for this artist in the legend. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_path_effects:matplotlib.axis.XTick.get_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_path\_effects}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_picker:matplotlib.axis.XTick.get_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_picker}}}}} & Return the picker object used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_rasterized:matplotlib.axis.XTick.get_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_rasterized}}}}} & Return whether the artist is to be rasterized. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_sketch_params:matplotlib.axis.XTick.get_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_sketch\_params}}}}} & Returns the sketch parameters for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_snap:matplotlib.axis.XTick.get_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_snap}}}}} & Returns the snap setting which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_transform:matplotlib.axis.XTick.get_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_transform}}}}} & Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_transformed_clip_path_and_affine:matplotlib.axis.XTick.get_transformed_clip_path_and_affine}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_transformed\_clip\_path\_and\_affine}}}}} & Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_url:matplotlib.axis.XTick.get_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_url}}}}} & Returns the url. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_visible:matplotlib.axis.XTick.get_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_visible}}}}} & Return the artist’s visiblity \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_window_extent:matplotlib.axis.XTick.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_window\_extent}}}}} & Get the axes bounding box in display space. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.get_zorder:matplotlib.axis.XTick.get_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.get\_zorder}}}}} & Return the artist’s zorder. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.have_units:matplotlib.axis.XTick.have_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.have\_units}}}}} & Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.is_transform_set:matplotlib.axis.XTick.is_transform_set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.is\_transform\_set}}}}} & Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.mouseover:matplotlib.axis.XTick.mouseover}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.mouseover}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.pchanged:matplotlib.axis.XTick.pchanged}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.pchanged}}}}} & Fire an event when property changed, calling all of the registered callbacks. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.pick:matplotlib.axis.XTick.pick}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.pick}}}}} & Process pick event \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.pickable:matplotlib.axis.XTick.pickable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.pickable}}}}} & Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.properties:matplotlib.axis.XTick.properties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.properties}}}}} & return a dictionary mapping property name -\textgreater{} value for all Artist props \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.remove:matplotlib.axis.XTick.remove}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.remove}}}}} & Remove the artist from the figure if possible. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.remove_callback:matplotlib.axis.XTick.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.remove\_callback}}}}} & Remove a callback based on its \sphinxstyleemphasis{id}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set:matplotlib.axis.XTick.set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set}}}}} & A property batch setter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_agg_filter:matplotlib.axis.XTick.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_agg\_filter}}}}} & Set the agg filter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_alpha:matplotlib.axis.XTick.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_alpha}}}}} & Set the alpha value used for blending - not supported on all backends. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_animated:matplotlib.axis.XTick.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_animated}}}}} & Set the artist’s animation state. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_clip_box:matplotlib.axis.XTick.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_clip\_box}}}}} & Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_clip_on:matplotlib.axis.XTick.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_clip\_on}}}}} & Set whether artist uses clipping. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_clip_path:matplotlib.axis.XTick.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_clip\_path}}}}} & Set the artist’s clip path, which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_contains:matplotlib.axis.XTick.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_contains}}}}} & Replace the contains test used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_figure:matplotlib.axis.XTick.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_figure}}}}} & Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_gid:matplotlib.axis.XTick.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_gid}}}}} & Sets the (group) id for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_label:matplotlib.axis.XTick.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_label}}}}} & Set the text of ticklabel \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_path_effects:matplotlib.axis.XTick.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_path\_effects}}}}} & Set the path effects. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_picker:matplotlib.axis.XTick.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_picker}}}}} & Set the epsilon for picking used by this artist \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_rasterized:matplotlib.axis.XTick.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_rasterized}}}}} & Force rasterized (bitmap) drawing in vector backend output. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_sketch_params:matplotlib.axis.XTick.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_sketch\_params}}}}} & Sets the sketch parameters. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_snap:matplotlib.axis.XTick.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_snap}}}}} & Sets the snap setting which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_transform:matplotlib.axis.XTick.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_transform}}}}} & Set the artist transform. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_url:matplotlib.axis.XTick.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_url}}}}} & Sets the url for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_visible:matplotlib.axis.XTick.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_visible}}}}} & Set the artist’s visibility. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.set_zorder:matplotlib.axis.XTick.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.set\_zorder}}}}} & Set the zorder for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.stale:matplotlib.axis.XTick.stale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.stale}}}}} & If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.update:matplotlib.axis.XTick.update}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.update}}}}} & Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.update_from:matplotlib.axis.XTick.update_from}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.update\_from}}}}} & Copy properties from \sphinxstyleemphasis{other} to \sphinxstyleemphasis{self}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.zorder:matplotlib.axis.XTick.zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XTick.zorder}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.add_callback:matplotlib.axis.YTick.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.add\_callback}}}}} & Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.aname:matplotlib.axis.YTick.aname}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.aname}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.axes:matplotlib.axis.YTick.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.axes}}}}} & The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.contains:matplotlib.axis.YTick.contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.contains}}}}} & Test whether the mouse event occurred in the Tick marks. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.convert_xunits:matplotlib.axis.YTick.convert_xunits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.convert\_xunits}}}}} & For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.convert_yunits:matplotlib.axis.YTick.convert_yunits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.convert\_yunits}}}}} & For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.draw:matplotlib.axis.YTick.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.draw}}}}} & Derived classes drawing method \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.findobj:matplotlib.axis.YTick.findobj}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.findobj}}}}} & Find artist objects. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.format_cursor_data:matplotlib.axis.YTick.format_cursor_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.format\_cursor\_data}}}}} & Return \sphinxstyleemphasis{cursor data} string formatted. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_agg_filter:matplotlib.axis.YTick.get_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_agg\_filter}}}}} & Return filter function to be used for agg filter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_alpha:matplotlib.axis.YTick.get_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_alpha}}}}} & Return the alpha value used for blending - not supported on all backends \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_animated:matplotlib.axis.YTick.get_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_animated}}}}} & Return the artist’s animated state \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_children:matplotlib.axis.YTick.get_children}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_children}}}}} & Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_clip_box:matplotlib.axis.YTick.get_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_clip\_box}}}}} & Return artist clipbox \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_clip_on:matplotlib.axis.YTick.get_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_clip\_on}}}}} & Return whether artist uses clipping \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_clip_path:matplotlib.axis.YTick.get_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_clip\_path}}}}} & Return artist clip path \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_contains:matplotlib.axis.YTick.get_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_contains}}}}} & Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_cursor_data:matplotlib.axis.YTick.get_cursor_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_cursor\_data}}}}} & Get the cursor data for a given event. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_figure:matplotlib.axis.YTick.get_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_figure}}}}} & Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_gid:matplotlib.axis.YTick.get_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_gid}}}}} & Returns the group id. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_label:matplotlib.axis.YTick.get_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_label}}}}} & Get the label used for this artist in the legend. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_path_effects:matplotlib.axis.YTick.get_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_path\_effects}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_picker:matplotlib.axis.YTick.get_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_picker}}}}} & Return the picker object used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_rasterized:matplotlib.axis.YTick.get_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_rasterized}}}}} & Return whether the artist is to be rasterized. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_sketch_params:matplotlib.axis.YTick.get_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_sketch\_params}}}}} & Returns the sketch parameters for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_snap:matplotlib.axis.YTick.get_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_snap}}}}} & Returns the snap setting which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_transform:matplotlib.axis.YTick.get_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_transform}}}}} & Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_transformed_clip_path_and_affine:matplotlib.axis.YTick.get_transformed_clip_path_and_affine}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_transformed\_clip\_path\_and\_affine}}}}} & Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_url:matplotlib.axis.YTick.get_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_url}}}}} & Returns the url. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_visible:matplotlib.axis.YTick.get_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_visible}}}}} & Return the artist’s visiblity \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_window_extent:matplotlib.axis.YTick.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_window\_extent}}}}} & Get the axes bounding box in display space. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.get_zorder:matplotlib.axis.YTick.get_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.get\_zorder}}}}} & Return the artist’s zorder. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.have_units:matplotlib.axis.YTick.have_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.have\_units}}}}} & Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.is_transform_set:matplotlib.axis.YTick.is_transform_set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.is\_transform\_set}}}}} & Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.mouseover:matplotlib.axis.YTick.mouseover}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.mouseover}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.pchanged:matplotlib.axis.YTick.pchanged}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.pchanged}}}}} & Fire an event when property changed, calling all of the registered callbacks. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.pick:matplotlib.axis.YTick.pick}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.pick}}}}} & Process pick event \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.pickable:matplotlib.axis.YTick.pickable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.pickable}}}}} & Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.properties:matplotlib.axis.YTick.properties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.properties}}}}} & return a dictionary mapping property name -\textgreater{} value for all Artist props \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.remove:matplotlib.axis.YTick.remove}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.remove}}}}} & Remove the artist from the figure if possible. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.remove_callback:matplotlib.axis.YTick.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.remove\_callback}}}}} & Remove a callback based on its \sphinxstyleemphasis{id}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set:matplotlib.axis.YTick.set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set}}}}} & A property batch setter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_agg_filter:matplotlib.axis.YTick.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_agg\_filter}}}}} & Set the agg filter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_alpha:matplotlib.axis.YTick.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_alpha}}}}} & Set the alpha value used for blending - not supported on all backends. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_animated:matplotlib.axis.YTick.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_animated}}}}} & Set the artist’s animation state. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_clip_box:matplotlib.axis.YTick.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_clip\_box}}}}} & Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_clip_on:matplotlib.axis.YTick.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_clip\_on}}}}} & Set whether artist uses clipping. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_clip_path:matplotlib.axis.YTick.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_clip\_path}}}}} & Set the artist’s clip path, which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_contains:matplotlib.axis.YTick.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_contains}}}}} & Replace the contains test used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_figure:matplotlib.axis.YTick.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_figure}}}}} & Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_gid:matplotlib.axis.YTick.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_gid}}}}} & Sets the (group) id for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_label:matplotlib.axis.YTick.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_label}}}}} & Set the text of ticklabel \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_path_effects:matplotlib.axis.YTick.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_path\_effects}}}}} & Set the path effects. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_picker:matplotlib.axis.YTick.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_picker}}}}} & Set the epsilon for picking used by this artist \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_rasterized:matplotlib.axis.YTick.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_rasterized}}}}} & Force rasterized (bitmap) drawing in vector backend output. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_sketch_params:matplotlib.axis.YTick.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_sketch\_params}}}}} & Sets the sketch parameters. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_snap:matplotlib.axis.YTick.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_snap}}}}} & Sets the snap setting which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_transform:matplotlib.axis.YTick.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_transform}}}}} & Set the artist transform. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_url:matplotlib.axis.YTick.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_url}}}}} & Sets the url for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_visible:matplotlib.axis.YTick.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_visible}}}}} & Set the artist’s visibility. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.set_zorder:matplotlib.axis.YTick.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.set\_zorder}}}}} & Set the zorder for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.stale:matplotlib.axis.YTick.stale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.stale}}}}} & If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.update:matplotlib.axis.YTick.update}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.update}}}}} & Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.update_from:matplotlib.axis.YTick.update_from}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.update\_from}}}}} & Copy properties from \sphinxstyleemphasis{other} to \sphinxstyleemphasis{self}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.zorder:matplotlib.axis.YTick.zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YTick.zorder}}}}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \paragraph{matplotlib.axis.Tick.add\_callback} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.add_callback:matplotlib-axis-tick-add-callback}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.add_callback::doc}}\index{add\_callback() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.add_callback:matplotlib.axis.Tick.add_callback}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.remove_callback:matplotlib.axis.Tick.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.aname} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.aname:matplotlib-axis-tick-aname}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.aname::doc}}\index{aname (matplotlib.axis.Tick attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.aname:matplotlib.axis.Tick.aname}}\pysigline{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.axes} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.axes:matplotlib-axis-tick-axes}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.axes::doc}}\index{axes (matplotlib.axis.Tick attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.axes:matplotlib.axis.Tick.axes}}\pysigline{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.contains} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.contains:matplotlib-axis-tick-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.contains::doc}}\index{contains() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.contains:matplotlib.axis.Tick.contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the Tick marks. This function always returns false. It is more useful to test if the axis as a whole contains the mouse rather than the set of tick marks. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.convert\_xunits} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.convert_xunits:matplotlib-axis-tick-convert-xunits}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.convert_xunits::doc}}\index{convert\_xunits() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.convert_xunits:matplotlib.axis.Tick.convert_xunits}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \paragraph{matplotlib.axis.Tick.convert\_yunits} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.convert_yunits:matplotlib-axis-tick-convert-yunits}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.convert_yunits::doc}}\index{convert\_yunits() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.convert_yunits:matplotlib.axis.Tick.convert_yunits}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \paragraph{matplotlib.axis.Tick.draw} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.draw:matplotlib-axis-tick-draw}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.draw::doc}}\index{draw() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.draw:matplotlib.axis.Tick.draw}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \paragraph{matplotlib.axis.Tick.findobj} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.findobj:matplotlib-axis-tick-findobj}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.findobj::doc}}\index{findobj() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.findobj:matplotlib.axis.Tick.findobj}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.format\_cursor\_data} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.format_cursor_data:matplotlib-axis-tick-format-cursor-data}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.format_cursor_data::doc}}\index{format\_cursor\_data() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.format_cursor_data:matplotlib.axis.Tick.format_cursor_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_agg\_filter} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_agg_filter:matplotlib-axis-tick-get-agg-filter}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_agg_filter::doc}}\index{get\_agg\_filter() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_agg_filter:matplotlib.axis.Tick.get_agg_filter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_alpha} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_alpha:matplotlib-axis-tick-get-alpha}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_alpha::doc}}\index{get\_alpha() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_alpha:matplotlib.axis.Tick.get_alpha}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_animated} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_animated:matplotlib-axis-tick-get-animated}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_animated::doc}}\index{get\_animated() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_animated:matplotlib.axis.Tick.get_animated}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_children} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_children:matplotlib-axis-tick-get-children}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_children::doc}}\index{get\_children() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_children:matplotlib.axis.Tick.get_children}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_clip\_box} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_clip_box:matplotlib-axis-tick-get-clip-box}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_clip_box::doc}}\index{get\_clip\_box() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_clip_box:matplotlib.axis.Tick.get_clip_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_clip\_on} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_clip_on:matplotlib-axis-tick-get-clip-on}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_clip_on::doc}}\index{get\_clip\_on() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_clip_on:matplotlib.axis.Tick.get_clip_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_clip\_path} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_clip_path:matplotlib-axis-tick-get-clip-path}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_clip_path::doc}}\index{get\_clip\_path() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_clip_path:matplotlib.axis.Tick.get_clip_path}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_contains} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_contains:matplotlib-axis-tick-get-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_contains::doc}}\index{get\_contains() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_contains:matplotlib.axis.Tick.get_contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_cursor\_data} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_cursor_data:matplotlib-axis-tick-get-cursor-data}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_cursor_data::doc}}\index{get\_cursor\_data() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_cursor_data:matplotlib.axis.Tick.get_cursor_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_figure} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_figure:matplotlib-axis-tick-get-figure}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_figure::doc}}\index{get\_figure() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_figure:matplotlib.axis.Tick.get_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_gid} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_gid:matplotlib-axis-tick-get-gid}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_gid::doc}}\index{get\_gid() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_gid:matplotlib.axis.Tick.get_gid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_label} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_label:matplotlib-axis-tick-get-label}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_label::doc}}\index{get\_label() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_label:matplotlib.axis.Tick.get_label}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_path\_effects} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_path_effects:matplotlib-axis-tick-get-path-effects}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_path_effects::doc}}\index{get\_path\_effects() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_path_effects:matplotlib.axis.Tick.get_path_effects}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_picker} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_picker:matplotlib-axis-tick-get-picker}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_picker::doc}}\index{get\_picker() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_picker:matplotlib.axis.Tick.get_picker}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_rasterized} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_rasterized:matplotlib-axis-tick-get-rasterized}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_rasterized::doc}}\index{get\_rasterized() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_rasterized:matplotlib.axis.Tick.get_rasterized}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_sketch\_params} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_sketch_params:matplotlib-axis-tick-get-sketch-params}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_sketch_params::doc}}\index{get\_sketch\_params() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_sketch_params:matplotlib.axis.Tick.get_sketch_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_snap} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_snap:matplotlib-axis-tick-get-snap}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_snap::doc}}\index{get\_snap() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_snap:matplotlib.axis.Tick.get_snap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_transform} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_transform:matplotlib-axis-tick-get-transform}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_transform::doc}}\index{get\_transform() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_transform:matplotlib.axis.Tick.get_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_transformed\_clip\_path\_and\_affine} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_transformed_clip_path_and_affine:matplotlib-axis-tick-get-transformed-clip-path-and-affine}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_transformed_clip_path_and_affine::doc}}\index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_transformed_clip_path_and_affine:matplotlib.axis.Tick.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_url} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_url:matplotlib-axis-tick-get-url}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_url::doc}}\index{get\_url() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_url:matplotlib.axis.Tick.get_url}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_visible} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_visible:matplotlib-axis-tick-get-visible}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_visible::doc}}\index{get\_visible() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_visible:matplotlib.axis.Tick.get_visible}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_window\_extent} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_window_extent:matplotlib-axis-tick-get-window-extent}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_window_extent::doc}}\index{get\_window\_extent() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_window_extent:matplotlib.axis.Tick.get_window_extent}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.get\_zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_zorder:matplotlib-axis-tick-get-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_zorder::doc}}\index{get\_zorder() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.get_zorder:matplotlib.axis.Tick.get_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.have\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.have_units:matplotlib-axis-tick-have-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.have_units::doc}}\index{have\_units() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.have_units:matplotlib.axis.Tick.have_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \paragraph{matplotlib.axis.Tick.is\_transform\_set} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.is_transform_set:matplotlib-axis-tick-is-transform-set}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.is_transform_set::doc}}\index{is\_transform\_set() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.is_transform_set:matplotlib.axis.Tick.is_transform_set}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.mouseover} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.mouseover:matplotlib-axis-tick-mouseover}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.mouseover::doc}}\index{mouseover (matplotlib.axis.Tick attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.mouseover:matplotlib.axis.Tick.mouseover}}\pysigline{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \paragraph{matplotlib.axis.Tick.pchanged} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.pchanged:matplotlib-axis-tick-pchanged}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.pchanged::doc}}\index{pchanged() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.pchanged:matplotlib.axis.Tick.pchanged}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.pick} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.pick:matplotlib-axis-tick-pick}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.pick::doc}}\index{pick() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.pick:matplotlib.axis.Tick.pick}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \paragraph{matplotlib.axis.Tick.pickable} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.pickable:matplotlib-axis-tick-pickable}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.pickable::doc}}\index{pickable() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.pickable:matplotlib.axis.Tick.pickable}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.properties} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.properties:matplotlib-axis-tick-properties}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.properties::doc}}\index{properties() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.properties:matplotlib.axis.Tick.properties}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \paragraph{matplotlib.axis.Tick.remove} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.remove:matplotlib-axis-tick-remove}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.remove::doc}}\index{remove() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.remove:matplotlib.axis.Tick.remove}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.remove\_callback} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.remove_callback:matplotlib-axis-tick-remove-callback}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.remove_callback::doc}}\index{remove\_callback() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.remove_callback:matplotlib.axis.Tick.remove_callback}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Tick.add_callback:matplotlib.axis.Tick.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set:matplotlib-axis-tick-set}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set::doc}}\index{set() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set:matplotlib.axis.Tick.set}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_agg\_filter} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_agg_filter:matplotlib-axis-tick-set-agg-filter}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_agg_filter::doc}}\index{set\_agg\_filter() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_agg_filter:matplotlib.axis.Tick.set_agg_filter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_alpha} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_alpha:matplotlib-axis-tick-set-alpha}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_alpha::doc}}\index{set\_alpha() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_alpha:matplotlib.axis.Tick.set_alpha}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha value used for blending - not supported on all backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_animated} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_animated:matplotlib-axis-tick-set-animated}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_animated::doc}}\index{set\_animated() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_animated:matplotlib.axis.Tick.set_animated}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_clip\_box} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_clip_box:matplotlib-axis-tick-set-clip-box}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_clip_box::doc}}\index{set\_clip\_box() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_clip_box:matplotlib.axis.Tick.set_clip_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_clip\_on} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_clip_on:matplotlib-axis-tick-set-clip-on}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_clip_on::doc}}\index{set\_clip\_on() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_clip_on:matplotlib.axis.Tick.set_clip_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_clip\_path} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_clip_path:matplotlib-axis-tick-set-clip-path}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_clip_path::doc}}\index{set\_clip\_path() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_clip_path:matplotlib.axis.Tick.set_clip_path}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{clippath}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_contains} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_contains:matplotlib-axis-tick-set-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_contains::doc}}\index{set\_contains() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_contains:matplotlib.axis.Tick.set_contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_figure} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_figure:matplotlib-axis-tick-set-figure}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_figure::doc}}\index{set\_figure() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_figure:matplotlib.axis.Tick.set_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_gid} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_gid:matplotlib-axis-tick-set-gid}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_gid::doc}}\index{set\_gid() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_gid:matplotlib.axis.Tick.set_gid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_label} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_label:matplotlib-axis-tick-set-label}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_label::doc}}\index{set\_label() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_label:matplotlib.axis.Tick.set_label}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the text of ticklabel ACCEPTS: str \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_path\_effects} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_path_effects:matplotlib-axis-tick-set-path-effects}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_path_effects::doc}}\index{set\_path\_effects() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_path_effects:matplotlib.axis.Tick.set_path_effects}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_picker} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_picker:matplotlib-axis-tick-set-picker}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_picker::doc}}\index{set\_picker() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_picker:matplotlib.axis.Tick.set_picker}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_rasterized} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_rasterized:matplotlib-axis-tick-set-rasterized}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_rasterized::doc}}\index{set\_rasterized() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_rasterized:matplotlib.axis.Tick.set_rasterized}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_sketch\_params} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_sketch_params:matplotlib-axis-tick-set-sketch-params}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_sketch_params::doc}}\index{set\_sketch\_params() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_sketch_params:matplotlib.axis.Tick.set_sketch_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_snap} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_snap:matplotlib-axis-tick-set-snap}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_snap::doc}}\index{set\_snap() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_snap:matplotlib.axis.Tick.set_snap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_transform} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_transform:matplotlib-axis-tick-set-transform}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_transform::doc}}\index{set\_transform() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_transform:matplotlib.axis.Tick.set_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_url} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_url:matplotlib-axis-tick-set-url}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_url::doc}}\index{set\_url() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_url:matplotlib.axis.Tick.set_url}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_visible} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_visible:matplotlib-axis-tick-set-visible}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_visible::doc}}\index{set\_visible() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_visible:matplotlib.axis.Tick.set_visible}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.set\_zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_zorder:matplotlib-axis-tick-set-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_zorder::doc}}\index{set\_zorder() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.set_zorder:matplotlib.axis.Tick.set_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Tick.stale} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.stale:matplotlib-axis-tick-stale}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.stale::doc}}\index{stale (matplotlib.axis.Tick attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.stale:matplotlib.axis.Tick.stale}}\pysigline{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.update} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.update:matplotlib-axis-tick-update}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.update::doc}}\index{update() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.update:matplotlib.axis.Tick.update}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.update\_from} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.update_from:matplotlib-axis-tick-update-from}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.update_from::doc}}\index{update\_from() (matplotlib.axis.Tick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.update_from:matplotlib.axis.Tick.update_from}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} Copy properties from \sphinxstyleemphasis{other} to \sphinxstyleemphasis{self}. \end{fulllineitems} \paragraph{matplotlib.axis.Tick.zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.Tick.zorder:matplotlib-axis-tick-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.zorder::doc}}\index{zorder (matplotlib.axis.Tick attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Tick.zorder:matplotlib.axis.Tick.zorder}}\pysigline{\sphinxcode{\sphinxupquote{Tick.}}\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.add\_callback} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.add_callback:matplotlib-axis-xtick-add-callback}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.add_callback::doc}}\index{add\_callback() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.add_callback:matplotlib.axis.XTick.add_callback}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.remove_callback:matplotlib.axis.XTick.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.aname} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.aname:matplotlib-axis-xtick-aname}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.aname::doc}}\index{aname (matplotlib.axis.XTick attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.aname:matplotlib.axis.XTick.aname}}\pysigline{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.axes} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.axes:matplotlib-axis-xtick-axes}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.axes::doc}}\index{axes (matplotlib.axis.XTick attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.axes:matplotlib.axis.XTick.axes}}\pysigline{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.contains} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.contains:matplotlib-axis-xtick-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.contains::doc}}\index{contains() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.contains:matplotlib.axis.XTick.contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the Tick marks. This function always returns false. It is more useful to test if the axis as a whole contains the mouse rather than the set of tick marks. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.convert\_xunits} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.convert_xunits:matplotlib-axis-xtick-convert-xunits}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.convert_xunits::doc}}\index{convert\_xunits() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.convert_xunits:matplotlib.axis.XTick.convert_xunits}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \paragraph{matplotlib.axis.XTick.convert\_yunits} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.convert_yunits:matplotlib-axis-xtick-convert-yunits}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.convert_yunits::doc}}\index{convert\_yunits() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.convert_yunits:matplotlib.axis.XTick.convert_yunits}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \paragraph{matplotlib.axis.XTick.draw} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.draw:matplotlib-axis-xtick-draw}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.draw::doc}}\index{draw() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.draw:matplotlib.axis.XTick.draw}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \paragraph{matplotlib.axis.XTick.findobj} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.findobj:matplotlib-axis-xtick-findobj}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.findobj::doc}}\index{findobj() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.findobj:matplotlib.axis.XTick.findobj}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.format\_cursor\_data} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.format_cursor_data:matplotlib-axis-xtick-format-cursor-data}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.format_cursor_data::doc}}\index{format\_cursor\_data() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.format_cursor_data:matplotlib.axis.XTick.format_cursor_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_agg\_filter} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_agg_filter:matplotlib-axis-xtick-get-agg-filter}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_agg_filter::doc}}\index{get\_agg\_filter() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_agg_filter:matplotlib.axis.XTick.get_agg_filter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_alpha} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_alpha:matplotlib-axis-xtick-get-alpha}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_alpha::doc}}\index{get\_alpha() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_alpha:matplotlib.axis.XTick.get_alpha}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_animated} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_animated:matplotlib-axis-xtick-get-animated}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_animated::doc}}\index{get\_animated() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_animated:matplotlib.axis.XTick.get_animated}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_children} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_children:matplotlib-axis-xtick-get-children}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_children::doc}}\index{get\_children() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_children:matplotlib.axis.XTick.get_children}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_clip\_box} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_clip_box:matplotlib-axis-xtick-get-clip-box}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_clip_box::doc}}\index{get\_clip\_box() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_clip_box:matplotlib.axis.XTick.get_clip_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_clip\_on} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_clip_on:matplotlib-axis-xtick-get-clip-on}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_clip_on::doc}}\index{get\_clip\_on() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_clip_on:matplotlib.axis.XTick.get_clip_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_clip\_path} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_clip_path:matplotlib-axis-xtick-get-clip-path}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_clip_path::doc}}\index{get\_clip\_path() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_clip_path:matplotlib.axis.XTick.get_clip_path}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_contains} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_contains:matplotlib-axis-xtick-get-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_contains::doc}}\index{get\_contains() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_contains:matplotlib.axis.XTick.get_contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_cursor\_data} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_cursor_data:matplotlib-axis-xtick-get-cursor-data}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_cursor_data::doc}}\index{get\_cursor\_data() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_cursor_data:matplotlib.axis.XTick.get_cursor_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_figure} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_figure:matplotlib-axis-xtick-get-figure}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_figure::doc}}\index{get\_figure() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_figure:matplotlib.axis.XTick.get_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_gid} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_gid:matplotlib-axis-xtick-get-gid}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_gid::doc}}\index{get\_gid() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_gid:matplotlib.axis.XTick.get_gid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_label} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_label:matplotlib-axis-xtick-get-label}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_label::doc}}\index{get\_label() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_label:matplotlib.axis.XTick.get_label}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_path\_effects} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_path_effects:matplotlib-axis-xtick-get-path-effects}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_path_effects::doc}}\index{get\_path\_effects() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_path_effects:matplotlib.axis.XTick.get_path_effects}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_picker} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_picker:matplotlib-axis-xtick-get-picker}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_picker::doc}}\index{get\_picker() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_picker:matplotlib.axis.XTick.get_picker}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_rasterized} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_rasterized:matplotlib-axis-xtick-get-rasterized}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_rasterized::doc}}\index{get\_rasterized() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_rasterized:matplotlib.axis.XTick.get_rasterized}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_sketch\_params} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_sketch_params:matplotlib-axis-xtick-get-sketch-params}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_sketch_params::doc}}\index{get\_sketch\_params() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_sketch_params:matplotlib.axis.XTick.get_sketch_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_snap} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_snap:matplotlib-axis-xtick-get-snap}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_snap::doc}}\index{get\_snap() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_snap:matplotlib.axis.XTick.get_snap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_transform} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_transform:matplotlib-axis-xtick-get-transform}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_transform::doc}}\index{get\_transform() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_transform:matplotlib.axis.XTick.get_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_transformed\_clip\_path\_and\_affine} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_transformed_clip_path_and_affine:matplotlib-axis-xtick-get-transformed-clip-path-and-affine}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_transformed_clip_path_and_affine::doc}}\index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_transformed_clip_path_and_affine:matplotlib.axis.XTick.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_url} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_url:matplotlib-axis-xtick-get-url}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_url::doc}}\index{get\_url() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_url:matplotlib.axis.XTick.get_url}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_visible} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_visible:matplotlib-axis-xtick-get-visible}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_visible::doc}}\index{get\_visible() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_visible:matplotlib.axis.XTick.get_visible}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_window\_extent} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_window_extent:matplotlib-axis-xtick-get-window-extent}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_window_extent::doc}}\index{get\_window\_extent() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_window_extent:matplotlib.axis.XTick.get_window_extent}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.get\_zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_zorder:matplotlib-axis-xtick-get-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_zorder::doc}}\index{get\_zorder() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.get_zorder:matplotlib.axis.XTick.get_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.have\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.have_units:matplotlib-axis-xtick-have-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.have_units::doc}}\index{have\_units() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.have_units:matplotlib.axis.XTick.have_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \paragraph{matplotlib.axis.XTick.is\_transform\_set} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.is_transform_set:matplotlib-axis-xtick-is-transform-set}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.is_transform_set::doc}}\index{is\_transform\_set() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.is_transform_set:matplotlib.axis.XTick.is_transform_set}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.mouseover} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.mouseover:matplotlib-axis-xtick-mouseover}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.mouseover::doc}}\index{mouseover (matplotlib.axis.XTick attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.mouseover:matplotlib.axis.XTick.mouseover}}\pysigline{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \paragraph{matplotlib.axis.XTick.pchanged} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.pchanged:matplotlib-axis-xtick-pchanged}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.pchanged::doc}}\index{pchanged() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.pchanged:matplotlib.axis.XTick.pchanged}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.pick} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.pick:matplotlib-axis-xtick-pick}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.pick::doc}}\index{pick() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.pick:matplotlib.axis.XTick.pick}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \paragraph{matplotlib.axis.XTick.pickable} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.pickable:matplotlib-axis-xtick-pickable}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.pickable::doc}}\index{pickable() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.pickable:matplotlib.axis.XTick.pickable}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.properties} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.properties:matplotlib-axis-xtick-properties}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.properties::doc}}\index{properties() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.properties:matplotlib.axis.XTick.properties}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \paragraph{matplotlib.axis.XTick.remove} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.remove:matplotlib-axis-xtick-remove}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.remove::doc}}\index{remove() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.remove:matplotlib.axis.XTick.remove}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.remove\_callback} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.remove_callback:matplotlib-axis-xtick-remove-callback}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.remove_callback::doc}}\index{remove\_callback() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.remove_callback:matplotlib.axis.XTick.remove_callback}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XTick.add_callback:matplotlib.axis.XTick.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set:matplotlib-axis-xtick-set}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set::doc}}\index{set() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set:matplotlib.axis.XTick.set}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_agg\_filter} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_agg_filter:matplotlib-axis-xtick-set-agg-filter}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_agg_filter::doc}}\index{set\_agg\_filter() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_agg_filter:matplotlib.axis.XTick.set_agg_filter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_alpha} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_alpha:matplotlib-axis-xtick-set-alpha}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_alpha::doc}}\index{set\_alpha() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_alpha:matplotlib.axis.XTick.set_alpha}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha value used for blending - not supported on all backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_animated} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_animated:matplotlib-axis-xtick-set-animated}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_animated::doc}}\index{set\_animated() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_animated:matplotlib.axis.XTick.set_animated}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_clip\_box} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_clip_box:matplotlib-axis-xtick-set-clip-box}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_clip_box::doc}}\index{set\_clip\_box() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_clip_box:matplotlib.axis.XTick.set_clip_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_clip\_on} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_clip_on:matplotlib-axis-xtick-set-clip-on}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_clip_on::doc}}\index{set\_clip\_on() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_clip_on:matplotlib.axis.XTick.set_clip_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_clip\_path} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_clip_path:matplotlib-axis-xtick-set-clip-path}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_clip_path::doc}}\index{set\_clip\_path() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_clip_path:matplotlib.axis.XTick.set_clip_path}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{clippath}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_contains} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_contains:matplotlib-axis-xtick-set-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_contains::doc}}\index{set\_contains() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_contains:matplotlib.axis.XTick.set_contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_figure} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_figure:matplotlib-axis-xtick-set-figure}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_figure::doc}}\index{set\_figure() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_figure:matplotlib.axis.XTick.set_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_gid} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_gid:matplotlib-axis-xtick-set-gid}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_gid::doc}}\index{set\_gid() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_gid:matplotlib.axis.XTick.set_gid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_label} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_label:matplotlib-axis-xtick-set-label}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_label::doc}}\index{set\_label() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_label:matplotlib.axis.XTick.set_label}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the text of ticklabel ACCEPTS: str \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_path\_effects} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_path_effects:matplotlib-axis-xtick-set-path-effects}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_path_effects::doc}}\index{set\_path\_effects() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_path_effects:matplotlib.axis.XTick.set_path_effects}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_picker} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_picker:matplotlib-axis-xtick-set-picker}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_picker::doc}}\index{set\_picker() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_picker:matplotlib.axis.XTick.set_picker}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_rasterized} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_rasterized:matplotlib-axis-xtick-set-rasterized}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_rasterized::doc}}\index{set\_rasterized() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_rasterized:matplotlib.axis.XTick.set_rasterized}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_sketch\_params} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_sketch_params:matplotlib-axis-xtick-set-sketch-params}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_sketch_params::doc}}\index{set\_sketch\_params() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_sketch_params:matplotlib.axis.XTick.set_sketch_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_snap} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_snap:matplotlib-axis-xtick-set-snap}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_snap::doc}}\index{set\_snap() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_snap:matplotlib.axis.XTick.set_snap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_transform} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_transform:matplotlib-axis-xtick-set-transform}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_transform::doc}}\index{set\_transform() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_transform:matplotlib.axis.XTick.set_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_url} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_url:matplotlib-axis-xtick-set-url}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_url::doc}}\index{set\_url() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_url:matplotlib.axis.XTick.set_url}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_visible} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_visible:matplotlib-axis-xtick-set-visible}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_visible::doc}}\index{set\_visible() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_visible:matplotlib.axis.XTick.set_visible}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.set\_zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_zorder:matplotlib-axis-xtick-set-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_zorder::doc}}\index{set\_zorder() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.set_zorder:matplotlib.axis.XTick.set_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XTick.stale} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.stale:matplotlib-axis-xtick-stale}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.stale::doc}}\index{stale (matplotlib.axis.XTick attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.stale:matplotlib.axis.XTick.stale}}\pysigline{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.update} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.update:matplotlib-axis-xtick-update}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.update::doc}}\index{update() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.update:matplotlib.axis.XTick.update}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.update\_from} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.update_from:matplotlib-axis-xtick-update-from}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.update_from::doc}}\index{update\_from() (matplotlib.axis.XTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.update_from:matplotlib.axis.XTick.update_from}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} Copy properties from \sphinxstyleemphasis{other} to \sphinxstyleemphasis{self}. \end{fulllineitems} \paragraph{matplotlib.axis.XTick.zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.XTick.zorder:matplotlib-axis-xtick-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.zorder::doc}}\index{zorder (matplotlib.axis.XTick attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XTick.zorder:matplotlib.axis.XTick.zorder}}\pysigline{\sphinxcode{\sphinxupquote{XTick.}}\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.add\_callback} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.add_callback:matplotlib-axis-ytick-add-callback}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.add_callback::doc}}\index{add\_callback() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.add_callback:matplotlib.axis.YTick.add_callback}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.remove_callback:matplotlib.axis.YTick.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.aname} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.aname:matplotlib-axis-ytick-aname}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.aname::doc}}\index{aname (matplotlib.axis.YTick attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.aname:matplotlib.axis.YTick.aname}}\pysigline{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.axes} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.axes:matplotlib-axis-ytick-axes}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.axes::doc}}\index{axes (matplotlib.axis.YTick attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.axes:matplotlib.axis.YTick.axes}}\pysigline{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.contains} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.contains:matplotlib-axis-ytick-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.contains::doc}}\index{contains() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.contains:matplotlib.axis.YTick.contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the Tick marks. This function always returns false. It is more useful to test if the axis as a whole contains the mouse rather than the set of tick marks. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.convert\_xunits} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.convert_xunits:matplotlib-axis-ytick-convert-xunits}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.convert_xunits::doc}}\index{convert\_xunits() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.convert_xunits:matplotlib.axis.YTick.convert_xunits}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \paragraph{matplotlib.axis.YTick.convert\_yunits} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.convert_yunits:matplotlib-axis-ytick-convert-yunits}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.convert_yunits::doc}}\index{convert\_yunits() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.convert_yunits:matplotlib.axis.YTick.convert_yunits}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \paragraph{matplotlib.axis.YTick.draw} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.draw:matplotlib-axis-ytick-draw}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.draw::doc}}\index{draw() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.draw:matplotlib.axis.YTick.draw}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \paragraph{matplotlib.axis.YTick.findobj} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.findobj:matplotlib-axis-ytick-findobj}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.findobj::doc}}\index{findobj() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.findobj:matplotlib.axis.YTick.findobj}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.format\_cursor\_data} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.format_cursor_data:matplotlib-axis-ytick-format-cursor-data}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.format_cursor_data::doc}}\index{format\_cursor\_data() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.format_cursor_data:matplotlib.axis.YTick.format_cursor_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_agg\_filter} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_agg_filter:matplotlib-axis-ytick-get-agg-filter}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_agg_filter::doc}}\index{get\_agg\_filter() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_agg_filter:matplotlib.axis.YTick.get_agg_filter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_alpha} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_alpha:matplotlib-axis-ytick-get-alpha}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_alpha::doc}}\index{get\_alpha() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_alpha:matplotlib.axis.YTick.get_alpha}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_animated} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_animated:matplotlib-axis-ytick-get-animated}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_animated::doc}}\index{get\_animated() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_animated:matplotlib.axis.YTick.get_animated}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_children} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_children:matplotlib-axis-ytick-get-children}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_children::doc}}\index{get\_children() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_children:matplotlib.axis.YTick.get_children}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_clip\_box} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_clip_box:matplotlib-axis-ytick-get-clip-box}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_clip_box::doc}}\index{get\_clip\_box() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_clip_box:matplotlib.axis.YTick.get_clip_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_clip\_on} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_clip_on:matplotlib-axis-ytick-get-clip-on}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_clip_on::doc}}\index{get\_clip\_on() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_clip_on:matplotlib.axis.YTick.get_clip_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_clip\_path} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_clip_path:matplotlib-axis-ytick-get-clip-path}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_clip_path::doc}}\index{get\_clip\_path() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_clip_path:matplotlib.axis.YTick.get_clip_path}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_contains} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_contains:matplotlib-axis-ytick-get-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_contains::doc}}\index{get\_contains() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_contains:matplotlib.axis.YTick.get_contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_cursor\_data} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_cursor_data:matplotlib-axis-ytick-get-cursor-data}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_cursor_data::doc}}\index{get\_cursor\_data() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_cursor_data:matplotlib.axis.YTick.get_cursor_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_figure} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_figure:matplotlib-axis-ytick-get-figure}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_figure::doc}}\index{get\_figure() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_figure:matplotlib.axis.YTick.get_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_gid} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_gid:matplotlib-axis-ytick-get-gid}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_gid::doc}}\index{get\_gid() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_gid:matplotlib.axis.YTick.get_gid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_label} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_label:matplotlib-axis-ytick-get-label}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_label::doc}}\index{get\_label() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_label:matplotlib.axis.YTick.get_label}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_path\_effects} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_path_effects:matplotlib-axis-ytick-get-path-effects}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_path_effects::doc}}\index{get\_path\_effects() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_path_effects:matplotlib.axis.YTick.get_path_effects}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_picker} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_picker:matplotlib-axis-ytick-get-picker}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_picker::doc}}\index{get\_picker() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_picker:matplotlib.axis.YTick.get_picker}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_rasterized} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_rasterized:matplotlib-axis-ytick-get-rasterized}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_rasterized::doc}}\index{get\_rasterized() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_rasterized:matplotlib.axis.YTick.get_rasterized}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_sketch\_params} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_sketch_params:matplotlib-axis-ytick-get-sketch-params}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_sketch_params::doc}}\index{get\_sketch\_params() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_sketch_params:matplotlib.axis.YTick.get_sketch_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_snap} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_snap:matplotlib-axis-ytick-get-snap}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_snap::doc}}\index{get\_snap() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_snap:matplotlib.axis.YTick.get_snap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_transform} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_transform:matplotlib-axis-ytick-get-transform}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_transform::doc}}\index{get\_transform() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_transform:matplotlib.axis.YTick.get_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_transformed\_clip\_path\_and\_affine} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_transformed_clip_path_and_affine:matplotlib-axis-ytick-get-transformed-clip-path-and-affine}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_transformed_clip_path_and_affine::doc}}\index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_transformed_clip_path_and_affine:matplotlib.axis.YTick.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_url} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_url:matplotlib-axis-ytick-get-url}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_url::doc}}\index{get\_url() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_url:matplotlib.axis.YTick.get_url}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_visible} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_visible:matplotlib-axis-ytick-get-visible}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_visible::doc}}\index{get\_visible() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_visible:matplotlib.axis.YTick.get_visible}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_window\_extent} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_window_extent:matplotlib-axis-ytick-get-window-extent}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_window_extent::doc}}\index{get\_window\_extent() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_window_extent:matplotlib.axis.YTick.get_window_extent}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.get\_zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_zorder:matplotlib-axis-ytick-get-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_zorder::doc}}\index{get\_zorder() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.get_zorder:matplotlib.axis.YTick.get_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.have\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.have_units:matplotlib-axis-ytick-have-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.have_units::doc}}\index{have\_units() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.have_units:matplotlib.axis.YTick.have_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \paragraph{matplotlib.axis.YTick.is\_transform\_set} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.is_transform_set:matplotlib-axis-ytick-is-transform-set}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.is_transform_set::doc}}\index{is\_transform\_set() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.is_transform_set:matplotlib.axis.YTick.is_transform_set}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.mouseover} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.mouseover:matplotlib-axis-ytick-mouseover}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.mouseover::doc}}\index{mouseover (matplotlib.axis.YTick attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.mouseover:matplotlib.axis.YTick.mouseover}}\pysigline{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \paragraph{matplotlib.axis.YTick.pchanged} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.pchanged:matplotlib-axis-ytick-pchanged}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.pchanged::doc}}\index{pchanged() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.pchanged:matplotlib.axis.YTick.pchanged}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.pick} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.pick:matplotlib-axis-ytick-pick}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.pick::doc}}\index{pick() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.pick:matplotlib.axis.YTick.pick}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \paragraph{matplotlib.axis.YTick.pickable} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.pickable:matplotlib-axis-ytick-pickable}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.pickable::doc}}\index{pickable() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.pickable:matplotlib.axis.YTick.pickable}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.properties} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.properties:matplotlib-axis-ytick-properties}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.properties::doc}}\index{properties() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.properties:matplotlib.axis.YTick.properties}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \paragraph{matplotlib.axis.YTick.remove} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.remove:matplotlib-axis-ytick-remove}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.remove::doc}}\index{remove() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.remove:matplotlib.axis.YTick.remove}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.remove\_callback} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.remove_callback:matplotlib-axis-ytick-remove-callback}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.remove_callback::doc}}\index{remove\_callback() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.remove_callback:matplotlib.axis.YTick.remove_callback}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YTick.add_callback:matplotlib.axis.YTick.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set:matplotlib-axis-ytick-set}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set::doc}}\index{set() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set:matplotlib.axis.YTick.set}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_agg\_filter} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_agg_filter:matplotlib-axis-ytick-set-agg-filter}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_agg_filter::doc}}\index{set\_agg\_filter() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_agg_filter:matplotlib.axis.YTick.set_agg_filter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_alpha} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_alpha:matplotlib-axis-ytick-set-alpha}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_alpha::doc}}\index{set\_alpha() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_alpha:matplotlib.axis.YTick.set_alpha}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha value used for blending - not supported on all backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_animated} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_animated:matplotlib-axis-ytick-set-animated}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_animated::doc}}\index{set\_animated() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_animated:matplotlib.axis.YTick.set_animated}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_clip\_box} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_clip_box:matplotlib-axis-ytick-set-clip-box}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_clip_box::doc}}\index{set\_clip\_box() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_clip_box:matplotlib.axis.YTick.set_clip_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_clip\_on} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_clip_on:matplotlib-axis-ytick-set-clip-on}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_clip_on::doc}}\index{set\_clip\_on() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_clip_on:matplotlib.axis.YTick.set_clip_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_clip\_path} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_clip_path:matplotlib-axis-ytick-set-clip-path}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_clip_path::doc}}\index{set\_clip\_path() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_clip_path:matplotlib.axis.YTick.set_clip_path}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{clippath}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_contains} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_contains:matplotlib-axis-ytick-set-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_contains::doc}}\index{set\_contains() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_contains:matplotlib.axis.YTick.set_contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_figure} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_figure:matplotlib-axis-ytick-set-figure}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_figure::doc}}\index{set\_figure() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_figure:matplotlib.axis.YTick.set_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_gid} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_gid:matplotlib-axis-ytick-set-gid}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_gid::doc}}\index{set\_gid() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_gid:matplotlib.axis.YTick.set_gid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_label} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_label:matplotlib-axis-ytick-set-label}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_label::doc}}\index{set\_label() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_label:matplotlib.axis.YTick.set_label}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the text of ticklabel ACCEPTS: str \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_path\_effects} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_path_effects:matplotlib-axis-ytick-set-path-effects}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_path_effects::doc}}\index{set\_path\_effects() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_path_effects:matplotlib.axis.YTick.set_path_effects}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_picker} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_picker:matplotlib-axis-ytick-set-picker}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_picker::doc}}\index{set\_picker() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_picker:matplotlib.axis.YTick.set_picker}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_rasterized} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_rasterized:matplotlib-axis-ytick-set-rasterized}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_rasterized::doc}}\index{set\_rasterized() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_rasterized:matplotlib.axis.YTick.set_rasterized}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_sketch\_params} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_sketch_params:matplotlib-axis-ytick-set-sketch-params}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_sketch_params::doc}}\index{set\_sketch\_params() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_sketch_params:matplotlib.axis.YTick.set_sketch_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_snap} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_snap:matplotlib-axis-ytick-set-snap}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_snap::doc}}\index{set\_snap() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_snap:matplotlib.axis.YTick.set_snap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_transform} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_transform:matplotlib-axis-ytick-set-transform}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_transform::doc}}\index{set\_transform() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_transform:matplotlib.axis.YTick.set_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_url} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_url:matplotlib-axis-ytick-set-url}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_url::doc}}\index{set\_url() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_url:matplotlib.axis.YTick.set_url}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_visible} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_visible:matplotlib-axis-ytick-set-visible}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_visible::doc}}\index{set\_visible() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_visible:matplotlib.axis.YTick.set_visible}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.set\_zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_zorder:matplotlib-axis-ytick-set-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_zorder::doc}}\index{set\_zorder() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.set_zorder:matplotlib.axis.YTick.set_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YTick.stale} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.stale:matplotlib-axis-ytick-stale}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.stale::doc}}\index{stale (matplotlib.axis.YTick attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.stale:matplotlib.axis.YTick.stale}}\pysigline{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.update} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.update:matplotlib-axis-ytick-update}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.update::doc}}\index{update() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.update:matplotlib.axis.YTick.update}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.update\_from} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.update_from:matplotlib-axis-ytick-update-from}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.update_from::doc}}\index{update\_from() (matplotlib.axis.YTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.update_from:matplotlib.axis.YTick.update_from}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} Copy properties from \sphinxstyleemphasis{other} to \sphinxstyleemphasis{self}. \end{fulllineitems} \paragraph{matplotlib.axis.YTick.zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.YTick.zorder:matplotlib-axis-ytick-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.zorder::doc}}\index{zorder (matplotlib.axis.YTick attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YTick.zorder:matplotlib.axis.YTick.zorder}}\pysigline{\sphinxcode{\sphinxupquote{YTick.}}\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \subsubsection{Axis} \label{\detokenize{api/axis_api:axis}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.add_callback:matplotlib.axis.Axis.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.add\_callback}}}}} & Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.aname:matplotlib.axis.Axis.aname}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.aname}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.axes:matplotlib.axis.Axis.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.axes}}}}} & The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.contains:matplotlib.axis.Axis.contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.contains}}}}} & Test whether the artist contains the mouse event. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.convert_xunits:matplotlib.axis.Axis.convert_xunits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.convert\_xunits}}}}} & For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.convert_yunits:matplotlib.axis.Axis.convert_yunits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.convert\_yunits}}}}} & For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.draw:matplotlib.axis.Axis.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.draw}}}}} & Draw the axis lines, grid lines, tick lines and labels \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.findobj:matplotlib.axis.Axis.findobj}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.findobj}}}}} & Find artist objects. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.format_cursor_data:matplotlib.axis.Axis.format_cursor_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.format\_cursor\_data}}}}} & Return \sphinxstyleemphasis{cursor data} string formatted. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_agg_filter:matplotlib.axis.Axis.get_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_agg\_filter}}}}} & Return filter function to be used for agg filter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_alpha:matplotlib.axis.Axis.get_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_alpha}}}}} & Return the alpha value used for blending - not supported on all backends \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_animated:matplotlib.axis.Axis.get_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_animated}}}}} & Return the artist’s animated state \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_children:matplotlib.axis.Axis.get_children}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_children}}}}} & Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_clip_box:matplotlib.axis.Axis.get_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_clip\_box}}}}} & Return artist clipbox \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_clip_on:matplotlib.axis.Axis.get_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_clip\_on}}}}} & Return whether artist uses clipping \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_clip_path:matplotlib.axis.Axis.get_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_clip\_path}}}}} & Return artist clip path \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_contains:matplotlib.axis.Axis.get_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_contains}}}}} & Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_cursor_data:matplotlib.axis.Axis.get_cursor_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_cursor\_data}}}}} & Get the cursor data for a given event. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_figure:matplotlib.axis.Axis.get_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_figure}}}}} & Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_gid:matplotlib.axis.Axis.get_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_gid}}}}} & Returns the group id. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_label:matplotlib.axis.Axis.get_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_label}}}}} & Return the axis label as a Text instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_path_effects:matplotlib.axis.Axis.get_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_path\_effects}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_picker:matplotlib.axis.Axis.get_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_picker}}}}} & Return the picker object used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_rasterized:matplotlib.axis.Axis.get_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_rasterized}}}}} & Return whether the artist is to be rasterized. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_sketch_params:matplotlib.axis.Axis.get_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_sketch\_params}}}}} & Returns the sketch parameters for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_snap:matplotlib.axis.Axis.get_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_snap}}}}} & Returns the snap setting which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_transform:matplotlib.axis.Axis.get_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_transform}}}}} & Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_transformed_clip_path_and_affine:matplotlib.axis.Axis.get_transformed_clip_path_and_affine}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_transformed\_clip\_path\_and\_affine}}}}} & Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_url:matplotlib.axis.Axis.get_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_url}}}}} & Returns the url. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_visible:matplotlib.axis.Axis.get_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_visible}}}}} & Return the artist’s visiblity \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_window_extent:matplotlib.axis.Axis.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_window\_extent}}}}} & Get the axes bounding box in display space. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.get_zorder:matplotlib.axis.Axis.get_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.get\_zorder}}}}} & Return the artist’s zorder. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.have_units:matplotlib.axis.Axis.have_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.have\_units}}}}} & Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.is_transform_set:matplotlib.axis.Axis.is_transform_set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.is\_transform\_set}}}}} & Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.mouseover:matplotlib.axis.Axis.mouseover}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.mouseover}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.pchanged:matplotlib.axis.Axis.pchanged}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.pchanged}}}}} & Fire an event when property changed, calling all of the registered callbacks. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.pick:matplotlib.axis.Axis.pick}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.pick}}}}} & Process pick event \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.pickable:matplotlib.axis.Axis.pickable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.pickable}}}}} & Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.properties:matplotlib.axis.Axis.properties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.properties}}}}} & return a dictionary mapping property name -\textgreater{} value for all Artist props \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.remove:matplotlib.axis.Axis.remove}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.remove}}}}} & Remove the artist from the figure if possible. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.remove_callback:matplotlib.axis.Axis.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.remove\_callback}}}}} & Remove a callback based on its \sphinxstyleemphasis{id}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set:matplotlib.axis.Axis.set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set}}}}} & A property batch setter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_agg_filter:matplotlib.axis.Axis.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_agg\_filter}}}}} & Set the agg filter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_alpha:matplotlib.axis.Axis.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_alpha}}}}} & Set the alpha value used for blending - not supported on all backends. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_animated:matplotlib.axis.Axis.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_animated}}}}} & Set the artist’s animation state. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_clip_box:matplotlib.axis.Axis.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_clip\_box}}}}} & Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_clip_on:matplotlib.axis.Axis.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_clip\_on}}}}} & Set whether artist uses clipping. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_clip_path:matplotlib.axis.Axis.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_clip\_path}}}}} & Set the artist’s clip path, which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_contains:matplotlib.axis.Axis.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_contains}}}}} & Replace the contains test used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_figure:matplotlib.axis.Axis.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_figure}}}}} & Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_gid:matplotlib.axis.Axis.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_gid}}}}} & Sets the (group) id for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_label:matplotlib.axis.Axis.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_label}}}}} & Set the label to \sphinxstyleemphasis{s} for auto legend. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_path_effects:matplotlib.axis.Axis.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_path\_effects}}}}} & Set the path effects. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_picker:matplotlib.axis.Axis.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_picker}}}}} & Set the epsilon for picking used by this artist \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_rasterized:matplotlib.axis.Axis.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_rasterized}}}}} & Force rasterized (bitmap) drawing in vector backend output. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_sketch_params:matplotlib.axis.Axis.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_sketch\_params}}}}} & Sets the sketch parameters. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_snap:matplotlib.axis.Axis.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_snap}}}}} & Sets the snap setting which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_transform:matplotlib.axis.Axis.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_transform}}}}} & Set the artist transform. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_url:matplotlib.axis.Axis.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_url}}}}} & Sets the url for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_visible:matplotlib.axis.Axis.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_visible}}}}} & Set the artist’s visibility. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.set_zorder:matplotlib.axis.Axis.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.set\_zorder}}}}} & Set the zorder for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.stale:matplotlib.axis.Axis.stale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.stale}}}}} & If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.update:matplotlib.axis.Axis.update}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.update}}}}} & Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.update_from:matplotlib.axis.Axis.update_from}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.update\_from}}}}} & Copy properties from \sphinxstyleemphasis{other} to \sphinxstyleemphasis{self}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.zorder:matplotlib.axis.Axis.zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis.zorder}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.add_callback:matplotlib.axis.XAxis.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.add\_callback}}}}} & Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.aname:matplotlib.axis.XAxis.aname}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.aname}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.axes:matplotlib.axis.XAxis.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.axes}}}}} & The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.contains:matplotlib.axis.XAxis.contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.contains}}}}} & Test whether the mouse event occurred in the x axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.convert_xunits:matplotlib.axis.XAxis.convert_xunits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.convert\_xunits}}}}} & For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.convert_yunits:matplotlib.axis.XAxis.convert_yunits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.convert\_yunits}}}}} & For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.draw:matplotlib.axis.XAxis.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.draw}}}}} & Draw the axis lines, grid lines, tick lines and labels \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.findobj:matplotlib.axis.XAxis.findobj}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.findobj}}}}} & Find artist objects. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.format_cursor_data:matplotlib.axis.XAxis.format_cursor_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.format\_cursor\_data}}}}} & Return \sphinxstyleemphasis{cursor data} string formatted. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_agg_filter:matplotlib.axis.XAxis.get_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_agg\_filter}}}}} & Return filter function to be used for agg filter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_alpha:matplotlib.axis.XAxis.get_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_alpha}}}}} & Return the alpha value used for blending - not supported on all backends \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_animated:matplotlib.axis.XAxis.get_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_animated}}}}} & Return the artist’s animated state \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_children:matplotlib.axis.XAxis.get_children}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_children}}}}} & Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_clip_box:matplotlib.axis.XAxis.get_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_clip\_box}}}}} & Return artist clipbox \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_clip_on:matplotlib.axis.XAxis.get_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_clip\_on}}}}} & Return whether artist uses clipping \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_clip_path:matplotlib.axis.XAxis.get_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_clip\_path}}}}} & Return artist clip path \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_contains:matplotlib.axis.XAxis.get_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_contains}}}}} & Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_cursor_data:matplotlib.axis.XAxis.get_cursor_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_cursor\_data}}}}} & Get the cursor data for a given event. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_figure:matplotlib.axis.XAxis.get_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_figure}}}}} & Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_gid:matplotlib.axis.XAxis.get_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_gid}}}}} & Returns the group id. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_label:matplotlib.axis.XAxis.get_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_label}}}}} & Return the axis label as a Text instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_path_effects:matplotlib.axis.XAxis.get_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_path\_effects}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_picker:matplotlib.axis.XAxis.get_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_picker}}}}} & Return the picker object used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_rasterized:matplotlib.axis.XAxis.get_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_rasterized}}}}} & Return whether the artist is to be rasterized. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_sketch_params:matplotlib.axis.XAxis.get_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_sketch\_params}}}}} & Returns the sketch parameters for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_snap:matplotlib.axis.XAxis.get_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_snap}}}}} & Returns the snap setting which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_transform:matplotlib.axis.XAxis.get_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_transform}}}}} & Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_transformed_clip_path_and_affine:matplotlib.axis.XAxis.get_transformed_clip_path_and_affine}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_transformed\_clip\_path\_and\_affine}}}}} & Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_url:matplotlib.axis.XAxis.get_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_url}}}}} & Returns the url. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_visible:matplotlib.axis.XAxis.get_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_visible}}}}} & Return the artist’s visiblity \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_window_extent:matplotlib.axis.XAxis.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_window\_extent}}}}} & Get the axes bounding box in display space. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_zorder:matplotlib.axis.XAxis.get_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.get\_zorder}}}}} & Return the artist’s zorder. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.have_units:matplotlib.axis.XAxis.have_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.have\_units}}}}} & Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.is_transform_set:matplotlib.axis.XAxis.is_transform_set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.is\_transform\_set}}}}} & Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.mouseover:matplotlib.axis.XAxis.mouseover}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.mouseover}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.pchanged:matplotlib.axis.XAxis.pchanged}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.pchanged}}}}} & Fire an event when property changed, calling all of the registered callbacks. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.pick:matplotlib.axis.XAxis.pick}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.pick}}}}} & Process pick event \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.pickable:matplotlib.axis.XAxis.pickable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.pickable}}}}} & Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.properties:matplotlib.axis.XAxis.properties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.properties}}}}} & return a dictionary mapping property name -\textgreater{} value for all Artist props \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.remove:matplotlib.axis.XAxis.remove}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.remove}}}}} & Remove the artist from the figure if possible. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.remove_callback:matplotlib.axis.XAxis.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.remove\_callback}}}}} & Remove a callback based on its \sphinxstyleemphasis{id}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set:matplotlib.axis.XAxis.set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set}}}}} & A property batch setter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_agg_filter:matplotlib.axis.XAxis.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_agg\_filter}}}}} & Set the agg filter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_alpha:matplotlib.axis.XAxis.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_alpha}}}}} & Set the alpha value used for blending - not supported on all backends. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_animated:matplotlib.axis.XAxis.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_animated}}}}} & Set the artist’s animation state. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_clip_box:matplotlib.axis.XAxis.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_clip\_box}}}}} & Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_clip_on:matplotlib.axis.XAxis.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_clip\_on}}}}} & Set whether artist uses clipping. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_clip_path:matplotlib.axis.XAxis.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_clip\_path}}}}} & Set the artist’s clip path, which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_contains:matplotlib.axis.XAxis.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_contains}}}}} & Replace the contains test used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_figure:matplotlib.axis.XAxis.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_figure}}}}} & Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_gid:matplotlib.axis.XAxis.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_gid}}}}} & Sets the (group) id for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_label:matplotlib.axis.XAxis.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_label}}}}} & Set the label to \sphinxstyleemphasis{s} for auto legend. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_path_effects:matplotlib.axis.XAxis.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_path\_effects}}}}} & Set the path effects. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_picker:matplotlib.axis.XAxis.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_picker}}}}} & Set the epsilon for picking used by this artist \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_rasterized:matplotlib.axis.XAxis.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_rasterized}}}}} & Force rasterized (bitmap) drawing in vector backend output. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_sketch_params:matplotlib.axis.XAxis.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_sketch\_params}}}}} & Sets the sketch parameters. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_snap:matplotlib.axis.XAxis.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_snap}}}}} & Sets the snap setting which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_transform:matplotlib.axis.XAxis.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_transform}}}}} & Set the artist transform. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_url:matplotlib.axis.XAxis.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_url}}}}} & Sets the url for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_visible:matplotlib.axis.XAxis.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_visible}}}}} & Set the artist’s visibility. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_zorder:matplotlib.axis.XAxis.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.set\_zorder}}}}} & Set the zorder for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.stale:matplotlib.axis.XAxis.stale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.stale}}}}} & If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.update:matplotlib.axis.XAxis.update}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.update}}}}} & Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.update_from:matplotlib.axis.XAxis.update_from}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.update\_from}}}}} & Copy properties from \sphinxstyleemphasis{other} to \sphinxstyleemphasis{self}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.zorder:matplotlib.axis.XAxis.zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{XAxis.zorder}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.add_callback:matplotlib.axis.YAxis.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.add\_callback}}}}} & Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.aname:matplotlib.axis.YAxis.aname}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.aname}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.axes:matplotlib.axis.YAxis.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.axes}}}}} & The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.contains:matplotlib.axis.YAxis.contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.contains}}}}} & Test whether the mouse event occurred in the y axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.convert_xunits:matplotlib.axis.YAxis.convert_xunits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.convert\_xunits}}}}} & For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.convert_yunits:matplotlib.axis.YAxis.convert_yunits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.convert\_yunits}}}}} & For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.draw:matplotlib.axis.YAxis.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.draw}}}}} & Draw the axis lines, grid lines, tick lines and labels \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.findobj:matplotlib.axis.YAxis.findobj}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.findobj}}}}} & Find artist objects. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.format_cursor_data:matplotlib.axis.YAxis.format_cursor_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.format\_cursor\_data}}}}} & Return \sphinxstyleemphasis{cursor data} string formatted. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_agg_filter:matplotlib.axis.YAxis.get_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_agg\_filter}}}}} & Return filter function to be used for agg filter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_alpha:matplotlib.axis.YAxis.get_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_alpha}}}}} & Return the alpha value used for blending - not supported on all backends \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_animated:matplotlib.axis.YAxis.get_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_animated}}}}} & Return the artist’s animated state \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_children:matplotlib.axis.YAxis.get_children}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_children}}}}} & Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_clip_box:matplotlib.axis.YAxis.get_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_clip\_box}}}}} & Return artist clipbox \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_clip_on:matplotlib.axis.YAxis.get_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_clip\_on}}}}} & Return whether artist uses clipping \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_clip_path:matplotlib.axis.YAxis.get_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_clip\_path}}}}} & Return artist clip path \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_contains:matplotlib.axis.YAxis.get_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_contains}}}}} & Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_cursor_data:matplotlib.axis.YAxis.get_cursor_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_cursor\_data}}}}} & Get the cursor data for a given event. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_figure:matplotlib.axis.YAxis.get_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_figure}}}}} & Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_gid:matplotlib.axis.YAxis.get_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_gid}}}}} & Returns the group id. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_label:matplotlib.axis.YAxis.get_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_label}}}}} & Return the axis label as a Text instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_path_effects:matplotlib.axis.YAxis.get_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_path\_effects}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_picker:matplotlib.axis.YAxis.get_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_picker}}}}} & Return the picker object used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_rasterized:matplotlib.axis.YAxis.get_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_rasterized}}}}} & Return whether the artist is to be rasterized. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_sketch_params:matplotlib.axis.YAxis.get_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_sketch\_params}}}}} & Returns the sketch parameters for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_snap:matplotlib.axis.YAxis.get_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_snap}}}}} & Returns the snap setting which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_transform:matplotlib.axis.YAxis.get_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_transform}}}}} & Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_transformed_clip_path_and_affine:matplotlib.axis.YAxis.get_transformed_clip_path_and_affine}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_transformed\_clip\_path\_and\_affine}}}}} & Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_url:matplotlib.axis.YAxis.get_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_url}}}}} & Returns the url. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_visible:matplotlib.axis.YAxis.get_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_visible}}}}} & Return the artist’s visiblity \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_window_extent:matplotlib.axis.YAxis.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_window\_extent}}}}} & Get the axes bounding box in display space. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_zorder:matplotlib.axis.YAxis.get_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.get\_zorder}}}}} & Return the artist’s zorder. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.have_units:matplotlib.axis.YAxis.have_units}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.have\_units}}}}} & Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.is_transform_set:matplotlib.axis.YAxis.is_transform_set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.is\_transform\_set}}}}} & Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.mouseover:matplotlib.axis.YAxis.mouseover}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.mouseover}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.pchanged:matplotlib.axis.YAxis.pchanged}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.pchanged}}}}} & Fire an event when property changed, calling all of the registered callbacks. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.pick:matplotlib.axis.YAxis.pick}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.pick}}}}} & Process pick event \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.pickable:matplotlib.axis.YAxis.pickable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.pickable}}}}} & Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.properties:matplotlib.axis.YAxis.properties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.properties}}}}} & return a dictionary mapping property name -\textgreater{} value for all Artist props \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.remove:matplotlib.axis.YAxis.remove}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.remove}}}}} & Remove the artist from the figure if possible. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.remove_callback:matplotlib.axis.YAxis.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.remove\_callback}}}}} & Remove a callback based on its \sphinxstyleemphasis{id}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set:matplotlib.axis.YAxis.set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set}}}}} & A property batch setter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_agg_filter:matplotlib.axis.YAxis.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_agg\_filter}}}}} & Set the agg filter. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_alpha:matplotlib.axis.YAxis.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_alpha}}}}} & Set the alpha value used for blending - not supported on all backends. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_animated:matplotlib.axis.YAxis.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_animated}}}}} & Set the artist’s animation state. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_clip_box:matplotlib.axis.YAxis.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_clip\_box}}}}} & Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_clip_on:matplotlib.axis.YAxis.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_clip\_on}}}}} & Set whether artist uses clipping. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_clip_path:matplotlib.axis.YAxis.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_clip\_path}}}}} & Set the artist’s clip path, which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_contains:matplotlib.axis.YAxis.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_contains}}}}} & Replace the contains test used by this artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_figure:matplotlib.axis.YAxis.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_figure}}}}} & Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_gid:matplotlib.axis.YAxis.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_gid}}}}} & Sets the (group) id for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_label:matplotlib.axis.YAxis.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_label}}}}} & Set the label to \sphinxstyleemphasis{s} for auto legend. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_path_effects:matplotlib.axis.YAxis.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_path\_effects}}}}} & Set the path effects. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_picker:matplotlib.axis.YAxis.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_picker}}}}} & Set the epsilon for picking used by this artist \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_rasterized:matplotlib.axis.YAxis.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_rasterized}}}}} & Force rasterized (bitmap) drawing in vector backend output. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_sketch_params:matplotlib.axis.YAxis.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_sketch\_params}}}}} & Sets the sketch parameters. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_snap:matplotlib.axis.YAxis.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_snap}}}}} & Sets the snap setting which may be: \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_transform:matplotlib.axis.YAxis.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_transform}}}}} & Set the artist transform. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_url:matplotlib.axis.YAxis.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_url}}}}} & Sets the url for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_visible:matplotlib.axis.YAxis.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_visible}}}}} & Set the artist’s visibility. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_zorder:matplotlib.axis.YAxis.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.set\_zorder}}}}} & Set the zorder for the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.stale:matplotlib.axis.YAxis.stale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.stale}}}}} & If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.update:matplotlib.axis.YAxis.update}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.update}}}}} & Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.update_from:matplotlib.axis.YAxis.update_from}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.update\_from}}}}} & Copy properties from \sphinxstyleemphasis{other} to \sphinxstyleemphasis{self}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.zorder:matplotlib.axis.YAxis.zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAxis.zorder}}}}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \paragraph{matplotlib.axis.Axis.add\_callback} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.add_callback:matplotlib-axis-axis-add-callback}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.add_callback::doc}}\index{add\_callback() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.add_callback:matplotlib.axis.Axis.add_callback}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.remove_callback:matplotlib.axis.Axis.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.aname} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.aname:matplotlib-axis-axis-aname}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.aname::doc}}\index{aname (matplotlib.axis.Axis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.aname:matplotlib.axis.Axis.aname}}\pysigline{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.axes} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.axes:matplotlib-axis-axis-axes}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.axes::doc}}\index{axes (matplotlib.axis.Axis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.axes:matplotlib.axis.Axis.axes}}\pysigline{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.contains} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.contains:matplotlib-axis-axis-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.contains::doc}}\index{contains() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.contains:matplotlib.axis.Axis.contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the artist contains the mouse event. Returns the truth value and a dictionary of artist specific details of selection, such as which points are contained in the pick radius. See individual artists for details. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.convert\_xunits} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.convert_xunits:matplotlib-axis-axis-convert-xunits}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.convert_xunits::doc}}\index{convert\_xunits() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.convert_xunits:matplotlib.axis.Axis.convert_xunits}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \paragraph{matplotlib.axis.Axis.convert\_yunits} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.convert_yunits:matplotlib-axis-axis-convert-yunits}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.convert_yunits::doc}}\index{convert\_yunits() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.convert_yunits:matplotlib.axis.Axis.convert_yunits}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \paragraph{matplotlib.axis.Axis.draw} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.draw:matplotlib-axis-axis-draw}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.draw::doc}}\index{draw() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.draw:matplotlib.axis.Axis.draw}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}, \emph{*args}, \emph{**kwargs}}{} Draw the axis lines, grid lines, tick lines and labels \end{fulllineitems} \paragraph{matplotlib.axis.Axis.findobj} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.findobj:matplotlib-axis-axis-findobj}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.findobj::doc}}\index{findobj() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.findobj:matplotlib.axis.Axis.findobj}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.format\_cursor\_data} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.format_cursor_data:matplotlib-axis-axis-format-cursor-data}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.format_cursor_data::doc}}\index{format\_cursor\_data() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.format_cursor_data:matplotlib.axis.Axis.format_cursor_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_agg\_filter} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_agg_filter:matplotlib-axis-axis-get-agg-filter}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_agg_filter::doc}}\index{get\_agg\_filter() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_agg_filter:matplotlib.axis.Axis.get_agg_filter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_alpha} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_alpha:matplotlib-axis-axis-get-alpha}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_alpha::doc}}\index{get\_alpha() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_alpha:matplotlib.axis.Axis.get_alpha}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_animated} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_animated:matplotlib-axis-axis-get-animated}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_animated::doc}}\index{get\_animated() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_animated:matplotlib.axis.Axis.get_animated}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_children} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_children:matplotlib-axis-axis-get-children}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_children::doc}}\index{get\_children() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_children:matplotlib.axis.Axis.get_children}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_clip\_box} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_clip_box:matplotlib-axis-axis-get-clip-box}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_clip_box::doc}}\index{get\_clip\_box() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_clip_box:matplotlib.axis.Axis.get_clip_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_clip\_on} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_clip_on:matplotlib-axis-axis-get-clip-on}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_clip_on::doc}}\index{get\_clip\_on() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_clip_on:matplotlib.axis.Axis.get_clip_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_clip\_path} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_clip_path:matplotlib-axis-axis-get-clip-path}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_clip_path::doc}}\index{get\_clip\_path() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_clip_path:matplotlib.axis.Axis.get_clip_path}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_contains} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_contains:matplotlib-axis-axis-get-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_contains::doc}}\index{get\_contains() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_contains:matplotlib.axis.Axis.get_contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_cursor\_data} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_cursor_data:matplotlib-axis-axis-get-cursor-data}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_cursor_data::doc}}\index{get\_cursor\_data() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_cursor_data:matplotlib.axis.Axis.get_cursor_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_figure} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_figure:matplotlib-axis-axis-get-figure}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_figure::doc}}\index{get\_figure() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_figure:matplotlib.axis.Axis.get_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_gid} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_gid:matplotlib-axis-axis-get-gid}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_gid::doc}}\index{get\_gid() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_gid:matplotlib.axis.Axis.get_gid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_label} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_label:matplotlib-axis-axis-get-label}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_label::doc}}\index{get\_label() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_label:matplotlib.axis.Axis.get_label}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Return the axis label as a Text instance \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_path\_effects} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_path_effects:matplotlib-axis-axis-get-path-effects}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_path_effects::doc}}\index{get\_path\_effects() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_path_effects:matplotlib.axis.Axis.get_path_effects}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_picker} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_picker:matplotlib-axis-axis-get-picker}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_picker::doc}}\index{get\_picker() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_picker:matplotlib.axis.Axis.get_picker}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_rasterized} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_rasterized:matplotlib-axis-axis-get-rasterized}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_rasterized::doc}}\index{get\_rasterized() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_rasterized:matplotlib.axis.Axis.get_rasterized}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_sketch\_params} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_sketch_params:matplotlib-axis-axis-get-sketch-params}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_sketch_params::doc}}\index{get\_sketch\_params() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_sketch_params:matplotlib.axis.Axis.get_sketch_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_snap} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_snap:matplotlib-axis-axis-get-snap}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_snap::doc}}\index{get\_snap() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_snap:matplotlib.axis.Axis.get_snap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_transform} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_transform:matplotlib-axis-axis-get-transform}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_transform::doc}}\index{get\_transform() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_transform:matplotlib.axis.Axis.get_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_transformed\_clip\_path\_and\_affine} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_transformed_clip_path_and_affine:matplotlib-axis-axis-get-transformed-clip-path-and-affine}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_transformed_clip_path_and_affine::doc}}\index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_transformed_clip_path_and_affine:matplotlib.axis.Axis.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_url} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_url:matplotlib-axis-axis-get-url}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_url::doc}}\index{get\_url() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_url:matplotlib.axis.Axis.get_url}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_visible} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_visible:matplotlib-axis-axis-get-visible}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_visible::doc}}\index{get\_visible() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_visible:matplotlib.axis.Axis.get_visible}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_window\_extent} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_window_extent:matplotlib-axis-axis-get-window-extent}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_window_extent::doc}}\index{get\_window\_extent() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_window_extent:matplotlib.axis.Axis.get_window_extent}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.get\_zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_zorder:matplotlib-axis-axis-get-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_zorder::doc}}\index{get\_zorder() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.get_zorder:matplotlib.axis.Axis.get_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.have\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.have_units:matplotlib-axis-axis-have-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.have_units::doc}}\index{have\_units() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.have_units:matplotlib.axis.Axis.have_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \paragraph{matplotlib.axis.Axis.is\_transform\_set} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.is_transform_set:matplotlib-axis-axis-is-transform-set}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.is_transform_set::doc}}\index{is\_transform\_set() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.is_transform_set:matplotlib.axis.Axis.is_transform_set}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.mouseover} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.mouseover:matplotlib-axis-axis-mouseover}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.mouseover::doc}}\index{mouseover (matplotlib.axis.Axis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.mouseover:matplotlib.axis.Axis.mouseover}}\pysigline{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \paragraph{matplotlib.axis.Axis.pchanged} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.pchanged:matplotlib-axis-axis-pchanged}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.pchanged::doc}}\index{pchanged() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.pchanged:matplotlib.axis.Axis.pchanged}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.pick} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.pick:matplotlib-axis-axis-pick}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.pick::doc}}\index{pick() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.pick:matplotlib.axis.Axis.pick}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \paragraph{matplotlib.axis.Axis.pickable} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.pickable:matplotlib-axis-axis-pickable}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.pickable::doc}}\index{pickable() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.pickable:matplotlib.axis.Axis.pickable}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.properties} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.properties:matplotlib-axis-axis-properties}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.properties::doc}}\index{properties() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.properties:matplotlib.axis.Axis.properties}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \paragraph{matplotlib.axis.Axis.remove} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.remove:matplotlib-axis-axis-remove}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.remove::doc}}\index{remove() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.remove:matplotlib.axis.Axis.remove}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.remove\_callback} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.remove_callback:matplotlib-axis-axis-remove-callback}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.remove_callback::doc}}\index{remove\_callback() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.remove_callback:matplotlib.axis.Axis.remove_callback}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axis.Axis.add_callback:matplotlib.axis.Axis.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set:matplotlib-axis-axis-set}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set::doc}}\index{set() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set:matplotlib.axis.Axis.set}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_agg\_filter} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_agg_filter:matplotlib-axis-axis-set-agg-filter}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_agg_filter::doc}}\index{set\_agg\_filter() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_agg_filter:matplotlib.axis.Axis.set_agg_filter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_alpha} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_alpha:matplotlib-axis-axis-set-alpha}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_alpha::doc}}\index{set\_alpha() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_alpha:matplotlib.axis.Axis.set_alpha}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha value used for blending - not supported on all backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_animated} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_animated:matplotlib-axis-axis-set-animated}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_animated::doc}}\index{set\_animated() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_animated:matplotlib.axis.Axis.set_animated}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_clip\_box} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_clip_box:matplotlib-axis-axis-set-clip-box}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_clip_box::doc}}\index{set\_clip\_box() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_clip_box:matplotlib.axis.Axis.set_clip_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_clip\_on} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_clip_on:matplotlib-axis-axis-set-clip-on}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_clip_on::doc}}\index{set\_clip\_on() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_clip_on:matplotlib.axis.Axis.set_clip_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_clip\_path} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_clip_path:matplotlib-axis-axis-set-clip-path}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_clip_path::doc}}\index{set\_clip\_path() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_clip_path:matplotlib.axis.Axis.set_clip_path}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{clippath}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_contains} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_contains:matplotlib-axis-axis-set-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_contains::doc}}\index{set\_contains() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_contains:matplotlib.axis.Axis.set_contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_figure} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_figure:matplotlib-axis-axis-set-figure}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_figure::doc}}\index{set\_figure() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_figure:matplotlib.axis.Axis.set_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_gid} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_gid:matplotlib-axis-axis-set-gid}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_gid::doc}}\index{set\_gid() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_gid:matplotlib.axis.Axis.set_gid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_label} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_label:matplotlib-axis-axis-set-label}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_label::doc}}\index{set\_label() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_label:matplotlib.axis.Axis.set_label}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_path\_effects} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_path_effects:matplotlib-axis-axis-set-path-effects}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_path_effects::doc}}\index{set\_path\_effects() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_path_effects:matplotlib.axis.Axis.set_path_effects}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_picker} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_picker:matplotlib-axis-axis-set-picker}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_picker::doc}}\index{set\_picker() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_picker:matplotlib.axis.Axis.set_picker}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_rasterized} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_rasterized:matplotlib-axis-axis-set-rasterized}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_rasterized::doc}}\index{set\_rasterized() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_rasterized:matplotlib.axis.Axis.set_rasterized}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_sketch\_params} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_sketch_params:matplotlib-axis-axis-set-sketch-params}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_sketch_params::doc}}\index{set\_sketch\_params() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_sketch_params:matplotlib.axis.Axis.set_sketch_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_snap} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_snap:matplotlib-axis-axis-set-snap}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_snap::doc}}\index{set\_snap() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_snap:matplotlib.axis.Axis.set_snap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_transform} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_transform:matplotlib-axis-axis-set-transform}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_transform::doc}}\index{set\_transform() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_transform:matplotlib.axis.Axis.set_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_url} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_url:matplotlib-axis-axis-set-url}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_url::doc}}\index{set\_url() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_url:matplotlib.axis.Axis.set_url}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_visible} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_visible:matplotlib-axis-axis-set-visible}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_visible::doc}}\index{set\_visible() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_visible:matplotlib.axis.Axis.set_visible}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.set\_zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_zorder:matplotlib-axis-axis-set-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_zorder::doc}}\index{set\_zorder() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.set_zorder:matplotlib.axis.Axis.set_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.Axis.stale} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.stale:matplotlib-axis-axis-stale}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.stale::doc}}\index{stale (matplotlib.axis.Axis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.stale:matplotlib.axis.Axis.stale}}\pysigline{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.update} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.update:matplotlib-axis-axis-update}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.update::doc}}\index{update() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.update:matplotlib.axis.Axis.update}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.update\_from} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.update_from:matplotlib-axis-axis-update-from}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.update_from::doc}}\index{update\_from() (matplotlib.axis.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.update_from:matplotlib.axis.Axis.update_from}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} Copy properties from \sphinxstyleemphasis{other} to \sphinxstyleemphasis{self}. \end{fulllineitems} \paragraph{matplotlib.axis.Axis.zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.Axis.zorder:matplotlib-axis-axis-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.zorder::doc}}\index{zorder (matplotlib.axis.Axis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.Axis.zorder:matplotlib.axis.Axis.zorder}}\pysigline{\sphinxcode{\sphinxupquote{Axis.}}\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.add\_callback} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.add_callback:matplotlib-axis-xaxis-add-callback}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.add_callback::doc}}\index{add\_callback() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.add_callback:matplotlib.axis.XAxis.add_callback}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.remove_callback:matplotlib.axis.XAxis.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.aname} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.aname:matplotlib-axis-xaxis-aname}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.aname::doc}}\index{aname (matplotlib.axis.XAxis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.aname:matplotlib.axis.XAxis.aname}}\pysigline{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.axes} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.axes:matplotlib-axis-xaxis-axes}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.axes::doc}}\index{axes (matplotlib.axis.XAxis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.axes:matplotlib.axis.XAxis.axes}}\pysigline{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.contains} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.contains:matplotlib-axis-xaxis-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.contains::doc}}\index{contains() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.contains:matplotlib.axis.XAxis.contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the x axis. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.convert\_xunits} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.convert_xunits:matplotlib-axis-xaxis-convert-xunits}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.convert_xunits::doc}}\index{convert\_xunits() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.convert_xunits:matplotlib.axis.XAxis.convert_xunits}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.convert\_yunits} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.convert_yunits:matplotlib-axis-xaxis-convert-yunits}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.convert_yunits::doc}}\index{convert\_yunits() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.convert_yunits:matplotlib.axis.XAxis.convert_yunits}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.draw} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.draw:matplotlib-axis-xaxis-draw}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.draw::doc}}\index{draw() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.draw:matplotlib.axis.XAxis.draw}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}, \emph{*args}, \emph{**kwargs}}{} Draw the axis lines, grid lines, tick lines and labels \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.findobj} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.findobj:matplotlib-axis-xaxis-findobj}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.findobj::doc}}\index{findobj() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.findobj:matplotlib.axis.XAxis.findobj}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.format\_cursor\_data} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.format_cursor_data:matplotlib-axis-xaxis-format-cursor-data}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.format_cursor_data::doc}}\index{format\_cursor\_data() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.format_cursor_data:matplotlib.axis.XAxis.format_cursor_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_agg\_filter} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_agg_filter:matplotlib-axis-xaxis-get-agg-filter}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_agg_filter::doc}}\index{get\_agg\_filter() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_agg_filter:matplotlib.axis.XAxis.get_agg_filter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_alpha} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_alpha:matplotlib-axis-xaxis-get-alpha}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_alpha::doc}}\index{get\_alpha() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_alpha:matplotlib.axis.XAxis.get_alpha}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_animated} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_animated:matplotlib-axis-xaxis-get-animated}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_animated::doc}}\index{get\_animated() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_animated:matplotlib.axis.XAxis.get_animated}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_children} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_children:matplotlib-axis-xaxis-get-children}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_children::doc}}\index{get\_children() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_children:matplotlib.axis.XAxis.get_children}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_clip\_box} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_clip_box:matplotlib-axis-xaxis-get-clip-box}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_clip_box::doc}}\index{get\_clip\_box() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_clip_box:matplotlib.axis.XAxis.get_clip_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_clip\_on} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_clip_on:matplotlib-axis-xaxis-get-clip-on}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_clip_on::doc}}\index{get\_clip\_on() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_clip_on:matplotlib.axis.XAxis.get_clip_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_clip\_path} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_clip_path:matplotlib-axis-xaxis-get-clip-path}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_clip_path::doc}}\index{get\_clip\_path() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_clip_path:matplotlib.axis.XAxis.get_clip_path}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_contains} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_contains:matplotlib-axis-xaxis-get-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_contains::doc}}\index{get\_contains() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_contains:matplotlib.axis.XAxis.get_contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_cursor\_data} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_cursor_data:matplotlib-axis-xaxis-get-cursor-data}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_cursor_data::doc}}\index{get\_cursor\_data() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_cursor_data:matplotlib.axis.XAxis.get_cursor_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_figure} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_figure:matplotlib-axis-xaxis-get-figure}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_figure::doc}}\index{get\_figure() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_figure:matplotlib.axis.XAxis.get_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_gid} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_gid:matplotlib-axis-xaxis-get-gid}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_gid::doc}}\index{get\_gid() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_gid:matplotlib.axis.XAxis.get_gid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_label} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_label:matplotlib-axis-xaxis-get-label}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_label::doc}}\index{get\_label() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_label:matplotlib.axis.XAxis.get_label}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Return the axis label as a Text instance \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_path\_effects} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_path_effects:matplotlib-axis-xaxis-get-path-effects}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_path_effects::doc}}\index{get\_path\_effects() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_path_effects:matplotlib.axis.XAxis.get_path_effects}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_picker} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_picker:matplotlib-axis-xaxis-get-picker}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_picker::doc}}\index{get\_picker() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_picker:matplotlib.axis.XAxis.get_picker}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_rasterized} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_rasterized:matplotlib-axis-xaxis-get-rasterized}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_rasterized::doc}}\index{get\_rasterized() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_rasterized:matplotlib.axis.XAxis.get_rasterized}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_sketch\_params} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_sketch_params:matplotlib-axis-xaxis-get-sketch-params}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_sketch_params::doc}}\index{get\_sketch\_params() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_sketch_params:matplotlib.axis.XAxis.get_sketch_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_snap} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_snap:matplotlib-axis-xaxis-get-snap}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_snap::doc}}\index{get\_snap() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_snap:matplotlib.axis.XAxis.get_snap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_transform} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_transform:matplotlib-axis-xaxis-get-transform}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_transform::doc}}\index{get\_transform() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_transform:matplotlib.axis.XAxis.get_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_transformed\_clip\_path\_and\_affine} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_transformed_clip_path_and_affine:matplotlib-axis-xaxis-get-transformed-clip-path-and-affine}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_transformed_clip_path_and_affine::doc}}\index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_transformed_clip_path_and_affine:matplotlib.axis.XAxis.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_url} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_url:matplotlib-axis-xaxis-get-url}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_url::doc}}\index{get\_url() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_url:matplotlib.axis.XAxis.get_url}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_visible} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_visible:matplotlib-axis-xaxis-get-visible}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_visible::doc}}\index{get\_visible() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_visible:matplotlib.axis.XAxis.get_visible}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_window\_extent} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_window_extent:matplotlib-axis-xaxis-get-window-extent}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_window_extent::doc}}\index{get\_window\_extent() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_window_extent:matplotlib.axis.XAxis.get_window_extent}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.get\_zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_zorder:matplotlib-axis-xaxis-get-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_zorder::doc}}\index{get\_zorder() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.get_zorder:matplotlib.axis.XAxis.get_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.have\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.have_units:matplotlib-axis-xaxis-have-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.have_units::doc}}\index{have\_units() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.have_units:matplotlib.axis.XAxis.have_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.is\_transform\_set} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.is_transform_set:matplotlib-axis-xaxis-is-transform-set}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.is_transform_set::doc}}\index{is\_transform\_set() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.is_transform_set:matplotlib.axis.XAxis.is_transform_set}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.mouseover} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.mouseover:matplotlib-axis-xaxis-mouseover}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.mouseover::doc}}\index{mouseover (matplotlib.axis.XAxis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.mouseover:matplotlib.axis.XAxis.mouseover}}\pysigline{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.pchanged} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.pchanged:matplotlib-axis-xaxis-pchanged}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.pchanged::doc}}\index{pchanged() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.pchanged:matplotlib.axis.XAxis.pchanged}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.pick} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.pick:matplotlib-axis-xaxis-pick}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.pick::doc}}\index{pick() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.pick:matplotlib.axis.XAxis.pick}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.pickable} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.pickable:matplotlib-axis-xaxis-pickable}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.pickable::doc}}\index{pickable() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.pickable:matplotlib.axis.XAxis.pickable}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.properties} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.properties:matplotlib-axis-xaxis-properties}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.properties::doc}}\index{properties() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.properties:matplotlib.axis.XAxis.properties}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.remove} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.remove:matplotlib-axis-xaxis-remove}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.remove::doc}}\index{remove() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.remove:matplotlib.axis.XAxis.remove}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.remove\_callback} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.remove_callback:matplotlib-axis-xaxis-remove-callback}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.remove_callback::doc}}\index{remove\_callback() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.remove_callback:matplotlib.axis.XAxis.remove_callback}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axis.XAxis.add_callback:matplotlib.axis.XAxis.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set:matplotlib-axis-xaxis-set}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set::doc}}\index{set() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set:matplotlib.axis.XAxis.set}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_agg\_filter} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_agg_filter:matplotlib-axis-xaxis-set-agg-filter}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_agg_filter::doc}}\index{set\_agg\_filter() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_agg_filter:matplotlib.axis.XAxis.set_agg_filter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_alpha} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_alpha:matplotlib-axis-xaxis-set-alpha}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_alpha::doc}}\index{set\_alpha() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_alpha:matplotlib.axis.XAxis.set_alpha}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha value used for blending - not supported on all backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_animated} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_animated:matplotlib-axis-xaxis-set-animated}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_animated::doc}}\index{set\_animated() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_animated:matplotlib.axis.XAxis.set_animated}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_clip\_box} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_clip_box:matplotlib-axis-xaxis-set-clip-box}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_clip_box::doc}}\index{set\_clip\_box() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_clip_box:matplotlib.axis.XAxis.set_clip_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_clip\_on} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_clip_on:matplotlib-axis-xaxis-set-clip-on}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_clip_on::doc}}\index{set\_clip\_on() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_clip_on:matplotlib.axis.XAxis.set_clip_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_clip\_path} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_clip_path:matplotlib-axis-xaxis-set-clip-path}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_clip_path::doc}}\index{set\_clip\_path() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_clip_path:matplotlib.axis.XAxis.set_clip_path}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{clippath}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_contains} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_contains:matplotlib-axis-xaxis-set-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_contains::doc}}\index{set\_contains() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_contains:matplotlib.axis.XAxis.set_contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_figure} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_figure:matplotlib-axis-xaxis-set-figure}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_figure::doc}}\index{set\_figure() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_figure:matplotlib.axis.XAxis.set_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_gid} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_gid:matplotlib-axis-xaxis-set-gid}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_gid::doc}}\index{set\_gid() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_gid:matplotlib.axis.XAxis.set_gid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_label} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_label:matplotlib-axis-xaxis-set-label}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_label::doc}}\index{set\_label() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_label:matplotlib.axis.XAxis.set_label}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_path\_effects} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_path_effects:matplotlib-axis-xaxis-set-path-effects}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_path_effects::doc}}\index{set\_path\_effects() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_path_effects:matplotlib.axis.XAxis.set_path_effects}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_picker} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_picker:matplotlib-axis-xaxis-set-picker}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_picker::doc}}\index{set\_picker() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_picker:matplotlib.axis.XAxis.set_picker}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_rasterized} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_rasterized:matplotlib-axis-xaxis-set-rasterized}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_rasterized::doc}}\index{set\_rasterized() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_rasterized:matplotlib.axis.XAxis.set_rasterized}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_sketch\_params} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_sketch_params:matplotlib-axis-xaxis-set-sketch-params}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_sketch_params::doc}}\index{set\_sketch\_params() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_sketch_params:matplotlib.axis.XAxis.set_sketch_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_snap} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_snap:matplotlib-axis-xaxis-set-snap}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_snap::doc}}\index{set\_snap() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_snap:matplotlib.axis.XAxis.set_snap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_transform} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_transform:matplotlib-axis-xaxis-set-transform}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_transform::doc}}\index{set\_transform() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_transform:matplotlib.axis.XAxis.set_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_url} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_url:matplotlib-axis-xaxis-set-url}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_url::doc}}\index{set\_url() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_url:matplotlib.axis.XAxis.set_url}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_visible} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_visible:matplotlib-axis-xaxis-set-visible}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_visible::doc}}\index{set\_visible() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_visible:matplotlib.axis.XAxis.set_visible}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.set\_zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_zorder:matplotlib-axis-xaxis-set-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_zorder::doc}}\index{set\_zorder() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.set_zorder:matplotlib.axis.XAxis.set_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.stale} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.stale:matplotlib-axis-xaxis-stale}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.stale::doc}}\index{stale (matplotlib.axis.XAxis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.stale:matplotlib.axis.XAxis.stale}}\pysigline{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.update} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.update:matplotlib-axis-xaxis-update}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.update::doc}}\index{update() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.update:matplotlib.axis.XAxis.update}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.update\_from} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.update_from:matplotlib-axis-xaxis-update-from}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.update_from::doc}}\index{update\_from() (matplotlib.axis.XAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.update_from:matplotlib.axis.XAxis.update_from}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} Copy properties from \sphinxstyleemphasis{other} to \sphinxstyleemphasis{self}. \end{fulllineitems} \paragraph{matplotlib.axis.XAxis.zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.zorder:matplotlib-axis-xaxis-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.zorder::doc}}\index{zorder (matplotlib.axis.XAxis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.XAxis.zorder:matplotlib.axis.XAxis.zorder}}\pysigline{\sphinxcode{\sphinxupquote{XAxis.}}\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.add\_callback} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.add_callback:matplotlib-axis-yaxis-add-callback}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.add_callback::doc}}\index{add\_callback() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.add_callback:matplotlib.axis.YAxis.add_callback}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.remove_callback:matplotlib.axis.YAxis.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.aname} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.aname:matplotlib-axis-yaxis-aname}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.aname::doc}}\index{aname (matplotlib.axis.YAxis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.aname:matplotlib.axis.YAxis.aname}}\pysigline{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.axes} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.axes:matplotlib-axis-yaxis-axes}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.axes::doc}}\index{axes (matplotlib.axis.YAxis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.axes:matplotlib.axis.YAxis.axes}}\pysigline{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.contains} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.contains:matplotlib-axis-yaxis-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.contains::doc}}\index{contains() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.contains:matplotlib.axis.YAxis.contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the y axis. Returns \sphinxstyleemphasis{True} \textbar{} \sphinxstyleemphasis{False} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.convert\_xunits} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.convert_xunits:matplotlib-axis-yaxis-convert-xunits}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.convert_xunits::doc}}\index{convert\_xunits() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.convert_xunits:matplotlib.axis.YAxis.convert_xunits}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.convert\_yunits} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.convert_yunits:matplotlib-axis-yaxis-convert-yunits}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.convert_yunits::doc}}\index{convert\_yunits() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.convert_yunits:matplotlib.axis.YAxis.convert_yunits}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.draw} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.draw:matplotlib-axis-yaxis-draw}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.draw::doc}}\index{draw() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.draw:matplotlib.axis.YAxis.draw}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}, \emph{*args}, \emph{**kwargs}}{} Draw the axis lines, grid lines, tick lines and labels \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.findobj} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.findobj:matplotlib-axis-yaxis-findobj}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.findobj::doc}}\index{findobj() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.findobj:matplotlib.axis.YAxis.findobj}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.format\_cursor\_data} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.format_cursor_data:matplotlib-axis-yaxis-format-cursor-data}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.format_cursor_data::doc}}\index{format\_cursor\_data() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.format_cursor_data:matplotlib.axis.YAxis.format_cursor_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_agg\_filter} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_agg_filter:matplotlib-axis-yaxis-get-agg-filter}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_agg_filter::doc}}\index{get\_agg\_filter() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_agg_filter:matplotlib.axis.YAxis.get_agg_filter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_alpha} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_alpha:matplotlib-axis-yaxis-get-alpha}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_alpha::doc}}\index{get\_alpha() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_alpha:matplotlib.axis.YAxis.get_alpha}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_animated} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_animated:matplotlib-axis-yaxis-get-animated}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_animated::doc}}\index{get\_animated() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_animated:matplotlib.axis.YAxis.get_animated}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_children} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_children:matplotlib-axis-yaxis-get-children}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_children::doc}}\index{get\_children() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_children:matplotlib.axis.YAxis.get_children}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_clip\_box} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_clip_box:matplotlib-axis-yaxis-get-clip-box}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_clip_box::doc}}\index{get\_clip\_box() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_clip_box:matplotlib.axis.YAxis.get_clip_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_clip\_on} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_clip_on:matplotlib-axis-yaxis-get-clip-on}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_clip_on::doc}}\index{get\_clip\_on() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_clip_on:matplotlib.axis.YAxis.get_clip_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_clip\_path} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_clip_path:matplotlib-axis-yaxis-get-clip-path}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_clip_path::doc}}\index{get\_clip\_path() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_clip_path:matplotlib.axis.YAxis.get_clip_path}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_contains} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_contains:matplotlib-axis-yaxis-get-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_contains::doc}}\index{get\_contains() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_contains:matplotlib.axis.YAxis.get_contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_cursor\_data} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_cursor_data:matplotlib-axis-yaxis-get-cursor-data}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_cursor_data::doc}}\index{get\_cursor\_data() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_cursor_data:matplotlib.axis.YAxis.get_cursor_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_figure} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_figure:matplotlib-axis-yaxis-get-figure}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_figure::doc}}\index{get\_figure() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_figure:matplotlib.axis.YAxis.get_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_gid} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_gid:matplotlib-axis-yaxis-get-gid}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_gid::doc}}\index{get\_gid() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_gid:matplotlib.axis.YAxis.get_gid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_label} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_label:matplotlib-axis-yaxis-get-label}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_label::doc}}\index{get\_label() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_label:matplotlib.axis.YAxis.get_label}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Return the axis label as a Text instance \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_path\_effects} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_path_effects:matplotlib-axis-yaxis-get-path-effects}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_path_effects::doc}}\index{get\_path\_effects() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_path_effects:matplotlib.axis.YAxis.get_path_effects}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_picker} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_picker:matplotlib-axis-yaxis-get-picker}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_picker::doc}}\index{get\_picker() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_picker:matplotlib.axis.YAxis.get_picker}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_rasterized} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_rasterized:matplotlib-axis-yaxis-get-rasterized}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_rasterized::doc}}\index{get\_rasterized() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_rasterized:matplotlib.axis.YAxis.get_rasterized}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_sketch\_params} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_sketch_params:matplotlib-axis-yaxis-get-sketch-params}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_sketch_params::doc}}\index{get\_sketch\_params() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_sketch_params:matplotlib.axis.YAxis.get_sketch_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_snap} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_snap:matplotlib-axis-yaxis-get-snap}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_snap::doc}}\index{get\_snap() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_snap:matplotlib.axis.YAxis.get_snap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_transform} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_transform:matplotlib-axis-yaxis-get-transform}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_transform::doc}}\index{get\_transform() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_transform:matplotlib.axis.YAxis.get_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_transformed\_clip\_path\_and\_affine} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_transformed_clip_path_and_affine:matplotlib-axis-yaxis-get-transformed-clip-path-and-affine}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_transformed_clip_path_and_affine::doc}}\index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_transformed_clip_path_and_affine:matplotlib.axis.YAxis.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_url} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_url:matplotlib-axis-yaxis-get-url}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_url::doc}}\index{get\_url() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_url:matplotlib.axis.YAxis.get_url}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_visible} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_visible:matplotlib-axis-yaxis-get-visible}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_visible::doc}}\index{get\_visible() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_visible:matplotlib.axis.YAxis.get_visible}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_window\_extent} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_window_extent:matplotlib-axis-yaxis-get-window-extent}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_window_extent::doc}}\index{get\_window\_extent() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_window_extent:matplotlib.axis.YAxis.get_window_extent}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.get\_zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_zorder:matplotlib-axis-yaxis-get-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_zorder::doc}}\index{get\_zorder() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.get_zorder:matplotlib.axis.YAxis.get_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.have\_units} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.have_units:matplotlib-axis-yaxis-have-units}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.have_units::doc}}\index{have\_units() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.have_units:matplotlib.axis.YAxis.have_units}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.is\_transform\_set} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.is_transform_set:matplotlib-axis-yaxis-is-transform-set}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.is_transform_set::doc}}\index{is\_transform\_set() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.is_transform_set:matplotlib.axis.YAxis.is_transform_set}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.mouseover} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.mouseover:matplotlib-axis-yaxis-mouseover}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.mouseover::doc}}\index{mouseover (matplotlib.axis.YAxis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.mouseover:matplotlib.axis.YAxis.mouseover}}\pysigline{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.pchanged} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.pchanged:matplotlib-axis-yaxis-pchanged}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.pchanged::doc}}\index{pchanged() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.pchanged:matplotlib.axis.YAxis.pchanged}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.pick} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.pick:matplotlib-axis-yaxis-pick}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.pick::doc}}\index{pick() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.pick:matplotlib.axis.YAxis.pick}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.pickable} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.pickable:matplotlib-axis-yaxis-pickable}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.pickable::doc}}\index{pickable() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.pickable:matplotlib.axis.YAxis.pickable}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.properties} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.properties:matplotlib-axis-yaxis-properties}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.properties::doc}}\index{properties() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.properties:matplotlib.axis.YAxis.properties}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.remove} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.remove:matplotlib-axis-yaxis-remove}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.remove::doc}}\index{remove() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.remove:matplotlib.axis.YAxis.remove}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.remove\_callback} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.remove_callback:matplotlib-axis-yaxis-remove-callback}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.remove_callback::doc}}\index{remove\_callback() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.remove_callback:matplotlib.axis.YAxis.remove_callback}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.axis.YAxis.add_callback:matplotlib.axis.YAxis.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set:matplotlib-axis-yaxis-set}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set::doc}}\index{set() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set:matplotlib.axis.YAxis.set}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_agg\_filter} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_agg_filter:matplotlib-axis-yaxis-set-agg-filter}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_agg_filter::doc}}\index{set\_agg\_filter() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_agg_filter:matplotlib.axis.YAxis.set_agg_filter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_alpha} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_alpha:matplotlib-axis-yaxis-set-alpha}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_alpha::doc}}\index{set\_alpha() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_alpha:matplotlib.axis.YAxis.set_alpha}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha value used for blending - not supported on all backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_animated} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_animated:matplotlib-axis-yaxis-set-animated}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_animated::doc}}\index{set\_animated() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_animated:matplotlib.axis.YAxis.set_animated}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_clip\_box} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_clip_box:matplotlib-axis-yaxis-set-clip-box}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_clip_box::doc}}\index{set\_clip\_box() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_clip_box:matplotlib.axis.YAxis.set_clip_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_clip\_on} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_clip_on:matplotlib-axis-yaxis-set-clip-on}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_clip_on::doc}}\index{set\_clip\_on() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_clip_on:matplotlib.axis.YAxis.set_clip_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_clip\_path} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_clip_path:matplotlib-axis-yaxis-set-clip-path}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_clip_path::doc}}\index{set\_clip\_path() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_clip_path:matplotlib.axis.YAxis.set_clip_path}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{clippath}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_contains} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_contains:matplotlib-axis-yaxis-set-contains}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_contains::doc}}\index{set\_contains() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_contains:matplotlib.axis.YAxis.set_contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_figure} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_figure:matplotlib-axis-yaxis-set-figure}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_figure::doc}}\index{set\_figure() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_figure:matplotlib.axis.YAxis.set_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_gid} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_gid:matplotlib-axis-yaxis-set-gid}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_gid::doc}}\index{set\_gid() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_gid:matplotlib.axis.YAxis.set_gid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_label} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_label:matplotlib-axis-yaxis-set-label}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_label::doc}}\index{set\_label() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_label:matplotlib.axis.YAxis.set_label}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_path\_effects} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_path_effects:matplotlib-axis-yaxis-set-path-effects}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_path_effects::doc}}\index{set\_path\_effects() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_path_effects:matplotlib.axis.YAxis.set_path_effects}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_picker} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_picker:matplotlib-axis-yaxis-set-picker}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_picker::doc}}\index{set\_picker() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_picker:matplotlib.axis.YAxis.set_picker}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_rasterized} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_rasterized:matplotlib-axis-yaxis-set-rasterized}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_rasterized::doc}}\index{set\_rasterized() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_rasterized:matplotlib.axis.YAxis.set_rasterized}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_sketch\_params} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_sketch_params:matplotlib-axis-yaxis-set-sketch-params}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_sketch_params::doc}}\index{set\_sketch\_params() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_sketch_params:matplotlib.axis.YAxis.set_sketch_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_snap} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_snap:matplotlib-axis-yaxis-set-snap}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_snap::doc}}\index{set\_snap() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_snap:matplotlib.axis.YAxis.set_snap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_transform} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_transform:matplotlib-axis-yaxis-set-transform}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_transform::doc}}\index{set\_transform() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_transform:matplotlib.axis.YAxis.set_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_url} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_url:matplotlib-axis-yaxis-set-url}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_url::doc}}\index{set\_url() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_url:matplotlib.axis.YAxis.set_url}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_visible} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_visible:matplotlib-axis-yaxis-set-visible}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_visible::doc}}\index{set\_visible() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_visible:matplotlib.axis.YAxis.set_visible}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.set\_zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_zorder:matplotlib-axis-yaxis-set-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_zorder::doc}}\index{set\_zorder() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.set_zorder:matplotlib.axis.YAxis.set_zorder}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.stale} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.stale:matplotlib-axis-yaxis-stale}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.stale::doc}}\index{stale (matplotlib.axis.YAxis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.stale:matplotlib.axis.YAxis.stale}}\pysigline{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.update} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.update:matplotlib-axis-yaxis-update}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.update::doc}}\index{update() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.update:matplotlib.axis.YAxis.update}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.update\_from} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.update_from:matplotlib-axis-yaxis-update-from}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.update_from::doc}}\index{update\_from() (matplotlib.axis.YAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.update_from:matplotlib.axis.YAxis.update_from}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} Copy properties from \sphinxstyleemphasis{other} to \sphinxstyleemphasis{self}. \end{fulllineitems} \paragraph{matplotlib.axis.YAxis.zorder} \label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.zorder:matplotlib-axis-yaxis-zorder}}\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.zorder::doc}}\index{zorder (matplotlib.axis.YAxis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.axis.YAxis.zorder:matplotlib.axis.YAxis.zorder}}\pysigline{\sphinxcode{\sphinxupquote{YAxis.}}\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \chapter{backends} \label{\detokenize{api/index_backend_api:backends}}\label{\detokenize{api/index_backend_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backend\_bases}}} \label{\detokenize{api/backend_bases_api:module-matplotlib.backend_bases}}\label{\detokenize{api/backend_bases_api:matplotlib-backend-bases}}\label{\detokenize{api/backend_bases_api::doc}}\index{matplotlib.backend\_bases (module)} Abstract base classes define the primitives that renderers and graphics contexts must implement to serve as a matplotlib backend \begin{description} \item[{{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RendererBase}}}}}}] \leavevmode An abstract base class to handle drawing/rendering operations. \item[{{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FigureCanvasBase}}}}}}] \leavevmode The abstraction layer that separates the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure}}}}} from the backend specific details like a user interface drawing area \item[{{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GraphicsContextBase}}}}}}] \leavevmode An abstract base class that provides color, line styles, etc… \item[{{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Event}}}}}}] \leavevmode The base class for all of the matplotlib event handling. Derived classes such as {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.KeyEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{KeyEvent}}}}} and {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MouseEvent}}}}} store the meta data like keys and buttons pressed, x and y locations in pixel and {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} coordinates. \item[{{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.ShowBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ShowBase}}}}}}] \leavevmode The base class for the Show class of each interactive backend; the ‘show’ callable is then set to Show.\_\_call\_\_, inherited from ShowBase. \item[{{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.ToolContainerBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolContainerBase}}}}}}] \leavevmode The base class for the Toolbar class of each interactive backend. \item[{{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.StatusbarBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{StatusbarBase}}}}}}] \leavevmode The base class for the messaging area. \end{description} \index{CloseEvent (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.CloseEvent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{CloseEvent}}}{\emph{name}, \emph{canvas}, \emph{guiEvent=None}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.Event}}}}} An event triggered by a figure being closed \end{fulllineitems} \index{DrawEvent (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.DrawEvent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{DrawEvent}}}{\emph{name}, \emph{canvas}, \emph{renderer}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.Event}}}}} An event triggered by a draw operation on the canvas In most backends callbacks subscribed to this callback will be fired after the rendering is complete but before the screen is updated. Any extra artists drawn to the canvas’s renderer will be reflected without an explicit call to \sphinxcode{\sphinxupquote{blit}}. \begin{sphinxadmonition}{warning}{Warning:} Calling \sphinxcode{\sphinxupquote{canvas.draw}} and \sphinxcode{\sphinxupquote{canvas.blit}} in these callbacks may not be safe with all backends and may cause infinite recursion. \end{sphinxadmonition} In addition to the {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Event}}}}} attributes, the following event attributes are defined: \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{renderer}}] \leavevmode{[}{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RendererBase}}}}}{]} the renderer for the draw event \end{description} \end{description}\end{quote} \end{fulllineitems} \index{Event (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{Event}}}{\emph{name}, \emph{canvas}, \emph{guiEvent=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} A matplotlib event. Attach additional attributes as defined in {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.mpl_connect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FigureCanvasBase.mpl\_connect()}}}}}. The following attributes are defined and shown with their default values \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{name}}] \leavevmode{[}str{]} the event name \item[{\sphinxstylestrong{canvas}}] \leavevmode{[}{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FigureCanvasBase}}}}}{]} the backend-specific canvas instance generating the event \item[{\sphinxstylestrong{guiEvent}}] \leavevmode the GUI event that triggered the matplotlib event \end{description} \end{description}\end{quote} \end{fulllineitems} \index{FigureCanvasBase (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{FigureCanvasBase}}}{\emph{figure}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} The canvas the figure renders into. Public attributes \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{figure}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure}}}}}{]} A high-level figure instance \end{description} \end{description}\end{quote} \index{blit() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.blit}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{blit}}}{\emph{bbox=None}}{} Blit the canvas in bbox (default entire canvas). \end{fulllineitems} \index{button\_press\_event() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.button_press_event}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{button\_press\_event}}}{\emph{x}, \emph{y}, \emph{button}, \emph{dblclick=False}, \emph{guiEvent=None}}{} Backend derived classes should call this function on any mouse button press. x,y are the canvas coords: 0,0 is lower, left. button and key are as defined in {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MouseEvent}}}}}. This method will be call all functions connected to the ‘button\_press\_event’ with a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MouseEvent}}}}} instance. \end{fulllineitems} \index{button\_release\_event() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.button_release_event}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{button\_release\_event}}}{\emph{x}, \emph{y}, \emph{button}, \emph{guiEvent=None}}{} Backend derived classes should call this function on any mouse button release. This method will call all functions connected to the ‘button\_release\_event’ with a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MouseEvent}}}}} instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar{]} the canvas coordinates where 0=left \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar{]} the canvas coordinates where 0=bottom \item[{\sphinxstylestrong{guiEvent}}] \leavevmode the native UI event that generated the mpl event \end{description} \end{description}\end{quote} \end{fulllineitems} \index{close\_event() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.close_event}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{close\_event}}}{\emph{guiEvent=None}}{} Pass a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.CloseEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CloseEvent}}}}} to all functions connected to \sphinxcode{\sphinxupquote{close\_event}}. \end{fulllineitems} \index{draw() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{*args}, \emph{**kwargs}}{} Render the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \end{fulllineitems} \index{draw\_cursor() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.draw_cursor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_cursor}}}{\emph{event}}{} Draw a cursor in the event.axes if inaxes is not None. Use native GUI drawing for efficiency if possible \end{fulllineitems} \index{draw\_event() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.draw_event}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_event}}}{\emph{renderer}}{} Pass a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.DrawEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{DrawEvent}}}}} to all functions connected to \sphinxcode{\sphinxupquote{draw\_event}}. \end{fulllineitems} \index{draw\_idle() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.draw_idle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_idle}}}{\emph{*args}, \emph{**kwargs}}{} {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw()}}}}} only if idle; defaults to draw but backends can override \end{fulllineitems} \index{enter\_notify\_event() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.enter_notify_event}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{enter\_notify\_event}}}{\emph{guiEvent=None}, \emph{xy=None}}{} Backend derived classes should call this function when entering canvas \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{guiEvent}}] \leavevmode the native UI event that generated the mpl event \item[{\sphinxstylestrong{xy}}] \leavevmode{[}tuple of 2 scalars{]} the coordinate location of the pointer when the canvas is entered \end{description} \end{description}\end{quote} \end{fulllineitems} \index{events (matplotlib.backend\_bases.FigureCanvasBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.events}}\pysigline{\sphinxbfcode{\sphinxupquote{events}}\sphinxbfcode{\sphinxupquote{ = {[}'resize\_event', 'draw\_event', 'key\_press\_event', 'key\_release\_event', 'button\_press\_event', 'button\_release\_event', 'scroll\_event', 'motion\_notify\_event', 'pick\_event', 'idle\_event', 'figure\_enter\_event', 'figure\_leave\_event', 'axes\_enter\_event', 'axes\_leave\_event', 'close\_event'{]}}}} \end{fulllineitems} \index{filetypes (matplotlib.backend\_bases.FigureCanvasBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.filetypes}}\pysigline{\sphinxbfcode{\sphinxupquote{filetypes}}\sphinxbfcode{\sphinxupquote{ = \{'eps': 'Encapsulated Postscript', 'jpeg': 'Joint Photographic Experts Group', 'jpg': 'Joint Photographic Experts Group', 'pdf': 'Portable Document Format', 'pgf': 'PGF code for LaTeX', 'png': 'Portable Network Graphics', 'ps': 'Postscript', 'raw': 'Raw RGBA bitmap', 'rgba': 'Raw RGBA bitmap', 'svg': 'Scalable Vector Graphics', 'svgz': 'Scalable Vector Graphics', 'tif': 'Tagged Image File Format', 'tiff': 'Tagged Image File Format'\}}}} \end{fulllineitems} \index{fixed\_dpi (matplotlib.backend\_bases.FigureCanvasBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.fixed_dpi}}\pysigline{\sphinxbfcode{\sphinxupquote{fixed\_dpi}}\sphinxbfcode{\sphinxupquote{ = None}}} \end{fulllineitems} \index{flush\_events() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.flush_events}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{flush\_events}}}{}{} Flush the GUI events for the figure. Interactive backends need to reimplement this method. \end{fulllineitems} \index{get\_default\_filename() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.get_default_filename}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_default\_filename}}}{}{} Return a string, which includes extension, suitable for use as a default filename. \end{fulllineitems} \index{get\_default\_filetype() (matplotlib.backend\_bases.FigureCanvasBase class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.get_default_filetype}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{get\_default\_filetype}}}{}{} Get the default savefig file format as specified in rcParam \sphinxcode{\sphinxupquote{savefig.format}}. Returned string excludes period. Overridden in backends that only support a single file type. \end{fulllineitems} \index{get\_supported\_filetypes() (matplotlib.backend\_bases.FigureCanvasBase class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.get_supported_filetypes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{get\_supported\_filetypes}}}{}{} Return dict of savefig file formats supported by this backend \end{fulllineitems} \index{get\_supported\_filetypes\_grouped() (matplotlib.backend\_bases.FigureCanvasBase class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.get_supported_filetypes_grouped}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{get\_supported\_filetypes\_grouped}}}{}{} Return a dict of savefig file formats supported by this backend, where the keys are a file type name, such as ‘Joint Photographic Experts Group’, and the values are a list of filename extensions used for that filetype, such as {[}‘jpg’, ‘jpeg’{]}. \end{fulllineitems} \index{get\_width\_height() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.get_width_height}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_width\_height}}}{}{} Return the figure width and height in points or pixels (depending on the backend), truncated to integers \end{fulllineitems} \index{get\_window\_title() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.get_window_title}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_title}}}{}{} Get the title text of the window containing the figure. Return None if there is no window (e.g., a PS backend). \end{fulllineitems} \index{grab\_mouse() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.grab_mouse}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{grab\_mouse}}}{\emph{ax}}{} Set the child axes which are currently grabbing the mouse events. Usually called by the widgets themselves. It is an error to call this if the mouse is already grabbed by another axes. \end{fulllineitems} \index{idle\_event() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.idle_event}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{idle\_event}}}{\emph{guiEvent=None}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The idle\_event function was deprecated in version 2.1. Called when GUI is idle. \end{fulllineitems} \index{is\_saving() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.is_saving}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_saving}}}{}{} Returns whether the renderer is in the process of saving to a file, rather than rendering for an on-screen buffer. \end{fulllineitems} \index{key\_press\_event() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.key_press_event}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{key\_press\_event}}}{\emph{key}, \emph{guiEvent=None}}{} Pass a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.KeyEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{KeyEvent}}}}} to all functions connected to \sphinxcode{\sphinxupquote{key\_press\_event}}. \end{fulllineitems} \index{key\_release\_event() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.key_release_event}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{key\_release\_event}}}{\emph{key}, \emph{guiEvent=None}}{} Pass a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.KeyEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{KeyEvent}}}}} to all functions connected to \sphinxcode{\sphinxupquote{key\_release\_event}}. \end{fulllineitems} \index{leave\_notify\_event() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.leave_notify_event}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{leave\_notify\_event}}}{\emph{guiEvent=None}}{} Backend derived classes should call this function when leaving canvas \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{guiEvent}}] \leavevmode the native UI event that generated the mpl event \end{description} \end{description}\end{quote} \end{fulllineitems} \index{motion\_notify\_event() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.motion_notify_event}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{motion\_notify\_event}}}{\emph{x}, \emph{y}, \emph{guiEvent=None}}{} Backend derived classes should call this function on any motion-notify-event. This method will call all functions connected to the ‘motion\_notify\_event’ with a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MouseEvent}}}}} instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar{]} the canvas coordinates where 0=left \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar{]} the canvas coordinates where 0=bottom \item[{\sphinxstylestrong{guiEvent}}] \leavevmode the native UI event that generated the mpl event \end{description} \end{description}\end{quote} \end{fulllineitems} \index{mpl\_connect() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.mpl_connect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{mpl\_connect}}}{\emph{s}, \emph{func}}{} Connect event with string \sphinxstyleemphasis{s} to \sphinxstyleemphasis{func}. The signature of \sphinxstyleemphasis{func} is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{func}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)} \end{sphinxVerbatim} where event is a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.Event}}}}}. The following events are recognized \begin{itemize} \item {} ‘button\_press\_event’ \item {} ‘button\_release\_event’ \item {} ‘draw\_event’ \item {} ‘key\_press\_event’ \item {} ‘key\_release\_event’ \item {} ‘motion\_notify\_event’ \item {} ‘pick\_event’ \item {} ‘resize\_event’ \item {} ‘scroll\_event’ \item {} ‘figure\_enter\_event’, \item {} ‘figure\_leave\_event’, \item {} ‘axes\_enter\_event’, \item {} ‘axes\_leave\_event’ \item {} ‘close\_event’ \end{itemize} For the location events (button and key press/release), if the mouse is over the axes, the variable \sphinxcode{\sphinxupquote{event.inaxes}} will be set to the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} the event occurs is over, and additionally, the variables \sphinxcode{\sphinxupquote{event.xdata}} and \sphinxcode{\sphinxupquote{event.ydata}} will be defined. This is the mouse location in data coords. See {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.KeyEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{KeyEvent}}}}} and {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MouseEvent}}}}} for more info. Return value is a connection id that can be used with \sphinxcode{\sphinxupquote{mpl\_disconnect()}}. \paragraph{Examples} Usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{on\PYGZus{}press}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{you pressed}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{button}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{xdata}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{ydata}\PYG{p}{)} \PYG{n}{cid} \PYG{o}{=} \PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{button\PYGZus{}press\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{on\PYGZus{}press}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{mpl\_disconnect() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.mpl_disconnect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{mpl\_disconnect}}}{\emph{cid}}{} Disconnect callback id cid \paragraph{Examples} Usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{cid} \PYG{o}{=} \PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{button\PYGZus{}press\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{on\PYGZus{}press}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{}...later} \PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}disconnect}\PYG{p}{(}\PYG{n}{cid}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{new\_timer() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.new_timer}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{new\_timer}}}{\emph{*args}, \emph{**kwargs}}{} Creates a new backend-specific subclass of \sphinxcode{\sphinxupquote{backend\_bases.Timer}}. This is useful for getting periodic events through the backend’s native event loop. Implemented only for backends with GUIs. \begin{quote}\begin{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{interval}}] \leavevmode{[}scalar{]} Timer interval in milliseconds \item[{\sphinxstylestrong{callbacks}}] \leavevmode{[}List{[}Tuple{[}callable, Tuple, Dict{]}{]}{]} Sequence of (func, args, kwargs) where \sphinxcode{\sphinxupquote{func(*args, **kwargs)}} will be executed by the timer every \sphinxstyleemphasis{interval}. callbacks which return \sphinxcode{\sphinxupquote{False}} or \sphinxcode{\sphinxupquote{0}} will be removed from the timer. \end{description} \end{description}\end{quote} \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{timer} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{new\PYGZus{}timer}\PYG{p}{(}\PYG{n}{callbacks}\PYG{o}{=}\PYG{p}{[}\PYG{p}{(}\PYG{n}{f1}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{p}{)}\PYG{p}{,} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{a}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{3}\PYG{p}{\PYGZcb{}}\PYG{p}{)}\PYG{p}{,}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{onRemove() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.onRemove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{onRemove}}}{\emph{ev}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The onRemove function was deprecated in version 2.2. Mouse event processor which removes the top artist under the cursor. Connect this to the ‘mouse\_press\_event’ using: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{mouse\PYGZus{}press\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{onRemove}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{pick() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.pick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{}~ \end{fulllineitems} \index{pick\_event() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.pick_event}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pick\_event}}}{\emph{mouseevent}, \emph{artist}, \emph{**kwargs}}{} This method will be called by artists who are picked and will fire off {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.PickEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PickEvent}}}}} callbacks registered listeners \end{fulllineitems} \index{print\_figure() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.print_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_figure}}}{\emph{filename}, \emph{dpi=None}, \emph{facecolor=None}, \emph{edgecolor=None}, \emph{orientation='portrait'}, \emph{format=None}, \emph{**kwargs}}{} Render the figure to hardcopy. Set the figure patch face and edge colors. This is useful because some of the GUIs have a gray figure face color background and you’ll probably want to override this on hardcopy. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filename}}] \leavevmode can also be a file object on image backends \item[{\sphinxstylestrong{orientation}}] \leavevmode{[}\{‘landscape’, ‘portrait’\}, optional{]} only currently applies to PostScript printing. \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}scalar, optional{]} the dots per inch to save the figure in; if None, use savefig.dpi \item[{\sphinxstylestrong{facecolor}}] \leavevmode{[}color spec or None, optional{]} the facecolor of the figure; if None, defaults to savefig.facecolor \item[{\sphinxstylestrong{edgecolor}}] \leavevmode{[}color spec or None, optional{]} the edgecolor of the figure; if None, defaults to savefig.edgecolor \item[{\sphinxstylestrong{format}}] \leavevmode{[}str, optional{]} when set, forcibly set the file format to save to \item[{\sphinxstylestrong{bbox\_inches}}] \leavevmode{[}str or {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}, optional{]} Bbox in inches. Only the given portion of the figure is saved. If ‘tight’, try to figure out the tight bbox of the figure. If None, use savefig.bbox \item[{\sphinxstylestrong{pad\_inches}}] \leavevmode{[}scalar, optional{]} Amount of padding around the figure when bbox\_inches is ‘tight’. If None, use savefig.pad\_inches \item[{\sphinxstylestrong{bbox\_extra\_artists}}] \leavevmode{[}list of {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}}, optional{]} A list of extra artists that will be considered when the tight bbox is calculated. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{release\_mouse() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.release_mouse}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{release\_mouse}}}{\emph{ax}}{} Release the mouse grab held by the axes, ax. Usually called by the widgets. It is ok to call this even if you ax doesn’t have the mouse grab currently. \end{fulllineitems} \index{resize() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.resize}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{resize}}}{\emph{w}, \emph{h}}{} Set the canvas size in pixels. \end{fulllineitems} \index{resize\_event() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.resize_event}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{resize\_event}}}{}{} Pass a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.ResizeEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ResizeEvent}}}}} to all functions connected to \sphinxcode{\sphinxupquote{resize\_event}}. \end{fulllineitems} \index{scroll\_event() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.scroll_event}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{scroll\_event}}}{\emph{x}, \emph{y}, \emph{step}, \emph{guiEvent=None}}{} Backend derived classes should call this function on any scroll wheel event. x,y are the canvas coords: 0,0 is lower, left. button and key are as defined in MouseEvent. This method will be call all functions connected to the ‘scroll\_event’ with a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MouseEvent}}}}} instance. \end{fulllineitems} \index{set\_window\_title() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.set_window_title}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_window\_title}}}{\emph{title}}{} Set the title text of the window containing the figure. Note that this has no effect if there is no window (e.g., a PS backend). \end{fulllineitems} \index{start\_event\_loop() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.start_event_loop}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{start\_event\_loop}}}{\emph{timeout=0}}{} Start a blocking event loop. Such an event loop is used by interactive functions, such as \sphinxcode{\sphinxupquote{ginput}} and \sphinxcode{\sphinxupquote{waitforbuttonpress}}, to wait for events. The event loop blocks until a callback function triggers {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.stop_event_loop}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stop\_event\_loop}}}}}, or \sphinxstyleemphasis{timeout} is reached. If \sphinxstyleemphasis{timeout} is negative, never timeout. Only interactive backends need to reimplement this method and it relies on {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.flush_events}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{flush\_events}}}}} being properly implemented. Interactive backends should implement this in a more native way. \end{fulllineitems} \index{start\_event\_loop\_default() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.start_event_loop_default}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{start\_event\_loop\_default}}}{\emph{timeout=0}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The start\_event\_loop\_default function was deprecated in version 2.1. Start a blocking event loop. \begin{quote} Such an event loop is used by interactive functions, such as \sphinxcode{\sphinxupquote{ginput}} and \sphinxcode{\sphinxupquote{waitforbuttonpress}}, to wait for events. The event loop blocks until a callback function triggers {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.stop_event_loop}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stop\_event\_loop}}}}}, or \sphinxstyleemphasis{timeout} is reached. If \sphinxstyleemphasis{timeout} is negative, never timeout. Only interactive backends need to reimplement this method and it relies on {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.flush_events}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{flush\_events}}}}} being properly implemented. Interactive backends should implement this in a more native way. \end{quote} \end{fulllineitems} \index{stop\_event\_loop() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.stop_event_loop}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{stop\_event\_loop}}}{}{} Stop the current blocking event loop. Interactive backends need to reimplement this to match {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.start_event_loop}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{start\_event\_loop}}}}} \end{fulllineitems} \index{stop\_event\_loop\_default() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.stop_event_loop_default}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{stop\_event\_loop\_default}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The stop\_event\_loop\_default function was deprecated in version 2.1. Stop the current blocking event loop. \begin{quote} Interactive backends need to reimplement this to match {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.start_event_loop}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{start\_event\_loop}}}}} \end{quote} \end{fulllineitems} \index{supports\_blit (matplotlib.backend\_bases.FigureCanvasBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.supports_blit}}\pysigline{\sphinxbfcode{\sphinxupquote{supports\_blit}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{switch\_backends() (matplotlib.backend\_bases.FigureCanvasBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.switch_backends}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{switch\_backends}}}{\emph{FigureCanvasClass}}{} Instantiate an instance of FigureCanvasClass This is used for backend switching, e.g., to instantiate a FigureCanvasPS from a FigureCanvasGTK. Note, deep copying is not done, so any changes to one of the instances (e.g., setting figure size or line props), will be reflected in the other \end{fulllineitems} \end{fulllineitems} \index{FigureManagerBase (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureManagerBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{FigureManagerBase}}}{\emph{canvas}, \emph{num}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Helper class for pyplot mode, wraps everything up into a neat bundle \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{canvas}}] \leavevmode{[}{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FigureCanvasBase}}}}}{]} The backend-specific canvas instance \item[{\sphinxstylestrong{num}}] \leavevmode{[}int or str{]} The figure number \item[{\sphinxstylestrong{key\_press\_handler\_id}}] \leavevmode{[}int{]} The default key handler cid, when using the toolmanager. Can be used to disable default key press handling \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}disconnect}\PYG{p}{(} \PYG{n}{figure}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{manager}\PYG{o}{.}\PYG{n}{key\PYGZus{}press\PYGZus{}handler\PYGZus{}id}\PYG{p}{)} \end{sphinxVerbatim} \end{description} \end{description}\end{quote} \index{destroy() (matplotlib.backend\_bases.FigureManagerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureManagerBase.destroy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{destroy}}}{}{}~ \end{fulllineitems} \index{full\_screen\_toggle() (matplotlib.backend\_bases.FigureManagerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureManagerBase.full_screen_toggle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{full\_screen\_toggle}}}{}{}~ \end{fulllineitems} \index{get\_window\_title() (matplotlib.backend\_bases.FigureManagerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureManagerBase.get_window_title}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_title}}}{}{} Get the title text of the window containing the figure. Return None for non-GUI (e.g., PS) backends. \end{fulllineitems} \index{key\_press() (matplotlib.backend\_bases.FigureManagerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureManagerBase.key_press}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{key\_press}}}{\emph{event}}{} Implement the default mpl key bindings defined at {\hyperref[\detokenize{users/navigation_toolbar:key-event-handling}]{\sphinxcrossref{\DUrole{std,std-ref}{Navigation Keyboard Shortcuts}}}} \end{fulllineitems} \index{resize() (matplotlib.backend\_bases.FigureManagerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureManagerBase.resize}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{resize}}}{\emph{w}, \emph{h}}{} “For GUI backends, resize the window (in pixels). \end{fulllineitems} \index{set\_window\_title() (matplotlib.backend\_bases.FigureManagerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureManagerBase.set_window_title}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_window\_title}}}{\emph{title}}{} Set the title text of the window containing the figure. This has no effect for non-GUI (e.g., PS) backends. \end{fulllineitems} \index{show() (matplotlib.backend\_bases.FigureManagerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureManagerBase.show}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{show}}}{}{} For GUI backends, show the figure window and redraw. For non-GUI backends, raise an exception to be caught by {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.show}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{show()}}}}}, for an optional warning. \end{fulllineitems} \index{show\_popup() (matplotlib.backend\_bases.FigureManagerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureManagerBase.show_popup}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{show\_popup}}}{\emph{msg}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The show\_popup function was deprecated in version 2.2. Display message in a popup \textendash{} GUI only. \end{fulllineitems} \end{fulllineitems} \index{GraphicsContextBase (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{GraphicsContextBase}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} An abstract base class that provides color, line styles, etc… \index{copy\_properties() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.copy_properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{copy\_properties}}}{\emph{gc}}{} Copy properties from gc to self \end{fulllineitems} \index{get\_alpha() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \index{get\_antialiased() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_antialiased}}}{}{} Return true if the object should try to do antialiased rendering \end{fulllineitems} \index{get\_capstyle() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{} Return the capstyle as a string in (‘butt’, ‘round’, ‘projecting’) \end{fulllineitems} \index{get\_clip\_path() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return the clip path in the form (path, transform), where path is a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, and transform is an affine transform to apply to the path before clipping. \end{fulllineitems} \index{get\_clip\_rectangle() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_clip_rectangle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_rectangle}}}{}{} Return the clip rectangle as a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \end{fulllineitems} \index{get\_dashes() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashes}}}{}{} Return the dash information as an offset dashlist tuple. The dash list is a even size list that gives the ink on, ink off in pixels. See p107 of to PostScript \sphinxhref{https://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF}{BLUEBOOK} for more info. Default value is None \end{fulllineitems} \index{get\_forced\_alpha() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_forced_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_forced\_alpha}}}{}{} Return whether the value given by get\_alpha() should be used to override any other alpha-channel values. \end{fulllineitems} \index{get\_gid() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Return the object identifier if one is set, None otherwise. \end{fulllineitems} \index{get\_hatch() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch}}}{}{} Gets the current hatch style \end{fulllineitems} \index{get\_hatch\_color() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_hatch_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch\_color}}}{}{} Gets the color to use for hatching. \end{fulllineitems} \index{get\_hatch\_linewidth() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_hatch_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch\_linewidth}}}{}{} Gets the linewidth to use for hatching. \end{fulllineitems} \index{get\_hatch\_path() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_hatch_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch\_path}}}{\emph{density=6.0}}{} Returns a Path for the current hatch. \end{fulllineitems} \index{get\_joinstyle() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{} Return the line join style as one of (‘miter’, ‘round’, ‘bevel’) \end{fulllineitems} \index{get\_linestyle() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyle}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The get\_linestyle function was deprecated in version 2.1. Return the linestyle: one of (‘solid’, ‘dashed’, ‘dashdot’, ‘dotted’). \end{fulllineitems} \index{get\_linewidth() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidth}}}{}{} Return the line width in points as a scalar \end{fulllineitems} \index{get\_rgb() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_rgb}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rgb}}}{}{} returns a tuple of three or four floats from 0-1. \end{fulllineitems} \index{get\_sketch\_params() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_snap() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} \end{fulllineitems} \index{get\_url() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.get_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} returns a url if one is set, None otherwise \end{fulllineitems} \index{restore() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.restore}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{restore}}}{}{} Restore the graphics context from the stack - needed only for backends that save graphics contexts on a stack \end{fulllineitems} \index{set\_alpha() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha value used for blending - not supported on all backends. If \sphinxcode{\sphinxupquote{alpha=None}} (the default), the alpha components of the foreground and fill colors will be used to set their respective transparencies (where applicable); otherwise, \sphinxcode{\sphinxupquote{alpha}} will override them. \end{fulllineitems} \index{set\_antialiased() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiased}}}{\emph{b}}{} True if object should be drawn with antialiased rendering \end{fulllineitems} \index{set\_capstyle() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_capstyle}}}{\emph{cs}}{} Set the capstyle as a string in (‘butt’, ‘round’, ‘projecting’) \end{fulllineitems} \index{set\_clip\_path() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}}{} Set the clip path and transformation. Path should be a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformedPath}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformedPath}}}}} instance. \end{fulllineitems} \index{set\_clip\_rectangle() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_clip_rectangle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_rectangle}}}{\emph{rectangle}}{} Set the clip rectangle with sequence (left, bottom, width, height) \end{fulllineitems} \index{set\_dashes() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashes}}}{\emph{dash\_offset}, \emph{dash\_list}}{} Set the dash style for the gc. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{dash\_offset}}] \leavevmode{[}float{]} is the offset (usually 0). \item[{\sphinxstylestrong{dash\_list}}] \leavevmode{[}array\_like{]} specifies the on-off sequence as points. \sphinxcode{\sphinxupquote{(None, None)}} specifies a solid line \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_foreground() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_foreground}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_foreground}}}{\emph{fg}, \emph{isRGBA=False}}{} Set the foreground color. fg can be a MATLAB format string, a html hex color string, an rgb or rgba unit tuple, or a float between 0 and 1. In the latter case, grayscale is used. If you know fg is rgba, set \sphinxcode{\sphinxupquote{isRGBA=True}} for efficiency. \end{fulllineitems} \index{set\_gid() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{id}}{} Sets the id. \end{fulllineitems} \index{set\_hatch() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_hatch}}}{\emph{hatch}}{} Sets the hatch style for filling \end{fulllineitems} \index{set\_hatch\_color() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_hatch_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_hatch\_color}}}{\emph{hatch\_color}}{} sets the color to use for hatching. \end{fulllineitems} \index{set\_joinstyle() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_joinstyle}}}{\emph{js}}{} Set the join style to be one of (‘miter’, ‘round’, ‘bevel’) \end{fulllineitems} \index{set\_linestyle() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyle}}}{\emph{style}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The set\_linestyle function was deprecated in version 2.1. Set the linestyle to be one of (‘solid’, ‘dashed’, ‘dashdot’, ‘dotted’). These are defined in the rcParams \sphinxcode{\sphinxupquote{lines.dashed\_pattern}}, \sphinxcode{\sphinxupquote{lines.dashdot\_pattern}} and \sphinxcode{\sphinxupquote{lines.dotted\_pattern}}. One may also specify customized dash styles by providing a tuple of (offset, dash pairs). \end{fulllineitems} \index{set\_linewidth() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{w}}{} Set the linewidth in points \end{fulllineitems} \index{set\_sketch\_params() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_snap() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} \end{fulllineitems} \index{set\_url() (matplotlib.backend\_bases.GraphicsContextBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase.set_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for links in compatible backends \end{fulllineitems} \end{fulllineitems} \index{IdleEvent (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.IdleEvent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{IdleEvent}}}{\emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.Event}}}}} \DUrole{versionmodified}{Deprecated since version 2.1: }The IdleEvent class was deprecated in version 2.1. An event triggered by the GUI backend when it is idle \textendash{} useful for passive animation \end{fulllineitems} \index{KeyEvent (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.KeyEvent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{KeyEvent}}}{\emph{name}, \emph{canvas}, \emph{key}, \emph{x=0}, \emph{y=0}, \emph{guiEvent=None}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.LocationEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.LocationEvent}}}}} A key event (key press, key release). Attach additional attributes as defined in {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.mpl_connect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FigureCanvasBase.mpl\_connect()}}}}}. In addition to the {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Event}}}}} and {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.LocationEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LocationEvent}}}}} attributes, the following attributes are defined: \paragraph{Notes} Modifier keys will be prefixed to the pressed key and will be in the order “ctrl”, “alt”, “super”. The exception to this rule is when the pressed key is itself a modifier key, therefore “ctrl+alt” and “alt+control” can both be valid key values. \paragraph{Examples} Usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{on\PYGZus{}key}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{you pressed}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{key}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{xdata}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{ydata}\PYG{p}{)} \PYG{n}{cid} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{key\PYGZus{}press\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{on\PYGZus{}key}\PYG{p}{)} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{key}}] \leavevmode{[}None or str{]} the key(s) pressed. Could be \sphinxstylestrong{None}, a single case sensitive ascii character (“g”, “G”, “\#”, etc.), a special key (“control”, “shift”, “f1”, “up”, etc.) or a combination of the above (e.g., “ctrl+alt+g”, “ctrl+alt+G”). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{LocationEvent (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.LocationEvent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{LocationEvent}}}{\emph{name}, \emph{canvas}, \emph{x}, \emph{y}, \emph{guiEvent=None}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.Event}}}}} An event that has a screen location The following additional attributes are defined and shown with their default values. In addition to the {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Event}}}}} attributes, the following event attributes are defined: \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar{]} x position - pixels from left of canvas \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar{]} y position - pixels from bottom of canvas \item[{\sphinxstylestrong{inaxes}}] \leavevmode{[}bool{]} the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance if mouse is over axes \item[{\sphinxstylestrong{xdata}}] \leavevmode{[}scalar{]} x coord of mouse in data coords \item[{\sphinxstylestrong{ydata}}] \leavevmode{[}scalar{]} y coord of mouse in data coords \end{description} \end{description}\end{quote} \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} in figure coords, 0,0 = bottom, left \index{inaxes (matplotlib.backend\_bases.LocationEvent attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.LocationEvent.inaxes}}\pysigline{\sphinxbfcode{\sphinxupquote{inaxes}}\sphinxbfcode{\sphinxupquote{ = None}}} \end{fulllineitems} \index{lastevent (matplotlib.backend\_bases.LocationEvent attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.LocationEvent.lastevent}}\pysigline{\sphinxbfcode{\sphinxupquote{lastevent}}\sphinxbfcode{\sphinxupquote{ = None}}} \end{fulllineitems} \index{x (matplotlib.backend\_bases.LocationEvent attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.LocationEvent.x}}\pysigline{\sphinxbfcode{\sphinxupquote{x}}\sphinxbfcode{\sphinxupquote{ = None}}} \end{fulllineitems} \index{xdata (matplotlib.backend\_bases.LocationEvent attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.LocationEvent.xdata}}\pysigline{\sphinxbfcode{\sphinxupquote{xdata}}\sphinxbfcode{\sphinxupquote{ = None}}} \end{fulllineitems} \index{y (matplotlib.backend\_bases.LocationEvent attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.LocationEvent.y}}\pysigline{\sphinxbfcode{\sphinxupquote{y}}\sphinxbfcode{\sphinxupquote{ = None}}} \end{fulllineitems} \index{ydata (matplotlib.backend\_bases.LocationEvent attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.LocationEvent.ydata}}\pysigline{\sphinxbfcode{\sphinxupquote{ydata}}\sphinxbfcode{\sphinxupquote{ = None}}} \end{fulllineitems} \end{fulllineitems} \index{MouseEvent (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{MouseEvent}}}{\emph{name}, \emph{canvas}, \emph{x}, \emph{y}, \emph{button=None}, \emph{key=None}, \emph{step=0}, \emph{dblclick=False}, \emph{guiEvent=None}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.LocationEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.LocationEvent}}}}} \begin{description} \item[{A mouse event (‘button\_press\_event’,}] \leavevmode ‘button\_release\_event’, ‘scroll\_event’, ‘motion\_notify\_event’). \end{description} In addition to the {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Event}}}}} and {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.LocationEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LocationEvent}}}}} attributes, the following attributes are defined: \paragraph{Examples} Usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{on\PYGZus{}press}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{you pressed}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{button}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{xdata}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{ydata}\PYG{p}{)} \PYG{n}{cid} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{button\PYGZus{}press\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{on\PYGZus{}press}\PYG{p}{)} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{button}}] \leavevmode{[}None, scalar, or str{]} button pressed None, 1, 2, 3, ‘up’, ‘down’ (up and down are used for scroll events). Note that in the nbagg backend, both the middle and right clicks return 3 since right clicking will bring up the context menu in some browsers. \item[{\sphinxstylestrong{key}}] \leavevmode{[}None, or str{]} the key depressed when the mouse event triggered (see {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.KeyEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{KeyEvent}}}}}) \item[{\sphinxstylestrong{step}}] \leavevmode{[}scalar{]} number of scroll steps (positive for ‘up’, negative for ‘down’) \end{description} \end{description}\end{quote} x, y in figure coords, 0,0 = bottom, left button pressed None, 1, 2, 3, ‘up’, ‘down’ \index{button (matplotlib.backend\_bases.MouseEvent attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent.button}}\pysigline{\sphinxbfcode{\sphinxupquote{button}}\sphinxbfcode{\sphinxupquote{ = None}}} \end{fulllineitems} \index{dblclick (matplotlib.backend\_bases.MouseEvent attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent.dblclick}}\pysigline{\sphinxbfcode{\sphinxupquote{dblclick}}\sphinxbfcode{\sphinxupquote{ = None}}} \end{fulllineitems} \index{inaxes (matplotlib.backend\_bases.MouseEvent attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent.inaxes}}\pysigline{\sphinxbfcode{\sphinxupquote{inaxes}}\sphinxbfcode{\sphinxupquote{ = None}}} \end{fulllineitems} \index{step (matplotlib.backend\_bases.MouseEvent attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent.step}}\pysigline{\sphinxbfcode{\sphinxupquote{step}}\sphinxbfcode{\sphinxupquote{ = None}}} \end{fulllineitems} \index{x (matplotlib.backend\_bases.MouseEvent attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent.x}}\pysigline{\sphinxbfcode{\sphinxupquote{x}}\sphinxbfcode{\sphinxupquote{ = None}}} \end{fulllineitems} \index{xdata (matplotlib.backend\_bases.MouseEvent attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent.xdata}}\pysigline{\sphinxbfcode{\sphinxupquote{xdata}}\sphinxbfcode{\sphinxupquote{ = None}}} \end{fulllineitems} \index{y (matplotlib.backend\_bases.MouseEvent attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent.y}}\pysigline{\sphinxbfcode{\sphinxupquote{y}}\sphinxbfcode{\sphinxupquote{ = None}}} \end{fulllineitems} \index{ydata (matplotlib.backend\_bases.MouseEvent attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent.ydata}}\pysigline{\sphinxbfcode{\sphinxupquote{ydata}}\sphinxbfcode{\sphinxupquote{ = None}}} \end{fulllineitems} \end{fulllineitems} \index{NavigationToolbar2 (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{NavigationToolbar2}}}{\emph{canvas}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Base class for the navigation cursor, version 2 backends must implement a canvas that handles connections for ‘button\_press\_event’ and ‘button\_release\_event’. See {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase.mpl_connect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FigureCanvasBase.mpl\_connect()}}}}} for more information They must also define \begin{quote} \begin{description} \item[{{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.save_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{save\_figure()}}}}}}] \leavevmode save the current figure \item[{{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.set_cursor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_cursor()}}}}}}] \leavevmode if you want the pointer icon to change \item[{\sphinxcode{\sphinxupquote{\_init\_toolbar()}}}] \leavevmode create your toolbar widget \item[{{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.draw_rubberband}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_rubberband()}}}}} (optional)}] \leavevmode draw the zoom to rect “rubberband” rectangle \item[{{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.press}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{press()}}}}} (optional)}] \leavevmode whenever a mouse button is pressed, you’ll be notified with the event \item[{{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.release}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{release()}}}}} (optional)}] \leavevmode whenever a mouse button is released, you’ll be notified with the event \item[{{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.set_message}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_message()}}}}} (optional)}] \leavevmode display message \item[{{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.set_history_buttons}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_history\_buttons()}}}}} (optional)}] \leavevmode you can change the history back / forward buttons to indicate disabled / enabled state. \end{description} \end{quote} That’s it, we’ll do the rest! \index{back() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.back}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{back}}}{\emph{*args}}{} move back up the view lim stack \end{fulllineitems} \index{drag\_pan() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.drag_pan}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{drag\_pan}}}{\emph{event}}{} Callback for dragging in pan/zoom mode. \end{fulllineitems} \index{drag\_zoom() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.drag_zoom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{drag\_zoom}}}{\emph{event}}{} Callback for dragging in zoom mode. \end{fulllineitems} \index{draw() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{}{} Redraw the canvases, update the locators. \end{fulllineitems} \index{draw\_rubberband() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.draw_rubberband}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_rubberband}}}{\emph{event}, \emph{x0}, \emph{y0}, \emph{x1}, \emph{y1}}{} Draw a rectangle rubberband to indicate zoom limits. Note that it is not guaranteed that \sphinxcode{\sphinxupquote{x0 \textless{}= x1}} and \sphinxcode{\sphinxupquote{y0 \textless{}= y1}}. \end{fulllineitems} \index{dynamic\_update() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.dynamic_update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{dynamic\_update}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The dynamic\_update function was deprecated in version 2.1. Use canvas.draw\_idle instead. \end{fulllineitems} \index{forward() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.forward}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{forward}}}{\emph{*args}}{} Move forward in the view lim stack. \end{fulllineitems} \index{home() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.home}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{home}}}{\emph{*args}}{} Restore the original view. \end{fulllineitems} \index{mouse\_move() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.mouse_move}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{mouse\_move}}}{\emph{event}}{}~ \end{fulllineitems} \index{pan() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.pan}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pan}}}{\emph{*args}}{} Activate the pan/zoom tool. pan with left button, zoom with right \end{fulllineitems} \index{press() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.press}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{press}}}{\emph{event}}{} Called whenever a mouse button is pressed. \end{fulllineitems} \index{press\_pan() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.press_pan}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{press\_pan}}}{\emph{event}}{} Callback for mouse button press in pan/zoom mode. \end{fulllineitems} \index{press\_zoom() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.press_zoom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{press\_zoom}}}{\emph{event}}{} Callback for mouse button press in zoom to rect mode. \end{fulllineitems} \index{push\_current() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.push_current}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{push\_current}}}{}{} Push the current view limits and position onto the stack. \end{fulllineitems} \index{release() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.release}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{release}}}{\emph{event}}{} Callback for mouse button release. \end{fulllineitems} \index{release\_pan() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.release_pan}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{release\_pan}}}{\emph{event}}{} Callback for mouse button release in pan/zoom mode. \end{fulllineitems} \index{release\_zoom() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.release_zoom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{release\_zoom}}}{\emph{event}}{} Callback for mouse button release in zoom to rect mode. \end{fulllineitems} \index{remove\_rubberband() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.remove_rubberband}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_rubberband}}}{}{} Remove the rubberband. \end{fulllineitems} \index{save\_figure() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.save_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{save\_figure}}}{\emph{*args}}{} Save the current figure. \end{fulllineitems} \index{set\_cursor() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.set_cursor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cursor}}}{\emph{cursor}}{} Set the current cursor to one of the \sphinxcode{\sphinxupquote{Cursors}} enums values. If required by the backend, this method should trigger an update in the backend event loop after the cursor is set, as this method may be called e.g. before a long-running task during which the GUI is not updated. \end{fulllineitems} \index{set\_history\_buttons() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.set_history_buttons}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_history\_buttons}}}{}{} Enable or disable the back/forward button. \end{fulllineitems} \index{set\_message() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.set_message}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_message}}}{\emph{s}}{} Display a message on toolbar or in status bar. \end{fulllineitems} \index{toolitems (matplotlib.backend\_bases.NavigationToolbar2 attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.toolitems}}\pysigline{\sphinxbfcode{\sphinxupquote{toolitems}}\sphinxbfcode{\sphinxupquote{ = (('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous view', 'back', 'back'), ('Forward', 'Forward to next view', 'forward', 'forward'), (None, None, None, None), ('Pan', 'Pan axes with left mouse, zoom with right', 'move', 'pan'), ('Zoom', 'Zoom to rectangle', 'zoom\_to\_rect', 'zoom'), ('Subplots', 'Configure subplots', 'subplots', 'configure\_subplots'), (None, None, None, None), ('Save', 'Save the figure', 'filesave', 'save\_figure'))}}} \end{fulllineitems} \index{update() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{}{} Reset the axes stack. \end{fulllineitems} \index{zoom() (matplotlib.backend\_bases.NavigationToolbar2 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2.zoom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{zoom}}}{\emph{*args}}{} Activate zoom to rect mode. \end{fulllineitems} \end{fulllineitems} \index{NonGuiException} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.NonGuiException}}\pysigline{\sphinxbfcode{\sphinxupquote{exception }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{NonGuiException}}} Bases: \sphinxhref{https://docs.python.org/3/library/exceptions.html\#Exception}{\sphinxcode{\sphinxupquote{Exception}}} \end{fulllineitems} \index{PickEvent (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.PickEvent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{PickEvent}}}{\emph{name}, \emph{canvas}, \emph{mouseevent}, \emph{artist}, \emph{guiEvent=None}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.Event}}}}} a pick event, fired when the user picks a location on the canvas sufficiently close to an artist. Attrs: all the {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Event}}}}} attributes plus \paragraph{Examples} Usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{o}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{picker}\PYG{o}{=}\PYG{l+m+mi}{5}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} 5 points tolerance} \PYG{k}{def} \PYG{n+nf}{on\PYGZus{}pick}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{n}{line} \PYG{o}{=} \PYG{n}{event}\PYG{o}{.}\PYG{n}{artist} \PYG{n}{xdata}\PYG{p}{,} \PYG{n}{ydata} \PYG{o}{=} \PYG{n}{line}\PYG{o}{.}\PYG{n}{get\PYGZus{}data}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ind} \PYG{o}{=} \PYG{n}{event}\PYG{o}{.}\PYG{n}{ind} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{on pick line:}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{array}\PYG{p}{(}\PYG{p}{[}\PYG{n}{xdata}\PYG{p}{[}\PYG{n}{ind}\PYG{p}{]}\PYG{p}{,} \PYG{n}{ydata}\PYG{p}{[}\PYG{n}{ind}\PYG{p}{]}\PYG{p}{]}\PYG{p}{)}\PYG{o}{.}\PYG{n}{T}\PYG{p}{)} \PYG{n}{cid} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{pick\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{on\PYGZus{}pick}\PYG{p}{)} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{mouseevent}}] \leavevmode{[}{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MouseEvent}}}}}{]} the mouse event that generated the pick \item[{\sphinxstylestrong{artist}}] \leavevmode{[}{\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.Artist}}}}}{]} the picked artist \item[{\sphinxstylestrong{other}}] \leavevmode extra class dependent attrs \textendash{} e.g., a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} pick may define different extra attributes than a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PatchCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PatchCollection}}}}} pick event \end{description} \end{description}\end{quote} \end{fulllineitems} \index{RendererBase (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{RendererBase}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} An abstract base class to handle drawing/rendering operations. The following methods must be implemented in the backend for full functionality (though just implementing {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path()}}}}} alone would give a highly capable backend): \begin{itemize} \item {} {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path()}}}}} \item {} {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_image()}}}}} \item {} {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_gouraud_triangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_gouraud\_triangle()}}}}} \end{itemize} The following methods \sphinxstyleemphasis{should} be implemented in the backend for optimization reasons: \begin{itemize} \item {} {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_text()}}}}} \item {} {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_markers()}}}}} \item {} {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_path_collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path\_collection()}}}}} \item {} {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_quad_mesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_quad\_mesh()}}}}} \end{itemize} \index{close\_group() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.close_group}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{close\_group}}}{\emph{s}}{} Close a grouping element with label \sphinxstyleemphasis{s} Is only currently used by {\hyperref[\detokenize{api/backend_svg_api:module-matplotlib.backends.backend_svg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{backend\_svg}}}}} \end{fulllineitems} \index{draw\_gouraud\_triangle() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_gouraud_triangle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_gouraud\_triangle}}}{\emph{gc}, \emph{points}, \emph{colors}, \emph{transform}}{} Draw a Gouraud-shaded triangle. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{points}}] \leavevmode{[}array\_like, shape=(3, 2){]} Array of (x, y) points for the triangle. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}array\_like, shape=(3, 4){]} RGBA colors for each point of the triangle. \item[{\sphinxstylestrong{transform}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform to apply to the points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_gouraud\_triangles() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_gouraud_triangles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_gouraud\_triangles}}}{\emph{gc}, \emph{triangles\_array}, \emph{colors\_array}, \emph{transform}}{} Draws a series of Gouraud triangles. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{points}}] \leavevmode{[}array\_like, shape=(N, 3, 2){]} Array of \sphinxstyleemphasis{N} (x, y) points for the triangles. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}array\_like, shape=(N, 3, 4){]} Array of \sphinxstyleemphasis{N} RGBA colors for each point of the triangles. \item[{\sphinxstylestrong{transform}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform to apply to the points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_image() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_image}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{im}, \emph{transform=None}}{} Draw an RGBA image. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gc}}] \leavevmode{[}{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GraphicsContextBase}}}}}{]} a graphics context with clipping information. \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar{]} the distance in physical units (i.e., dots or pixels) from the left hand side of the canvas. \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar{]} the distance in physical units (i.e., dots or pixels) from the bottom side of the canvas. \item[{\sphinxstylestrong{im}}] \leavevmode{[}array\_like, shape=(N, M, 4), dtype=np.uint8{]} An array of RGBA pixels. \item[{\sphinxstylestrong{transform}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Affine2DBase}}}}}{]} If and only if the concrete backend is written such that {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.option_scale_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{option\_scale\_image()}}}}} returns \sphinxcode{\sphinxupquote{True}}, an affine transformation \sphinxstyleemphasis{may} be passed to {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_image()}}}}}. It takes the form of a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Affine2DBase}}}}} instance. The translation vector of the transformation is given in physical units (i.e., dots or pixels). Note that the transformation does not override \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}}, and has to be applied \sphinxstyleemphasis{before} translating the result by \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} (this can be accomplished by adding \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} to the translation vector defined by \sphinxcode{\sphinxupquote{transform}}). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_markers() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_markers}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_markers}}}{\emph{gc}, \emph{marker\_path}, \emph{marker\_trans}, \emph{path}, \emph{trans}, \emph{rgbFace=None}}{} Draws a marker at each of the vertices in path. This includes all vertices, including control points on curves. To avoid that behavior, those vertices should be removed before calling this function. This provides a fallback implementation of draw\_markers that makes multiple calls to {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path()}}}}}. Some backends may want to override this method in order to draw the marker only once and reuse it multiple times. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gc}}] \leavevmode{[}{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GraphicsContextBase}}}}}{]} The graphics context \item[{\sphinxstylestrong{marker\_trans}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform applied to the marker. \item[{\sphinxstylestrong{trans}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform applied to the path. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_path() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path}}}{\emph{gc}, \emph{path}, \emph{transform}, \emph{rgbFace=None}}{} Draws a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance using the given affine transform. \end{fulllineitems} \index{draw\_path\_collection() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_path_collection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path\_collection}}}{\emph{gc}, \emph{master\_transform}, \emph{paths}, \emph{all\_transforms}, \emph{offsets}, \emph{offsetTrans}, \emph{facecolors}, \emph{edgecolors}, \emph{linewidths}, \emph{linestyles}, \emph{antialiaseds}, \emph{urls}, \emph{offset\_position}}{} Draws a collection of paths selecting drawing properties from the lists \sphinxstyleemphasis{facecolors}, \sphinxstyleemphasis{edgecolors}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{linestyles} and \sphinxstyleemphasis{antialiaseds}. \sphinxstyleemphasis{offsets} is a list of offsets to apply to each of the paths. The offsets in \sphinxstyleemphasis{offsets} are first transformed by \sphinxstyleemphasis{offsetTrans} before being applied. \sphinxstyleemphasis{offset\_position} may be either “screen” or “data” depending on the space that the offsets are in. This provides a fallback implementation of {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_path_collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path\_collection()}}}}} that makes multiple calls to {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path()}}}}}. Some backends may want to override this in order to render each set of path data only once, and then reference that path multiple times with the different offsets, colors, styles etc. The generator methods \sphinxcode{\sphinxupquote{\_iter\_collection\_raw\_paths()}} and \sphinxcode{\sphinxupquote{\_iter\_collection()}} are provided to help with (and standardize) the implementation across backends. It is highly recommended to use those generators, so that changes to the behavior of {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_path_collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path\_collection()}}}}} can be made globally. \end{fulllineitems} \index{draw\_quad\_mesh() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_quad_mesh}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_quad\_mesh}}}{\emph{gc}, \emph{master\_transform}, \emph{meshWidth}, \emph{meshHeight}, \emph{coordinates}, \emph{offsets}, \emph{offsetTrans}, \emph{facecolors}, \emph{antialiased}, \emph{edgecolors}}{} This provides a fallback implementation of {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_quad_mesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_quad\_mesh()}}}}} that generates paths and then calls {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_path_collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path\_collection()}}}}}. \end{fulllineitems} \index{draw\_tex() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_tex}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_tex}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{s}, \emph{prop}, \emph{angle}, \emph{ismath='TeX!'}, \emph{mtext=None}}{}~ \end{fulllineitems} \index{draw\_text() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_text}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_text}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{s}, \emph{prop}, \emph{angle}, \emph{ismath=False}, \emph{mtext=None}}{} Draw the text instance \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gc}}] \leavevmode{[}{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GraphicsContextBase}}}}}{]} the graphics context \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar{]} the x location of the text in display coords \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar{]} the y location of the text baseline in display coords \item[{\sphinxstylestrong{s}}] \leavevmode{[}str{]} the text string \item[{\sphinxstylestrong{prop}}] \leavevmode{[}{\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}}{]} font properties \item[{\sphinxstylestrong{angle}}] \leavevmode{[}scalar{]} the rotation angle in degrees \item[{\sphinxstylestrong{mtext}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}}{]} the original text object to be rendered \end{description} \end{description}\end{quote} \paragraph{Notes} \sphinxstylestrong{backend implementers note} When you are trying to determine if you have gotten your bounding box right (which is what enables the text layout/alignment to work properly), it helps to change the line in text.py: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{if} \PYG{l+m+mi}{0}\PYG{p}{:} \PYG{n}{bbox\PYGZus{}artist}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{renderer}\PYG{p}{)} \end{sphinxVerbatim} to if 1, and then the actual bounding box will be plotted along with your text. \end{fulllineitems} \index{flipy() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.flipy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{flipy}}}{}{} Return true if y small numbers are top for renderer Is used for drawing text ({\hyperref[\detokenize{api/text_api:module-matplotlib.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text}}}}}) and images ({\hyperref[\detokenize{api/image_api:module-matplotlib.image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.image}}}}}) only \end{fulllineitems} \index{get\_canvas\_width\_height() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.get_canvas_width_height}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_canvas\_width\_height}}}{}{} return the canvas width and height in display coords \end{fulllineitems} \index{get\_image\_magnification() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.get_image_magnification}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_image\_magnification}}}{}{} Get the factor by which to magnify images passed to {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_image()}}}}}. Allows a backend to have images at a different resolution to other artists. \end{fulllineitems} \index{get\_texmanager() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.get_texmanager}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_texmanager}}}{}{} return the \sphinxcode{\sphinxupquote{matplotlib.texmanager.TexManager}} instance \end{fulllineitems} \index{get\_text\_width\_height\_descent() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.get_text_width_height_descent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_text\_width\_height\_descent}}}{\emph{s}, \emph{prop}, \emph{ismath}}{} Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string \sphinxstyleemphasis{s} with {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FontProperties}}}}} \sphinxstyleemphasis{prop} \end{fulllineitems} \index{new\_gc() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.new_gc}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{new\_gc}}}{}{} Return an instance of a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GraphicsContextBase}}}}} \end{fulllineitems} \index{open\_group() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.open_group}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{open\_group}}}{\emph{s}, \emph{gid=None}}{} Open a grouping element with label \sphinxstyleemphasis{s}. If \sphinxstyleemphasis{gid} is given, use \sphinxstyleemphasis{gid} as the id of the group. Is only currently used by {\hyperref[\detokenize{api/backend_svg_api:module-matplotlib.backends.backend_svg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{backend\_svg}}}}}. \end{fulllineitems} \index{option\_image\_nocomposite() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.option_image_nocomposite}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{option\_image\_nocomposite}}}{}{} override this method for renderers that do not necessarily always want to rescale and composite raster images. (like SVG, PDF, or PS) \end{fulllineitems} \index{option\_scale\_image() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.option_scale_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{option\_scale\_image}}}{}{} override this method for renderers that support arbitrary affine transformations in {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_image()}}}}} (most vector backends). \end{fulllineitems} \index{points\_to\_pixels() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.points_to_pixels}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{points\_to\_pixels}}}{\emph{points}}{} Convert points to display units You need to override this function (unless your backend doesn’t have a dpi, e.g., postscript or svg). Some imaging systems assume some value for pixels per inch: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{points} \PYG{n}{to} \PYG{n}{pixels} \PYG{o}{=} \PYG{n}{points} \PYG{o}{*} \PYG{n}{pixels\PYGZus{}per\PYGZus{}inch}\PYG{o}{/}\PYG{l+m+mf}{72.0} \PYG{o}{*} \PYG{n}{dpi}\PYG{o}{/}\PYG{l+m+mf}{72.0} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{points}}] \leavevmode{[}scalar or array\_like{]} a float or a numpy array of float \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Points converted to pixels}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{start\_filter() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.start_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{start\_filter}}}{}{} Used in AggRenderer. Switch to a temporary renderer for image filtering effects. \end{fulllineitems} \index{start\_rasterizing() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.start_rasterizing}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{start\_rasterizing}}}{}{} Used in MixedModeRenderer. Switch to the raster renderer. \end{fulllineitems} \index{stop\_filter() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.stop_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{stop\_filter}}}{\emph{filter\_func}}{} Used in AggRenderer. Switch back to the original renderer. The contents of the temporary renderer is processed with the \sphinxstyleemphasis{filter\_func} and is drawn on the original renderer as an image. \end{fulllineitems} \index{stop\_rasterizing() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.stop_rasterizing}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{stop\_rasterizing}}}{}{} Used in MixedModeRenderer. Switch back to the vector renderer and draw the contents of the raster renderer as an image on the vector renderer. \end{fulllineitems} \index{strip\_math() (matplotlib.backend\_bases.RendererBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.strip_math}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{strip\_math}}}{\emph{s}}{}~ \end{fulllineitems} \end{fulllineitems} \index{ResizeEvent (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.ResizeEvent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{ResizeEvent}}}{\emph{name}, \emph{canvas}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.Event}}}}} An event triggered by a canvas resize In addition to the {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Event}}}}} attributes, the following event attributes are defined: \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{width}}] \leavevmode{[}scalar{]} width of the canvas in pixels \item[{\sphinxstylestrong{height}}] \leavevmode{[}scalar{]} height of the canvas in pixels \end{description} \end{description}\end{quote} \end{fulllineitems} \index{ShowBase (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.ShowBase}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{ShowBase}}} Bases: \sphinxcode{\sphinxupquote{matplotlib.backend\_bases.\_Backend}} Simple base class to generate a show() callable in backends. Subclass must override mainloop() method. \end{fulllineitems} \index{StatusbarBase (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.StatusbarBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{StatusbarBase}}}{\emph{toolmanager}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Base class for the statusbar \index{set\_message() (matplotlib.backend\_bases.StatusbarBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.StatusbarBase.set_message}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_message}}}{\emph{s}}{} Display a message on toolbar or in status bar \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}str{]} Message text \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{TimerBase (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.TimerBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{TimerBase}}}{\emph{interval=None}, \emph{callbacks=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} A base class for providing timer events, useful for things animations. Backends need to implement a few specific methods in order to use their own timing mechanisms so that the timer events are integrated into their event loops. Mandatory functions that must be implemented: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{\_timer\_start}}: Contains backend-specific code for starting the timer \item {} \sphinxcode{\sphinxupquote{\_timer\_stop}}: Contains backend-specific code for stopping the timer \end{itemize} Optional overrides: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{\_timer\_set\_single\_shot}}: Code for setting the timer to single shot operating mode, if supported by the timer object. If not, the \sphinxcode{\sphinxupquote{Timer}} class itself will store the flag and the \sphinxcode{\sphinxupquote{\_on\_timer}} method should be overridden to support such behavior. \item {} \sphinxcode{\sphinxupquote{\_timer\_set\_interval}}: Code for setting the interval on the timer, if there is a method for doing so on the timer object. \item {} \sphinxcode{\sphinxupquote{\_on\_timer}}: This is the internal function that any timer object should call, which will handle the task of running all callbacks that have been set. \end{itemize} \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{interval}}] \leavevmode{[}scalar{]} The time between timer events in milliseconds. Default is 1000 ms. \item[{\sphinxstylestrong{single\_shot}}] \leavevmode{[}bool{]} Boolean flag indicating whether this timer should operate as single shot (run once and then stop). Defaults to \sphinxhref{https://docs.python.org/3/library/constants.html\#False}{\sphinxcode{\sphinxupquote{False}}}. \item[{\sphinxstylestrong{callbacks}}] \leavevmode{[}List{[}Tuple{[}callable, Tuple, Dict{]}{]}{]} Stores list of (func, args, kwargs) tuples that will be called upon timer events. This list can be manipulated directly, or the functions {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.TimerBase.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback}}}}} and {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.TimerBase.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback}}}}} can be used. \end{description} \end{description}\end{quote} \index{add\_callback() (matplotlib.backend\_bases.TimerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.TimerBase.add_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}, \emph{*args}, \emph{**kwargs}}{} Register \sphinxcode{\sphinxupquote{func}} to be called by timer when the event fires. Any additional arguments provided will be passed to \sphinxcode{\sphinxupquote{func}}. \end{fulllineitems} \index{interval (matplotlib.backend\_bases.TimerBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.TimerBase.interval}}\pysigline{\sphinxbfcode{\sphinxupquote{interval}}}~ \end{fulllineitems} \index{remove\_callback() (matplotlib.backend\_bases.TimerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.TimerBase.remove_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{func}, \emph{*args}, \emph{**kwargs}}{} Remove \sphinxcode{\sphinxupquote{func}} from list of callbacks. \sphinxcode{\sphinxupquote{args}} and \sphinxcode{\sphinxupquote{kwargs}} are optional and used to distinguish between copies of the same function registered to be called with different arguments. \end{fulllineitems} \index{single\_shot (matplotlib.backend\_bases.TimerBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.TimerBase.single_shot}}\pysigline{\sphinxbfcode{\sphinxupquote{single\_shot}}}~ \end{fulllineitems} \index{start() (matplotlib.backend\_bases.TimerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.TimerBase.start}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{start}}}{\emph{interval=None}}{} Start the timer object. {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.TimerBase.interval}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{interval}}}}} is optional and will be used to reset the timer interval first if provided. \end{fulllineitems} \index{stop() (matplotlib.backend\_bases.TimerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.TimerBase.stop}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{stop}}}{}{} Stop the timer. \end{fulllineitems} \end{fulllineitems} \index{ToolContainerBase (class in matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.ToolContainerBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{ToolContainerBase}}}{\emph{toolmanager}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Base class for all tool containers, e.g. toolbars. \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{toolmanager}}] \leavevmode{[}\sphinxcode{\sphinxupquote{ToolManager}}{]} The tools with which this \sphinxcode{\sphinxupquote{ToolContainer}} wants to communicate. \end{description} \end{description}\end{quote} \index{add\_tool() (matplotlib.backend\_bases.ToolContainerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.ToolContainerBase.add_tool}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_tool}}}{\emph{tool}, \emph{group}, \emph{position=-1}}{} Adds a tool to this container \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{tool}}] \leavevmode{[}tool\_like{]} The tool to add, see \sphinxcode{\sphinxupquote{ToolManager.get\_tool}}. \item[{\sphinxstylestrong{group}}] \leavevmode{[}str{]} The name of the group to add this tool to. \item[{\sphinxstylestrong{position}}] \leavevmode{[}int (optional){]} The position within the group to place this tool. Defaults to end. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{add\_toolitem() (matplotlib.backend\_bases.ToolContainerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.ToolContainerBase.add_toolitem}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_toolitem}}}{\emph{name}, \emph{group}, \emph{position}, \emph{image}, \emph{description}, \emph{toggle}}{} Add a toolitem to the container This method must get implemented per backend The callback associated with the button click event, must be \sphinxstylestrong{EXACTLY} \sphinxcode{\sphinxupquote{self.trigger\_tool(name)}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{name}}] \leavevmode{[}string{]} Name of the tool to add, this gets used as the tool’s ID and as the default label of the buttons \item[{\sphinxstylestrong{group}}] \leavevmode{[}String{]} Name of the group that this tool belongs to \item[{\sphinxstylestrong{position}}] \leavevmode{[}Int{]} Position of the tool within its group, if -1 it goes at the End \item[{\sphinxstylestrong{image\_file}}] \leavevmode{[}String{]} Filename of the image for the button or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}} \item[{\sphinxstylestrong{description}}] \leavevmode{[}String{]} Description of the tool, used for the tooltips \item[{\sphinxstylestrong{toggle}}] \leavevmode{[}Bool{]}\begin{itemize} \item {} \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} : The button is a toggle (change the pressed/unpressed state between consecutive clicks) \item {} \sphinxhref{https://docs.python.org/3/library/constants.html\#False}{\sphinxcode{\sphinxupquote{False}}} : The button is a normal button (returns to unpressed state after release) \end{itemize} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{remove\_toolitem() (matplotlib.backend\_bases.ToolContainerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.ToolContainerBase.remove_toolitem}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_toolitem}}}{\emph{name}}{} Remove a toolitem from the \sphinxcode{\sphinxupquote{ToolContainer}} This method must get implemented per backend Called when \sphinxcode{\sphinxupquote{ToolManager}} emits a \sphinxcode{\sphinxupquote{tool\_removed\_event}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{name}}] \leavevmode{[}string{]} Name of the tool to remove \end{description} \end{description}\end{quote} \end{fulllineitems} \index{toggle\_toolitem() (matplotlib.backend\_bases.ToolContainerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.ToolContainerBase.toggle_toolitem}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{toggle\_toolitem}}}{\emph{name}, \emph{toggled}}{} Toggle the toolitem without firing event \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{name}}] \leavevmode{[}String{]} Id of the tool to toggle \item[{\sphinxstylestrong{toggled}}] \leavevmode{[}bool{]} Whether to set this tool as toggled or not. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{trigger\_tool() (matplotlib.backend\_bases.ToolContainerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.ToolContainerBase.trigger_tool}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{trigger\_tool}}}{\emph{name}}{} Trigger the tool \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{name}}] \leavevmode{[}String{]} Name (id) of the tool triggered from within the container \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{get\_registered\_canvas\_class() (in module matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.get_registered_canvas_class}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{get\_registered\_canvas\_class}}}{\emph{format}}{} Return the registered default canvas for given file format. Handles deferred import of required backend. \end{fulllineitems} \index{key\_press\_handler() (in module matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.key_press_handler}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{key\_press\_handler}}}{\emph{event}, \emph{canvas}, \emph{toolbar=None}}{} Implement the default mpl key bindings for the canvas and toolbar described at {\hyperref[\detokenize{users/navigation_toolbar:key-event-handling}]{\sphinxcrossref{\DUrole{std,std-ref}{Navigation Keyboard Shortcuts}}}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{event}}] \leavevmode{[}{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.KeyEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{KeyEvent}}}}}{]} a key press/release event \item[{\sphinxstylestrong{canvas}}] \leavevmode{[}{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FigureCanvasBase}}}}}{]} the backend-specific canvas instance \item[{\sphinxstylestrong{toolbar}}] \leavevmode{[}{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.NavigationToolbar2}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{NavigationToolbar2}}}}}{]} the navigation cursor toolbar \end{description} \end{description}\end{quote} \end{fulllineitems} \index{register\_backend() (in module matplotlib.backend\_bases)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_bases_api:matplotlib.backend_bases.register_backend}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.}}\sphinxbfcode{\sphinxupquote{register\_backend}}}{\emph{format}, \emph{backend}, \emph{description=None}}{} Register a backend for saving to a given file format. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{format}}] \leavevmode{[}str{]} File extension \item[{\sphinxstylestrong{backend}}] \leavevmode{[}module string or canvas class{]} Backend for handling file output \item[{\sphinxstylestrong{description}}] \leavevmode{[}str, optional{]} Description of the file type. Defaults to an empty string \end{description} \end{description}\end{quote} \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backend\_managers}}} \label{\detokenize{api/backend_managers_api:module-matplotlib.backend_managers}}\label{\detokenize{api/backend_managers_api:matplotlib-backend-managers}}\label{\detokenize{api/backend_managers_api::doc}}\index{matplotlib.backend\_managers (module)}\begin{description} \item[{{\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolManager}}}}}}] \leavevmode Class that makes the bridge between user interaction (key press, toolbar clicks, ..) and the actions in response to the user inputs. \end{description} \index{ToolEvent (class in matplotlib.backend\_managers)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolEvent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.}}\sphinxbfcode{\sphinxupquote{ToolEvent}}}{\emph{name}, \emph{sender}, \emph{tool}, \emph{data=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Event for tool manipulation (add/remove) \end{fulllineitems} \index{ToolManager (class in matplotlib.backend\_managers)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.}}\sphinxbfcode{\sphinxupquote{ToolManager}}}{\emph{figure=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Helper class that groups all the user interactions for a Figure \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{figure: {}`Figure{}`}}] \leavevmode \item[{\sphinxstylestrong{keypresslock: {}`widgets.LockDraw{}`}}] \leavevmode \sphinxcode{\sphinxupquote{LockDraw}} object to know if the {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.canvas}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{canvas}}}}} key\_press\_event is locked \item[{\sphinxstylestrong{messagelock: {}`widgets.LockDraw{}`}}] \leavevmode \sphinxcode{\sphinxupquote{LockDraw}} object to know if the message is available to write \end{description} \end{description}\end{quote} \index{active\_toggle (matplotlib.backend\_managers.ToolManager attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.active_toggle}}\pysigline{\sphinxbfcode{\sphinxupquote{active\_toggle}}} Currently toggled tools \end{fulllineitems} \index{add\_tool() (matplotlib.backend\_managers.ToolManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.add_tool}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_tool}}}{\emph{name}, \emph{tool}, \emph{*args}, \emph{**kwargs}}{} Add \sphinxstyleemphasis{tool} to {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolManager}}}}} If successful adds a new event \sphinxcode{\sphinxupquote{tool\_trigger\_name}} where \sphinxstylestrong{name} is the \sphinxstylestrong{name} of the tool, this event is fired everytime the tool is triggered. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{name}}] \leavevmode{[}str{]} Name of the tool, treated as the ID, has to be unique \item[{\sphinxstylestrong{tool}}] \leavevmode{[}class\_like, i.e. str or type{]} Reference to find the class of the Tool to added. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ToolBase}}}}}}] \leavevmode The base class for tools. \end{description} \paragraph{Notes} args and kwargs get passed directly to the tools constructor. \end{fulllineitems} \index{canvas (matplotlib.backend\_managers.ToolManager attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.canvas}}\pysigline{\sphinxbfcode{\sphinxupquote{canvas}}} Canvas managed by FigureManager \end{fulllineitems} \index{figure (matplotlib.backend\_managers.ToolManager attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.figure}}\pysigline{\sphinxbfcode{\sphinxupquote{figure}}} Figure that holds the canvas \end{fulllineitems} \index{get\_tool() (matplotlib.backend\_managers.ToolManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.get_tool}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_tool}}}{\emph{name}, \emph{warn=True}}{} Return the tool object, also accepts the actual tool for convenience \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{name}}] \leavevmode{[}str, ToolBase{]} Name of the tool, or the tool itself \item[{\sphinxstylestrong{warn}}] \leavevmode{[}bool, optional{]} If this method should give warnings. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_tool\_keymap() (matplotlib.backend\_managers.ToolManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.get_tool_keymap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_tool\_keymap}}}{\emph{name}}{} Get the keymap associated with the specified tool \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{name}}] \leavevmode{[}string{]} Name of the Tool \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{list}}] \leavevmode{[}list of keys associated with the Tool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{message\_event() (matplotlib.backend\_managers.ToolManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.message_event}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{message\_event}}}{\emph{message}, \emph{sender=None}}{} Emit a {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManagerMessageEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolManagerMessageEvent}}}}} \end{fulllineitems} \index{remove\_tool() (matplotlib.backend\_managers.ToolManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.remove_tool}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_tool}}}{\emph{name}}{} Remove tool from {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolManager}}}}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{name}}] \leavevmode{[}string{]} Name of the Tool \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_figure() (matplotlib.backend\_managers.ToolManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{figure}, \emph{update\_tools=True}}{} Sets the figure to interact with the tools \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{figure: {}`Figure{}`}}] \leavevmode \item[{\sphinxstylestrong{update\_tools: bool}}] \leavevmode Force tools to update figure \end{description} \end{description}\end{quote} \end{fulllineitems} \index{toolmanager\_connect() (matplotlib.backend\_managers.ToolManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.toolmanager_connect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{toolmanager\_connect}}}{\emph{s}, \emph{func}}{} Connect event with string \sphinxstyleemphasis{s} to \sphinxstyleemphasis{func}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}String{]} Name of the event The following events are recognized \begin{itemize} \item {} ‘tool\_message\_event’ \item {} ‘tool\_removed\_event’ \item {} ‘tool\_added\_event’ \end{itemize} For every tool added a new event is created \begin{itemize} \item {} ‘tool\_trigger\_TOOLNAME{}` Where TOOLNAME is the id of the tool. \end{itemize} \item[{\sphinxstylestrong{func}}] \leavevmode{[}function{]} Function to be called with signature def func(event) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{toolmanager\_disconnect() (matplotlib.backend\_managers.ToolManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.toolmanager_disconnect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{toolmanager\_disconnect}}}{\emph{cid}}{} Disconnect callback id \sphinxstyleemphasis{cid} Example usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{cid} \PYG{o}{=} \PYG{n}{toolmanager}\PYG{o}{.}\PYG{n}{toolmanager\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{tool\PYGZus{}trigger\PYGZus{}zoom}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{on\PYGZus{}press}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{}...later} \PYG{n}{toolmanager}\PYG{o}{.}\PYG{n}{toolmanager\PYGZus{}disconnect}\PYG{p}{(}\PYG{n}{cid}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{tools (matplotlib.backend\_managers.ToolManager attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.tools}}\pysigline{\sphinxbfcode{\sphinxupquote{tools}}} Return the tools controlled by {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolManager}}}}} \end{fulllineitems} \index{trigger\_tool() (matplotlib.backend\_managers.ToolManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.trigger_tool}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{trigger\_tool}}}{\emph{name}, \emph{sender=None}, \emph{canvasevent=None}, \emph{data=None}}{} Trigger a tool and emit the tool\_trigger\_{[}name{]} event \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{name}}] \leavevmode{[}string{]} Name of the tool \item[{\sphinxstylestrong{sender: object}}] \leavevmode Object that wishes to trigger the tool \item[{\sphinxstylestrong{canvasevent}}] \leavevmode{[}Event{]} Original Canvas event or None \item[{\sphinxstylestrong{data}}] \leavevmode{[}Object{]} Extra data to pass to the tool when triggering \end{description} \end{description}\end{quote} \end{fulllineitems} \index{update\_keymap() (matplotlib.backend\_managers.ToolManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.update_keymap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_keymap}}}{\emph{name}, \emph{*keys}}{} Set the keymap to associate with the specified tool \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{name}}] \leavevmode{[}string{]} Name of the Tool \item[{\sphinxstylestrong{keys}}] \leavevmode{[}keys to associate with the Tool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{ToolManagerMessageEvent (class in matplotlib.backend\_managers)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManagerMessageEvent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.}}\sphinxbfcode{\sphinxupquote{ToolManagerMessageEvent}}}{\emph{name}, \emph{sender}, \emph{message}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Event carrying messages from toolmanager Messages usually get displayed to the user by the toolbar \end{fulllineitems} \index{ToolTriggerEvent (class in matplotlib.backend\_managers)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolTriggerEvent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.}}\sphinxbfcode{\sphinxupquote{ToolTriggerEvent}}}{\emph{name}, \emph{sender}, \emph{tool}, \emph{canvasevent=None}, \emph{data=None}}{} Bases: {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.ToolEvent}}}}} Event to inform that a tool has been triggered \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_mixed}}} \label{\detokenize{api/backend_mixed_api:module-matplotlib.backends.backend_mixed}}\label{\detokenize{api/backend_mixed_api:matplotlib-backends-backend-mixed}}\label{\detokenize{api/backend_mixed_api::doc}}\index{matplotlib.backends.backend\_mixed (module)}\index{MixedModeRenderer (class in matplotlib.backends.backend\_mixed)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_mixed_api:matplotlib.backends.backend_mixed.MixedModeRenderer}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_mixed.}}\sphinxbfcode{\sphinxupquote{MixedModeRenderer}}}{\emph{figure}, \emph{width}, \emph{height}, \emph{dpi}, \emph{vector\_renderer}, \emph{raster\_renderer\_class=None}, \emph{bbox\_inches\_restore=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} A helper class to implement a renderer that switches between vector and raster drawing. An example may be a PDF writer, where most things are drawn with PDF vector commands, but some very complex objects, such as quad meshes, are rasterised and then output as images. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{figure}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure}}}}}{]} The figure instance. \item[{\sphinxstylestrong{width}}] \leavevmode{[}scalar{]} The width of the canvas in logical units \item[{\sphinxstylestrong{height}}] \leavevmode{[}scalar{]} The height of the canvas in logical units \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}scalar{]} The dpi of the canvas \item[{\sphinxstylestrong{vector\_renderer}}] \leavevmode{[}{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.RendererBase}}}}}{]} An instance of a subclass of {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RendererBase}}}}} that will be used for the vector drawing. \item[{\sphinxstylestrong{raster\_renderer\_class}}] \leavevmode{[}{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.RendererBase}}}}}{]} The renderer class to use for the raster drawing. If not provided, this will use the Agg backend (which is currently the only viable option anyway.) \end{description} \end{description}\end{quote} \index{start\_rasterizing() (matplotlib.backends.backend\_mixed.MixedModeRenderer method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_mixed_api:matplotlib.backends.backend_mixed.MixedModeRenderer.start_rasterizing}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{start\_rasterizing}}}{}{} Enter “raster” mode. All subsequent drawing commands (until stop\_rasterizing is called) will be drawn with the raster backend. If start\_rasterizing is called multiple times before stop\_rasterizing is called, this method has no effect. \end{fulllineitems} \index{stop\_rasterizing() (matplotlib.backends.backend\_mixed.MixedModeRenderer method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_mixed_api:matplotlib.backends.backend_mixed.MixedModeRenderer.stop_rasterizing}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{stop\_rasterizing}}}{}{} Exit “raster” mode. All of the drawing that was done since the last start\_rasterizing command will be copied to the vector backend by calling draw\_image. If stop\_rasterizing is called multiple times before start\_rasterizing is called, this method has no effect. \end{fulllineitems} \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backend\_tools}}} \label{\detokenize{api/backend_tools_api:module-matplotlib.backend_tools}}\label{\detokenize{api/backend_tools_api:matplotlib-backend-tools}}\label{\detokenize{api/backend_tools_api::doc}}\index{matplotlib.backend\_tools (module)} Abstract base classes define the primitives for Tools. These tools are used by {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.ToolManager}}}}} \begin{description} \item[{{\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolBase}}}}}}] \leavevmode Simple stateless tool \item[{{\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolToggleBase}}}}}}] \leavevmode Tool that has two states, only one Toggle tool can be active at any given time for the same {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.ToolManager}}}}} \end{description} \index{AxisScaleBase (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.AxisScaleBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{AxisScaleBase}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ToolToggleBase}}}}} Base Tool to toggle between linear and logarithmic \index{disable() (matplotlib.backend\_tools.AxisScaleBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.AxisScaleBase.disable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{disable}}}{\emph{event}}{} Disable the toggle tool {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.AxisScaleBase.trigger}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{trigger}}}}} call this method when \sphinxcode{\sphinxupquote{toggled}} is True. This can happen in different circumstances \begin{itemize} \item {} Click on the toolbar tool button \item {} Call to {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.trigger_tool}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.ToolManager.trigger\_tool}}}}} \item {} Another {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolToggleBase}}}}} derived tool is triggered (from the same \sphinxcode{\sphinxupquote{ToolManager}}) \end{itemize} \end{fulllineitems} \index{enable() (matplotlib.backend\_tools.AxisScaleBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.AxisScaleBase.enable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{enable}}}{\emph{event}}{} Enable the toggle tool {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.AxisScaleBase.trigger}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{trigger}}}}} calls this method when \sphinxcode{\sphinxupquote{toggled}} is False \end{fulllineitems} \index{trigger() (matplotlib.backend\_tools.AxisScaleBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.AxisScaleBase.trigger}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{trigger}}}{\emph{sender}, \emph{event}, \emph{data=None}}{} Calls {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.AxisScaleBase.enable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{enable}}}}} or {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.AxisScaleBase.disable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{disable}}}}} based on \sphinxcode{\sphinxupquote{toggled}} value \end{fulllineitems} \end{fulllineitems} \index{ConfigureSubplotsBase (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ConfigureSubplotsBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ConfigureSubplotsBase}}}{\emph{toolmanager}, \emph{name}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ToolBase}}}}} Base tool for the configuration of subplots \index{description (matplotlib.backend\_tools.ConfigureSubplotsBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ConfigureSubplotsBase.description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}\sphinxbfcode{\sphinxupquote{ = 'Configure subplots'}}} \end{fulllineitems} \index{image (matplotlib.backend\_tools.ConfigureSubplotsBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ConfigureSubplotsBase.image}}\pysigline{\sphinxbfcode{\sphinxupquote{image}}\sphinxbfcode{\sphinxupquote{ = 'subplots'}}} \end{fulllineitems} \end{fulllineitems} \index{Cursors (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.Cursors}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{Cursors}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Simple namespace for cursor reference \index{HAND (matplotlib.backend\_tools.Cursors attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.Cursors.HAND}}\pysigline{\sphinxbfcode{\sphinxupquote{HAND}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \index{MOVE (matplotlib.backend\_tools.Cursors attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.Cursors.MOVE}}\pysigline{\sphinxbfcode{\sphinxupquote{MOVE}}\sphinxbfcode{\sphinxupquote{ = 3}}} \end{fulllineitems} \index{POINTER (matplotlib.backend\_tools.Cursors attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.Cursors.POINTER}}\pysigline{\sphinxbfcode{\sphinxupquote{POINTER}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{SELECT\_REGION (matplotlib.backend\_tools.Cursors attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.Cursors.SELECT_REGION}}\pysigline{\sphinxbfcode{\sphinxupquote{SELECT\_REGION}}\sphinxbfcode{\sphinxupquote{ = 2}}} \end{fulllineitems} \index{WAIT (matplotlib.backend\_tools.Cursors attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.Cursors.WAIT}}\pysigline{\sphinxbfcode{\sphinxupquote{WAIT}}\sphinxbfcode{\sphinxupquote{ = 4}}} \end{fulllineitems} \end{fulllineitems} \index{RubberbandBase (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.RubberbandBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{RubberbandBase}}}{\emph{toolmanager}, \emph{name}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ToolBase}}}}} Draw and remove rubberband \index{draw\_rubberband() (matplotlib.backend\_tools.RubberbandBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.RubberbandBase.draw_rubberband}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_rubberband}}}{\emph{*data}}{} Draw rubberband This method must get implemented per backend \end{fulllineitems} \index{remove\_rubberband() (matplotlib.backend\_tools.RubberbandBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.RubberbandBase.remove_rubberband}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_rubberband}}}{}{} Remove rubberband This method should get implemented per backend \end{fulllineitems} \index{trigger() (matplotlib.backend\_tools.RubberbandBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.RubberbandBase.trigger}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{trigger}}}{\emph{sender}, \emph{event}, \emph{data}}{} Call {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.RubberbandBase.draw_rubberband}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_rubberband}}}}} or {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.RubberbandBase.remove_rubberband}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_rubberband}}}}} based on data \end{fulllineitems} \end{fulllineitems} \index{SaveFigureBase (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.SaveFigureBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{SaveFigureBase}}}{\emph{toolmanager}, \emph{name}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ToolBase}}}}} Base tool for figure saving \index{default\_keymap (matplotlib.backend\_tools.SaveFigureBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.SaveFigureBase.default_keymap}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_keymap}}\sphinxbfcode{\sphinxupquote{ = {[}'s', 'ctrl+s'{]}}}} \end{fulllineitems} \index{description (matplotlib.backend\_tools.SaveFigureBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.SaveFigureBase.description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}\sphinxbfcode{\sphinxupquote{ = 'Save the figure'}}} \end{fulllineitems} \index{image (matplotlib.backend\_tools.SaveFigureBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.SaveFigureBase.image}}\pysigline{\sphinxbfcode{\sphinxupquote{image}}\sphinxbfcode{\sphinxupquote{ = 'filesave'}}} \end{fulllineitems} \end{fulllineitems} \index{SetCursorBase (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.SetCursorBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{SetCursorBase}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ToolBase}}}}} Change to the current cursor while inaxes This tool, keeps track of all {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolToggleBase}}}}} derived tools, and calls set\_cursor when a tool gets triggered \index{set\_cursor() (matplotlib.backend\_tools.SetCursorBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.SetCursorBase.set_cursor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cursor}}}{\emph{cursor}}{} Set the cursor This method has to be implemented per backend \end{fulllineitems} \index{set\_figure() (matplotlib.backend\_tools.SetCursorBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.SetCursorBase.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{figure}}{} Assign a figure to the tool \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{figure: {}`Figure{}`}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{ToolBack (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBack}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolBack}}}{\emph{toolmanager}, \emph{name}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ViewsPositionsBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ViewsPositionsBase}}}}} Move back up the view lim stack \index{default\_keymap (matplotlib.backend\_tools.ToolBack attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBack.default_keymap}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_keymap}}\sphinxbfcode{\sphinxupquote{ = {[}'left', 'c', 'backspace'{]}}}} \end{fulllineitems} \index{description (matplotlib.backend\_tools.ToolBack attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBack.description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}\sphinxbfcode{\sphinxupquote{ = 'Back to previous view'}}} \end{fulllineitems} \index{image (matplotlib.backend\_tools.ToolBack attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBack.image}}\pysigline{\sphinxbfcode{\sphinxupquote{image}}\sphinxbfcode{\sphinxupquote{ = 'back'}}} \end{fulllineitems} \end{fulllineitems} \index{ToolBase (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolBase}}}{\emph{toolmanager}, \emph{name}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Base tool class A base tool, only implements {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase.trigger}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{trigger}}}}} method or not method at all. The tool is instantiated by {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.ToolManager}}}}} \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{toolmanager: {}`matplotlib.backend\_managers.ToolManager{}`}}] \leavevmode ToolManager that controls this Tool \item[{\sphinxstylestrong{figure: {}`FigureCanvas{}`}}] \leavevmode Figure instance that is affected by this Tool \item[{\sphinxstylestrong{name: String}}] \leavevmode Used as \sphinxstylestrong{Id} of the tool, has to be unique among tools of the same ToolManager \end{description} \end{description}\end{quote} \index{canvas (matplotlib.backend\_tools.ToolBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase.canvas}}\pysigline{\sphinxbfcode{\sphinxupquote{canvas}}}~ \end{fulllineitems} \index{default\_keymap (matplotlib.backend\_tools.ToolBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase.default_keymap}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_keymap}}\sphinxbfcode{\sphinxupquote{ = None}}} Keymap to associate with this tool \sphinxstylestrong{String}: List of comma separated keys that will be used to call this tool when the keypress event of \sphinxstyleemphasis{self.figure.canvas} is emitted \end{fulllineitems} \index{description (matplotlib.backend\_tools.ToolBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase.description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}\sphinxbfcode{\sphinxupquote{ = None}}} Description of the Tool \sphinxstylestrong{String}: If the Tool is included in the Toolbar this text is used as a Tooltip \end{fulllineitems} \index{destroy() (matplotlib.backend\_tools.ToolBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase.destroy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{destroy}}}{}{} Destroy the tool This method is called when the tool is removed by {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.remove_tool}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.ToolManager.remove\_tool}}}}} \end{fulllineitems} \index{figure (matplotlib.backend\_tools.ToolBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase.figure}}\pysigline{\sphinxbfcode{\sphinxupquote{figure}}}~ \end{fulllineitems} \index{image (matplotlib.backend\_tools.ToolBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase.image}}\pysigline{\sphinxbfcode{\sphinxupquote{image}}\sphinxbfcode{\sphinxupquote{ = None}}} Filename of the image \sphinxstylestrong{String}: Filename of the image to use in the toolbar. If None, the {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase.name}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{name}}}}} is used as a label in the toolbar button \end{fulllineitems} \index{name (matplotlib.backend\_tools.ToolBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase.name}}\pysigline{\sphinxbfcode{\sphinxupquote{name}}} Tool Id \end{fulllineitems} \index{set\_figure() (matplotlib.backend\_tools.ToolBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{figure}}{} Assign a figure to the tool \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{figure: {}`Figure{}`}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{toolmanager (matplotlib.backend\_tools.ToolBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase.toolmanager}}\pysigline{\sphinxbfcode{\sphinxupquote{toolmanager}}}~ \end{fulllineitems} \index{trigger() (matplotlib.backend\_tools.ToolBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase.trigger}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{trigger}}}{\emph{sender}, \emph{event}, \emph{data=None}}{} Called when this tool gets used This method is called by {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.trigger_tool}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.ToolManager.trigger\_tool}}}}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{event: {}`Event{}`}}] \leavevmode The Canvas event that caused this tool to be called \item[{\sphinxstylestrong{sender: object}}] \leavevmode Object that requested the tool to be triggered \item[{\sphinxstylestrong{data: object}}] \leavevmode Extra data \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{ToolCursorPosition (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolCursorPosition}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolCursorPosition}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ToolBase}}}}} Send message with the current pointer position This tool runs in the background reporting the position of the cursor \index{send\_message() (matplotlib.backend\_tools.ToolCursorPosition method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolCursorPosition.send_message}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{send\_message}}}{\emph{event}}{} Call {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.message_event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.ToolManager.message\_event}}}}} \end{fulllineitems} \index{set\_figure() (matplotlib.backend\_tools.ToolCursorPosition method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolCursorPosition.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{figure}}{} Assign a figure to the tool \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{figure: {}`Figure{}`}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{ToolEnableAllNavigation (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolEnableAllNavigation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolEnableAllNavigation}}}{\emph{toolmanager}, \emph{name}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ToolBase}}}}} Tool to enable all axes for toolmanager interaction \index{default\_keymap (matplotlib.backend\_tools.ToolEnableAllNavigation attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolEnableAllNavigation.default_keymap}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_keymap}}\sphinxbfcode{\sphinxupquote{ = {[}'a'{]}}}} \end{fulllineitems} \index{description (matplotlib.backend\_tools.ToolEnableAllNavigation attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolEnableAllNavigation.description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}\sphinxbfcode{\sphinxupquote{ = 'Enables all axes toolmanager'}}} \end{fulllineitems} \index{trigger() (matplotlib.backend\_tools.ToolEnableAllNavigation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolEnableAllNavigation.trigger}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{trigger}}}{\emph{sender}, \emph{event}, \emph{data=None}}{} Called when this tool gets used This method is called by {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.trigger_tool}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.ToolManager.trigger\_tool}}}}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{event: {}`Event{}`}}] \leavevmode The Canvas event that caused this tool to be called \item[{\sphinxstylestrong{sender: object}}] \leavevmode Object that requested the tool to be triggered \item[{\sphinxstylestrong{data: object}}] \leavevmode Extra data \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{ToolEnableNavigation (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolEnableNavigation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolEnableNavigation}}}{\emph{toolmanager}, \emph{name}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ToolBase}}}}} Tool to enable a specific axes for toolmanager interaction \index{default\_keymap (matplotlib.backend\_tools.ToolEnableNavigation attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolEnableNavigation.default_keymap}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_keymap}}\sphinxbfcode{\sphinxupquote{ = (1, 2, 3, 4, 5, 6, 7, 8, 9)}}} \end{fulllineitems} \index{description (matplotlib.backend\_tools.ToolEnableNavigation attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolEnableNavigation.description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}\sphinxbfcode{\sphinxupquote{ = 'Enables one axes toolmanager'}}} \end{fulllineitems} \index{trigger() (matplotlib.backend\_tools.ToolEnableNavigation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolEnableNavigation.trigger}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{trigger}}}{\emph{sender}, \emph{event}, \emph{data=None}}{} Called when this tool gets used This method is called by {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.trigger_tool}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.ToolManager.trigger\_tool}}}}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{event: {}`Event{}`}}] \leavevmode The Canvas event that caused this tool to be called \item[{\sphinxstylestrong{sender: object}}] \leavevmode Object that requested the tool to be triggered \item[{\sphinxstylestrong{data: object}}] \leavevmode Extra data \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{ToolForward (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolForward}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolForward}}}{\emph{toolmanager}, \emph{name}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ViewsPositionsBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ViewsPositionsBase}}}}} Move forward in the view lim stack \index{default\_keymap (matplotlib.backend\_tools.ToolForward attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolForward.default_keymap}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_keymap}}\sphinxbfcode{\sphinxupquote{ = {[}'right', 'v'{]}}}} \end{fulllineitems} \index{description (matplotlib.backend\_tools.ToolForward attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolForward.description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}\sphinxbfcode{\sphinxupquote{ = 'Forward to next view'}}} \end{fulllineitems} \index{image (matplotlib.backend\_tools.ToolForward attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolForward.image}}\pysigline{\sphinxbfcode{\sphinxupquote{image}}\sphinxbfcode{\sphinxupquote{ = 'forward'}}} \end{fulllineitems} \end{fulllineitems} \index{ToolFullScreen (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolFullScreen}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolFullScreen}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ToolToggleBase}}}}} Tool to toggle full screen \index{default\_keymap (matplotlib.backend\_tools.ToolFullScreen attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolFullScreen.default_keymap}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_keymap}}\sphinxbfcode{\sphinxupquote{ = {[}'f', 'ctrl+f'{]}}}} \end{fulllineitems} \index{description (matplotlib.backend\_tools.ToolFullScreen attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolFullScreen.description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}\sphinxbfcode{\sphinxupquote{ = 'Toogle Fullscreen mode'}}} \end{fulllineitems} \index{disable() (matplotlib.backend\_tools.ToolFullScreen method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolFullScreen.disable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{disable}}}{\emph{event}}{} Disable the toggle tool \sphinxcode{\sphinxupquote{trigger}} call this method when \sphinxcode{\sphinxupquote{toggled}} is True. This can happen in different circumstances \begin{itemize} \item {} Click on the toolbar tool button \item {} Call to {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.trigger_tool}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.ToolManager.trigger\_tool}}}}} \item {} Another {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolToggleBase}}}}} derived tool is triggered (from the same \sphinxcode{\sphinxupquote{ToolManager}}) \end{itemize} \end{fulllineitems} \index{enable() (matplotlib.backend\_tools.ToolFullScreen method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolFullScreen.enable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{enable}}}{\emph{event}}{} Enable the toggle tool \sphinxcode{\sphinxupquote{trigger}} calls this method when \sphinxcode{\sphinxupquote{toggled}} is False \end{fulllineitems} \end{fulllineitems} \index{ToolGrid (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolGrid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolGrid}}}{\emph{toolmanager}, \emph{name}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.backend\_tools.\_ToolGridBase}} Tool to toggle the major grids of the figure \index{default\_keymap (matplotlib.backend\_tools.ToolGrid attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolGrid.default_keymap}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_keymap}}\sphinxbfcode{\sphinxupquote{ = {[}'g'{]}}}} \end{fulllineitems} \index{description (matplotlib.backend\_tools.ToolGrid attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolGrid.description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}\sphinxbfcode{\sphinxupquote{ = 'Toogle major grids'}}} \end{fulllineitems} \end{fulllineitems} \index{ToolHome (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolHome}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolHome}}}{\emph{toolmanager}, \emph{name}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ViewsPositionsBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ViewsPositionsBase}}}}} Restore the original view lim \index{default\_keymap (matplotlib.backend\_tools.ToolHome attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolHome.default_keymap}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_keymap}}\sphinxbfcode{\sphinxupquote{ = {[}'h', 'r', 'home'{]}}}} \end{fulllineitems} \index{description (matplotlib.backend\_tools.ToolHome attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolHome.description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}\sphinxbfcode{\sphinxupquote{ = 'Reset original view'}}} \end{fulllineitems} \index{image (matplotlib.backend\_tools.ToolHome attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolHome.image}}\pysigline{\sphinxbfcode{\sphinxupquote{image}}\sphinxbfcode{\sphinxupquote{ = 'home'}}} \end{fulllineitems} \end{fulllineitems} \index{ToolMinorGrid (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolMinorGrid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolMinorGrid}}}{\emph{toolmanager}, \emph{name}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.backend\_tools.\_ToolGridBase}} Tool to toggle the major and minor grids of the figure \index{default\_keymap (matplotlib.backend\_tools.ToolMinorGrid attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolMinorGrid.default_keymap}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_keymap}}\sphinxbfcode{\sphinxupquote{ = {[}'G'{]}}}} \end{fulllineitems} \index{description (matplotlib.backend\_tools.ToolMinorGrid attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolMinorGrid.description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}\sphinxbfcode{\sphinxupquote{ = 'Toogle major and minor grids'}}} \end{fulllineitems} \end{fulllineitems} \index{ToolPan (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolPan}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolPan}}}{\emph{*args}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ZoomPanBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ZoomPanBase}}}}} Pan axes with left mouse, zoom with right \index{cursor (matplotlib.backend\_tools.ToolPan attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolPan.cursor}}\pysigline{\sphinxbfcode{\sphinxupquote{cursor}}\sphinxbfcode{\sphinxupquote{ = 3}}} \end{fulllineitems} \index{default\_keymap (matplotlib.backend\_tools.ToolPan attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolPan.default_keymap}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_keymap}}\sphinxbfcode{\sphinxupquote{ = {[}'p'{]}}}} \end{fulllineitems} \index{description (matplotlib.backend\_tools.ToolPan attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolPan.description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}\sphinxbfcode{\sphinxupquote{ = 'Pan axes with left mouse, zoom with right'}}} \end{fulllineitems} \index{image (matplotlib.backend\_tools.ToolPan attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolPan.image}}\pysigline{\sphinxbfcode{\sphinxupquote{image}}\sphinxbfcode{\sphinxupquote{ = 'move'}}} \end{fulllineitems} \index{radio\_group (matplotlib.backend\_tools.ToolPan attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolPan.radio_group}}\pysigline{\sphinxbfcode{\sphinxupquote{radio\_group}}\sphinxbfcode{\sphinxupquote{ = 'default'}}} \end{fulllineitems} \end{fulllineitems} \index{ToolQuit (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolQuit}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolQuit}}}{\emph{toolmanager}, \emph{name}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ToolBase}}}}} Tool to call the figure manager destroy method \index{default\_keymap (matplotlib.backend\_tools.ToolQuit attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolQuit.default_keymap}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_keymap}}\sphinxbfcode{\sphinxupquote{ = {[}'ctrl+w', 'cmd+w', 'q'{]}}}} \end{fulllineitems} \index{description (matplotlib.backend\_tools.ToolQuit attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolQuit.description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}\sphinxbfcode{\sphinxupquote{ = 'Quit the figure'}}} \end{fulllineitems} \index{trigger() (matplotlib.backend\_tools.ToolQuit method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolQuit.trigger}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{trigger}}}{\emph{sender}, \emph{event}, \emph{data=None}}{} Called when this tool gets used This method is called by {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.trigger_tool}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.ToolManager.trigger\_tool}}}}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{event: {}`Event{}`}}] \leavevmode The Canvas event that caused this tool to be called \item[{\sphinxstylestrong{sender: object}}] \leavevmode Object that requested the tool to be triggered \item[{\sphinxstylestrong{data: object}}] \leavevmode Extra data \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{ToolQuitAll (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolQuitAll}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolQuitAll}}}{\emph{toolmanager}, \emph{name}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ToolBase}}}}} Tool to call the figure manager destroy method \index{default\_keymap (matplotlib.backend\_tools.ToolQuitAll attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolQuitAll.default_keymap}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_keymap}}\sphinxbfcode{\sphinxupquote{ = {[}'W', 'cmd+W', 'Q'{]}}}} \end{fulllineitems} \index{description (matplotlib.backend\_tools.ToolQuitAll attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolQuitAll.description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}\sphinxbfcode{\sphinxupquote{ = 'Quit all figures'}}} \end{fulllineitems} \index{trigger() (matplotlib.backend\_tools.ToolQuitAll method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolQuitAll.trigger}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{trigger}}}{\emph{sender}, \emph{event}, \emph{data=None}}{} Called when this tool gets used This method is called by {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.trigger_tool}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.ToolManager.trigger\_tool}}}}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{event: {}`Event{}`}}] \leavevmode The Canvas event that caused this tool to be called \item[{\sphinxstylestrong{sender: object}}] \leavevmode Object that requested the tool to be triggered \item[{\sphinxstylestrong{data: object}}] \leavevmode Extra data \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{ToolToggleBase (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolToggleBase}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ToolBase}}}}} Toggleable tool Every time it is triggered, it switches between enable and disable \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{{}`{}`*args{}`{}`}}] \leavevmode Variable length argument to be used by the Tool \item[{\sphinxstylestrong{{}`{}`**kwargs{}`{}`}}] \leavevmode {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase.toggled}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{toggled}}}}} if present and True, sets the initial state of the Tool Arbitrary keyword arguments to be consumed by the Tool \end{description} \end{description}\end{quote} \index{cursor (matplotlib.backend\_tools.ToolToggleBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase.cursor}}\pysigline{\sphinxbfcode{\sphinxupquote{cursor}}\sphinxbfcode{\sphinxupquote{ = None}}} Cursor to use when the tool is active \end{fulllineitems} \index{default\_toggled (matplotlib.backend\_tools.ToolToggleBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase.default_toggled}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_toggled}}\sphinxbfcode{\sphinxupquote{ = False}}} Default of toggled state \end{fulllineitems} \index{disable() (matplotlib.backend\_tools.ToolToggleBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase.disable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{disable}}}{\emph{event=None}}{} Disable the toggle tool {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase.trigger}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{trigger}}}}} call this method when {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase.toggled}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{toggled}}}}} is True. This can happen in different circumstances \begin{itemize} \item {} Click on the toolbar tool button \item {} Call to {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.trigger_tool}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.ToolManager.trigger\_tool}}}}} \item {} Another {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolToggleBase}}}}} derived tool is triggered (from the same \sphinxcode{\sphinxupquote{ToolManager}}) \end{itemize} \end{fulllineitems} \index{enable() (matplotlib.backend\_tools.ToolToggleBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase.enable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{enable}}}{\emph{event=None}}{} Enable the toggle tool {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase.trigger}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{trigger}}}}} calls this method when {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase.toggled}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{toggled}}}}} is False \end{fulllineitems} \index{radio\_group (matplotlib.backend\_tools.ToolToggleBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase.radio_group}}\pysigline{\sphinxbfcode{\sphinxupquote{radio\_group}}\sphinxbfcode{\sphinxupquote{ = None}}} Attribute to group ‘radio’ like tools (mutually exclusive) \sphinxstylestrong{String} that identifies the group or \sphinxstylestrong{None} if not belonging to a group \end{fulllineitems} \index{set\_figure() (matplotlib.backend\_tools.ToolToggleBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{figure}}{} Assign a figure to the tool \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{figure: {}`Figure{}`}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{toggled (matplotlib.backend\_tools.ToolToggleBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase.toggled}}\pysigline{\sphinxbfcode{\sphinxupquote{toggled}}} State of the toggled tool \end{fulllineitems} \index{trigger() (matplotlib.backend\_tools.ToolToggleBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase.trigger}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{trigger}}}{\emph{sender}, \emph{event}, \emph{data=None}}{} Calls {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase.enable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{enable}}}}} or {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase.disable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{disable}}}}} based on {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase.toggled}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{toggled}}}}} value \end{fulllineitems} \end{fulllineitems} \index{ToolViewsPositions (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolViewsPositions}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolViewsPositions}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ToolBase}}}}} Auxiliary Tool to handle changes in views and positions Runs in the background and should get used by all the tools that need to access the figure’s history of views and positions, e.g. \begin{itemize} \item {} {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolZoom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolZoom}}}}} \item {} {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolPan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolPan}}}}} \item {} {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolHome}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolHome}}}}} \item {} {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBack}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolBack}}}}} \item {} {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolForward}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolForward}}}}} \end{itemize} \index{add\_figure() (matplotlib.backend\_tools.ToolViewsPositions method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolViewsPositions.add_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_figure}}}{\emph{figure}}{} Add the current figure to the stack of views and positions \end{fulllineitems} \index{back() (matplotlib.backend\_tools.ToolViewsPositions method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolViewsPositions.back}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{back}}}{}{} Back one step in the stack of views and positions \end{fulllineitems} \index{clear() (matplotlib.backend\_tools.ToolViewsPositions method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolViewsPositions.clear}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{clear}}}{\emph{figure}}{} Reset the axes stack \end{fulllineitems} \index{forward() (matplotlib.backend\_tools.ToolViewsPositions method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolViewsPositions.forward}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{forward}}}{}{} Forward one step in the stack of views and positions \end{fulllineitems} \index{home() (matplotlib.backend\_tools.ToolViewsPositions method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolViewsPositions.home}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{home}}}{}{} Recall the first view and position from the stack \end{fulllineitems} \index{push\_current() (matplotlib.backend\_tools.ToolViewsPositions method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolViewsPositions.push_current}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{push\_current}}}{\emph{figure=None}}{} Push the current view limits and position onto their respective stacks \end{fulllineitems} \index{refresh\_locators() (matplotlib.backend\_tools.ToolViewsPositions method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolViewsPositions.refresh_locators}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{refresh\_locators}}}{}{} Redraw the canvases, update the locators \end{fulllineitems} \index{update\_home\_views() (matplotlib.backend\_tools.ToolViewsPositions method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolViewsPositions.update_home_views}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_home\_views}}}{\emph{figure=None}}{} Make sure that self.home\_views has an entry for all axes present in the figure \end{fulllineitems} \index{update\_view() (matplotlib.backend\_tools.ToolViewsPositions method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolViewsPositions.update_view}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_view}}}{}{} Update the view limits and position for each axes from the current stack position. If any axes are present in the figure that aren’t in the current stack position, use the home view limits for those axes and don’t update \sphinxstyleemphasis{any} positions. \end{fulllineitems} \end{fulllineitems} \index{ToolXScale (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolXScale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolXScale}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.AxisScaleBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.AxisScaleBase}}}}} Tool to toggle between linear and logarithmic scales on the X axis \index{default\_keymap (matplotlib.backend\_tools.ToolXScale attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolXScale.default_keymap}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_keymap}}\sphinxbfcode{\sphinxupquote{ = {[}'k', 'L'{]}}}} \end{fulllineitems} \index{description (matplotlib.backend\_tools.ToolXScale attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolXScale.description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}\sphinxbfcode{\sphinxupquote{ = 'Toogle Scale X axis'}}} \end{fulllineitems} \index{set\_scale() (matplotlib.backend\_tools.ToolXScale method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolXScale.set_scale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_scale}}}{\emph{ax}, \emph{scale}}{}~ \end{fulllineitems} \end{fulllineitems} \index{ToolYScale (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolYScale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolYScale}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.AxisScaleBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.AxisScaleBase}}}}} Tool to toggle between linear and logarithmic scales on the Y axis \index{default\_keymap (matplotlib.backend\_tools.ToolYScale attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolYScale.default_keymap}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_keymap}}\sphinxbfcode{\sphinxupquote{ = {[}'l'{]}}}} \end{fulllineitems} \index{description (matplotlib.backend\_tools.ToolYScale attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolYScale.description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}\sphinxbfcode{\sphinxupquote{ = 'Toogle Scale Y axis'}}} \end{fulllineitems} \index{set\_scale() (matplotlib.backend\_tools.ToolYScale method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolYScale.set_scale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_scale}}}{\emph{ax}, \emph{scale}}{}~ \end{fulllineitems} \end{fulllineitems} \index{ToolZoom (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolZoom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ToolZoom}}}{\emph{*args}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ZoomPanBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ZoomPanBase}}}}} Zoom to rectangle \index{cursor (matplotlib.backend\_tools.ToolZoom attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolZoom.cursor}}\pysigline{\sphinxbfcode{\sphinxupquote{cursor}}\sphinxbfcode{\sphinxupquote{ = 2}}} \end{fulllineitems} \index{default\_keymap (matplotlib.backend\_tools.ToolZoom attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolZoom.default_keymap}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_keymap}}\sphinxbfcode{\sphinxupquote{ = {[}'o'{]}}}} \end{fulllineitems} \index{description (matplotlib.backend\_tools.ToolZoom attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolZoom.description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}\sphinxbfcode{\sphinxupquote{ = 'Zoom to rectangle'}}} \end{fulllineitems} \index{image (matplotlib.backend\_tools.ToolZoom attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolZoom.image}}\pysigline{\sphinxbfcode{\sphinxupquote{image}}\sphinxbfcode{\sphinxupquote{ = 'zoom\_to\_rect'}}} \end{fulllineitems} \index{radio\_group (matplotlib.backend\_tools.ToolZoom attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolZoom.radio_group}}\pysigline{\sphinxbfcode{\sphinxupquote{radio\_group}}\sphinxbfcode{\sphinxupquote{ = 'default'}}} \end{fulllineitems} \end{fulllineitems} \index{ViewsPositionsBase (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ViewsPositionsBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ViewsPositionsBase}}}{\emph{toolmanager}, \emph{name}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ToolBase}}}}} Base class for {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolHome}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolHome}}}}}, {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolBack}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolBack}}}}} and {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolForward}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolForward}}}}} \index{trigger() (matplotlib.backend\_tools.ViewsPositionsBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ViewsPositionsBase.trigger}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{trigger}}}{\emph{sender}, \emph{event}, \emph{data=None}}{} Called when this tool gets used This method is called by {\hyperref[\detokenize{api/backend_managers_api:matplotlib.backend_managers.ToolManager.trigger_tool}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_managers.ToolManager.trigger\_tool}}}}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{event: {}`Event{}`}}] \leavevmode The Canvas event that caused this tool to be called \item[{\sphinxstylestrong{sender: object}}] \leavevmode Object that requested the tool to be triggered \item[{\sphinxstylestrong{data: object}}] \leavevmode Extra data \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{ZoomPanBase (class in matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ZoomPanBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{ZoomPanBase}}}{\emph{*args}}{} Bases: {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolToggleBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.ToolToggleBase}}}}} Base class for {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolZoom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolZoom}}}}} and {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ToolPan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ToolPan}}}}} \index{disable() (matplotlib.backend\_tools.ZoomPanBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ZoomPanBase.disable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{disable}}}{\emph{event}}{} Release the canvas and disconnect press/release events \end{fulllineitems} \index{enable() (matplotlib.backend\_tools.ZoomPanBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ZoomPanBase.enable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{enable}}}{\emph{event}}{} Connect press/release events and lock the canvas \end{fulllineitems} \index{scroll\_zoom() (matplotlib.backend\_tools.ZoomPanBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ZoomPanBase.scroll_zoom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{scroll\_zoom}}}{\emph{event}}{}~ \end{fulllineitems} \index{trigger() (matplotlib.backend\_tools.ZoomPanBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.ZoomPanBase.trigger}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{trigger}}}{\emph{sender}, \emph{event}, \emph{data=None}}{} Calls {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ZoomPanBase.enable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{enable}}}}} or {\hyperref[\detokenize{api/backend_tools_api:matplotlib.backend_tools.ZoomPanBase.disable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{disable}}}}} based on \sphinxcode{\sphinxupquote{toggled}} value \end{fulllineitems} \end{fulllineitems} \index{add\_tools\_to\_container() (in module matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.add_tools_to_container}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{add\_tools\_to\_container}}}{\emph{container, tools={[}{[}'navigation', {[}'home', 'back', 'forward'{]}{]}, {[}'zoompan', {[}'pan', 'zoom', 'subplots'{]}{]}, {[}'io', {[}'save'{]}{]}{]}}}{} Add multiple tools to the container. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{container: Container}}] \leavevmode \sphinxcode{\sphinxupquote{backend\_bases.ToolContainerBase}} object that will get the tools added \item[{\sphinxstylestrong{tools}}] \leavevmode{[}list, optional{]} List in the form {[}{[}group1, {[}tool1, tool2 …{]}{]}, {[}group2, {[}…{]}{]}{]} Where the tools given by tool1, and tool2 will display in group1. See \sphinxcode{\sphinxupquote{add\_tool}} for details. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{add\_tools\_to\_manager() (in module matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.add_tools_to_manager}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{add\_tools\_to\_manager}}}{\emph{toolmanager}, \emph{tools=\{'allnav': \textless{}class 'matplotlib.backend\_tools.ToolEnableAllNavigation'\textgreater{}}, \emph{'back': \textless{}class 'matplotlib.backend\_tools.ToolBack'\textgreater{}}, \emph{'cursor': 'ToolSetCursor'}, \emph{'forward': \textless{}class 'matplotlib.backend\_tools.ToolForward'\textgreater{}}, \emph{'fullscreen': \textless{}class 'matplotlib.backend\_tools.ToolFullScreen'\textgreater{}}, \emph{'grid': \textless{}class 'matplotlib.backend\_tools.ToolGrid'\textgreater{}}, \emph{'grid\_minor': \textless{}class 'matplotlib.backend\_tools.ToolMinorGrid'\textgreater{}}, \emph{'home': \textless{}class 'matplotlib.backend\_tools.ToolHome'\textgreater{}}, \emph{'nav': \textless{}class 'matplotlib.backend\_tools.ToolEnableNavigation'\textgreater{}}, \emph{'pan': \textless{}class 'matplotlib.backend\_tools.ToolPan'\textgreater{}}, \emph{'position': \textless{}class 'matplotlib.backend\_tools.ToolCursorPosition'\textgreater{}}, \emph{'quit': \textless{}class 'matplotlib.backend\_tools.ToolQuit'\textgreater{}}, \emph{'quit\_all': \textless{}class 'matplotlib.backend\_tools.ToolQuitAll'\textgreater{}}, \emph{'rubberband': 'ToolRubberband'}, \emph{'save': 'ToolSaveFigure'}, \emph{'subplots': 'ToolConfigureSubplots'}, \emph{'viewpos': \textless{}class 'matplotlib.backend\_tools.ToolViewsPositions'\textgreater{}}, \emph{'xscale': \textless{}class 'matplotlib.backend\_tools.ToolXScale'\textgreater{}}, \emph{'yscale': \textless{}class 'matplotlib.backend\_tools.ToolYScale'\textgreater{}}, \emph{'zoom': \textless{}class 'matplotlib.backend\_tools.ToolZoom'\textgreater{}\}}}{} Add multiple tools to \sphinxcode{\sphinxupquote{ToolManager}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{toolmanager: ToolManager}}] \leavevmode \sphinxcode{\sphinxupquote{backend\_managers.ToolManager}} object that will get the tools added \item[{\sphinxstylestrong{tools}}] \leavevmode{[}\{str: class\_like\}, optional{]} The tools to add in a \{name: tool\} dict, see \sphinxcode{\sphinxupquote{add\_tool}} for more info. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{default\_toolbar\_tools (in module matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.default_toolbar_tools}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{default\_toolbar\_tools}}\sphinxbfcode{\sphinxupquote{ = {[}{[}'navigation', {[}'home', 'back', 'forward'{]}{]}, {[}'zoompan', {[}'pan', 'zoom', 'subplots'{]}{]}, {[}'io', {[}'save'{]}{]}{]}}}} Default tools in the toolbar \end{fulllineitems} \index{default\_tools (in module matplotlib.backend\_tools)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tools_api:matplotlib.backend_tools.default_tools}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backend\_tools.}}\sphinxbfcode{\sphinxupquote{default\_tools}}\sphinxbfcode{\sphinxupquote{ = \{'allnav': \textless{}class 'matplotlib.backend\_tools.ToolEnableAllNavigation'\textgreater{}, 'back': \textless{}class 'matplotlib.backend\_tools.ToolBack'\textgreater{}, 'cursor': 'ToolSetCursor', 'forward': \textless{}class 'matplotlib.backend\_tools.ToolForward'\textgreater{}, 'fullscreen': \textless{}class 'matplotlib.backend\_tools.ToolFullScreen'\textgreater{}, 'grid': \textless{}class 'matplotlib.backend\_tools.ToolGrid'\textgreater{}, 'grid\_minor': \textless{}class 'matplotlib.backend\_tools.ToolMinorGrid'\textgreater{}, 'home': \textless{}class 'matplotlib.backend\_tools.ToolHome'\textgreater{}, 'nav': \textless{}class 'matplotlib.backend\_tools.ToolEnableNavigation'\textgreater{}, 'pan': \textless{}class 'matplotlib.backend\_tools.ToolPan'\textgreater{}, 'position': \textless{}class 'matplotlib.backend\_tools.ToolCursorPosition'\textgreater{}, 'quit': \textless{}class 'matplotlib.backend\_tools.ToolQuit'\textgreater{}, 'quit\_all': \textless{}class 'matplotlib.backend\_tools.ToolQuitAll'\textgreater{}, 'rubberband': 'ToolRubberband', 'save': 'ToolSaveFigure', 'subplots': 'ToolConfigureSubplots', 'viewpos': \textless{}class 'matplotlib.backend\_tools.ToolViewsPositions'\textgreater{}, 'xscale': \textless{}class 'matplotlib.backend\_tools.ToolXScale'\textgreater{}, 'yscale': \textless{}class 'matplotlib.backend\_tools.ToolYScale'\textgreater{}, 'zoom': \textless{}class 'matplotlib.backend\_tools.ToolZoom'\textgreater{}\}}}} Default tools \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_agg}}} \label{\detokenize{api/backend_agg_api:module-matplotlib.backends.backend_agg}}\label{\detokenize{api/backend_agg_api:matplotlib-backends-backend-agg}}\label{\detokenize{api/backend_agg_api::doc}}\index{matplotlib.backends.backend\_agg (module)} An agg \sphinxurl{http://antigrain.com/} backend Features that are implemented \begin{itemize} \item {} capstyles and join styles \item {} dashes \item {} linewidth \item {} lines, rectangles, ellipses \item {} clipping to a rectangle \item {} output to RGBA and PNG, optionally JPEG and TIFF \item {} alpha blending \item {} DPI scaling properly - everything scales properly (dashes, linewidths, etc) \item {} draw polygon \item {} freetype2 w/ ft2font \end{itemize} TODO: \begin{itemize} \item {} integrate screen dpi w/ ppi and text \end{itemize} \index{FigureCanvas (in module matplotlib.backends.backend\_agg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvas}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_agg.}}\sphinxbfcode{\sphinxupquote{FigureCanvas}}} alias of {\hyperref[\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_agg.FigureCanvasAgg}}}}} \end{fulllineitems} \index{FigureCanvasAgg (class in matplotlib.backends.backend\_agg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_agg.}}\sphinxbfcode{\sphinxupquote{FigureCanvasAgg}}}{\emph{figure}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.FigureCanvasBase}}}}} The canvas the figure renders into. Calls the draw and print fig methods, creates the renderers, etc… \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{figure}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure}}}}}{]} A high-level Figure instance \end{description} \end{description}\end{quote} \index{buffer\_rgba() (matplotlib.backends.backend\_agg.FigureCanvasAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.buffer_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{buffer\_rgba}}}{}{} Get the image as an RGBA byte string {\hyperref[\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw}}}}} must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{bytes}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{copy\_from\_bbox() (matplotlib.backends.backend\_agg.FigureCanvasAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.copy_from_bbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{copy\_from\_bbox}}}{\emph{bbox}}{}~ \end{fulllineitems} \index{draw() (matplotlib.backends.backend\_agg.FigureCanvasAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{}{} Draw the figure using the renderer \end{fulllineitems} \index{get\_renderer() (matplotlib.backends.backend\_agg.FigureCanvasAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.get_renderer}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_renderer}}}{\emph{cleared=False}}{}~ \end{fulllineitems} \index{print\_jpeg() (matplotlib.backends.backend\_agg.FigureCanvasAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.print_jpeg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_jpeg}}}{\emph{filename\_or\_obj}, \emph{*args}, \emph{**kwargs}}{}~\begin{quote}\begin{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{quality}}] \leavevmode{[}int{]} The image quality, on a scale from 1 (worst) to 95 (best). The default is 95, if not given in the matplotlibrc file in the savefig.jpeg\_quality parameter. Values above 95 should be avoided; 100 completely disables the JPEG quantization stage. \item[{\sphinxstylestrong{optimize}}] \leavevmode{[}bool{]} If present, indicates that the encoder should make an extra pass over the image in order to select optimal encoder settings. \item[{\sphinxstylestrong{progressive}}] \leavevmode{[}bool{]} If present, indicates that this image should be stored as a progressive JPEG file. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{print\_jpg() (matplotlib.backends.backend\_agg.FigureCanvasAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.print_jpg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_jpg}}}{\emph{filename\_or\_obj}, \emph{*args}, \emph{**kwargs}}{}~\begin{quote}\begin{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{quality}}] \leavevmode{[}int{]} The image quality, on a scale from 1 (worst) to 95 (best). The default is 95, if not given in the matplotlibrc file in the savefig.jpeg\_quality parameter. Values above 95 should be avoided; 100 completely disables the JPEG quantization stage. \item[{\sphinxstylestrong{optimize}}] \leavevmode{[}bool{]} If present, indicates that the encoder should make an extra pass over the image in order to select optimal encoder settings. \item[{\sphinxstylestrong{progressive}}] \leavevmode{[}bool{]} If present, indicates that this image should be stored as a progressive JPEG file. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{print\_png() (matplotlib.backends.backend\_agg.FigureCanvasAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.print_png}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_png}}}{\emph{filename\_or\_obj}, \emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \index{print\_raw() (matplotlib.backends.backend\_agg.FigureCanvasAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.print_raw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_raw}}}{\emph{filename\_or\_obj}, \emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \index{print\_rgba() (matplotlib.backends.backend\_agg.FigureCanvasAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.print_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_rgba}}}{\emph{filename\_or\_obj}, \emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \index{print\_tif() (matplotlib.backends.backend\_agg.FigureCanvasAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.print_tif}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_tif}}}{\emph{filename\_or\_obj}, \emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \index{print\_tiff() (matplotlib.backends.backend\_agg.FigureCanvasAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.print_tiff}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_tiff}}}{\emph{filename\_or\_obj}, \emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \index{print\_to\_buffer() (matplotlib.backends.backend\_agg.FigureCanvasAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.print_to_buffer}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_to\_buffer}}}{}{}~ \end{fulllineitems} \index{restore\_region() (matplotlib.backends.backend\_agg.FigureCanvasAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.restore_region}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{restore\_region}}}{\emph{region}, \emph{bbox=None}, \emph{xy=None}}{}~ \end{fulllineitems} \index{tostring\_argb() (matplotlib.backends.backend\_agg.FigureCanvasAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.tostring_argb}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tostring\_argb}}}{}{} Get the image as an ARGB byte string {\hyperref[\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw}}}}} must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{bytes}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{tostring\_rgb() (matplotlib.backends.backend\_agg.FigureCanvasAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.tostring_rgb}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tostring\_rgb}}}{}{} Get the image as an RGB byte string {\hyperref[\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw}}}}} must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{bytes}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{RendererAgg (class in matplotlib.backends.backend\_agg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_agg.}}\sphinxbfcode{\sphinxupquote{RendererAgg}}}{\emph{width}, \emph{height}, \emph{dpi}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.RendererBase}}}}} The renderer handles all the drawing primitives using a graphics context instance that controls the colors/styles \index{buffer\_rgba() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.buffer_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{buffer\_rgba}}}{}{}~ \end{fulllineitems} \index{clear() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.clear}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{clear}}}{}{}~ \end{fulllineitems} \index{debug (matplotlib.backends.backend\_agg.RendererAgg attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.debug}}\pysigline{\sphinxbfcode{\sphinxupquote{debug}}}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The debug function was deprecated in version 2.2. \end{fulllineitems} \index{draw\_markers() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.draw_markers}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_markers}}}{\emph{*kl}, \emph{**kw}}{} Draws a marker at each of the vertices in path. This includes all vertices, including control points on curves. To avoid that behavior, those vertices should be removed before calling this function. This provides a fallback implementation of draw\_markers that makes multiple calls to {\hyperref[\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path()}}}}}. Some backends may want to override this method in order to draw the marker only once and reuse it multiple times. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gc}}] \leavevmode{[}\sphinxcode{\sphinxupquote{GraphicsContextBase}}{]} The graphics context \item[{\sphinxstylestrong{marker\_trans}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform applied to the marker. \item[{\sphinxstylestrong{trans}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform applied to the path. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_mathtext() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.draw_mathtext}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_mathtext}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{s}, \emph{prop}, \emph{angle}}{} Draw the math text using matplotlib.mathtext \end{fulllineitems} \index{draw\_path() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.draw_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path}}}{\emph{gc}, \emph{path}, \emph{transform}, \emph{rgbFace=None}}{} Draw the path \end{fulllineitems} \index{draw\_path\_collection() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.draw_path_collection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path\_collection}}}{\emph{*kl}, \emph{**kw}}{} Draws a collection of paths selecting drawing properties from the lists \sphinxstyleemphasis{facecolors}, \sphinxstyleemphasis{edgecolors}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{linestyles} and \sphinxstyleemphasis{antialiaseds}. \sphinxstyleemphasis{offsets} is a list of offsets to apply to each of the paths. The offsets in \sphinxstyleemphasis{offsets} are first transformed by \sphinxstyleemphasis{offsetTrans} before being applied. \sphinxstyleemphasis{offset\_position} may be either “screen” or “data” depending on the space that the offsets are in. This provides a fallback implementation of {\hyperref[\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.draw_path_collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path\_collection()}}}}} that makes multiple calls to {\hyperref[\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path()}}}}}. Some backends may want to override this in order to render each set of path data only once, and then reference that path multiple times with the different offsets, colors, styles etc. The generator methods \sphinxcode{\sphinxupquote{\_iter\_collection\_raw\_paths()}} and \sphinxcode{\sphinxupquote{\_iter\_collection()}} are provided to help with (and standardize) the implementation across backends. It is highly recommended to use those generators, so that changes to the behavior of {\hyperref[\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.draw_path_collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path\_collection()}}}}} can be made globally. \end{fulllineitems} \index{draw\_tex() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.draw_tex}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_tex}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{s}, \emph{prop}, \emph{angle}, \emph{ismath='TeX!'}, \emph{mtext=None}}{}~ \end{fulllineitems} \index{draw\_text() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.draw_text}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_text}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{s}, \emph{prop}, \emph{angle}, \emph{ismath=False}, \emph{mtext=None}}{} Render the text \end{fulllineitems} \index{get\_canvas\_width\_height() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.get_canvas_width_height}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_canvas\_width\_height}}}{}{} return the canvas width and height in display coords \end{fulllineitems} \index{get\_text\_width\_height\_descent() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.get_text_width_height_descent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_text\_width\_height\_descent}}}{\emph{s}, \emph{prop}, \emph{ismath}}{} Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string \sphinxstyleemphasis{s} with {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FontProperties}}}}} \sphinxstyleemphasis{prop} \end{fulllineitems} \index{lock (matplotlib.backends.backend\_agg.RendererAgg attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.lock}}\pysigline{\sphinxbfcode{\sphinxupquote{lock}}\sphinxbfcode{\sphinxupquote{ = \textless{}unlocked \_thread.RLock object owner=0 count=0\textgreater{}}}} \end{fulllineitems} \index{option\_image\_nocomposite() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.option_image_nocomposite}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{option\_image\_nocomposite}}}{}{} override this method for renderers that do not necessarily always want to rescale and composite raster images. (like SVG, PDF, or PS) \end{fulllineitems} \index{option\_scale\_image() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.option_scale_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{option\_scale\_image}}}{}{} agg backend doesn’t support arbitrary scaling of image. \end{fulllineitems} \index{points\_to\_pixels() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.points_to_pixels}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{points\_to\_pixels}}}{\emph{points}}{} convert point measures to pixes using dpi and the pixels per inch of the display \end{fulllineitems} \index{restore\_region() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.restore_region}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{restore\_region}}}{\emph{region}, \emph{bbox=None}, \emph{xy=None}}{} Restore the saved region. If bbox (instance of BboxBase, or its extents) is given, only the region specified by the bbox will be restored. \sphinxstyleemphasis{xy} (a tuple of two floasts) optionally specifies the new position (the LLC of the original region, not the LLC of the bbox) where the region will be restored. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{region} \PYG{o}{=} \PYG{n}{renderer}\PYG{o}{.}\PYG{n}{copy\PYGZus{}from\PYGZus{}bbox}\PYG{p}{(}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{,} \PYG{n}{x2}\PYG{p}{,} \PYG{n}{y2} \PYG{o}{=} \PYG{n}{region}\PYG{o}{.}\PYG{n}{get\PYGZus{}extents}\PYG{p}{(}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{renderer}\PYG{o}{.}\PYG{n}{restore\PYGZus{}region}\PYG{p}{(}\PYG{n}{region}\PYG{p}{,} \PYG{n}{bbox}\PYG{o}{=}\PYG{p}{(}\PYG{n}{x1}\PYG{o}{+}\PYG{n}{dx}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{,} \PYG{n}{x2}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{)}\PYG{p}{,} \PYG{g+gp}{... } \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{n}{x1}\PYG{o}{\PYGZhy{}}\PYG{n}{dx}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{start\_filter() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.start_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{start\_filter}}}{}{} Start filtering. It simply create a new canvas (the old one is saved). \end{fulllineitems} \index{stop\_filter() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.stop_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{stop\_filter}}}{\emph{post\_processing}}{} Save the plot in the current canvas as a image and apply the \sphinxstyleemphasis{post\_processing} function. \begin{quote} \begin{description} \item[{def post\_processing(image, dpi):}] \leavevmode \# ny, nx, depth = image.shape \# image (numpy array) has RGBA channels and has a depth of 4. … \# create a new\_image (numpy array of 4 channels, size can be \# different). The resulting image may have offsets from \# lower-left corner of the original image return new\_image, offset\_x, offset\_y \end{description} \end{quote} The saved renderer is restored and the returned image from post\_processing is plotted (using draw\_image) on it. \end{fulllineitems} \index{tostring\_argb() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.tostring_argb}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tostring\_argb}}}{}{}~ \end{fulllineitems} \index{tostring\_rgb() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.tostring_rgb}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tostring\_rgb}}}{}{}~ \end{fulllineitems} \index{tostring\_rgba\_minimized() (matplotlib.backends.backend\_agg.RendererAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.RendererAgg.tostring_rgba_minimized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tostring\_rgba\_minimized}}}{}{}~ \end{fulllineitems} \end{fulllineitems} \index{get\_hinting\_flag() (in module matplotlib.backends.backend\_agg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.get_hinting_flag}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_agg.}}\sphinxbfcode{\sphinxupquote{get\_hinting\_flag}}}{}{}~ \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_cairo}}} \label{\detokenize{api/backend_cairo_api:module-matplotlib.backends.backend_cairo}}\label{\detokenize{api/backend_cairo_api:matplotlib-backends-backend-cairo}}\label{\detokenize{api/backend_cairo_api::doc}}\index{matplotlib.backends.backend\_cairo (module)} \subsection{A Cairo backend for matplotlib} \label{\detokenize{api/backend_cairo_api:a-cairo-backend-for-matplotlib}}\begin{quote}\begin{description} \item[{Author}] \leavevmode Steve Chaplin and others \end{description}\end{quote} This backend depends on \sphinxhref{http://cairographics.org}{cairo}, and either on cairocffi, or (Python 2 only) on pycairo. \index{ArrayWrapper (class in matplotlib.backends.backend\_cairo)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.ArrayWrapper}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_cairo.}}\sphinxbfcode{\sphinxupquote{ArrayWrapper}}}{\emph{myarray}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Thin wrapper around numpy ndarray to expose the interface expected by cairocffi. Basically replicates the array.array interface. \index{buffer\_info() (matplotlib.backends.backend\_cairo.ArrayWrapper method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.ArrayWrapper.buffer_info}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{buffer\_info}}}{}{}~ \end{fulllineitems} \end{fulllineitems} \index{FigureCanvas (in module matplotlib.backends.backend\_cairo)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.FigureCanvas}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_cairo.}}\sphinxbfcode{\sphinxupquote{FigureCanvas}}} alias of {\hyperref[\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.FigureCanvasCairo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_cairo.FigureCanvasCairo}}}}} \end{fulllineitems} \index{FigureCanvasCairo (class in matplotlib.backends.backend\_cairo)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.FigureCanvasCairo}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_cairo.}}\sphinxbfcode{\sphinxupquote{FigureCanvasCairo}}}{\emph{figure}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.FigureCanvasBase}}}}} \index{print\_pdf() (matplotlib.backends.backend\_cairo.FigureCanvasCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.FigureCanvasCairo.print_pdf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_pdf}}}{\emph{fobj}, \emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \index{print\_png() (matplotlib.backends.backend\_cairo.FigureCanvasCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.FigureCanvasCairo.print_png}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_png}}}{\emph{fobj}, \emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \index{print\_ps() (matplotlib.backends.backend\_cairo.FigureCanvasCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.FigureCanvasCairo.print_ps}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_ps}}}{\emph{fobj}, \emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \index{print\_svg() (matplotlib.backends.backend\_cairo.FigureCanvasCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.FigureCanvasCairo.print_svg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_svg}}}{\emph{fobj}, \emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \index{print\_svgz() (matplotlib.backends.backend\_cairo.FigureCanvasCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.FigureCanvasCairo.print_svgz}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_svgz}}}{\emph{fobj}, \emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \index{supports\_blit (matplotlib.backends.backend\_cairo.FigureCanvasCairo attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.FigureCanvasCairo.supports_blit}}\pysigline{\sphinxbfcode{\sphinxupquote{supports\_blit}}\sphinxbfcode{\sphinxupquote{ = False}}} \end{fulllineitems} \end{fulllineitems} \index{GraphicsContextCairo (class in matplotlib.backends.backend\_cairo)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.GraphicsContextCairo}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_cairo.}}\sphinxbfcode{\sphinxupquote{GraphicsContextCairo}}}{\emph{renderer}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.GraphicsContextBase}}}}} \index{get\_rgb() (matplotlib.backends.backend\_cairo.GraphicsContextCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.GraphicsContextCairo.get_rgb}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rgb}}}{}{} returns a tuple of three or four floats from 0-1. \end{fulllineitems} \index{restore() (matplotlib.backends.backend\_cairo.GraphicsContextCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.GraphicsContextCairo.restore}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{restore}}}{}{} Restore the graphics context from the stack - needed only for backends that save graphics contexts on a stack \end{fulllineitems} \index{set\_alpha() (matplotlib.backends.backend\_cairo.GraphicsContextCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.GraphicsContextCairo.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha value used for blending - not supported on all backends. If \sphinxcode{\sphinxupquote{alpha=None}} (the default), the alpha components of the foreground and fill colors will be used to set their respective transparencies (where applicable); otherwise, \sphinxcode{\sphinxupquote{alpha}} will override them. \end{fulllineitems} \index{set\_capstyle() (matplotlib.backends.backend\_cairo.GraphicsContextCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.GraphicsContextCairo.set_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_capstyle}}}{\emph{cs}}{} Set the capstyle as a string in (‘butt’, ‘round’, ‘projecting’) \end{fulllineitems} \index{set\_clip\_path() (matplotlib.backends.backend\_cairo.GraphicsContextCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.GraphicsContextCairo.set_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}}{} Set the clip path and transformation. Path should be a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformedPath}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformedPath}}}}} instance. \end{fulllineitems} \index{set\_clip\_rectangle() (matplotlib.backends.backend\_cairo.GraphicsContextCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.GraphicsContextCairo.set_clip_rectangle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_rectangle}}}{\emph{rectangle}}{} Set the clip rectangle with sequence (left, bottom, width, height) \end{fulllineitems} \index{set\_dashes() (matplotlib.backends.backend\_cairo.GraphicsContextCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.GraphicsContextCairo.set_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashes}}}{\emph{offset}, \emph{dashes}}{} Set the dash style for the gc. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{dash\_offset}}] \leavevmode{[}float{]} is the offset (usually 0). \item[{\sphinxstylestrong{dash\_list}}] \leavevmode{[}array\_like{]} specifies the on-off sequence as points. \sphinxcode{\sphinxupquote{(None, None)}} specifies a solid line \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_foreground() (matplotlib.backends.backend\_cairo.GraphicsContextCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.GraphicsContextCairo.set_foreground}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_foreground}}}{\emph{fg}, \emph{isRGBA=None}}{} Set the foreground color. fg can be a MATLAB format string, a html hex color string, an rgb or rgba unit tuple, or a float between 0 and 1. In the latter case, grayscale is used. If you know fg is rgba, set \sphinxcode{\sphinxupquote{isRGBA=True}} for efficiency. \end{fulllineitems} \index{set\_joinstyle() (matplotlib.backends.backend\_cairo.GraphicsContextCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.GraphicsContextCairo.set_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_joinstyle}}}{\emph{js}}{} Set the join style to be one of (‘miter’, ‘round’, ‘bevel’) \end{fulllineitems} \index{set\_linewidth() (matplotlib.backends.backend\_cairo.GraphicsContextCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.GraphicsContextCairo.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{w}}{} Set the linewidth in points \end{fulllineitems} \end{fulllineitems} \index{RendererCairo (class in matplotlib.backends.backend\_cairo)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.RendererCairo}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_cairo.}}\sphinxbfcode{\sphinxupquote{RendererCairo}}}{\emph{dpi}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.RendererBase}}}}} \index{convert\_path() (matplotlib.backends.backend\_cairo.RendererCairo static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.RendererCairo.convert_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{convert\_path}}}{\emph{ctx}, \emph{path}, \emph{transform}, \emph{clip=None}}{}~ \end{fulllineitems} \index{draw\_image() (matplotlib.backends.backend\_cairo.RendererCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.RendererCairo.draw_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_image}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{im}}{} Draw an RGBA image. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gc}}] \leavevmode{[}\sphinxcode{\sphinxupquote{GraphicsContextBase}}{]} a graphics context with clipping information. \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar{]} the distance in physical units (i.e., dots or pixels) from the left hand side of the canvas. \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar{]} the distance in physical units (i.e., dots or pixels) from the bottom side of the canvas. \item[{\sphinxstylestrong{im}}] \leavevmode{[}array\_like, shape=(N, M, 4), dtype=np.uint8{]} An array of RGBA pixels. \item[{\sphinxstylestrong{transform}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Affine2DBase}}}}}{]} If and only if the concrete backend is written such that \sphinxcode{\sphinxupquote{option\_scale\_image()}} returns \sphinxcode{\sphinxupquote{True}}, an affine transformation \sphinxstyleemphasis{may} be passed to {\hyperref[\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.RendererCairo.draw_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_image()}}}}}. It takes the form of a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Affine2DBase}}}}} instance. The translation vector of the transformation is given in physical units (i.e., dots or pixels). Note that the transformation does not override \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}}, and has to be applied \sphinxstyleemphasis{before} translating the result by \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} (this can be accomplished by adding \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} to the translation vector defined by \sphinxcode{\sphinxupquote{transform}}). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_markers() (matplotlib.backends.backend\_cairo.RendererCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.RendererCairo.draw_markers}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_markers}}}{\emph{gc}, \emph{marker\_path}, \emph{marker\_trans}, \emph{path}, \emph{transform}, \emph{rgbFace=None}}{} Draws a marker at each of the vertices in path. This includes all vertices, including control points on curves. To avoid that behavior, those vertices should be removed before calling this function. This provides a fallback implementation of draw\_markers that makes multiple calls to {\hyperref[\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.RendererCairo.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path()}}}}}. Some backends may want to override this method in order to draw the marker only once and reuse it multiple times. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gc}}] \leavevmode{[}\sphinxcode{\sphinxupquote{GraphicsContextBase}}{]} The graphics context \item[{\sphinxstylestrong{marker\_trans}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform applied to the marker. \item[{\sphinxstylestrong{trans}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform applied to the path. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_path() (matplotlib.backends.backend\_cairo.RendererCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.RendererCairo.draw_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path}}}{\emph{gc}, \emph{path}, \emph{transform}, \emph{rgbFace=None}}{} Draws a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance using the given affine transform. \end{fulllineitems} \index{draw\_text() (matplotlib.backends.backend\_cairo.RendererCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.RendererCairo.draw_text}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_text}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{s}, \emph{prop}, \emph{angle}, \emph{ismath=False}, \emph{mtext=None}}{} Draw the text instance \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gc}}] \leavevmode{[}\sphinxcode{\sphinxupquote{GraphicsContextBase}}{]} the graphics context \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar{]} the x location of the text in display coords \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar{]} the y location of the text baseline in display coords \item[{\sphinxstylestrong{s}}] \leavevmode{[}str{]} the text string \item[{\sphinxstylestrong{prop}}] \leavevmode{[}{\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}}{]} font properties \item[{\sphinxstylestrong{angle}}] \leavevmode{[}scalar{]} the rotation angle in degrees \item[{\sphinxstylestrong{mtext}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}}{]} the original text object to be rendered \end{description} \end{description}\end{quote} \paragraph{Notes} \sphinxstylestrong{backend implementers note} When you are trying to determine if you have gotten your bounding box right (which is what enables the text layout/alignment to work properly), it helps to change the line in text.py: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{if} \PYG{l+m+mi}{0}\PYG{p}{:} \PYG{n}{bbox\PYGZus{}artist}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{renderer}\PYG{p}{)} \end{sphinxVerbatim} to if 1, and then the actual bounding box will be plotted along with your text. \end{fulllineitems} \index{fontangles (matplotlib.backends.backend\_cairo.RendererCairo attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.RendererCairo.fontangles}}\pysigline{\sphinxbfcode{\sphinxupquote{fontangles}}\sphinxbfcode{\sphinxupquote{ = \{'italic': \textless{}MyCairoCffi name='mock.FONT\_SLANT\_ITALIC' id='140269517061424'\textgreater{}, 'normal': \textless{}MyCairoCffi name='mock.FONT\_SLANT\_NORMAL' id='140269517073936'\textgreater{}, 'oblique': \textless{}MyCairoCffi name='mock.FONT\_SLANT\_OBLIQUE' id='140269517090544'\textgreater{}\}}}} \end{fulllineitems} \index{fontweights (matplotlib.backends.backend\_cairo.RendererCairo attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.RendererCairo.fontweights}}\pysigline{\sphinxbfcode{\sphinxupquote{fontweights}}\sphinxbfcode{\sphinxupquote{ = \{100: \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_NORMAL' id='140269517024168'\textgreater{}, 200: \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_NORMAL' id='140269517024168'\textgreater{}, 300: \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_NORMAL' id='140269517024168'\textgreater{}, 400: \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_NORMAL' id='140269517024168'\textgreater{}, 500: \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_NORMAL' id='140269517024168'\textgreater{}, 600: \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_BOLD' id='140269517040720'\textgreater{}, 700: \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_BOLD' id='140269517040720'\textgreater{}, 800: \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_BOLD' id='140269517040720'\textgreater{}, 900: \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_BOLD' id='140269517040720'\textgreater{}, 'ultralight': \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_NORMAL' id='140269517024168'\textgreater{}, 'light': \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_NORMAL' id='140269517024168'\textgreater{}, 'normal': \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_NORMAL' id='140269517024168'\textgreater{}, 'medium': \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_NORMAL' id='140269517024168'\textgreater{}, 'regular': \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_NORMAL' id='140269517024168'\textgreater{}, 'semibold': \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_BOLD' id='140269517040720'\textgreater{}, 'bold': \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_BOLD' id='140269517040720'\textgreater{}, 'heavy': \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_BOLD' id='140269517040720'\textgreater{}, 'ultrabold': \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_BOLD' id='140269517040720'\textgreater{}, 'black': \textless{}MyCairoCffi name='mock.FONT\_WEIGHT\_BOLD' id='140269517040720'\textgreater{}\}}}} \end{fulllineitems} \index{get\_canvas\_width\_height() (matplotlib.backends.backend\_cairo.RendererCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.RendererCairo.get_canvas_width_height}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_canvas\_width\_height}}}{}{} return the canvas width and height in display coords \end{fulllineitems} \index{get\_text\_width\_height\_descent() (matplotlib.backends.backend\_cairo.RendererCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.RendererCairo.get_text_width_height_descent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_text\_width\_height\_descent}}}{\emph{s}, \emph{prop}, \emph{ismath}}{} Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string \sphinxstyleemphasis{s} with {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FontProperties}}}}} \sphinxstyleemphasis{prop} \end{fulllineitems} \index{new\_gc() (matplotlib.backends.backend\_cairo.RendererCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.RendererCairo.new_gc}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{new\_gc}}}{}{} Return an instance of a \sphinxcode{\sphinxupquote{GraphicsContextBase}} \end{fulllineitems} \index{points\_to\_pixels() (matplotlib.backends.backend\_cairo.RendererCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.RendererCairo.points_to_pixels}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{points\_to\_pixels}}}{\emph{points}}{} Convert points to display units You need to override this function (unless your backend doesn’t have a dpi, e.g., postscript or svg). Some imaging systems assume some value for pixels per inch: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{points} \PYG{n}{to} \PYG{n}{pixels} \PYG{o}{=} \PYG{n}{points} \PYG{o}{*} \PYG{n}{pixels\PYGZus{}per\PYGZus{}inch}\PYG{o}{/}\PYG{l+m+mf}{72.0} \PYG{o}{*} \PYG{n}{dpi}\PYG{o}{/}\PYG{l+m+mf}{72.0} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{points}}] \leavevmode{[}scalar or array\_like{]} a float or a numpy array of float \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Points converted to pixels}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_ctx\_from\_surface() (matplotlib.backends.backend\_cairo.RendererCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.RendererCairo.set_ctx_from_surface}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_ctx\_from\_surface}}}{\emph{surface}}{}~ \end{fulllineitems} \index{set\_width\_height() (matplotlib.backends.backend\_cairo.RendererCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.RendererCairo.set_width_height}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_width\_height}}}{\emph{width}, \emph{height}}{}~ \end{fulllineitems} \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_gtkagg}}} \label{\detokenize{api/backend_gtkagg_api:matplotlib-backends-backend-gtkagg}}\label{\detokenize{api/backend_gtkagg_api::doc}} \sphinxstylestrong{TODO} We’ll add this later, importing the gtk backends requires an active X-session, which is not compatible with cron jobs. \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_gtkcairo}}} \label{\detokenize{api/backend_gtkcairo_api:matplotlib-backends-backend-gtkcairo}}\label{\detokenize{api/backend_gtkcairo_api::doc}} \sphinxstylestrong{TODO} We’ll add this later, importing the gtk backends requires an active X-session, which is not compatible with cron jobs. \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_gtk3agg}}} \label{\detokenize{api/backend_gtk3agg_api:matplotlib-backends-backend-gtk3agg}}\label{\detokenize{api/backend_gtk3agg_api::doc}} \sphinxstylestrong{TODO} We’ll add this later, importing the gtk3 backends requires an active X-session, which is not compatible with cron jobs. \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_gtk3cairo}}} \label{\detokenize{api/backend_gtk3cairo_api:matplotlib-backends-backend-gtk3cairo}}\label{\detokenize{api/backend_gtk3cairo_api::doc}} \sphinxstylestrong{TODO} We’ll add this later, importing the gtk3 backends requires an active X-session, which is not compatible with cron jobs. \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_nbagg}}} \label{\detokenize{api/backend_nbagg_api:module-matplotlib.backends.backend_nbagg}}\label{\detokenize{api/backend_nbagg_api:matplotlib-backends-backend-nbagg}}\label{\detokenize{api/backend_nbagg_api::doc}}\index{matplotlib.backends.backend\_nbagg (module)} Interactive figures in the IPython notebook \index{CommSocket (class in matplotlib.backends.backend\_nbagg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.CommSocket}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_nbagg.}}\sphinxbfcode{\sphinxupquote{CommSocket}}}{\emph{manager}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Manages the Comm connection between IPython and the browser (client). Comms are 2 way, with the CommSocket being able to publish a message via the send\_json method, and handle a message with on\_message. On the JS side figure.send\_message and figure.ws.onmessage do the sending and receiving respectively. \index{is\_open() (matplotlib.backends.backend\_nbagg.CommSocket method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.CommSocket.is_open}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_open}}}{}{}~ \end{fulllineitems} \index{on\_close() (matplotlib.backends.backend\_nbagg.CommSocket method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.CommSocket.on_close}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{on\_close}}}{}{}~ \end{fulllineitems} \index{on\_message() (matplotlib.backends.backend\_nbagg.CommSocket method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.CommSocket.on_message}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{on\_message}}}{\emph{message}}{}~ \end{fulllineitems} \index{send\_binary() (matplotlib.backends.backend\_nbagg.CommSocket method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.CommSocket.send_binary}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{send\_binary}}}{\emph{blob}}{}~ \end{fulllineitems} \index{send\_json() (matplotlib.backends.backend\_nbagg.CommSocket method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.CommSocket.send_json}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{send\_json}}}{\emph{content}}{}~ \end{fulllineitems} \end{fulllineitems} \index{FigureCanvas (in module matplotlib.backends.backend\_nbagg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.FigureCanvas}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_nbagg.}}\sphinxbfcode{\sphinxupquote{FigureCanvas}}} alias of {\hyperref[\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.FigureCanvasNbAgg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_nbagg.FigureCanvasNbAgg}}}}} \end{fulllineitems} \index{FigureCanvasNbAgg (class in matplotlib.backends.backend\_nbagg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.FigureCanvasNbAgg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_nbagg.}}\sphinxbfcode{\sphinxupquote{FigureCanvasNbAgg}}}{\emph{*args}, \emph{**kwargs}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.backends.backend\_webagg\_core.FigureCanvasWebAggCore}} \index{new\_timer() (matplotlib.backends.backend\_nbagg.FigureCanvasNbAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.FigureCanvasNbAgg.new_timer}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{new\_timer}}}{\emph{*args}, \emph{**kwargs}}{} Creates a new backend-specific subclass of \sphinxcode{\sphinxupquote{backend\_bases.Timer}}. This is useful for getting periodic events through the backend’s native event loop. Implemented only for backends with GUIs. \begin{quote}\begin{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{interval}}] \leavevmode{[}scalar{]} Timer interval in milliseconds \item[{\sphinxstylestrong{callbacks}}] \leavevmode{[}List{[}Tuple{[}callable, Tuple, Dict{]}{]}{]} Sequence of (func, args, kwargs) where \sphinxcode{\sphinxupquote{func(*args, **kwargs)}} will be executed by the timer every \sphinxstyleemphasis{interval}. callbacks which return \sphinxcode{\sphinxupquote{False}} or \sphinxcode{\sphinxupquote{0}} will be removed from the timer. \end{description} \end{description}\end{quote} \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{timer} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{new\PYGZus{}timer}\PYG{p}{(}\PYG{n}{callbacks}\PYG{o}{=}\PYG{p}{[}\PYG{p}{(}\PYG{n}{f1}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{p}{)}\PYG{p}{,} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{a}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{3}\PYG{p}{\PYGZcb{}}\PYG{p}{)}\PYG{p}{,}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \end{fulllineitems} \index{FigureManager (in module matplotlib.backends.backend\_nbagg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.FigureManager}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_nbagg.}}\sphinxbfcode{\sphinxupquote{FigureManager}}} alias of {\hyperref[\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.FigureManagerNbAgg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_nbagg.FigureManagerNbAgg}}}}} \end{fulllineitems} \index{FigureManagerNbAgg (class in matplotlib.backends.backend\_nbagg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.FigureManagerNbAgg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_nbagg.}}\sphinxbfcode{\sphinxupquote{FigureManagerNbAgg}}}{\emph{canvas}, \emph{num}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.backends.backend\_webagg\_core.FigureManagerWebAgg}} \index{ToolbarCls (matplotlib.backends.backend\_nbagg.FigureManagerNbAgg attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.FigureManagerNbAgg.ToolbarCls}}\pysigline{\sphinxbfcode{\sphinxupquote{ToolbarCls}}} alias of {\hyperref[\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.NavigationIPy}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{NavigationIPy}}}}} \end{fulllineitems} \index{clearup\_closed() (matplotlib.backends.backend\_nbagg.FigureManagerNbAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.FigureManagerNbAgg.clearup_closed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{clearup\_closed}}}{}{} Clear up any closed Comms. \end{fulllineitems} \index{connected (matplotlib.backends.backend\_nbagg.FigureManagerNbAgg attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.FigureManagerNbAgg.connected}}\pysigline{\sphinxbfcode{\sphinxupquote{connected}}}~ \end{fulllineitems} \index{destroy() (matplotlib.backends.backend\_nbagg.FigureManagerNbAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.FigureManagerNbAgg.destroy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{destroy}}}{}{}~ \end{fulllineitems} \index{display\_js() (matplotlib.backends.backend\_nbagg.FigureManagerNbAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.FigureManagerNbAgg.display_js}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{display\_js}}}{}{}~ \end{fulllineitems} \index{get\_javascript() (matplotlib.backends.backend\_nbagg.FigureManagerNbAgg class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.FigureManagerNbAgg.get_javascript}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{get\_javascript}}}{\emph{stream=None}}{}~ \end{fulllineitems} \index{remove\_comm() (matplotlib.backends.backend\_nbagg.FigureManagerNbAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.FigureManagerNbAgg.remove_comm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_comm}}}{\emph{comm\_id}}{}~ \end{fulllineitems} \index{reshow() (matplotlib.backends.backend\_nbagg.FigureManagerNbAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.FigureManagerNbAgg.reshow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{reshow}}}{}{} A special method to re-show the figure in the notebook. \end{fulllineitems} \index{show() (matplotlib.backends.backend\_nbagg.FigureManagerNbAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.FigureManagerNbAgg.show}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{show}}}{}{} For GUI backends, show the figure window and redraw. For non-GUI backends, raise an exception to be caught by {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.show}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{show()}}}}}, for an optional warning. \end{fulllineitems} \end{fulllineitems} \index{NavigationIPy (class in matplotlib.backends.backend\_nbagg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.NavigationIPy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_nbagg.}}\sphinxbfcode{\sphinxupquote{NavigationIPy}}}{\emph{canvas}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.backends.backend\_webagg\_core.NavigationToolbar2WebAgg}} \index{toolitems (matplotlib.backends.backend\_nbagg.NavigationIPy attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.NavigationIPy.toolitems}}\pysigline{\sphinxbfcode{\sphinxupquote{toolitems}}\sphinxbfcode{\sphinxupquote{ = {[}('Home', 'Reset original view', 'fa fa-home icon-home', 'home'), ('Back', 'Back to previous view', 'fa fa-arrow-left icon-arrow-left', 'back'), ('Forward', 'Forward to next view', 'fa fa-arrow-right icon-arrow-right', 'forward'), (None, None, None, None), ('Pan', 'Pan axes with left mouse, zoom with right', 'fa fa-arrows icon-move', 'pan'), ('Zoom', 'Zoom to rectangle', 'fa fa-square-o icon-check-empty', 'zoom'), (None, None, None, None), ('Download', 'Download plot', 'fa fa-floppy-o icon-save', 'download'){]}}}} \end{fulllineitems} \end{fulllineitems} \index{connection\_info() (in module matplotlib.backends.backend\_nbagg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.connection_info}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_nbagg.}}\sphinxbfcode{\sphinxupquote{connection\_info}}}{}{} Return a string showing the figure and connection status for the backend. This is intended as a diagnostic tool, and not for general use. \end{fulllineitems} \index{new\_figure\_manager\_given\_figure() (in module matplotlib.backends.backend\_nbagg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.new_figure_manager_given_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_nbagg.}}\sphinxbfcode{\sphinxupquote{new\_figure\_manager\_given\_figure}}}{\emph{num}, \emph{figure}}{} Create a new figure manager instance for the given figure. \end{fulllineitems} \index{show() (in module matplotlib.backends.backend\_nbagg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.show}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_nbagg.}}\sphinxbfcode{\sphinxupquote{show}}}{\emph{*args}, \emph{**kwargs}}{} Show all figures. {\hyperref[\detokenize{api/backend_nbagg_api:matplotlib.backends.backend_nbagg.show}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{show}}}}} blocks by calling \sphinxcode{\sphinxupquote{mainloop}} if \sphinxstyleemphasis{block} is \sphinxcode{\sphinxupquote{True}}, or if it is \sphinxcode{\sphinxupquote{None}} and we are neither in IPython’s \sphinxcode{\sphinxupquote{\%pylab}} mode, nor in \sphinxcode{\sphinxupquote{interactive}} mode. \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_pdf}}} \label{\detokenize{api/backend_pdf_api:module-matplotlib.backends.backend_pdf}}\label{\detokenize{api/backend_pdf_api:matplotlib-backends-backend-pdf}}\label{\detokenize{api/backend_pdf_api::doc}}\index{matplotlib.backends.backend\_pdf (module)} A PDF matplotlib backend Author: Jouni K Seppänen \textless{}\sphinxhref{mailto:jks@iki.fi}{jks@iki.fi}\textgreater{} \index{FigureCanvas (in module matplotlib.backends.backend\_pdf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.FigureCanvas}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.}}\sphinxbfcode{\sphinxupquote{FigureCanvas}}} alias of {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.FigureCanvasPdf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.FigureCanvasPdf}}}}} \end{fulllineitems} \index{FigureCanvasPdf (class in matplotlib.backends.backend\_pdf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.FigureCanvasPdf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.}}\sphinxbfcode{\sphinxupquote{FigureCanvasPdf}}}{\emph{figure}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.FigureCanvasBase}}}}} The canvas the figure renders into. Calls the draw and print fig methods, creates the renderers, etc… \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{figure}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure}}}}}{]} A high-level Figure instance \end{description} \end{description}\end{quote} \index{draw() (matplotlib.backends.backend\_pdf.FigureCanvasPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.FigureCanvasPdf.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{}{} Render the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \end{fulllineitems} \index{filetypes (matplotlib.backends.backend\_pdf.FigureCanvasPdf attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.FigureCanvasPdf.filetypes}}\pysigline{\sphinxbfcode{\sphinxupquote{filetypes}}\sphinxbfcode{\sphinxupquote{ = \{'pdf': 'Portable Document Format'\}}}} \end{fulllineitems} \index{fixed\_dpi (matplotlib.backends.backend\_pdf.FigureCanvasPdf attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.FigureCanvasPdf.fixed_dpi}}\pysigline{\sphinxbfcode{\sphinxupquote{fixed\_dpi}}\sphinxbfcode{\sphinxupquote{ = 72}}} \end{fulllineitems} \index{get\_default\_filetype() (matplotlib.backends.backend\_pdf.FigureCanvasPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.FigureCanvasPdf.get_default_filetype}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_default\_filetype}}}{}{} Get the default savefig file format as specified in rcParam \sphinxcode{\sphinxupquote{savefig.format}}. Returned string excludes period. Overridden in backends that only support a single file type. \end{fulllineitems} \index{print\_pdf() (matplotlib.backends.backend\_pdf.FigureCanvasPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.FigureCanvasPdf.print_pdf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_pdf}}}{\emph{filename}, \emph{**kwargs}}{}~ \end{fulllineitems} \end{fulllineitems} \index{FigureManager (in module matplotlib.backends.backend\_pdf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.FigureManager}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.}}\sphinxbfcode{\sphinxupquote{FigureManager}}} alias of {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.FigureManagerPdf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.FigureManagerPdf}}}}} \end{fulllineitems} \index{FigureManagerPdf (class in matplotlib.backends.backend\_pdf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.FigureManagerPdf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.}}\sphinxbfcode{\sphinxupquote{FigureManagerPdf}}}{\emph{canvas}, \emph{num}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureManagerBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.FigureManagerBase}}}}} \end{fulllineitems} \index{GraphicsContextPdf (class in matplotlib.backends.backend\_pdf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.}}\sphinxbfcode{\sphinxupquote{GraphicsContextPdf}}}{\emph{file}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.GraphicsContextBase}}}}} \index{alpha\_cmd() (matplotlib.backends.backend\_pdf.GraphicsContextPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.alpha_cmd}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{alpha\_cmd}}}{\emph{alpha}, \emph{forced}, \emph{effective\_alphas}}{}~ \end{fulllineitems} \index{capstyle\_cmd() (matplotlib.backends.backend\_pdf.GraphicsContextPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.capstyle_cmd}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{capstyle\_cmd}}}{\emph{style}}{}~ \end{fulllineitems} \index{capstyles (matplotlib.backends.backend\_pdf.GraphicsContextPdf attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.capstyles}}\pysigline{\sphinxbfcode{\sphinxupquote{capstyles}}\sphinxbfcode{\sphinxupquote{ = \{'butt': 0, 'projecting': 2, 'round': 1\}}}} \end{fulllineitems} \index{clip\_cmd() (matplotlib.backends.backend\_pdf.GraphicsContextPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.clip_cmd}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{clip\_cmd}}}{\emph{cliprect}, \emph{clippath}}{} Set clip rectangle. Calls self.pop() and self.push(). \end{fulllineitems} \index{commands (matplotlib.backends.backend\_pdf.GraphicsContextPdf attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.commands}}\pysigline{\sphinxbfcode{\sphinxupquote{commands}}\sphinxbfcode{\sphinxupquote{ = ((('\_cliprect', '\_clippath'), \textless{}function GraphicsContextPdf.clip\_cmd\textgreater{}), (('\_alpha', '\_forced\_alpha', '\_effective\_alphas'), \textless{}function GraphicsContextPdf.alpha\_cmd\textgreater{}), (('\_capstyle',), \textless{}function GraphicsContextPdf.capstyle\_cmd\textgreater{}), (('\_fillcolor',), \textless{}function GraphicsContextPdf.fillcolor\_cmd\textgreater{}), (('\_joinstyle',), \textless{}function GraphicsContextPdf.joinstyle\_cmd\textgreater{}), (('\_linewidth',), \textless{}function GraphicsContextPdf.linewidth\_cmd\textgreater{}), (('\_dashes',), \textless{}function GraphicsContextPdf.dash\_cmd\textgreater{}), (('\_rgb',), \textless{}function GraphicsContextPdf.rgb\_cmd\textgreater{}), (('\_hatch', '\_hatch\_color'), \textless{}function GraphicsContextPdf.hatch\_cmd\textgreater{}))}}} \end{fulllineitems} \index{copy\_properties() (matplotlib.backends.backend\_pdf.GraphicsContextPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.copy_properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{copy\_properties}}}{\emph{other}}{} Copy properties of other into self. \end{fulllineitems} \index{dash\_cmd() (matplotlib.backends.backend\_pdf.GraphicsContextPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.dash_cmd}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{dash\_cmd}}}{\emph{dashes}}{}~ \end{fulllineitems} \index{delta() (matplotlib.backends.backend\_pdf.GraphicsContextPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.delta}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{delta}}}{\emph{other}}{} Copy properties of other into self and return PDF commands needed to transform self into other. \end{fulllineitems} \index{fill() (matplotlib.backends.backend\_pdf.GraphicsContextPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.fill}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{fill}}}{\emph{*args}}{} Predicate: does the path need to be filled? An optional argument can be used to specify an alternative \_fillcolor, as needed by RendererPdf.draw\_markers. \end{fulllineitems} \index{fillcolor\_cmd() (matplotlib.backends.backend\_pdf.GraphicsContextPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.fillcolor_cmd}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{fillcolor\_cmd}}}{\emph{rgb}}{}~ \end{fulllineitems} \index{finalize() (matplotlib.backends.backend\_pdf.GraphicsContextPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.finalize}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{finalize}}}{}{} Make sure every pushed graphics state is popped. \end{fulllineitems} \index{hatch\_cmd() (matplotlib.backends.backend\_pdf.GraphicsContextPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.hatch_cmd}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hatch\_cmd}}}{\emph{hatch}, \emph{hatch\_color}}{}~ \end{fulllineitems} \index{joinstyle\_cmd() (matplotlib.backends.backend\_pdf.GraphicsContextPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.joinstyle_cmd}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{joinstyle\_cmd}}}{\emph{style}}{}~ \end{fulllineitems} \index{joinstyles (matplotlib.backends.backend\_pdf.GraphicsContextPdf attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.joinstyles}}\pysigline{\sphinxbfcode{\sphinxupquote{joinstyles}}\sphinxbfcode{\sphinxupquote{ = \{'bevel': 2, 'miter': 0, 'round': 1\}}}} \end{fulllineitems} \index{linewidth\_cmd() (matplotlib.backends.backend\_pdf.GraphicsContextPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.linewidth_cmd}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{linewidth\_cmd}}}{\emph{width}}{}~ \end{fulllineitems} \index{paint() (matplotlib.backends.backend\_pdf.GraphicsContextPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.paint}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{paint}}}{}{} Return the appropriate pdf operator to cause the path to be stroked, filled, or both. \end{fulllineitems} \index{pop() (matplotlib.backends.backend\_pdf.GraphicsContextPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.pop}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pop}}}{}{}~ \end{fulllineitems} \index{push() (matplotlib.backends.backend\_pdf.GraphicsContextPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.push}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{push}}}{}{}~ \end{fulllineitems} \index{rgb\_cmd() (matplotlib.backends.backend\_pdf.GraphicsContextPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.rgb_cmd}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{rgb\_cmd}}}{\emph{rgb}}{}~ \end{fulllineitems} \index{stroke() (matplotlib.backends.backend\_pdf.GraphicsContextPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.GraphicsContextPdf.stroke}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{stroke}}}{}{} Predicate: does the path need to be stroked (its outline drawn)? This tests for the various conditions that disable stroking the path, in which case it would presumably be filled. \end{fulllineitems} \end{fulllineitems} \index{Name (class in matplotlib.backends.backend\_pdf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Name}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.}}\sphinxbfcode{\sphinxupquote{Name}}}{\emph{name}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} PDF name object. \index{hexify() (matplotlib.backends.backend\_pdf.Name static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Name.hexify}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{hexify}}}{\emph{match}}{}~ \end{fulllineitems} \index{name (matplotlib.backends.backend\_pdf.Name attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Name.name}}\pysigline{\sphinxbfcode{\sphinxupquote{name}}}~ \end{fulllineitems} \index{pdfRepr() (matplotlib.backends.backend\_pdf.Name method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Name.pdfRepr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pdfRepr}}}{}{}~ \end{fulllineitems} \end{fulllineitems} \index{Operator (class in matplotlib.backends.backend\_pdf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Operator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.}}\sphinxbfcode{\sphinxupquote{Operator}}}{\emph{op}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} PDF operator object. \index{op (matplotlib.backends.backend\_pdf.Operator attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Operator.op}}\pysigline{\sphinxbfcode{\sphinxupquote{op}}}~ \end{fulllineitems} \index{pdfRepr() (matplotlib.backends.backend\_pdf.Operator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Operator.pdfRepr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pdfRepr}}}{}{}~ \end{fulllineitems} \end{fulllineitems} \index{PdfFile (class in matplotlib.backends.backend\_pdf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.}}\sphinxbfcode{\sphinxupquote{PdfFile}}}{\emph{filename}, \emph{metadata=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} PDF file object. \index{addGouraudTriangles() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.addGouraudTriangles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{addGouraudTriangles}}}{\emph{points}, \emph{colors}}{}~ \end{fulllineitems} \index{alphaState() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.alphaState}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{alphaState}}}{\emph{alpha}}{} Return name of an ExtGState that sets alpha to the given value. \end{fulllineitems} \index{beginStream() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.beginStream}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{beginStream}}}{\emph{id}, \emph{len}, \emph{extra=None}, \emph{png=None}}{}~ \end{fulllineitems} \index{close() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.close}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{close}}}{}{} Flush all buffers and free all resources. \end{fulllineitems} \index{createType1Descriptor() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.createType1Descriptor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{createType1Descriptor}}}{\emph{t1font}, \emph{fontfile}}{}~ \end{fulllineitems} \index{dviFontName() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.dviFontName}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{dviFontName}}}{\emph{dvifont}}{} Given a dvi font object, return a name suitable for Op.selectfont. This registers the font information in self.dviFontInfo if not yet registered. \end{fulllineitems} \index{embedTTF() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.embedTTF}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{embedTTF}}}{\emph{filename}, \emph{characters}}{} Embed the TTF font from the named file into the document. \end{fulllineitems} \index{endStream() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.endStream}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{endStream}}}{}{}~ \end{fulllineitems} \index{finalize() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.finalize}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{finalize}}}{}{} Write out the various deferred objects and the pdf end matter. \end{fulllineitems} \index{fontName() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.fontName}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{fontName}}}{\emph{fontprop}}{} Select a font based on fontprop and return a name suitable for Op.selectfont. If fontprop is a string, it will be interpreted as the filename of the font. \end{fulllineitems} \index{hatchPattern() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.hatchPattern}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hatchPattern}}}{\emph{hatch\_style}}{}~ \end{fulllineitems} \index{imageObject() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.imageObject}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{imageObject}}}{\emph{image}}{} Return name of an image XObject representing the given image. \end{fulllineitems} \index{markerObject() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.markerObject}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{markerObject}}}{\emph{path}, \emph{trans}, \emph{fill}, \emph{stroke}, \emph{lw}, \emph{joinstyle}, \emph{capstyle}}{} Return name of a marker XObject representing the given path. \end{fulllineitems} \index{newPage() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.newPage}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{newPage}}}{\emph{width}, \emph{height}}{}~ \end{fulllineitems} \index{newTextnote() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.newTextnote}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{newTextnote}}}{\emph{text, positionRect={[}-100, -100, 0, 0{]}}}{}~ \end{fulllineitems} \index{output() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.output}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{output}}}{\emph{*data}}{}~ \end{fulllineitems} \index{pathCollectionObject() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.pathCollectionObject}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pathCollectionObject}}}{\emph{gc}, \emph{path}, \emph{trans}, \emph{padding}, \emph{filled}, \emph{stroked}}{}~ \end{fulllineitems} \index{pathOperations() (matplotlib.backends.backend\_pdf.PdfFile static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.pathOperations}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{pathOperations}}}{\emph{path}, \emph{transform}, \emph{clip=None}, \emph{simplify=None}, \emph{sketch=None}}{}~ \end{fulllineitems} \index{recordXref() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.recordXref}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{recordXref}}}{\emph{id}}{}~ \end{fulllineitems} \index{reserveObject() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.reserveObject}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{reserveObject}}}{\emph{name=''}}{} Reserve an ID for an indirect object. The name is used for debugging in case we forget to print out the object with writeObject. \end{fulllineitems} \index{texFontMap (matplotlib.backends.backend\_pdf.PdfFile attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.texFontMap}}\pysigline{\sphinxbfcode{\sphinxupquote{texFontMap}}}~ \end{fulllineitems} \index{write() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.write}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{write}}}{\emph{data}}{}~ \end{fulllineitems} \index{writeFonts() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.writeFonts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{writeFonts}}}{}{}~ \end{fulllineitems} \index{writeGouraudTriangles() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.writeGouraudTriangles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{writeGouraudTriangles}}}{}{}~ \end{fulllineitems} \index{writeHatches() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.writeHatches}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{writeHatches}}}{}{}~ \end{fulllineitems} \index{writeImages() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.writeImages}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{writeImages}}}{}{}~ \end{fulllineitems} \index{writeInfoDict() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.writeInfoDict}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{writeInfoDict}}}{}{} Write out the info dictionary, checking it for good form \end{fulllineitems} \index{writeMarkers() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.writeMarkers}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{writeMarkers}}}{}{}~ \end{fulllineitems} \index{writeObject() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.writeObject}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{writeObject}}}{\emph{object}, \emph{contents}}{}~ \end{fulllineitems} \index{writePath() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.writePath}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{writePath}}}{\emph{path}, \emph{transform}, \emph{clip=False}, \emph{sketch=None}}{}~ \end{fulllineitems} \index{writePathCollectionTemplates() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.writePathCollectionTemplates}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{writePathCollectionTemplates}}}{}{}~ \end{fulllineitems} \index{writeTrailer() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.writeTrailer}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{writeTrailer}}}{}{} Write out the PDF trailer. \end{fulllineitems} \index{writeXref() (matplotlib.backends.backend\_pdf.PdfFile method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile.writeXref}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{writeXref}}}{}{} Write out the xref table. \end{fulllineitems} \end{fulllineitems} \index{PdfPages (class in matplotlib.backends.backend\_pdf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfPages}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.}}\sphinxbfcode{\sphinxupquote{PdfPages}}}{\emph{filename}, \emph{keep\_empty=True}, \emph{metadata=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} A multi-page PDF file. \paragraph{Notes} In reality {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfPages}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PdfPages}}}}} is a thin wrapper around {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfFile}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PdfFile}}}}}, in order to avoid confusion when using {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.savefig:matplotlib.pyplot.savefig}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{savefig()}}}}} and forgetting the format argument. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{c+c1}{\PYGZsh{} Initialize:} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k}{with} \PYG{n}{PdfPages}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{foo.pdf}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k}{as} \PYG{n}{pdf}\PYG{p}{:} \PYG{g+gp}{... } \PYG{c+c1}{\PYGZsh{} As many times as you like, create a figure fig and save it:} \PYG{g+gp}{... } \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{g+gp}{... } \PYG{n}{pdf}\PYG{o}{.}\PYG{n}{savefig}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{)} \PYG{g+gp}{... } \PYG{c+c1}{\PYGZsh{} When no figure is specified the current figure is saved} \PYG{g+gp}{... } \PYG{n}{pdf}\PYG{o}{.}\PYG{n}{savefig}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} Create a new PdfPages object. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filename}}] \leavevmode{[}str{]} Plots using {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfPages.savefig}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PdfPages.savefig()}}}}} will be written to a file at this location. The file is opened at once and any older file with the same name is overwritten. \item[{\sphinxstylestrong{keep\_empty}}] \leavevmode{[}bool, optional{]} If set to False, then empty pdf files will be deleted automatically when closed. \item[{\sphinxstylestrong{metadata}}] \leavevmode{[}dictionary, optional{]} Information dictionary object (see PDF reference section 10.2.1 ‘Document Information Dictionary’), e.g.: \sphinxcode{\sphinxupquote{\{'Creator': 'My software', 'Author': 'Me', 'Title': 'Awesome fig'\}}} The standard keys are \sphinxcode{\sphinxupquote{'Title'}}, \sphinxcode{\sphinxupquote{'Author'}}, \sphinxcode{\sphinxupquote{'Subject'}}, \sphinxcode{\sphinxupquote{'Keywords'}}, \sphinxcode{\sphinxupquote{'Creator'}}, \sphinxcode{\sphinxupquote{'Producer'}}, \sphinxcode{\sphinxupquote{'CreationDate'}}, \sphinxcode{\sphinxupquote{'ModDate'}}, and \sphinxcode{\sphinxupquote{'Trapped'}}. Values have been predefined for \sphinxcode{\sphinxupquote{'Creator'}}, \sphinxcode{\sphinxupquote{'Producer'}} and \sphinxcode{\sphinxupquote{'CreationDate'}}. They can be removed by setting them to \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}. \end{description} \end{description}\end{quote} \index{attach\_note() (matplotlib.backends.backend\_pdf.PdfPages method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfPages.attach_note}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{attach\_note}}}{\emph{text, positionRect={[}-100, -100, 0, 0{]}}}{} Add a new text note to the page to be saved next. The optional positionRect specifies the position of the new note on the page. It is outside the page per default to make sure it is invisible on printouts. \end{fulllineitems} \index{close() (matplotlib.backends.backend\_pdf.PdfPages method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfPages.close}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{close}}}{}{} Finalize this object, making the underlying file a complete PDF file. \end{fulllineitems} \index{get\_pagecount() (matplotlib.backends.backend\_pdf.PdfPages method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfPages.get_pagecount}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_pagecount}}}{}{} Returns the current number of pages in the multipage pdf file. \end{fulllineitems} \index{infodict() (matplotlib.backends.backend\_pdf.PdfPages method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfPages.infodict}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{infodict}}}{}{} Return a modifiable information dictionary object (see PDF reference section 10.2.1 ‘Document Information Dictionary’). \end{fulllineitems} \index{keep\_empty (matplotlib.backends.backend\_pdf.PdfPages attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfPages.keep_empty}}\pysigline{\sphinxbfcode{\sphinxupquote{keep\_empty}}}~ \end{fulllineitems} \index{savefig() (matplotlib.backends.backend\_pdf.PdfPages method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfPages.savefig}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{savefig}}}{\emph{figure=None}, \emph{**kwargs}}{} Saves a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} to this file as a new page. Any other keyword arguments are passed to {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.savefig}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{savefig()}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{figure}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} or int, optional{]} Specifies what figure is saved to file. If not specified, the active figure is saved. If a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance is provided, this figure is saved. If an int is specified, the figure instance to save is looked up by number. \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{Reference (class in matplotlib.backends.backend\_pdf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Reference}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.}}\sphinxbfcode{\sphinxupquote{Reference}}}{\emph{id}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} PDF reference object. Use PdfFile.reserveObject() to create References. \index{pdfRepr() (matplotlib.backends.backend\_pdf.Reference method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Reference.pdfRepr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pdfRepr}}}{}{}~ \end{fulllineitems} \index{write() (matplotlib.backends.backend\_pdf.Reference method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Reference.write}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{write}}}{\emph{contents}, \emph{file}}{}~ \end{fulllineitems} \end{fulllineitems} \index{RendererPdf (class in matplotlib.backends.backend\_pdf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.}}\sphinxbfcode{\sphinxupquote{RendererPdf}}}{\emph{file}, \emph{image\_dpi}, \emph{height}, \emph{width}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.RendererBase}}}}} \index{afm\_font\_cache (matplotlib.backends.backend\_pdf.RendererPdf attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.afm_font_cache}}\pysigline{\sphinxbfcode{\sphinxupquote{afm\_font\_cache}}\sphinxbfcode{\sphinxupquote{ = \{\}}}} \end{fulllineitems} \index{check\_gc() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.check_gc}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{check\_gc}}}{\emph{gc}, \emph{fillcolor=None}}{}~ \end{fulllineitems} \index{draw\_gouraud\_triangle() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.draw_gouraud_triangle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_gouraud\_triangle}}}{\emph{gc}, \emph{points}, \emph{colors}, \emph{trans}}{} Draw a Gouraud-shaded triangle. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{points}}] \leavevmode{[}array\_like, shape=(3, 2){]} Array of (x, y) points for the triangle. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}array\_like, shape=(3, 4){]} RGBA colors for each point of the triangle. \item[{\sphinxstylestrong{transform}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform to apply to the points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_gouraud\_triangles() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.draw_gouraud_triangles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_gouraud\_triangles}}}{\emph{gc}, \emph{points}, \emph{colors}, \emph{trans}}{} Draws a series of Gouraud triangles. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{points}}] \leavevmode{[}array\_like, shape=(N, 3, 2){]} Array of \sphinxstyleemphasis{N} (x, y) points for the triangles. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}array\_like, shape=(N, 3, 4){]} Array of \sphinxstyleemphasis{N} RGBA colors for each point of the triangles. \item[{\sphinxstylestrong{transform}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform to apply to the points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_image() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.draw_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_image}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{im}, \emph{transform=None}}{} Draw an RGBA image. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gc}}] \leavevmode{[}\sphinxcode{\sphinxupquote{GraphicsContextBase}}{]} a graphics context with clipping information. \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar{]} the distance in physical units (i.e., dots or pixels) from the left hand side of the canvas. \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar{]} the distance in physical units (i.e., dots or pixels) from the bottom side of the canvas. \item[{\sphinxstylestrong{im}}] \leavevmode{[}array\_like, shape=(N, M, 4), dtype=np.uint8{]} An array of RGBA pixels. \item[{\sphinxstylestrong{transform}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Affine2DBase}}}}}{]} If and only if the concrete backend is written such that {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.option_scale_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{option\_scale\_image()}}}}} returns \sphinxcode{\sphinxupquote{True}}, an affine transformation \sphinxstyleemphasis{may} be passed to {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.draw_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_image()}}}}}. It takes the form of a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Affine2DBase}}}}} instance. The translation vector of the transformation is given in physical units (i.e., dots or pixels). Note that the transformation does not override \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}}, and has to be applied \sphinxstyleemphasis{before} translating the result by \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} (this can be accomplished by adding \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} to the translation vector defined by \sphinxcode{\sphinxupquote{transform}}). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_markers() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.draw_markers}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_markers}}}{\emph{gc}, \emph{marker\_path}, \emph{marker\_trans}, \emph{path}, \emph{trans}, \emph{rgbFace=None}}{} Draws a marker at each of the vertices in path. This includes all vertices, including control points on curves. To avoid that behavior, those vertices should be removed before calling this function. This provides a fallback implementation of draw\_markers that makes multiple calls to {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path()}}}}}. Some backends may want to override this method in order to draw the marker only once and reuse it multiple times. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gc}}] \leavevmode{[}\sphinxcode{\sphinxupquote{GraphicsContextBase}}{]} The graphics context \item[{\sphinxstylestrong{marker\_trans}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform applied to the marker. \item[{\sphinxstylestrong{trans}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform applied to the path. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_mathtext() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.draw_mathtext}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_mathtext}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{s}, \emph{prop}, \emph{angle}}{}~ \end{fulllineitems} \index{draw\_path() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.draw_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path}}}{\emph{gc}, \emph{path}, \emph{transform}, \emph{rgbFace=None}}{} Draws a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance using the given affine transform. \end{fulllineitems} \index{draw\_path\_collection() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.draw_path_collection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path\_collection}}}{\emph{gc}, \emph{master\_transform}, \emph{paths}, \emph{all\_transforms}, \emph{offsets}, \emph{offsetTrans}, \emph{facecolors}, \emph{edgecolors}, \emph{linewidths}, \emph{linestyles}, \emph{antialiaseds}, \emph{urls}, \emph{offset\_position}}{} Draws a collection of paths selecting drawing properties from the lists \sphinxstyleemphasis{facecolors}, \sphinxstyleemphasis{edgecolors}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{linestyles} and \sphinxstyleemphasis{antialiaseds}. \sphinxstyleemphasis{offsets} is a list of offsets to apply to each of the paths. The offsets in \sphinxstyleemphasis{offsets} are first transformed by \sphinxstyleemphasis{offsetTrans} before being applied. \sphinxstyleemphasis{offset\_position} may be either “screen” or “data” depending on the space that the offsets are in. This provides a fallback implementation of {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.draw_path_collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path\_collection()}}}}} that makes multiple calls to {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path()}}}}}. Some backends may want to override this in order to render each set of path data only once, and then reference that path multiple times with the different offsets, colors, styles etc. The generator methods \sphinxcode{\sphinxupquote{\_iter\_collection\_raw\_paths()}} and \sphinxcode{\sphinxupquote{\_iter\_collection()}} are provided to help with (and standardize) the implementation across backends. It is highly recommended to use those generators, so that changes to the behavior of {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.draw_path_collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path\_collection()}}}}} can be made globally. \end{fulllineitems} \index{draw\_tex() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.draw_tex}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_tex}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{s}, \emph{prop}, \emph{angle}, \emph{ismath='TeX!'}, \emph{mtext=None}}{}~ \end{fulllineitems} \index{draw\_text() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.draw_text}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_text}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{s}, \emph{prop}, \emph{angle}, \emph{ismath=False}, \emph{mtext=None}}{} Draw the text instance \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gc}}] \leavevmode{[}\sphinxcode{\sphinxupquote{GraphicsContextBase}}{]} the graphics context \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar{]} the x location of the text in display coords \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar{]} the y location of the text baseline in display coords \item[{\sphinxstylestrong{s}}] \leavevmode{[}str{]} the text string \item[{\sphinxstylestrong{prop}}] \leavevmode{[}{\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}}{]} font properties \item[{\sphinxstylestrong{angle}}] \leavevmode{[}scalar{]} the rotation angle in degrees \item[{\sphinxstylestrong{mtext}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}}{]} the original text object to be rendered \end{description} \end{description}\end{quote} \paragraph{Notes} \sphinxstylestrong{backend implementers note} When you are trying to determine if you have gotten your bounding box right (which is what enables the text layout/alignment to work properly), it helps to change the line in text.py: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{if} \PYG{l+m+mi}{0}\PYG{p}{:} \PYG{n}{bbox\PYGZus{}artist}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{renderer}\PYG{p}{)} \end{sphinxVerbatim} to if 1, and then the actual bounding box will be plotted along with your text. \end{fulllineitems} \index{encode\_string() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.encode_string}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{encode\_string}}}{\emph{s}, \emph{fonttype}}{}~ \end{fulllineitems} \index{finalize() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.finalize}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{finalize}}}{}{}~ \end{fulllineitems} \index{flipy() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.flipy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{flipy}}}{}{} Return true if y small numbers are top for renderer Is used for drawing text ({\hyperref[\detokenize{api/text_api:module-matplotlib.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text}}}}}) and images ({\hyperref[\detokenize{api/image_api:module-matplotlib.image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.image}}}}}) only \end{fulllineitems} \index{get\_canvas\_width\_height() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.get_canvas_width_height}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_canvas\_width\_height}}}{}{} return the canvas width and height in display coords \end{fulllineitems} \index{get\_image\_magnification() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.get_image_magnification}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_image\_magnification}}}{}{} Get the factor by which to magnify images passed to {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.draw_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_image()}}}}}. Allows a backend to have images at a different resolution to other artists. \end{fulllineitems} \index{get\_text\_width\_height\_descent() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.get_text_width_height_descent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_text\_width\_height\_descent}}}{\emph{s}, \emph{prop}, \emph{ismath}}{} Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string \sphinxstyleemphasis{s} with {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FontProperties}}}}} \sphinxstyleemphasis{prop} \end{fulllineitems} \index{merge\_used\_characters() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.merge_used_characters}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{merge\_used\_characters}}}{\emph{other}}{}~ \end{fulllineitems} \index{new\_gc() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.new_gc}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{new\_gc}}}{}{} Return an instance of a \sphinxcode{\sphinxupquote{GraphicsContextBase}} \end{fulllineitems} \index{option\_image\_nocomposite() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.option_image_nocomposite}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{option\_image\_nocomposite}}}{}{} return whether to generate a composite image from multiple images on a set of axes \end{fulllineitems} \index{option\_scale\_image() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.option_scale_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{option\_scale\_image}}}{}{} pdf backend support arbitrary scaling of image. \end{fulllineitems} \index{track\_characters() (matplotlib.backends.backend\_pdf.RendererPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.RendererPdf.track_characters}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{track\_characters}}}{\emph{font}, \emph{s}}{} Keeps track of which characters are required from each font. \end{fulllineitems} \end{fulllineitems} \index{Stream (class in matplotlib.backends.backend\_pdf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Stream}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.}}\sphinxbfcode{\sphinxupquote{Stream}}}{\emph{id}, \emph{len}, \emph{file}, \emph{extra=None}, \emph{png=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} PDF stream object. This has no pdfRepr method. Instead, call begin(), then output the contents of the stream by calling write(), and finally call end(). id: object id of stream; len: an unused Reference object for the length of the stream, or None (to use a memory buffer); file: a PdfFile; extra: a dictionary of extra key-value pairs to include in the stream header; png: if the data is already png compressed, the decode parameters \index{compressobj (matplotlib.backends.backend\_pdf.Stream attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Stream.compressobj}}\pysigline{\sphinxbfcode{\sphinxupquote{compressobj}}}~ \end{fulllineitems} \index{end() (matplotlib.backends.backend\_pdf.Stream method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Stream.end}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{end}}}{}{} Finalize stream. \end{fulllineitems} \index{extra (matplotlib.backends.backend\_pdf.Stream attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Stream.extra}}\pysigline{\sphinxbfcode{\sphinxupquote{extra}}}~ \end{fulllineitems} \index{file (matplotlib.backends.backend\_pdf.Stream attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Stream.file}}\pysigline{\sphinxbfcode{\sphinxupquote{file}}}~ \end{fulllineitems} \index{id (matplotlib.backends.backend\_pdf.Stream attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Stream.id}}\pysigline{\sphinxbfcode{\sphinxupquote{id}}}~ \end{fulllineitems} \index{len (matplotlib.backends.backend\_pdf.Stream attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Stream.len}}\pysigline{\sphinxbfcode{\sphinxupquote{len}}}~ \end{fulllineitems} \index{pdfFile (matplotlib.backends.backend\_pdf.Stream attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Stream.pdfFile}}\pysigline{\sphinxbfcode{\sphinxupquote{pdfFile}}}~ \end{fulllineitems} \index{pos (matplotlib.backends.backend\_pdf.Stream attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Stream.pos}}\pysigline{\sphinxbfcode{\sphinxupquote{pos}}}~ \end{fulllineitems} \index{write() (matplotlib.backends.backend\_pdf.Stream method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Stream.write}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{write}}}{\emph{data}}{} Write some data on the stream. \end{fulllineitems} \end{fulllineitems} \index{Verbatim (class in matplotlib.backends.backend\_pdf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Verbatim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.}}\sphinxbfcode{\sphinxupquote{Verbatim}}}{\emph{x}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Store verbatim PDF command content for later inclusion in the stream. \index{pdfRepr() (matplotlib.backends.backend\_pdf.Verbatim method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.Verbatim.pdfRepr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pdfRepr}}}{}{}~ \end{fulllineitems} \end{fulllineitems} \index{fill() (in module matplotlib.backends.backend\_pdf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.fill}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.}}\sphinxbfcode{\sphinxupquote{fill}}}{\emph{strings}, \emph{linelen=75}}{} Make one string from sequence of strings, with whitespace in between. The whitespace is chosen to form lines of at most linelen characters, if possible. \end{fulllineitems} \index{pdfRepr() (in module matplotlib.backends.backend\_pdf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.pdfRepr}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pdf.}}\sphinxbfcode{\sphinxupquote{pdfRepr}}}{\emph{obj}}{} Map Python objects to PDF syntax. \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_pgf}}} \label{\detokenize{api/backend_pgf_api:module-matplotlib.backends.backend_pgf}}\label{\detokenize{api/backend_pgf_api:matplotlib-backends-backend-pgf}}\label{\detokenize{api/backend_pgf_api::doc}}\index{matplotlib.backends.backend\_pgf (module)}\index{FigureCanvas (in module matplotlib.backends.backend\_pgf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.FigureCanvas}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{FigureCanvas}}} alias of {\hyperref[\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.FigureCanvasPgf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.FigureCanvasPgf}}}}} \end{fulllineitems} \index{FigureCanvasPgf (class in matplotlib.backends.backend\_pgf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.FigureCanvasPgf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{FigureCanvasPgf}}}{\emph{figure}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.FigureCanvasBase}}}}} \index{filetypes (matplotlib.backends.backend\_pgf.FigureCanvasPgf attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.FigureCanvasPgf.filetypes}}\pysigline{\sphinxbfcode{\sphinxupquote{filetypes}}\sphinxbfcode{\sphinxupquote{ = \{'pdf': 'LaTeX compiled PGF picture', 'pgf': 'LaTeX PGF picture', 'png': 'Portable Network Graphics'\}}}} \end{fulllineitems} \index{get\_default\_filetype() (matplotlib.backends.backend\_pgf.FigureCanvasPgf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.FigureCanvasPgf.get_default_filetype}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_default\_filetype}}}{}{} Get the default savefig file format as specified in rcParam \sphinxcode{\sphinxupquote{savefig.format}}. Returned string excludes period. Overridden in backends that only support a single file type. \end{fulllineitems} \index{get\_renderer() (matplotlib.backends.backend\_pgf.FigureCanvasPgf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.FigureCanvasPgf.get_renderer}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_renderer}}}{}{}~ \end{fulllineitems} \index{print\_pdf() (matplotlib.backends.backend\_pgf.FigureCanvasPgf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.FigureCanvasPgf.print_pdf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_pdf}}}{\emph{fname\_or\_fh}, \emph{*args}, \emph{**kwargs}}{} Use LaTeX to compile a Pgf generated figure to PDF. \end{fulllineitems} \index{print\_pgf() (matplotlib.backends.backend\_pgf.FigureCanvasPgf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.FigureCanvasPgf.print_pgf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_pgf}}}{\emph{fname\_or\_fh}, \emph{*args}, \emph{**kwargs}}{} Output pgf commands for drawing the figure so it can be included and rendered in latex documents. \end{fulllineitems} \index{print\_png() (matplotlib.backends.backend\_pgf.FigureCanvasPgf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.FigureCanvasPgf.print_png}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_png}}}{\emph{fname\_or\_fh}, \emph{*args}, \emph{**kwargs}}{} Use LaTeX to compile a pgf figure to pdf and convert it to png. \end{fulllineitems} \end{fulllineitems} \index{FigureManager (in module matplotlib.backends.backend\_pgf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.FigureManager}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{FigureManager}}} alias of {\hyperref[\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.FigureManagerPgf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.FigureManagerPgf}}}}} \end{fulllineitems} \index{FigureManagerPgf (class in matplotlib.backends.backend\_pgf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.FigureManagerPgf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{FigureManagerPgf}}}{\emph{*args}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureManagerBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.FigureManagerBase}}}}} \end{fulllineitems} \index{GraphicsContextPgf (class in matplotlib.backends.backend\_pgf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.GraphicsContextPgf}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{GraphicsContextPgf}}} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.GraphicsContextBase}}}}} \end{fulllineitems} \index{LatexError} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.LatexError}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{exception }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{LatexError}}}{\emph{message}, \emph{latex\_output=''}}{} Bases: \sphinxhref{https://docs.python.org/3/library/exceptions.html\#Exception}{\sphinxcode{\sphinxupquote{Exception}}} \end{fulllineitems} \index{LatexManager (class in matplotlib.backends.backend\_pgf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.LatexManager}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{LatexManager}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} The LatexManager opens an instance of the LaTeX application for determining the metrics of text elements. The LaTeX environment can be modified by setting fonts and/or a custem preamble in the rc parameters. \index{get\_width\_height\_descent() (matplotlib.backends.backend\_pgf.LatexManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.LatexManager.get_width_height_descent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_width\_height\_descent}}}{\emph{text}, \emph{prop}}{} Get the width, total height and descent for a text typesetted by the current LaTeX environment. \end{fulllineitems} \end{fulllineitems} \index{LatexManagerFactory (class in matplotlib.backends.backend\_pgf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.LatexManagerFactory}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{LatexManagerFactory}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} \index{get\_latex\_manager() (matplotlib.backends.backend\_pgf.LatexManagerFactory static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.LatexManagerFactory.get_latex_manager}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{get\_latex\_manager}}}{}{}~ \end{fulllineitems} \index{previous\_instance (matplotlib.backends.backend\_pgf.LatexManagerFactory attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.LatexManagerFactory.previous_instance}}\pysigline{\sphinxbfcode{\sphinxupquote{previous\_instance}}\sphinxbfcode{\sphinxupquote{ = None}}} \end{fulllineitems} \end{fulllineitems} \index{RendererPgf (class in matplotlib.backends.backend\_pgf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.RendererPgf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{RendererPgf}}}{\emph{figure}, \emph{fh}, \emph{dummy=False}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.RendererBase}}}}} Creates a new PGF renderer that translates any drawing instruction into text commands to be interpreted in a latex pgfpicture environment. \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{figure}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure}}}}}{]} Matplotlib figure to initialize height, width and dpi from. \item[{\sphinxstylestrong{fh}}] \leavevmode{[}file-like{]} File handle for the output of the drawing commands. \end{description} \end{description}\end{quote} \index{draw\_image() (matplotlib.backends.backend\_pgf.RendererPgf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.RendererPgf.draw_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_image}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{im}, \emph{transform=None}}{} Draw an RGBA image. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gc}}] \leavevmode{[}\sphinxcode{\sphinxupquote{GraphicsContextBase}}{]} a graphics context with clipping information. \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar{]} the distance in physical units (i.e., dots or pixels) from the left hand side of the canvas. \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar{]} the distance in physical units (i.e., dots or pixels) from the bottom side of the canvas. \item[{\sphinxstylestrong{im}}] \leavevmode{[}array\_like, shape=(N, M, 4), dtype=np.uint8{]} An array of RGBA pixels. \item[{\sphinxstylestrong{transform}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Affine2DBase}}}}}{]} If and only if the concrete backend is written such that {\hyperref[\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.RendererPgf.option_scale_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{option\_scale\_image()}}}}} returns \sphinxcode{\sphinxupquote{True}}, an affine transformation \sphinxstyleemphasis{may} be passed to {\hyperref[\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.RendererPgf.draw_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_image()}}}}}. It takes the form of a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Affine2DBase}}}}} instance. The translation vector of the transformation is given in physical units (i.e., dots or pixels). Note that the transformation does not override \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}}, and has to be applied \sphinxstyleemphasis{before} translating the result by \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} (this can be accomplished by adding \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} to the translation vector defined by \sphinxcode{\sphinxupquote{transform}}). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_markers() (matplotlib.backends.backend\_pgf.RendererPgf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.RendererPgf.draw_markers}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_markers}}}{\emph{gc}, \emph{marker\_path}, \emph{marker\_trans}, \emph{path}, \emph{trans}, \emph{rgbFace=None}}{} Draws a marker at each of the vertices in path. This includes all vertices, including control points on curves. To avoid that behavior, those vertices should be removed before calling this function. This provides a fallback implementation of draw\_markers that makes multiple calls to {\hyperref[\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.RendererPgf.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path()}}}}}. Some backends may want to override this method in order to draw the marker only once and reuse it multiple times. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gc}}] \leavevmode{[}\sphinxcode{\sphinxupquote{GraphicsContextBase}}{]} The graphics context \item[{\sphinxstylestrong{marker\_trans}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform applied to the marker. \item[{\sphinxstylestrong{trans}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform applied to the path. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_path() (matplotlib.backends.backend\_pgf.RendererPgf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.RendererPgf.draw_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path}}}{\emph{gc}, \emph{path}, \emph{transform}, \emph{rgbFace=None}}{} Draws a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance using the given affine transform. \end{fulllineitems} \index{draw\_tex() (matplotlib.backends.backend\_pgf.RendererPgf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.RendererPgf.draw_tex}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_tex}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{s}, \emph{prop}, \emph{angle}, \emph{ismath='TeX!'}, \emph{mtext=None}}{}~ \end{fulllineitems} \index{draw\_text() (matplotlib.backends.backend\_pgf.RendererPgf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.RendererPgf.draw_text}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_text}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{s}, \emph{prop}, \emph{angle}, \emph{ismath=False}, \emph{mtext=None}}{} Draw the text instance \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gc}}] \leavevmode{[}\sphinxcode{\sphinxupquote{GraphicsContextBase}}{]} the graphics context \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar{]} the x location of the text in display coords \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar{]} the y location of the text baseline in display coords \item[{\sphinxstylestrong{s}}] \leavevmode{[}str{]} the text string \item[{\sphinxstylestrong{prop}}] \leavevmode{[}{\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}}{]} font properties \item[{\sphinxstylestrong{angle}}] \leavevmode{[}scalar{]} the rotation angle in degrees \item[{\sphinxstylestrong{mtext}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}}{]} the original text object to be rendered \end{description} \end{description}\end{quote} \paragraph{Notes} \sphinxstylestrong{backend implementers note} When you are trying to determine if you have gotten your bounding box right (which is what enables the text layout/alignment to work properly), it helps to change the line in text.py: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{if} \PYG{l+m+mi}{0}\PYG{p}{:} \PYG{n}{bbox\PYGZus{}artist}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{renderer}\PYG{p}{)} \end{sphinxVerbatim} to if 1, and then the actual bounding box will be plotted along with your text. \end{fulllineitems} \index{flipy() (matplotlib.backends.backend\_pgf.RendererPgf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.RendererPgf.flipy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{flipy}}}{}{} Return true if y small numbers are top for renderer Is used for drawing text ({\hyperref[\detokenize{api/text_api:module-matplotlib.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text}}}}}) and images ({\hyperref[\detokenize{api/image_api:module-matplotlib.image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.image}}}}}) only \end{fulllineitems} \index{get\_canvas\_width\_height() (matplotlib.backends.backend\_pgf.RendererPgf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.RendererPgf.get_canvas_width_height}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_canvas\_width\_height}}}{}{} return the canvas width and height in display coords \end{fulllineitems} \index{get\_text\_width\_height\_descent() (matplotlib.backends.backend\_pgf.RendererPgf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.RendererPgf.get_text_width_height_descent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_text\_width\_height\_descent}}}{\emph{s}, \emph{prop}, \emph{ismath}}{} Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string \sphinxstyleemphasis{s} with {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FontProperties}}}}} \sphinxstyleemphasis{prop} \end{fulllineitems} \index{new\_gc() (matplotlib.backends.backend\_pgf.RendererPgf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.RendererPgf.new_gc}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{new\_gc}}}{}{} Return an instance of a \sphinxcode{\sphinxupquote{GraphicsContextBase}} \end{fulllineitems} \index{option\_image\_nocomposite() (matplotlib.backends.backend\_pgf.RendererPgf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.RendererPgf.option_image_nocomposite}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{option\_image\_nocomposite}}}{}{} return whether to generate a composite image from multiple images on a set of axes \end{fulllineitems} \index{option\_scale\_image() (matplotlib.backends.backend\_pgf.RendererPgf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.RendererPgf.option_scale_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{option\_scale\_image}}}{}{} pgf backend supports affine transform of image. \end{fulllineitems} \index{points\_to\_pixels() (matplotlib.backends.backend\_pgf.RendererPgf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.RendererPgf.points_to_pixels}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{points\_to\_pixels}}}{\emph{points}}{} Convert points to display units You need to override this function (unless your backend doesn’t have a dpi, e.g., postscript or svg). Some imaging systems assume some value for pixels per inch: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{points} \PYG{n}{to} \PYG{n}{pixels} \PYG{o}{=} \PYG{n}{points} \PYG{o}{*} \PYG{n}{pixels\PYGZus{}per\PYGZus{}inch}\PYG{o}{/}\PYG{l+m+mf}{72.0} \PYG{o}{*} \PYG{n}{dpi}\PYG{o}{/}\PYG{l+m+mf}{72.0} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{points}}] \leavevmode{[}scalar or array\_like{]} a float or a numpy array of float \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Points converted to pixels}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{TmpDirCleaner (class in matplotlib.backends.backend\_pgf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.TmpDirCleaner}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{TmpDirCleaner}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} \index{add() (matplotlib.backends.backend\_pgf.TmpDirCleaner static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.TmpDirCleaner.add}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{add}}}{\emph{tmpdir}}{}~ \end{fulllineitems} \index{cleanup\_remaining\_tmpdirs() (matplotlib.backends.backend\_pgf.TmpDirCleaner static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.TmpDirCleaner.cleanup_remaining_tmpdirs}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{cleanup\_remaining\_tmpdirs}}}{}{}~ \end{fulllineitems} \index{remaining\_tmpdirs (matplotlib.backends.backend\_pgf.TmpDirCleaner attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.TmpDirCleaner.remaining_tmpdirs}}\pysigline{\sphinxbfcode{\sphinxupquote{remaining\_tmpdirs}}\sphinxbfcode{\sphinxupquote{ = set()}}} \end{fulllineitems} \end{fulllineitems} \index{common\_texification() (in module matplotlib.backends.backend\_pgf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.common_texification}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{common\_texification}}}{\emph{text}}{} Do some necessary and/or useful substitutions for texts to be included in LaTeX documents. \end{fulllineitems} \index{get\_fontspec() (in module matplotlib.backends.backend\_pgf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.get_fontspec}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{get\_fontspec}}}{}{} Build fontspec preamble from rc. \end{fulllineitems} \index{get\_preamble() (in module matplotlib.backends.backend\_pgf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.get_preamble}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{get\_preamble}}}{}{} Get LaTeX preamble from rc. \end{fulllineitems} \index{get\_texcommand() (in module matplotlib.backends.backend\_pgf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.get_texcommand}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{get\_texcommand}}}{}{} Get chosen TeX system from rc. \end{fulllineitems} \index{make\_pdf\_to\_png\_converter() (in module matplotlib.backends.backend\_pgf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.make_pdf_to_png_converter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{make\_pdf\_to\_png\_converter}}}{}{} Returns a function that converts a pdf file to a png file. \end{fulllineitems} \index{repl\_escapetext() (in module matplotlib.backends.backend\_pgf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.repl_escapetext}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{repl\_escapetext}}}{\emph{m}}{}~ \end{fulllineitems} \index{repl\_mathdefault() (in module matplotlib.backends.backend\_pgf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.repl_mathdefault}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{repl\_mathdefault}}}{\emph{m}}{}~ \end{fulllineitems} \index{writeln() (in module matplotlib.backends.backend\_pgf)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_pgf_api:matplotlib.backends.backend_pgf.writeln}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_pgf.}}\sphinxbfcode{\sphinxupquote{writeln}}}{\emph{fh}, \emph{line}}{}~ \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_ps}}} \label{\detokenize{api/backend_ps_api:module-matplotlib.backends.backend_ps}}\label{\detokenize{api/backend_ps_api:matplotlib-backends-backend-ps}}\label{\detokenize{api/backend_ps_api::doc}}\index{matplotlib.backends.backend\_ps (module)} A PostScript backend, which can produce both PostScript .ps and .eps \index{FigureCanvas (in module matplotlib.backends.backend\_ps)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.FigureCanvas}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_ps.}}\sphinxbfcode{\sphinxupquote{FigureCanvas}}} alias of {\hyperref[\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.FigureCanvasPS}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_ps.FigureCanvasPS}}}}} \end{fulllineitems} \index{FigureCanvasPS (class in matplotlib.backends.backend\_ps)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.FigureCanvasPS}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_ps.}}\sphinxbfcode{\sphinxupquote{FigureCanvasPS}}}{\emph{figure}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.FigureCanvasBase}}}}} \index{draw() (matplotlib.backends.backend\_ps.FigureCanvasPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.FigureCanvasPS.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{}{} Render the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \end{fulllineitems} \index{filetypes (matplotlib.backends.backend\_ps.FigureCanvasPS attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.FigureCanvasPS.filetypes}}\pysigline{\sphinxbfcode{\sphinxupquote{filetypes}}\sphinxbfcode{\sphinxupquote{ = \{'eps': 'Encapsulated Postscript', 'ps': 'Postscript'\}}}} \end{fulllineitems} \index{fixed\_dpi (matplotlib.backends.backend\_ps.FigureCanvasPS attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.FigureCanvasPS.fixed_dpi}}\pysigline{\sphinxbfcode{\sphinxupquote{fixed\_dpi}}\sphinxbfcode{\sphinxupquote{ = 72}}} \end{fulllineitems} \index{get\_default\_filetype() (matplotlib.backends.backend\_ps.FigureCanvasPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.FigureCanvasPS.get_default_filetype}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_default\_filetype}}}{}{} Get the default savefig file format as specified in rcParam \sphinxcode{\sphinxupquote{savefig.format}}. Returned string excludes period. Overridden in backends that only support a single file type. \end{fulllineitems} \index{print\_eps() (matplotlib.backends.backend\_ps.FigureCanvasPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.FigureCanvasPS.print_eps}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_eps}}}{\emph{outfile}, \emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \index{print\_ps() (matplotlib.backends.backend\_ps.FigureCanvasPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.FigureCanvasPS.print_ps}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_ps}}}{\emph{outfile}, \emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \end{fulllineitems} \index{FigureManager (in module matplotlib.backends.backend\_ps)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.FigureManager}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_ps.}}\sphinxbfcode{\sphinxupquote{FigureManager}}} alias of {\hyperref[\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.FigureManagerPS}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_ps.FigureManagerPS}}}}} \end{fulllineitems} \index{FigureManagerPS (class in matplotlib.backends.backend\_ps)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.FigureManagerPS}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_ps.}}\sphinxbfcode{\sphinxupquote{FigureManagerPS}}}{\emph{canvas}, \emph{num}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureManagerBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.FigureManagerBase}}}}} \end{fulllineitems} \index{GraphicsContextPS (class in matplotlib.backends.backend\_ps)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.GraphicsContextPS}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_ps.}}\sphinxbfcode{\sphinxupquote{GraphicsContextPS}}} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.GraphicsContextBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.GraphicsContextBase}}}}} \index{get\_capstyle() (matplotlib.backends.backend\_ps.GraphicsContextPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.GraphicsContextPS.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{} Return the capstyle as a string in (‘butt’, ‘round’, ‘projecting’) \end{fulllineitems} \index{get\_joinstyle() (matplotlib.backends.backend\_ps.GraphicsContextPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.GraphicsContextPS.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{} Return the line join style as one of (‘miter’, ‘round’, ‘bevel’) \end{fulllineitems} \index{shouldstroke() (matplotlib.backends.backend\_ps.GraphicsContextPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.GraphicsContextPS.shouldstroke}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{shouldstroke}}}{}{}~ \end{fulllineitems} \end{fulllineitems} \index{PsBackendHelper (class in matplotlib.backends.backend\_ps)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.PsBackendHelper}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_ps.}}\sphinxbfcode{\sphinxupquote{PsBackendHelper}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} \index{gs\_exe (matplotlib.backends.backend\_ps.PsBackendHelper attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.PsBackendHelper.gs_exe}}\pysigline{\sphinxbfcode{\sphinxupquote{gs\_exe}}} executable name of ghostscript. \end{fulllineitems} \index{gs\_version (matplotlib.backends.backend\_ps.PsBackendHelper attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.PsBackendHelper.gs_version}}\pysigline{\sphinxbfcode{\sphinxupquote{gs\_version}}} version of ghostscript. \end{fulllineitems} \index{supports\_ps2write (matplotlib.backends.backend\_ps.PsBackendHelper attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.PsBackendHelper.supports_ps2write}}\pysigline{\sphinxbfcode{\sphinxupquote{supports\_ps2write}}} True if the installed ghostscript supports ps2write device. \end{fulllineitems} \end{fulllineitems} \index{RendererPS (class in matplotlib.backends.backend\_ps)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_ps.}}\sphinxbfcode{\sphinxupquote{RendererPS}}}{\emph{width}, \emph{height}, \emph{pswriter}, \emph{imagedpi=72}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.RendererBase}}}}} The renderer handles all the drawing primitives using a graphics context instance that controls the colors/styles. Although postscript itself is dpi independent, we need to imform the image code about a requested dpi to generate high res images and them scale them before embeddin them \index{afmfontd (matplotlib.backends.backend\_ps.RendererPS attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.afmfontd}}\pysigline{\sphinxbfcode{\sphinxupquote{afmfontd}}\sphinxbfcode{\sphinxupquote{ = \{\}}}} \end{fulllineitems} \index{create\_hatch() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.create_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{create\_hatch}}}{\emph{hatch}}{}~ \end{fulllineitems} \index{draw\_gouraud\_triangle() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.draw_gouraud_triangle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_gouraud\_triangle}}}{\emph{gc}, \emph{points}, \emph{colors}, \emph{trans}}{} Draw a Gouraud-shaded triangle. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{points}}] \leavevmode{[}array\_like, shape=(3, 2){]} Array of (x, y) points for the triangle. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}array\_like, shape=(3, 4){]} RGBA colors for each point of the triangle. \item[{\sphinxstylestrong{transform}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform to apply to the points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_gouraud\_triangles() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.draw_gouraud_triangles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_gouraud\_triangles}}}{\emph{gc}, \emph{points}, \emph{colors}, \emph{trans}}{} Draws a series of Gouraud triangles. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{points}}] \leavevmode{[}array\_like, shape=(N, 3, 2){]} Array of \sphinxstyleemphasis{N} (x, y) points for the triangles. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}array\_like, shape=(N, 3, 4){]} Array of \sphinxstyleemphasis{N} RGBA colors for each point of the triangles. \item[{\sphinxstylestrong{transform}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform to apply to the points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_image() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.draw_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_image}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{im}, \emph{transform=None}}{} Draw the Image instance into the current axes; x is the distance in pixels from the left hand side of the canvas and y is the distance from bottom \end{fulllineitems} \index{draw\_markers() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.draw_markers}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_markers}}}{\emph{gc}, \emph{marker\_path}, \emph{marker\_trans}, \emph{path}, \emph{trans}, \emph{rgbFace=None}}{} Draw the markers defined by path at each of the positions in x and y. path coordinates are points, x and y coords will be transformed by the transform \end{fulllineitems} \index{draw\_mathtext() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.draw_mathtext}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_mathtext}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{s}, \emph{prop}, \emph{angle}}{} Draw the math text using matplotlib.mathtext \end{fulllineitems} \index{draw\_path() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.draw_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path}}}{\emph{gc}, \emph{path}, \emph{transform}, \emph{rgbFace=None}}{} Draws a Path instance using the given affine transform. \end{fulllineitems} \index{draw\_path\_collection() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.draw_path_collection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path\_collection}}}{\emph{gc}, \emph{master\_transform}, \emph{paths}, \emph{all\_transforms}, \emph{offsets}, \emph{offsetTrans}, \emph{facecolors}, \emph{edgecolors}, \emph{linewidths}, \emph{linestyles}, \emph{antialiaseds}, \emph{urls}, \emph{offset\_position}}{} Draws a collection of paths selecting drawing properties from the lists \sphinxstyleemphasis{facecolors}, \sphinxstyleemphasis{edgecolors}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{linestyles} and \sphinxstyleemphasis{antialiaseds}. \sphinxstyleemphasis{offsets} is a list of offsets to apply to each of the paths. The offsets in \sphinxstyleemphasis{offsets} are first transformed by \sphinxstyleemphasis{offsetTrans} before being applied. \sphinxstyleemphasis{offset\_position} may be either “screen” or “data” depending on the space that the offsets are in. This provides a fallback implementation of {\hyperref[\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.draw_path_collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path\_collection()}}}}} that makes multiple calls to {\hyperref[\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path()}}}}}. Some backends may want to override this in order to render each set of path data only once, and then reference that path multiple times with the different offsets, colors, styles etc. The generator methods \sphinxcode{\sphinxupquote{\_iter\_collection\_raw\_paths()}} and \sphinxcode{\sphinxupquote{\_iter\_collection()}} are provided to help with (and standardize) the implementation across backends. It is highly recommended to use those generators, so that changes to the behavior of {\hyperref[\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.draw_path_collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path\_collection()}}}}} can be made globally. \end{fulllineitems} \index{draw\_tex() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.draw_tex}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_tex}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{s}, \emph{prop}, \emph{angle}, \emph{ismath='TeX!'}, \emph{mtext=None}}{} draw a Text instance \end{fulllineitems} \index{draw\_text() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.draw_text}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_text}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{s}, \emph{prop}, \emph{angle}, \emph{ismath=False}, \emph{mtext=None}}{} Draw a Text instance. \end{fulllineitems} \index{flipy() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.flipy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{flipy}}}{}{} return true if small y numbers are top for renderer \end{fulllineitems} \index{get\_canvas\_width\_height() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.get_canvas_width_height}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_canvas\_width\_height}}}{}{} return the canvas width and height in display coords \end{fulllineitems} \index{get\_image\_magnification() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.get_image_magnification}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_image\_magnification}}}{}{} Get the factor by which to magnify images passed to draw\_image. Allows a backend to have images at a different resolution to other artists. \end{fulllineitems} \index{get\_text\_width\_height\_descent() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.get_text_width_height_descent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_text\_width\_height\_descent}}}{\emph{s}, \emph{prop}, \emph{ismath}}{} get the width and height in display coords of the string s with FontPropertry prop \end{fulllineitems} \index{merge\_used\_characters() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.merge_used_characters}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{merge\_used\_characters}}}{\emph{other}}{}~ \end{fulllineitems} \index{new\_gc() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.new_gc}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{new\_gc}}}{}{} Return an instance of a \sphinxcode{\sphinxupquote{GraphicsContextBase}} \end{fulllineitems} \index{option\_image\_nocomposite() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.option_image_nocomposite}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{option\_image\_nocomposite}}}{}{} return whether to generate a composite image from multiple images on a set of axes \end{fulllineitems} \index{option\_scale\_image() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.option_scale_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{option\_scale\_image}}}{}{} ps backend support arbitrary scaling of image. \end{fulllineitems} \index{set\_color() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{r}, \emph{g}, \emph{b}, \emph{store=1}}{}~ \end{fulllineitems} \index{set\_font() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.set_font}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_font}}}{\emph{fontname}, \emph{fontsize}, \emph{store=1}}{}~ \end{fulllineitems} \index{set\_linecap() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.set_linecap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linecap}}}{\emph{linecap}, \emph{store=1}}{}~ \end{fulllineitems} \index{set\_linedash() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.set_linedash}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linedash}}}{\emph{offset}, \emph{seq}, \emph{store=1}}{}~ \end{fulllineitems} \index{set\_linejoin() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.set_linejoin}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linejoin}}}{\emph{linejoin}, \emph{store=1}}{}~ \end{fulllineitems} \index{set\_linewidth() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{linewidth}, \emph{store=1}}{}~ \end{fulllineitems} \index{track\_characters() (matplotlib.backends.backend\_ps.RendererPS method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.RendererPS.track_characters}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{track\_characters}}}{\emph{font}, \emph{s}}{} Keeps track of which characters are required from each font. \end{fulllineitems} \end{fulllineitems} \index{convert\_psfrags() (in module matplotlib.backends.backend\_ps)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.convert_psfrags}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_ps.}}\sphinxbfcode{\sphinxupquote{convert\_psfrags}}}{\emph{tmpfile}, \emph{psfrags}, \emph{font\_preamble}, \emph{custom\_preamble}, \emph{paperWidth}, \emph{paperHeight}, \emph{orientation}}{} When we want to use the LaTeX backend with postscript, we write PSFrag tags to a temporary postscript file, each one marking a position for LaTeX to render some text. convert\_psfrags generates a LaTeX document containing the commands to convert those tags to text. LaTeX/dvips produces the postscript file that includes the actual text. \end{fulllineitems} \index{get\_bbox() (in module matplotlib.backends.backend\_ps)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.get_bbox}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_ps.}}\sphinxbfcode{\sphinxupquote{get\_bbox}}}{\emph{tmpfile}, \emph{bbox}}{} Use ghostscript’s bbox device to find the center of the bounding box. Return an appropriately sized bbox centered around that point. A bit of a hack. \end{fulllineitems} \index{get\_bbox\_header() (in module matplotlib.backends.backend\_ps)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.get_bbox_header}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_ps.}}\sphinxbfcode{\sphinxupquote{get\_bbox\_header}}}{\emph{lbrt}, \emph{rotated=False}}{} return a postscript header stringfor the given bbox lbrt=(l, b, r, t). Optionally, return rotate command. \end{fulllineitems} \index{gs\_distill() (in module matplotlib.backends.backend\_ps)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.gs_distill}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_ps.}}\sphinxbfcode{\sphinxupquote{gs\_distill}}}{\emph{tmpfile}, \emph{eps=False}, \emph{ptype='letter'}, \emph{bbox=None}, \emph{rotated=False}}{} Use ghostscript’s pswrite or epswrite device to distill a file. This yields smaller files without illegal encapsulated postscript operators. The output is low-level, converting text to outlines. \end{fulllineitems} \index{pstoeps() (in module matplotlib.backends.backend\_ps)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.pstoeps}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_ps.}}\sphinxbfcode{\sphinxupquote{pstoeps}}}{\emph{tmpfile}, \emph{bbox=None}, \emph{rotated=False}}{} Convert the postscript to encapsulated postscript. The bbox of the eps file will be replaced with the given \sphinxstyleemphasis{bbox} argument. If None, original bbox will be used. \end{fulllineitems} \index{quote\_ps\_string() (in module matplotlib.backends.backend\_ps)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.quote_ps_string}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_ps.}}\sphinxbfcode{\sphinxupquote{quote\_ps\_string}}}{\emph{s}}{} Quote dangerous characters of S for use in a PostScript string constant. \end{fulllineitems} \index{xpdf\_distill() (in module matplotlib.backends.backend\_ps)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_ps_api:matplotlib.backends.backend_ps.xpdf_distill}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_ps.}}\sphinxbfcode{\sphinxupquote{xpdf\_distill}}}{\emph{tmpfile}, \emph{eps=False}, \emph{ptype='letter'}, \emph{bbox=None}, \emph{rotated=False}}{} Use ghostscript’s ps2pdf and xpdf’s/poppler’s pdftops to distill a file. This yields smaller files without illegal encapsulated postscript operators. This distiller is preferred, generating high-level postscript output that treats text as text. \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_qt4agg}}} \label{\detokenize{api/backend_qt4agg_api:module-matplotlib.backends.backend_qt4agg}}\label{\detokenize{api/backend_qt4agg_api:matplotlib-backends-backend-qt4agg}}\label{\detokenize{api/backend_qt4agg_api::doc}}\index{matplotlib.backends.backend\_qt4agg (module)} Render to qt from agg \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_qt4cairo}}} \label{\detokenize{api/backend_qt4cairo_api:module-matplotlib.backends.backend_qt4cairo}}\label{\detokenize{api/backend_qt4cairo_api:matplotlib-backends-backend-qt4cairo}}\label{\detokenize{api/backend_qt4cairo_api::doc}}\index{matplotlib.backends.backend\_qt4cairo (module)} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_qt5agg}}} \label{\detokenize{api/backend_qt5agg_api:module-matplotlib.backends.backend_qt5agg}}\label{\detokenize{api/backend_qt5agg_api:matplotlib-backends-backend-qt5agg}}\label{\detokenize{api/backend_qt5agg_api::doc}}\index{matplotlib.backends.backend\_qt5agg (module)} Render to qt from agg \index{FigureCanvas (in module matplotlib.backends.backend\_qt5agg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_qt5agg_api:matplotlib.backends.backend_qt5agg.FigureCanvas}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_qt5agg.}}\sphinxbfcode{\sphinxupquote{FigureCanvas}}} alias of {\hyperref[\detokenize{api/backend_qt5agg_api:matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_qt5agg.FigureCanvasQTAgg}}}}} \end{fulllineitems} \index{FigureCanvasQTAgg (class in matplotlib.backends.backend\_qt5agg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_qt5agg_api:matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_qt5agg.}}\sphinxbfcode{\sphinxupquote{FigureCanvasQTAgg}}}{\emph{figure}}{} Bases: {\hyperref[\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_agg.FigureCanvasAgg}}}}}, \sphinxcode{\sphinxupquote{matplotlib.backends.backend\_qt5.FigureCanvasQT}} \index{blit() (matplotlib.backends.backend\_qt5agg.FigureCanvasQTAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_qt5agg_api:matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.blit}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{blit}}}{\emph{bbox=None}}{} Blit the region in bbox. \end{fulllineitems} \index{blitbox (matplotlib.backends.backend\_qt5agg.FigureCanvasQTAgg attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_qt5agg_api:matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.blitbox}}\pysigline{\sphinxbfcode{\sphinxupquote{blitbox}}}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The blitbox function was deprecated in version 2.1. \end{fulllineitems} \index{paintEvent() (matplotlib.backends.backend\_qt5agg.FigureCanvasQTAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_qt5agg_api:matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.paintEvent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{paintEvent}}}{\emph{e}}{} Copy the image from the Agg canvas to the qt.drawable. In Qt, all drawing should be done inside of here when a widget is shown onscreen. \end{fulllineitems} \index{print\_figure() (matplotlib.backends.backend\_qt5agg.FigureCanvasQTAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_qt5agg_api:matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.print_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_figure}}}{\emph{*args}, \emph{**kwargs}}{} Render the figure to hardcopy. Set the figure patch face and edge colors. This is useful because some of the GUIs have a gray figure face color background and you’ll probably want to override this on hardcopy. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filename}}] \leavevmode can also be a file object on image backends \item[{\sphinxstylestrong{orientation}}] \leavevmode{[}\{‘landscape’, ‘portrait’\}, optional{]} only currently applies to PostScript printing. \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}scalar, optional{]} the dots per inch to save the figure in; if None, use savefig.dpi \item[{\sphinxstylestrong{facecolor}}] \leavevmode{[}color spec or None, optional{]} the facecolor of the figure; if None, defaults to savefig.facecolor \item[{\sphinxstylestrong{edgecolor}}] \leavevmode{[}color spec or None, optional{]} the edgecolor of the figure; if None, defaults to savefig.edgecolor \item[{\sphinxstylestrong{format}}] \leavevmode{[}str, optional{]} when set, forcibly set the file format to save to \item[{\sphinxstylestrong{bbox\_inches}}] \leavevmode{[}str or {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}, optional{]} Bbox in inches. Only the given portion of the figure is saved. If ‘tight’, try to figure out the tight bbox of the figure. If None, use savefig.bbox \item[{\sphinxstylestrong{pad\_inches}}] \leavevmode{[}scalar, optional{]} Amount of padding around the figure when bbox\_inches is ‘tight’. If None, use savefig.pad\_inches \item[{\sphinxstylestrong{bbox\_extra\_artists}}] \leavevmode{[}list of {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}}, optional{]} A list of extra artists that will be considered when the tight bbox is calculated. \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{FigureCanvasQTAggBase (class in matplotlib.backends.backend\_qt5agg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_qt5agg_api:matplotlib.backends.backend_qt5agg.FigureCanvasQTAggBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_qt5agg.}}\sphinxbfcode{\sphinxupquote{FigureCanvasQTAggBase}}}{\emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/backend_qt5agg_api:matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_qt5agg.FigureCanvasQTAgg}}}}} \DUrole{versionmodified}{Deprecated since version 2.2: }The FigureCanvasQTAggBase class was deprecated in version 2.2. \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_qt5cairo}}} \label{\detokenize{api/backend_qt5cairo_api:module-matplotlib.backends.backend_qt5cairo}}\label{\detokenize{api/backend_qt5cairo_api:matplotlib-backends-backend-qt5cairo}}\label{\detokenize{api/backend_qt5cairo_api::doc}}\index{matplotlib.backends.backend\_qt5cairo (module)}\index{FigureCanvas (in module matplotlib.backends.backend\_qt5cairo)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_qt5cairo_api:matplotlib.backends.backend_qt5cairo.FigureCanvas}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_qt5cairo.}}\sphinxbfcode{\sphinxupquote{FigureCanvas}}} alias of {\hyperref[\detokenize{api/backend_qt5cairo_api:matplotlib.backends.backend_qt5cairo.FigureCanvasQTCairo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_qt5cairo.FigureCanvasQTCairo}}}}} \end{fulllineitems} \index{FigureCanvasQTCairo (class in matplotlib.backends.backend\_qt5cairo)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_qt5cairo_api:matplotlib.backends.backend_qt5cairo.FigureCanvasQTCairo}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_qt5cairo.}}\sphinxbfcode{\sphinxupquote{FigureCanvasQTCairo}}}{\emph{figure}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.backends.backend\_qt5.FigureCanvasQT}}, {\hyperref[\detokenize{api/backend_cairo_api:matplotlib.backends.backend_cairo.FigureCanvasCairo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_cairo.FigureCanvasCairo}}}}} \index{draw() (matplotlib.backends.backend\_qt5cairo.FigureCanvasQTCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_qt5cairo_api:matplotlib.backends.backend_qt5cairo.FigureCanvasQTCairo.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{}{} Render the figure, and queue a request for a Qt draw. \end{fulllineitems} \index{paintEvent() (matplotlib.backends.backend\_qt5cairo.FigureCanvasQTCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_qt5cairo_api:matplotlib.backends.backend_qt5cairo.FigureCanvasQTCairo.paintEvent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{paintEvent}}}{\emph{event}}{}~ \end{fulllineitems} \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_svg}}} \label{\detokenize{api/backend_svg_api:module-matplotlib.backends.backend_svg}}\label{\detokenize{api/backend_svg_api:matplotlib-backends-backend-svg}}\label{\detokenize{api/backend_svg_api::doc}}\index{matplotlib.backends.backend\_svg (module)}\index{FigureCanvas (in module matplotlib.backends.backend\_svg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.FigureCanvas}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_svg.}}\sphinxbfcode{\sphinxupquote{FigureCanvas}}} alias of {\hyperref[\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.FigureCanvasSVG}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_svg.FigureCanvasSVG}}}}} \end{fulllineitems} \index{FigureCanvasSVG (class in matplotlib.backends.backend\_svg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.FigureCanvasSVG}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_svg.}}\sphinxbfcode{\sphinxupquote{FigureCanvasSVG}}}{\emph{figure}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.FigureCanvasBase}}}}} \index{filetypes (matplotlib.backends.backend\_svg.FigureCanvasSVG attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.FigureCanvasSVG.filetypes}}\pysigline{\sphinxbfcode{\sphinxupquote{filetypes}}\sphinxbfcode{\sphinxupquote{ = \{'svg': 'Scalable Vector Graphics', 'svgz': 'Scalable Vector Graphics'\}}}} \end{fulllineitems} \index{fixed\_dpi (matplotlib.backends.backend\_svg.FigureCanvasSVG attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.FigureCanvasSVG.fixed_dpi}}\pysigline{\sphinxbfcode{\sphinxupquote{fixed\_dpi}}\sphinxbfcode{\sphinxupquote{ = 72}}} \end{fulllineitems} \index{get\_default\_filetype() (matplotlib.backends.backend\_svg.FigureCanvasSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.FigureCanvasSVG.get_default_filetype}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_default\_filetype}}}{}{} Get the default savefig file format as specified in rcParam \sphinxcode{\sphinxupquote{savefig.format}}. Returned string excludes period. Overridden in backends that only support a single file type. \end{fulllineitems} \index{print\_svg() (matplotlib.backends.backend\_svg.FigureCanvasSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.FigureCanvasSVG.print_svg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_svg}}}{\emph{filename}, \emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \index{print\_svgz() (matplotlib.backends.backend\_svg.FigureCanvasSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.FigureCanvasSVG.print_svgz}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_svgz}}}{\emph{filename}, \emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \end{fulllineitems} \index{FigureManager (in module matplotlib.backends.backend\_svg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.FigureManager}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_svg.}}\sphinxbfcode{\sphinxupquote{FigureManager}}} alias of {\hyperref[\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.FigureManagerSVG}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_svg.FigureManagerSVG}}}}} \end{fulllineitems} \index{FigureManagerSVG (class in matplotlib.backends.backend\_svg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.FigureManagerSVG}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_svg.}}\sphinxbfcode{\sphinxupquote{FigureManagerSVG}}}{\emph{canvas}, \emph{num}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureManagerBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.FigureManagerBase}}}}} \end{fulllineitems} \index{RendererSVG (class in matplotlib.backends.backend\_svg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_svg.}}\sphinxbfcode{\sphinxupquote{RendererSVG}}}{\emph{width}, \emph{height}, \emph{svgwriter}, \emph{basename=None}, \emph{image\_dpi=72}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.RendererBase}}}}} \index{FONT\_SCALE (matplotlib.backends.backend\_svg.RendererSVG attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.FONT_SCALE}}\pysigline{\sphinxbfcode{\sphinxupquote{FONT\_SCALE}}\sphinxbfcode{\sphinxupquote{ = 100.0}}} \end{fulllineitems} \index{close\_group() (matplotlib.backends.backend\_svg.RendererSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.close_group}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{close\_group}}}{\emph{s}}{} Close a grouping element with label \sphinxstyleemphasis{s} Is only currently used by {\hyperref[\detokenize{api/backend_svg_api:module-matplotlib.backends.backend_svg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{backend\_svg}}}}} \end{fulllineitems} \index{draw\_gouraud\_triangle() (matplotlib.backends.backend\_svg.RendererSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.draw_gouraud_triangle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_gouraud\_triangle}}}{\emph{gc}, \emph{points}, \emph{colors}, \emph{trans}}{} Draw a Gouraud-shaded triangle. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{points}}] \leavevmode{[}array\_like, shape=(3, 2){]} Array of (x, y) points for the triangle. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}array\_like, shape=(3, 4){]} RGBA colors for each point of the triangle. \item[{\sphinxstylestrong{transform}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform to apply to the points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_gouraud\_triangles() (matplotlib.backends.backend\_svg.RendererSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.draw_gouraud_triangles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_gouraud\_triangles}}}{\emph{gc}, \emph{triangles\_array}, \emph{colors\_array}, \emph{transform}}{} Draws a series of Gouraud triangles. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{points}}] \leavevmode{[}array\_like, shape=(N, 3, 2){]} Array of \sphinxstyleemphasis{N} (x, y) points for the triangles. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}array\_like, shape=(N, 3, 4){]} Array of \sphinxstyleemphasis{N} RGBA colors for each point of the triangles. \item[{\sphinxstylestrong{transform}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform to apply to the points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_image() (matplotlib.backends.backend\_svg.RendererSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.draw_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_image}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{im}, \emph{transform=None}}{} Draw an RGBA image. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gc}}] \leavevmode{[}\sphinxcode{\sphinxupquote{GraphicsContextBase}}{]} a graphics context with clipping information. \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar{]} the distance in physical units (i.e., dots or pixels) from the left hand side of the canvas. \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar{]} the distance in physical units (i.e., dots or pixels) from the bottom side of the canvas. \item[{\sphinxstylestrong{im}}] \leavevmode{[}array\_like, shape=(N, M, 4), dtype=np.uint8{]} An array of RGBA pixels. \item[{\sphinxstylestrong{transform}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Affine2DBase}}}}}{]} If and only if the concrete backend is written such that {\hyperref[\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.option_scale_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{option\_scale\_image()}}}}} returns \sphinxcode{\sphinxupquote{True}}, an affine transformation \sphinxstyleemphasis{may} be passed to {\hyperref[\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.draw_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_image()}}}}}. It takes the form of a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Affine2DBase}}}}} instance. The translation vector of the transformation is given in physical units (i.e., dots or pixels). Note that the transformation does not override \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}}, and has to be applied \sphinxstyleemphasis{before} translating the result by \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} (this can be accomplished by adding \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} to the translation vector defined by \sphinxcode{\sphinxupquote{transform}}). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_markers() (matplotlib.backends.backend\_svg.RendererSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.draw_markers}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_markers}}}{\emph{gc}, \emph{marker\_path}, \emph{marker\_trans}, \emph{path}, \emph{trans}, \emph{rgbFace=None}}{} Draws a marker at each of the vertices in path. This includes all vertices, including control points on curves. To avoid that behavior, those vertices should be removed before calling this function. This provides a fallback implementation of draw\_markers that makes multiple calls to {\hyperref[\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path()}}}}}. Some backends may want to override this method in order to draw the marker only once and reuse it multiple times. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gc}}] \leavevmode{[}\sphinxcode{\sphinxupquote{GraphicsContextBase}}{]} The graphics context \item[{\sphinxstylestrong{marker\_trans}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform applied to the marker. \item[{\sphinxstylestrong{trans}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform applied to the path. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_path() (matplotlib.backends.backend\_svg.RendererSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.draw_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path}}}{\emph{gc}, \emph{path}, \emph{transform}, \emph{rgbFace=None}}{} Draws a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance using the given affine transform. \end{fulllineitems} \index{draw\_path\_collection() (matplotlib.backends.backend\_svg.RendererSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.draw_path_collection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path\_collection}}}{\emph{gc}, \emph{master\_transform}, \emph{paths}, \emph{all\_transforms}, \emph{offsets}, \emph{offsetTrans}, \emph{facecolors}, \emph{edgecolors}, \emph{linewidths}, \emph{linestyles}, \emph{antialiaseds}, \emph{urls}, \emph{offset\_position}}{} Draws a collection of paths selecting drawing properties from the lists \sphinxstyleemphasis{facecolors}, \sphinxstyleemphasis{edgecolors}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{linestyles} and \sphinxstyleemphasis{antialiaseds}. \sphinxstyleemphasis{offsets} is a list of offsets to apply to each of the paths. The offsets in \sphinxstyleemphasis{offsets} are first transformed by \sphinxstyleemphasis{offsetTrans} before being applied. \sphinxstyleemphasis{offset\_position} may be either “screen” or “data” depending on the space that the offsets are in. This provides a fallback implementation of {\hyperref[\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.draw_path_collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path\_collection()}}}}} that makes multiple calls to {\hyperref[\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path()}}}}}. Some backends may want to override this in order to render each set of path data only once, and then reference that path multiple times with the different offsets, colors, styles etc. The generator methods \sphinxcode{\sphinxupquote{\_iter\_collection\_raw\_paths()}} and \sphinxcode{\sphinxupquote{\_iter\_collection()}} are provided to help with (and standardize) the implementation across backends. It is highly recommended to use those generators, so that changes to the behavior of {\hyperref[\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.draw_path_collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path\_collection()}}}}} can be made globally. \end{fulllineitems} \index{draw\_tex() (matplotlib.backends.backend\_svg.RendererSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.draw_tex}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_tex}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{s}, \emph{prop}, \emph{angle}, \emph{ismath='TeX!'}, \emph{mtext=None}}{}~ \end{fulllineitems} \index{draw\_text() (matplotlib.backends.backend\_svg.RendererSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.draw_text}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_text}}}{\emph{gc}, \emph{x}, \emph{y}, \emph{s}, \emph{prop}, \emph{angle}, \emph{ismath=False}, \emph{mtext=None}}{} Draw the text instance \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gc}}] \leavevmode{[}\sphinxcode{\sphinxupquote{GraphicsContextBase}}{]} the graphics context \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar{]} the x location of the text in display coords \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar{]} the y location of the text baseline in display coords \item[{\sphinxstylestrong{s}}] \leavevmode{[}str{]} the text string \item[{\sphinxstylestrong{prop}}] \leavevmode{[}{\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}}{]} font properties \item[{\sphinxstylestrong{angle}}] \leavevmode{[}scalar{]} the rotation angle in degrees \item[{\sphinxstylestrong{mtext}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}}{]} the original text object to be rendered \end{description} \end{description}\end{quote} \paragraph{Notes} \sphinxstylestrong{backend implementers note} When you are trying to determine if you have gotten your bounding box right (which is what enables the text layout/alignment to work properly), it helps to change the line in text.py: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{if} \PYG{l+m+mi}{0}\PYG{p}{:} \PYG{n}{bbox\PYGZus{}artist}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{renderer}\PYG{p}{)} \end{sphinxVerbatim} to if 1, and then the actual bounding box will be plotted along with your text. \end{fulllineitems} \index{finalize() (matplotlib.backends.backend\_svg.RendererSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.finalize}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{finalize}}}{}{}~ \end{fulllineitems} \index{flipy() (matplotlib.backends.backend\_svg.RendererSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.flipy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{flipy}}}{}{} Return true if y small numbers are top for renderer Is used for drawing text ({\hyperref[\detokenize{api/text_api:module-matplotlib.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text}}}}}) and images ({\hyperref[\detokenize{api/image_api:module-matplotlib.image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.image}}}}}) only \end{fulllineitems} \index{fontd (matplotlib.backends.backend\_svg.RendererSVG attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.fontd}}\pysigline{\sphinxbfcode{\sphinxupquote{fontd}}\sphinxbfcode{\sphinxupquote{ = \{\}}}} \end{fulllineitems} \index{get\_canvas\_width\_height() (matplotlib.backends.backend\_svg.RendererSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.get_canvas_width_height}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_canvas\_width\_height}}}{}{} return the canvas width and height in display coords \end{fulllineitems} \index{get\_image\_magnification() (matplotlib.backends.backend\_svg.RendererSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.get_image_magnification}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_image\_magnification}}}{}{} Get the factor by which to magnify images passed to {\hyperref[\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.draw_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_image()}}}}}. Allows a backend to have images at a different resolution to other artists. \end{fulllineitems} \index{get\_text\_width\_height\_descent() (matplotlib.backends.backend\_svg.RendererSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.get_text_width_height_descent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_text\_width\_height\_descent}}}{\emph{s}, \emph{prop}, \emph{ismath}}{} Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string \sphinxstyleemphasis{s} with {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FontProperties}}}}} \sphinxstyleemphasis{prop} \end{fulllineitems} \index{open\_group() (matplotlib.backends.backend\_svg.RendererSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.open_group}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{open\_group}}}{\emph{s}, \emph{gid=None}}{} Open a grouping element with label \sphinxstyleemphasis{s}. If \sphinxstyleemphasis{gid} is given, use \sphinxstyleemphasis{gid} as the id of the group. \end{fulllineitems} \index{option\_image\_nocomposite() (matplotlib.backends.backend\_svg.RendererSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.option_image_nocomposite}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{option\_image\_nocomposite}}}{}{} return whether to generate a composite image from multiple images on a set of axes \end{fulllineitems} \index{option\_scale\_image() (matplotlib.backends.backend\_svg.RendererSVG method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.option_scale_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{option\_scale\_image}}}{}{} override this method for renderers that support arbitrary affine transformations in {\hyperref[\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.RendererSVG.draw_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_image()}}}}} (most vector backends). \end{fulllineitems} \end{fulllineitems} \index{XMLWriter (class in matplotlib.backends.backend\_svg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.XMLWriter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_svg.}}\sphinxbfcode{\sphinxupquote{XMLWriter}}}{\emph{file}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} \index{close() (matplotlib.backends.backend\_svg.XMLWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.XMLWriter.close}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{close}}}{\emph{id}}{}~ \end{fulllineitems} \index{comment() (matplotlib.backends.backend\_svg.XMLWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.XMLWriter.comment}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{comment}}}{\emph{comment}}{}~ \end{fulllineitems} \index{data() (matplotlib.backends.backend\_svg.XMLWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.XMLWriter.data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{data}}}{\emph{text}}{}~ \end{fulllineitems} \index{element() (matplotlib.backends.backend\_svg.XMLWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.XMLWriter.element}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{element}}}{\emph{tag}, \emph{text=None}, \emph{attrib=\{\}}, \emph{**extra}}{}~ \end{fulllineitems} \index{end() (matplotlib.backends.backend\_svg.XMLWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.XMLWriter.end}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{end}}}{\emph{tag=None}, \emph{indent=True}}{}~ \end{fulllineitems} \index{flush() (matplotlib.backends.backend\_svg.XMLWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.XMLWriter.flush}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{flush}}}{}{}~ \end{fulllineitems} \index{start() (matplotlib.backends.backend\_svg.XMLWriter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.XMLWriter.start}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{start}}}{\emph{tag}, \emph{attrib=\{\}}, \emph{**extra}}{}~ \end{fulllineitems} \end{fulllineitems} \index{escape\_attrib() (in module matplotlib.backends.backend\_svg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.escape_attrib}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_svg.}}\sphinxbfcode{\sphinxupquote{escape\_attrib}}}{\emph{s}}{}~ \end{fulllineitems} \index{escape\_cdata() (in module matplotlib.backends.backend\_svg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.escape_cdata}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_svg.}}\sphinxbfcode{\sphinxupquote{escape\_cdata}}}{\emph{s}}{}~ \end{fulllineitems} \index{escape\_comment() (in module matplotlib.backends.backend\_svg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.escape_comment}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_svg.}}\sphinxbfcode{\sphinxupquote{escape\_comment}}}{\emph{s}}{}~ \end{fulllineitems} \index{generate\_css() (in module matplotlib.backends.backend\_svg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.generate_css}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_svg.}}\sphinxbfcode{\sphinxupquote{generate\_css}}}{\emph{attrib=\{\}}}{}~ \end{fulllineitems} \index{generate\_transform() (in module matplotlib.backends.backend\_svg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.generate_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_svg.}}\sphinxbfcode{\sphinxupquote{generate\_transform}}}{\emph{transform\_list={[}{]}}}{}~ \end{fulllineitems} \index{short\_float\_fmt() (in module matplotlib.backends.backend\_svg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_svg_api:matplotlib.backends.backend_svg.short_float_fmt}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_svg.}}\sphinxbfcode{\sphinxupquote{short\_float\_fmt}}}{\emph{x}}{} Create a short string representation of a float, which is \%f formatting with trailing zeros and the decimal point removed. \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_tkagg}}} \label{\detokenize{api/backend_tkagg_api:module-matplotlib.backends.backend_tkagg}}\label{\detokenize{api/backend_tkagg_api:matplotlib-backends-backend-tkagg}}\label{\detokenize{api/backend_tkagg_api::doc}}\index{matplotlib.backends.backend\_tkagg (module)}\index{FigureCanvas (in module matplotlib.backends.backend\_tkagg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tkagg_api:matplotlib.backends.backend_tkagg.FigureCanvas}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_tkagg.}}\sphinxbfcode{\sphinxupquote{FigureCanvas}}} alias of {\hyperref[\detokenize{api/backend_tkagg_api:matplotlib.backends.backend_tkagg.FigureCanvasTkAgg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_tkagg.FigureCanvasTkAgg}}}}} \end{fulllineitems} \index{FigureCanvasTkAgg (class in matplotlib.backends.backend\_tkagg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tkagg_api:matplotlib.backends.backend_tkagg.FigureCanvasTkAgg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_tkagg.}}\sphinxbfcode{\sphinxupquote{FigureCanvasTkAgg}}}{\emph{figure}, \emph{master=None}, \emph{resize\_callback=None}}{} Bases: {\hyperref[\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_agg.FigureCanvasAgg}}}}}, \sphinxcode{\sphinxupquote{matplotlib.backends.\_backend\_tk.FigureCanvasTk}} \index{blit() (matplotlib.backends.backend\_tkagg.FigureCanvasTkAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tkagg_api:matplotlib.backends.backend_tkagg.FigureCanvasTkAgg.blit}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{blit}}}{\emph{bbox=None}}{} Blit the canvas in bbox (default entire canvas). \end{fulllineitems} \index{draw() (matplotlib.backends.backend\_tkagg.FigureCanvasTkAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tkagg_api:matplotlib.backends.backend_tkagg.FigureCanvasTkAgg.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{}{} Draw the figure using the renderer \end{fulllineitems} \end{fulllineitems} \index{FigureManagerTkAgg (class in matplotlib.backends.backend\_tkagg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tkagg_api:matplotlib.backends.backend_tkagg.FigureManagerTkAgg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_tkagg.}}\sphinxbfcode{\sphinxupquote{FigureManagerTkAgg}}}{\emph{**kwargs}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.backends.\_backend\_tk.FigureManagerTk}} \DUrole{versionmodified}{Deprecated since version 2.2: }The FigureManagerTkAgg class was deprecated in version 2.2. \end{fulllineitems} \index{NavigationToolbar2TkAgg (class in matplotlib.backends.backend\_tkagg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_tkagg_api:matplotlib.backends.backend_tkagg.NavigationToolbar2TkAgg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_tkagg.}}\sphinxbfcode{\sphinxupquote{NavigationToolbar2TkAgg}}}{\emph{**kwargs}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.backends.\_backend\_tk.NavigationToolbar2Tk}} \DUrole{versionmodified}{Deprecated since version 2.2: }The NavigationToolbar2TkAgg class was deprecated in version 2.2. \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_webagg}}} \label{\detokenize{api/backend_webagg_api:matplotlib-backends-backend-webagg}}\label{\detokenize{api/backend_webagg_api::doc}} \begin{sphinxadmonition}{note}{Note:} The WebAgg backend is not documented here, in order to avoid adding Tornado to the doc build requirements. \end{sphinxadmonition} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.backends.backend\_wxagg}}} \label{\detokenize{api/backend_wxagg_api:module-matplotlib.backends.backend_wxagg}}\label{\detokenize{api/backend_wxagg_api:matplotlib-backends-backend-wxagg}}\label{\detokenize{api/backend_wxagg_api::doc}}\index{matplotlib.backends.backend\_wxagg (module)}\index{FigureCanvas (in module matplotlib.backends.backend\_wxagg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_wxagg_api:matplotlib.backends.backend_wxagg.FigureCanvas}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_wxagg.}}\sphinxbfcode{\sphinxupquote{FigureCanvas}}} alias of {\hyperref[\detokenize{api/backend_wxagg_api:matplotlib.backends.backend_wxagg.FigureCanvasWxAgg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_wxagg.FigureCanvasWxAgg}}}}} \end{fulllineitems} \index{FigureCanvasWxAgg (class in matplotlib.backends.backend\_wxagg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_wxagg_api:matplotlib.backends.backend_wxagg.FigureCanvasWxAgg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_wxagg.}}\sphinxbfcode{\sphinxupquote{FigureCanvasWxAgg}}}{\emph{parent}, \emph{id}, \emph{figure}}{} Bases: {\hyperref[\detokenize{api/backend_agg_api:matplotlib.backends.backend_agg.FigureCanvasAgg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_agg.FigureCanvasAgg}}}}}, \sphinxcode{\sphinxupquote{matplotlib.backends.backend\_wx.\_FigureCanvasWxBase}} The FigureCanvas contains the figure and does event handling. In the wxPython backend, it is derived from wxPanel, and (usually) lives inside a frame instantiated by a FigureManagerWx. The parent window probably implements a wxSizer to control the displayed control size - but we give a hint as to our preferred minimum size. Initialise a FigureWx instance. \begin{itemize} \item {} Initialise the FigureCanvasBase and wxPanel parents. \item {} Set event handlers for: EVT\_SIZE (Resize event) EVT\_PAINT (Paint event) \end{itemize} \index{blit() (matplotlib.backends.backend\_wxagg.FigureCanvasWxAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_wxagg_api:matplotlib.backends.backend_wxagg.FigureCanvasWxAgg.blit}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{blit}}}{\emph{bbox=None}}{} Transfer the region of the agg buffer defined by bbox to the display. If bbox is None, the entire buffer is transferred. \end{fulllineitems} \index{draw() (matplotlib.backends.backend\_wxagg.FigureCanvasWxAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_wxagg_api:matplotlib.backends.backend_wxagg.FigureCanvasWxAgg.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{drawDC=None}}{} Render the figure using agg. \end{fulllineitems} \index{filetypes (matplotlib.backends.backend\_wxagg.FigureCanvasWxAgg attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_wxagg_api:matplotlib.backends.backend_wxagg.FigureCanvasWxAgg.filetypes}}\pysigline{\sphinxbfcode{\sphinxupquote{filetypes}}\sphinxbfcode{\sphinxupquote{ = \{'eps': 'Encapsulated Postscript', 'jpeg': 'Joint Photographic Experts Group', 'jpg': 'Joint Photographic Experts Group', 'pdf': 'Portable Document Format', 'pgf': 'PGF code for LaTeX', 'png': 'Portable Network Graphics', 'ps': 'Postscript', 'raw': 'Raw RGBA bitmap', 'rgba': 'Raw RGBA bitmap', 'svg': 'Scalable Vector Graphics', 'svgz': 'Scalable Vector Graphics', 'tif': 'Tagged Image File Format', 'tiff': 'Tagged Image File Format'\}}}} \end{fulllineitems} \end{fulllineitems} \index{FigureFrameWxAgg (class in matplotlib.backends.backend\_wxagg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_wxagg_api:matplotlib.backends.backend_wxagg.FigureFrameWxAgg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_wxagg.}}\sphinxbfcode{\sphinxupquote{FigureFrameWxAgg}}}{\emph{num}, \emph{fig}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.backends.backend\_wx.FigureFrameWx}} \index{get\_canvas() (matplotlib.backends.backend\_wxagg.FigureFrameWxAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_wxagg_api:matplotlib.backends.backend_wxagg.FigureFrameWxAgg.get_canvas}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_canvas}}}{\emph{fig}}{}~ \end{fulllineitems} \end{fulllineitems} \index{Toolbar (class in matplotlib.backends.backend\_wxagg)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/backend_wxagg_api:matplotlib.backends.backend_wxagg.Toolbar}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.backends.backend\_wxagg.}}\sphinxbfcode{\sphinxupquote{Toolbar}}}{\emph{**kwargs}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.backends.backend\_wx.NavigationToolbar2Wx}} \DUrole{versionmodified}{Deprecated since version 2.2: }The Toolbar class was deprecated in version 2.2. Use NavigationToolbar2WxAgg instead. \end{fulllineitems} \chapter{cbook} \label{\detokenize{api/cbook_api:cbook}}\label{\detokenize{api/cbook_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.cbook}}} \label{\detokenize{api/cbook_api:module-matplotlib.cbook}}\label{\detokenize{api/cbook_api:matplotlib-cbook}}\index{matplotlib.cbook (module)} A collection of utility functions and classes. Originally, many (but not all) were from the Python Cookbook \textendash{} hence the name cbook. This module is safe to import from anywhere within matplotlib; it imports matplotlib only at runtime. \index{Bunch (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Bunch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{Bunch}}}{\emph{**kwds}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Often we want to just collect a bunch of stuff together, naming each item of the bunch; a dictionary’s OK for that, but a small do- nothing class is even handier, and prettier to use. Whenever you want to group a few variables: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{point} \PYG{o}{=} \PYG{n}{Bunch}\PYG{p}{(}\PYG{n}{datum}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{squared}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{n}{coord}\PYG{o}{=}\PYG{l+m+mi}{12}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{point}\PYG{o}{.}\PYG{n}{datum} \PYG{g+go}{By: Alex Martelli} \PYG{g+go}{From: https://code.activestate.com/recipes/121294/} \end{sphinxVerbatim} \end{fulllineitems} \index{CallbackRegistry (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.CallbackRegistry}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{CallbackRegistry}}}{\emph{exception\_handler=\textless{}function \_exception\_printer\textgreater{}}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Handle registering and disconnecting for a set of signals and callbacks: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k}{def} \PYG{n+nf}{oneat}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)}\PYG{p}{:} \PYG{g+gp}{... } \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{eat}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{x}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k}{def} \PYG{n+nf}{ondrink}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)}\PYG{p}{:} \PYG{g+gp}{... } \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{drink}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{x}\PYG{p}{)} \end{sphinxVerbatim} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{cbook} \PYG{k}{import} \PYG{n}{CallbackRegistry} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{callbacks} \PYG{o}{=} \PYG{n}{CallbackRegistry}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{id\PYGZus{}eat} \PYG{o}{=} \PYG{n}{callbacks}\PYG{o}{.}\PYG{n}{connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{eat}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{oneat}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{id\PYGZus{}drink} \PYG{o}{=} \PYG{n}{callbacks}\PYG{o}{.}\PYG{n}{connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{drink}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ondrink}\PYG{p}{)} \end{sphinxVerbatim} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{callbacks}\PYG{o}{.}\PYG{n}{process}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{drink}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+m+mi}{123}\PYG{p}{)} \PYG{g+go}{drink 123} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{callbacks}\PYG{o}{.}\PYG{n}{process}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{eat}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+m+mi}{456}\PYG{p}{)} \PYG{g+go}{eat 456} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{callbacks}\PYG{o}{.}\PYG{n}{process}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{be merry}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+m+mi}{456}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} nothing will be called} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{callbacks}\PYG{o}{.}\PYG{n}{disconnect}\PYG{p}{(}\PYG{n}{id\PYGZus{}eat}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{callbacks}\PYG{o}{.}\PYG{n}{process}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{eat}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+m+mi}{456}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} nothing will be called} \end{sphinxVerbatim} In practice, one should always disconnect all callbacks when they are no longer needed to avoid dangling references (and thus memory leaks). However, real code in matplotlib rarely does so, and due to its design, it is rather difficult to place this kind of code. To get around this, and prevent this class of memory leaks, we instead store weak references to bound methods only, so when the destination object needs to die, the CallbackRegistry won’t keep it alive. The Python stdlib weakref module can not create weak references to bound methods directly, so we need to create a proxy object to handle weak references to bound methods (or regular free functions). This technique was shared by Peter Parente on his \sphinxhref{http://mindtrove.info/python-weak-references/}{“Mindtrove” blog}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{exception\_handler}}] \leavevmode{[}callable, optional{]} If provided must have signature \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{handler}\PYG{p}{(}\PYG{n}{exc}\PYG{p}{:} \PYG{n+ne}{Exception}\PYG{p}{)} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZgt{}} \PYG{k+kc}{None}\PYG{p}{:} \end{sphinxVerbatim} If not None this function will be called with any \sphinxhref{https://docs.python.org/3/library/exceptions.html\#Exception}{\sphinxcode{\sphinxupquote{Exception}}} subclass raised by the callbacks in {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.CallbackRegistry.process}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CallbackRegistry.process}}}}}. The handler may either consume the exception or re-raise. The callable must be pickle-able. The default handler is \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{h}\PYG{p}{(}\PYG{n}{exc}\PYG{p}{)}\PYG{p}{:} \PYG{n}{traceback}\PYG{o}{.}\PYG{n}{print\PYGZus{}exc}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \end{description} \end{description}\end{quote} \index{connect() (matplotlib.cbook.CallbackRegistry method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.CallbackRegistry.connect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{connect}}}{\emph{s}, \emph{func}}{} Register \sphinxstyleemphasis{func} to be called when signal \sphinxstyleemphasis{s} is generated. \end{fulllineitems} \index{disconnect() (matplotlib.cbook.CallbackRegistry method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.CallbackRegistry.disconnect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{disconnect}}}{\emph{cid}}{} Disconnect the callback registered with callback id \sphinxstyleemphasis{cid}. \end{fulllineitems} \index{process() (matplotlib.cbook.CallbackRegistry method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.CallbackRegistry.process}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{process}}}{\emph{s}, \emph{*args}, \emph{**kwargs}}{} Process signal \sphinxstyleemphasis{s}. All of the functions registered to receive callbacks on \sphinxstyleemphasis{s} will be called with \sphinxcode{\sphinxupquote{*args}} and \sphinxcode{\sphinxupquote{**kwargs}}. \end{fulllineitems} \end{fulllineitems} \index{GetRealpathAndStat (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.GetRealpathAndStat}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{GetRealpathAndStat}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} \end{fulllineitems} \index{Grouper (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Grouper}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{Grouper}}}{\emph{init=()}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} This class provides a lightweight way to group arbitrary objects together into disjoint sets when a full-blown graph data structure would be overkill. Objects can be joined using {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.Grouper.join}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{join()}}}}}, tested for connectedness using {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.Grouper.joined}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joined()}}}}}, and all disjoint sets can be retrieved by using the object as an iterator. The objects being joined must be hashable and weak-referenceable. For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{cbook} \PYG{k}{import} \PYG{n}{Grouper} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k}{class} \PYG{n+nc}{Foo}\PYG{p}{(}\PYG{n+nb}{object}\PYG{p}{)}\PYG{p}{:} \PYG{g+gp}{... } \PYG{k}{def} \PYG{n+nf}{\PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{s}\PYG{p}{)}\PYG{p}{:} \PYG{g+gp}{... } \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{s} \PYG{o}{=} \PYG{n}{s} \PYG{g+gp}{... } \PYG{k}{def} \PYG{n+nf}{\PYGZus{}\PYGZus{}repr\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{)}\PYG{p}{:} \PYG{g+gp}{... } \PYG{k}{return} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{s} \PYG{g+gp}{...} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{a}\PYG{p}{,} \PYG{n}{b}\PYG{p}{,} \PYG{n}{c}\PYG{p}{,} \PYG{n}{d}\PYG{p}{,} \PYG{n}{e}\PYG{p}{,} \PYG{n}{f} \PYG{o}{=} \PYG{p}{[}\PYG{n}{Foo}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)} \PYG{k}{for} \PYG{n}{x} \PYG{o+ow}{in} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{abcdef}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{grp} \PYG{o}{=} \PYG{n}{Grouper}\PYG{p}{(}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{grp}\PYG{o}{.}\PYG{n}{join}\PYG{p}{(}\PYG{n}{a}\PYG{p}{,} \PYG{n}{b}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{grp}\PYG{o}{.}\PYG{n}{join}\PYG{p}{(}\PYG{n}{b}\PYG{p}{,} \PYG{n}{c}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{grp}\PYG{o}{.}\PYG{n}{join}\PYG{p}{(}\PYG{n}{d}\PYG{p}{,} \PYG{n}{e}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{sorted}\PYG{p}{(}\PYG{n+nb}{map}\PYG{p}{(}\PYG{n+nb}{tuple}\PYG{p}{,} \PYG{n}{grp}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{[(a, b, c), (d, e)]} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{grp}\PYG{o}{.}\PYG{n}{joined}\PYG{p}{(}\PYG{n}{a}\PYG{p}{,} \PYG{n}{b}\PYG{p}{)} \PYG{g+go}{True} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{grp}\PYG{o}{.}\PYG{n}{joined}\PYG{p}{(}\PYG{n}{a}\PYG{p}{,} \PYG{n}{c}\PYG{p}{)} \PYG{g+go}{True} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{grp}\PYG{o}{.}\PYG{n}{joined}\PYG{p}{(}\PYG{n}{a}\PYG{p}{,} \PYG{n}{d}\PYG{p}{)} \PYG{g+go}{False} \end{sphinxVerbatim} \index{clean() (matplotlib.cbook.Grouper method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Grouper.clean}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{clean}}}{}{} Clean dead weak references from the dictionary \end{fulllineitems} \index{get\_siblings() (matplotlib.cbook.Grouper method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Grouper.get_siblings}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_siblings}}}{\emph{a}}{} Returns all of the items joined with \sphinxstyleemphasis{a}, including itself. \end{fulllineitems} \index{join() (matplotlib.cbook.Grouper method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Grouper.join}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{join}}}{\emph{a}, \emph{*args}}{} Join given arguments into the same set. Accepts one or more arguments. \end{fulllineitems} \index{joined() (matplotlib.cbook.Grouper method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Grouper.joined}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{joined}}}{\emph{a}, \emph{b}}{} Returns True if \sphinxstyleemphasis{a} and \sphinxstyleemphasis{b} are members of the same set. \end{fulllineitems} \index{remove() (matplotlib.cbook.Grouper method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Grouper.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{\emph{a}}{}~ \end{fulllineitems} \end{fulllineitems} \index{IgnoredKeywordWarning} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.IgnoredKeywordWarning}}\pysigline{\sphinxbfcode{\sphinxupquote{exception }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{IgnoredKeywordWarning}}} Bases: \sphinxhref{https://docs.python.org/3/library/exceptions.html\#UserWarning}{\sphinxcode{\sphinxupquote{UserWarning}}} A class for issuing warnings about keyword arguments that will be ignored by matplotlib \end{fulllineitems} \index{Locked (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Locked}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{Locked}}}{\emph{path}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Context manager to handle locks. Based on code from conda. (c) 2012-2013 Continuum Analytics, Inc. / \sphinxurl{https://www.continuum.io/} All Rights Reserved conda is distributed under the terms of the BSD 3-clause license. Consult LICENSE\_CONDA or \sphinxurl{https://opensource.org/licenses/BSD-3-Clause}. \index{LOCKFN (matplotlib.cbook.Locked attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Locked.LOCKFN}}\pysigline{\sphinxbfcode{\sphinxupquote{LOCKFN}}\sphinxbfcode{\sphinxupquote{ = '.matplotlib\_lock'}}} \end{fulllineitems} \index{Locked.TimeoutError} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Locked.TimeoutError}}\pysigline{\sphinxbfcode{\sphinxupquote{exception }}\sphinxbfcode{\sphinxupquote{TimeoutError}}} Bases: \sphinxhref{https://docs.python.org/3/library/exceptions.html\#RuntimeError}{\sphinxcode{\sphinxupquote{RuntimeError}}} \end{fulllineitems} \end{fulllineitems} \index{Null (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Null}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{Null}}}{\emph{**kwargs}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} \DUrole{versionmodified}{Deprecated since version 2.1: }The Null class was deprecated in version 2.1. Null objects always and reliably “do nothing.” \end{fulllineitems} \index{RingBuffer (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.RingBuffer}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{RingBuffer}}}{\emph{**kwargs}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} \DUrole{versionmodified}{Deprecated since version 2.1: }The RingBuffer class was deprecated in version 2.1. class that implements a not-yet-full buffer \index{append() (matplotlib.cbook.RingBuffer method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.RingBuffer.append}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{append}}}{\emph{x}}{} append an element at the end of the buffer \end{fulllineitems} \index{get() (matplotlib.cbook.RingBuffer method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.RingBuffer.get}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get}}}{}{} Return a list of elements from the oldest to the newest. \end{fulllineitems} \end{fulllineitems} \index{Sorter (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Sorter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{Sorter}}}{\emph{**kwargs}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} \DUrole{versionmodified}{Deprecated since version 2.1: }sorted(…, key=itemgetter(…)) Sort by attribute or item Example usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{sort} \PYG{o}{=} \PYG{n}{Sorter}\PYG{p}{(}\PYG{p}{)} \PYG{n+nb}{list} \PYG{o}{=} \PYG{p}{[}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{8}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{]} \PYG{n+nb}{dict} \PYG{o}{=} \PYG{p}{[}\PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{a}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{4}\PYG{p}{\PYGZcb{}}\PYG{p}{,} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{a}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{2}\PYG{p}{\PYGZcb{}}\PYG{p}{,} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{a}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{0}\PYG{p}{\PYGZcb{}}\PYG{p}{,} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{a}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{9}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mi}{9}\PYG{p}{\PYGZcb{}}\PYG{p}{]} \PYG{n}{sort}\PYG{p}{(}\PYG{n+nb}{list}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} default sort} \PYG{n}{sort}\PYG{p}{(}\PYG{n+nb}{list}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} sort by index 1} \PYG{n}{sort}\PYG{p}{(}\PYG{n+nb}{dict}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{a}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} sort a list of dicts by key \PYGZsq{}a\PYGZsq{}} \end{sphinxVerbatim} \index{byAttribute() (matplotlib.cbook.Sorter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Sorter.byAttribute}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{byAttribute}}}{\emph{data}, \emph{attributename}, \emph{inplace=1}}{}~ \end{fulllineitems} \index{byItem() (matplotlib.cbook.Sorter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Sorter.byItem}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{byItem}}}{\emph{data}, \emph{itemindex=None}, \emph{inplace=1}}{}~ \end{fulllineitems} \index{sort() (matplotlib.cbook.Sorter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Sorter.sort}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{sort}}}{\emph{data}, \emph{itemindex=None}, \emph{inplace=1}}{}~ \end{fulllineitems} \end{fulllineitems} \index{Stack (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Stack}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{Stack}}}{\emph{default=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Implement a stack where elements can be pushed on and you can move back and forth. But no pop. Should mimic home / back / forward in a browser \index{back() (matplotlib.cbook.Stack method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Stack.back}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{back}}}{}{} move the position back and return the current element \end{fulllineitems} \index{bubble() (matplotlib.cbook.Stack method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Stack.bubble}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{bubble}}}{\emph{o}}{} raise \sphinxstyleemphasis{o} to the top of the stack and return \sphinxstyleemphasis{o}. \sphinxstyleemphasis{o} must be in the stack \end{fulllineitems} \index{clear() (matplotlib.cbook.Stack method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Stack.clear}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{clear}}}{}{} empty the stack \end{fulllineitems} \index{empty() (matplotlib.cbook.Stack method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Stack.empty}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{empty}}}{}{}~ \end{fulllineitems} \index{forward() (matplotlib.cbook.Stack method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Stack.forward}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{forward}}}{}{} move the position forward and return the current element \end{fulllineitems} \index{home() (matplotlib.cbook.Stack method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Stack.home}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{home}}}{}{} push the first element onto the top of the stack \end{fulllineitems} \index{push() (matplotlib.cbook.Stack method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Stack.push}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{push}}}{\emph{o}}{} push object onto stack at current position - all elements occurring later than the current position are discarded \end{fulllineitems} \index{remove() (matplotlib.cbook.Stack method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Stack.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{\emph{o}}{} remove element \sphinxstyleemphasis{o} from the stack \end{fulllineitems} \end{fulllineitems} \index{Xlator (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Xlator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{Xlator}}}{\emph{**kwargs}}{} Bases: \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#dict}{\sphinxcode{\sphinxupquote{dict}}} \DUrole{versionmodified}{Deprecated since version 2.1: }The Xlator class was deprecated in version 2.1. All-in-one multiple-string-substitution class Example usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{text} \PYG{o}{=} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Larry Wall is the creator of Perl}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{adict} \PYG{o}{=} \PYG{p}{\PYGZob{}} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Larry Wall}\PYG{l+s+s2}{\PYGZdq{}} \PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Guido van Rossum}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{creator}\PYG{l+s+s2}{\PYGZdq{}} \PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Benevolent Dictator for Life}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Perl}\PYG{l+s+s2}{\PYGZdq{}} \PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Python}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{p}{\PYGZcb{}} \PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{multiple\PYGZus{}replace}\PYG{p}{(}\PYG{n}{adict}\PYG{p}{,} \PYG{n}{text}\PYG{p}{)}\PYG{p}{)} \PYG{n}{xlat} \PYG{o}{=} \PYG{n}{Xlator}\PYG{p}{(}\PYG{n}{adict}\PYG{p}{)} \PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{xlat}\PYG{o}{.}\PYG{n}{xlat}\PYG{p}{(}\PYG{n}{text}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \index{xlat() (matplotlib.cbook.Xlator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.Xlator.xlat}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{xlat}}}{\emph{text}}{} Translate \sphinxstyleemphasis{text}, returns the modified text. \end{fulllineitems} \end{fulllineitems} \index{align\_iterators() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.align_iterators}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{align\_iterators}}}{\emph{func}, \emph{*iterables}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The align\_iterators function was deprecated in version 2.2. This generator takes a bunch of iterables that are ordered by func It sends out ordered tuples: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{func}\PYG{p}{(}\PYG{n}{row}\PYG{p}{)}\PYG{p}{,} \PYG{p}{[}\PYG{n}{rows} \PYG{k+kn}{from} \PYG{n+nn}{all} \PYG{n}{iterators} \PYG{n}{matching} \PYG{n}{func}\PYG{p}{(}\PYG{n}{row}\PYG{p}{)}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} It is used by {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.recs_join}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.recs\_join()}}}}} to join record arrays \end{fulllineitems} \index{allequal() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.allequal}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{allequal}}}{\emph{seq}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The allequal function was deprecated in version 2.1. Return \sphinxstyleemphasis{True} if all elements of \sphinxstyleemphasis{seq} compare equal. If \sphinxstyleemphasis{seq} is 0 or 1 length, return \sphinxstyleemphasis{True} \end{fulllineitems} \index{allpairs() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.allpairs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{allpairs}}}{\emph{x}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The allpairs function was deprecated in version 2.1. return all possible pairs in sequence \sphinxstyleemphasis{x} \end{fulllineitems} \index{alltrue() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.alltrue}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{alltrue}}}{\emph{seq}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The alltrue function was deprecated in version 2.1. Return \sphinxstyleemphasis{True} if all elements of \sphinxstyleemphasis{seq} evaluate to \sphinxstyleemphasis{True}. If \sphinxstyleemphasis{seq} is empty, return \sphinxstyleemphasis{False}. \end{fulllineitems} \index{boxplot\_stats() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.boxplot_stats}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{boxplot\_stats}}}{\emph{X}, \emph{whis=1.5}, \emph{bootstrap=None}, \emph{labels=None}, \emph{autorange=False}}{} Returns list of dictionaries of statistics used to draw a series of box and whisker plots. The \sphinxcode{\sphinxupquote{Returns}} section enumerates the required keys of the dictionary. Users can skip this function and pass a user-defined set of dictionaries to the new \sphinxcode{\sphinxupquote{axes.bxp}} method instead of relying on MPL to do the calculations. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{X}}] \leavevmode{[}array-like{]} Data that will be represented in the boxplots. Should have 2 or fewer dimensions. \item[{\sphinxstylestrong{whis}}] \leavevmode{[}float, string, or sequence (default = 1.5){]} As a float, determines the reach of the whiskers to the beyond the first and third quartiles. In other words, where IQR is the interquartile range (\sphinxcode{\sphinxupquote{Q3-Q1}}), the upper whisker will extend to last datum less than \sphinxcode{\sphinxupquote{Q3 + whis*IQR}}). Similarly, the lower whisker will extend to the first datum greater than \sphinxcode{\sphinxupquote{Q1 - whis*IQR}}. Beyond the whiskers, data are considered outliers and are plotted as individual points. This can be set this to an ascending sequence of percentile (e.g., {[}5, 95{]}) to set the whiskers at specific percentiles of the data. Finally, \sphinxcode{\sphinxupquote{whis}} can be the string \sphinxcode{\sphinxupquote{'range'}} to force the whiskers to the minimum and maximum of the data. In the edge case that the 25th and 75th percentiles are equivalent, \sphinxcode{\sphinxupquote{whis}} can be automatically set to \sphinxcode{\sphinxupquote{'range'}} via the \sphinxcode{\sphinxupquote{autorange}} option. \item[{\sphinxstylestrong{bootstrap}}] \leavevmode{[}int, optional{]} Number of times the confidence intervals around the median should be bootstrapped (percentile method). \item[{\sphinxstylestrong{labels}}] \leavevmode{[}array-like, optional{]} Labels for each dataset. Length must be compatible with dimensions of \sphinxcode{\sphinxupquote{X}}. \item[{\sphinxstylestrong{autorange}}] \leavevmode{[}bool, optional (False){]} When \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} and the data are distributed such that the 25th and 75th percentiles are equal, \sphinxcode{\sphinxupquote{whis}} is set to \sphinxcode{\sphinxupquote{'range'}} such that the whisker ends are at the minimum and maximum of the data. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{bxpstats}}] \leavevmode{[}list of dict{]} A list of dictionaries containing the results for each column of data. Keys of each dictionary are the following: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Key &\sphinxstyletheadfamily Value Description \\ \hline label & tick label for the boxplot \\ \hline mean & arithemetic mean value \\ \hline med & 50th percentile \\ \hline q1 & first quartile (25th percentile) \\ \hline q3 & third quartile (75th percentile) \\ \hline cilo & lower notch around the median \\ \hline cihi & upper notch around the median \\ \hline whislo & end of the lower whisker \\ \hline whishi & end of the upper whisker \\ \hline fliers & outliers \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{description} \end{description}\end{quote} \paragraph{Notes} Non-bootstrapping approach to confidence interval uses Gaussian- based asymptotic approximation: \begin{equation}\mathrm{med} \pm 1.57 \times \frac{\mathrm{iqr}}{\sqrt{N}}\end{equation} General approach from: McGill, R., Tukey, J.W., and Larsen, W.A. (1978) “Variations of Boxplots”, The American Statistician, 32:12-16. \end{fulllineitems} \index{contiguous\_regions() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.contiguous_regions}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{contiguous\_regions}}}{\emph{mask}}{} Return a list of (ind0, ind1) such that mask{[}ind0:ind1{]}.all() is True and we cover all such regions \end{fulllineitems} \index{converter (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.converter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{converter}}}{\emph{**kwargs}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} \DUrole{versionmodified}{Deprecated since version 2.1: }The converter class was deprecated in version 2.1. Base class for handling string -\textgreater{} python type with support for missing values \index{is\_missing() (matplotlib.cbook.converter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.converter.is_missing}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_missing}}}{\emph{s}}{}~ \end{fulllineitems} \end{fulllineitems} \index{dedent() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.dedent}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{dedent}}}{\emph{s}}{} Remove excess indentation from docstring \sphinxstyleemphasis{s}. Discards any leading blank lines, then removes up to n whitespace characters from each line, where n is the number of leading whitespace characters in the first line. It differs from textwrap.dedent in its deletion of leading blank lines and its use of the first non-blank line to determine the indentation. It is also faster in most cases. \end{fulllineitems} \index{delete\_masked\_points() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.delete_masked_points}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{delete\_masked\_points}}}{\emph{*args}}{} Find all masked and/or non-finite points in a set of arguments, and return the arguments with only the unmasked points remaining. Arguments can be in any of 5 categories: \begin{enumerate} \item {} 1-D masked arrays \item {} 1-D ndarrays \item {} ndarrays with more than one dimension \item {} other non-string iterables \item {} anything else \end{enumerate} The first argument must be in one of the first four categories; any argument with a length differing from that of the first argument (and hence anything in category 5) then will be passed through unchanged. Masks are obtained from all arguments of the correct length in categories 1, 2, and 4; a point is bad if masked in a masked array or if it is a nan or inf. No attempt is made to extract a mask from categories 2, 3, and 4 if \sphinxcode{\sphinxupquote{np.isfinite()}} does not yield a Boolean array. All input arguments that are not passed unchanged are returned as ndarrays after removing the points or rows corresponding to masks in any of the arguments. A vastly simpler version of this function was originally written as a helper for Axes.scatter(). \end{fulllineitems} \index{dict\_delall() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.dict_delall}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{dict\_delall}}}{\emph{d}, \emph{keys}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The dict\_delall function was deprecated in version 2.1. delete all of the \sphinxstyleemphasis{keys} from the \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#dict}{\sphinxcode{\sphinxupquote{dict}}} \sphinxstyleemphasis{d} \end{fulllineitems} \index{exception\_to\_str() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.exception_to_str}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{exception\_to\_str}}}{\emph{s=None}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The exception\_to\_str function was deprecated in version 2.1. \end{fulllineitems} \index{file\_requires\_unicode() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.file_requires_unicode}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{file\_requires\_unicode}}}{\emph{x}}{} Returns \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} if the given writable file-like object requires Unicode to be written to it. \end{fulllineitems} \index{finddir() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.finddir}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{finddir}}}{\emph{o}, \emph{match}, \emph{case=False}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The finddir function was deprecated in version 2.1. return all attributes of \sphinxstyleemphasis{o} which match string in match. if case is True require an exact case match. \end{fulllineitems} \index{flatten() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.flatten}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{flatten}}}{\emph{seq}, \emph{scalarp=\textless{}function is\_scalar\_or\_string\textgreater{}}}{} Returns a generator of flattened nested containers For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{cbook} \PYG{k}{import} \PYG{n}{flatten} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{l} \PYG{o}{=} \PYG{p}{(}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{John}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Hunter}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{23}\PYG{p}{)}\PYG{p}{,} \PYG{p}{[}\PYG{p}{[}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{42}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{23}\PYG{p}{)}\PYG{p}{]}\PYG{p}{,} \PYG{p}{)}\PYG{p}{]}\PYG{p}{]}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{n+nb}{list}\PYG{p}{(}\PYG{n}{flatten}\PYG{p}{(}\PYG{n}{l}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{[\PYGZsq{}John\PYGZsq{}, \PYGZsq{}Hunter\PYGZsq{}, 1, 23, 42, 5, 23]} \end{sphinxVerbatim} By: Composite of Holger Krekel and Luther Blissett From: \sphinxurl{https://code.activestate.com/recipes/121294/} and Recipe 1.12 in cookbook \end{fulllineitems} \index{get\_label() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.get_label}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{get\_label}}}{\emph{y}, \emph{default\_name}}{}~ \end{fulllineitems} \index{get\_recursive\_filelist() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.get_recursive_filelist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{get\_recursive\_filelist}}}{\emph{args}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The get\_recursive\_filelist function was deprecated in version 2.1. Recurse all the files and dirs in \sphinxstyleemphasis{args} ignoring symbolic links and return the files as a list of strings \end{fulllineitems} \index{get\_sample\_data() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.get_sample_data}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{get\_sample\_data}}}{\emph{fname}, \emph{asfileobj=True}}{} Return a sample data file. \sphinxstyleemphasis{fname} is a path relative to the \sphinxcode{\sphinxupquote{mpl-data/sample\_data}} directory. If \sphinxstyleemphasis{asfileobj} is \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} return a file object, otherwise just a file path. Set the rc parameter examples.directory to the directory where we should look, if sample\_data files are stored in a location different than default (which is ‘mpl-data/sample\_data{}` at the same level of ‘matplotlib{}` Python module files). If the filename ends in .gz, the file is implicitly ungzipped. \end{fulllineitems} \index{get\_split\_ind() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.get_split_ind}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{get\_split\_ind}}}{\emph{seq}, \emph{N}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The get\_split\_ind function was deprecated in version 2.1. \sphinxstyleemphasis{seq} is a list of words. Return the index into seq such that: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n+nb}{len}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ }\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{.}\PYG{n}{join}\PYG{p}{(}\PYG{n}{seq}\PYG{p}{[}\PYG{p}{:}\PYG{n}{ind}\PYG{p}{]}\PYG{p}{)}\PYG{o}{\PYGZlt{}}\PYG{o}{=}\PYG{n}{N} \end{sphinxVerbatim} . \end{fulllineitems} \index{index\_of() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.index_of}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{index\_of}}}{\emph{y}}{} A helper function to get the index of an input to plot against if x values are not explicitly given. Tries to get \sphinxcode{\sphinxupquote{y.index}} (works if this is a pd.Series), if that fails, return np.arange(y.shape{[}0{]}). This will be extended in the future to deal with more types of labeled data. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar or array-like{]} The proposed y-value \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}ndarray{]} The x and y values to plot. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{is\_hashable() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.is_hashable}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{is\_hashable}}}{\emph{obj}}{} Returns true if \sphinxstyleemphasis{obj} can be hashed \end{fulllineitems} \index{is\_math\_text() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.is_math_text}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{is\_math\_text}}}{\emph{s}}{}~ \end{fulllineitems} \index{is\_numlike() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.is_numlike}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{is\_numlike}}}{\emph{obj}}{} return true if \sphinxstyleemphasis{obj} looks like a number \end{fulllineitems} \index{is\_scalar() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.is_scalar}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{is\_scalar}}}{\emph{obj}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The is\_scalar function was deprecated in version 2.1. return true if \sphinxstyleemphasis{obj} is not string like and is not iterable \end{fulllineitems} \index{is\_scalar\_or\_string() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.is_scalar_or_string}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{is\_scalar\_or\_string}}}{\emph{val}}{} Return whether the given object is a scalar or string like. \end{fulllineitems} \index{is\_sequence\_of\_strings() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.is_sequence_of_strings}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{is\_sequence\_of\_strings}}}{\emph{obj}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The is\_sequence\_of\_strings function was deprecated in version 2.1. Returns true if \sphinxstyleemphasis{obj} is iterable and contains strings \end{fulllineitems} \index{is\_string\_like() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.is_string_like}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{is\_string\_like}}}{\emph{obj}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The is\_string\_like function was deprecated in version 2.1. Return True if \sphinxstyleemphasis{obj} looks like a string \end{fulllineitems} \index{is\_writable\_file\_like() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.is_writable_file_like}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{is\_writable\_file\_like}}}{\emph{obj}}{} return true if \sphinxstyleemphasis{obj} looks like a file object with a \sphinxstyleemphasis{write} method \end{fulllineitems} \index{issubclass\_safe() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.issubclass_safe}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{issubclass\_safe}}}{\emph{x}, \emph{klass}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The issubclass\_safe function was deprecated in version 2.1. return issubclass(x, klass) and return False on a TypeError \end{fulllineitems} \index{iterable() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.iterable}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{iterable}}}{\emph{obj}}{} return true if \sphinxstyleemphasis{obj} is iterable \end{fulllineitems} \index{listFiles() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.listFiles}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{listFiles}}}{\emph{root}, \emph{patterns='*'}, \emph{recurse=1}, \emph{return\_folders=0}}{} Recursively list files from Parmar and Martelli in the Python Cookbook \end{fulllineitems} \index{local\_over\_kwdict() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.local_over_kwdict}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{local\_over\_kwdict}}}{\emph{local\_var}, \emph{kwargs}, \emph{*keys}}{} Enforces the priority of a local variable over potentially conflicting argument(s) from a kwargs dict. The following possible output values are considered in order of priority: \begin{quote} local\_var \textgreater{} kwargs{[}keys{[}0{]}{]} \textgreater{} … \textgreater{} kwargs{[}keys{[}-1{]}{]} \end{quote} The first of these whose value is not None will be returned. If all are None then None will be returned. Each key in keys will be removed from the kwargs dict in place. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{local\_var: any object}}] \leavevmode\begin{quote} The local variable (highest priority) \end{quote} \begin{description} \item[{kwargs: dict}] \leavevmode Dictionary of keyword arguments; modified in place \item[{keys: str(s)}] \leavevmode Name(s) of keyword arguments to process, in descending order of priority \end{description} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{out: any object}}] \leavevmode Either local\_var or one of kwargs{[}key{]} for key in keys \end{description} \item[{Raises}] \leavevmode\begin{description} \item[{\sphinxstylestrong{IgnoredKeywordWarning}}] \leavevmode For each key in keys that is removed from kwargs but not used as the output value \end{description} \end{description}\end{quote} \end{fulllineitems} \index{maxdict (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.maxdict}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{maxdict}}}{\emph{maxsize}}{} Bases: \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#dict}{\sphinxcode{\sphinxupquote{dict}}} A dictionary with a maximum size; this doesn’t override all the relevant methods to constrain the size, just setitem, so use with caution \end{fulllineitems} \index{mkdirs() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.mkdirs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{mkdirs}}}{\emph{newdir}, \emph{mode=511}}{} make directory \sphinxstyleemphasis{newdir} recursively, and set \sphinxstyleemphasis{mode}. Equivalent to \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{\PYGZgt{}} \PYG{n}{mkdir} \PYG{o}{\PYGZhy{}}\PYG{n}{p} \PYG{n}{NEWDIR} \PYG{o}{\PYGZgt{}} \PYG{n}{chmod} \PYG{n}{MODE} \PYG{n}{NEWDIR} \end{sphinxVerbatim} \end{fulllineitems} \index{normalize\_kwargs() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.normalize_kwargs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{normalize\_kwargs}}}{\emph{kw}, \emph{alias\_mapping=None}, \emph{required=()}, \emph{forbidden=()}, \emph{allowed=None}}{} Helper function to normalize kwarg inputs The order they are resolved are: \begin{enumerate} \item {} aliasing \item {} required \item {} forbidden \item {} allowed \end{enumerate} This order means that only the canonical names need appear in \sphinxcode{\sphinxupquote{allowed}}, \sphinxcode{\sphinxupquote{forbidden}}, \sphinxcode{\sphinxupquote{required}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{alias\_mapping, dict, optional}}] \leavevmode A mapping between a canonical name to a list of aliases, in order of precedence from lowest to highest. If the canonical value is not in the list it is assumed to have the highest priority. \item[{\sphinxstylestrong{required}}] \leavevmode{[}iterable, optional{]} A tuple of fields that must be in kwargs. \item[{\sphinxstylestrong{forbidden}}] \leavevmode{[}iterable, optional{]} A list of keys which may not be in kwargs \item[{\sphinxstylestrong{allowed}}] \leavevmode{[}tuple, optional{]} A tuple of allowed fields. If this not None, then raise if \sphinxcode{\sphinxupquote{kw}} contains any keys not in the union of \sphinxcode{\sphinxupquote{required}} and \sphinxcode{\sphinxupquote{allowed}}. To allow only the required fields pass in \sphinxcode{\sphinxupquote{()}} for \sphinxcode{\sphinxupquote{allowed}} \end{description} \item[{Raises}] \leavevmode\begin{description} \item[{\sphinxstylestrong{TypeError}}] \leavevmode To match what python raises if invalid args/kwargs are passed to a callable. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{onetrue() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.onetrue}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{onetrue}}}{\emph{seq}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The onetrue function was deprecated in version 2.1. Return \sphinxstyleemphasis{True} if one element of \sphinxstyleemphasis{seq} is \sphinxstyleemphasis{True}. It \sphinxstyleemphasis{seq} is empty, return \sphinxstyleemphasis{False}. \end{fulllineitems} \index{open\_file\_cm() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.open_file_cm}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{open\_file\_cm}}}{\emph{path\_or\_file}, \emph{mode='r'}, \emph{encoding=None}}{} Pass through file objects and context-manage \sphinxcode{\sphinxupquote{PathLike}}s. \end{fulllineitems} \index{pieces() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.pieces}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{pieces}}}{\emph{seq}, \emph{num=2}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The pieces function was deprecated in version 2.1. Break up the \sphinxstyleemphasis{seq} into \sphinxstyleemphasis{num} tuples \end{fulllineitems} \index{print\_cycles() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.print_cycles}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{print\_cycles}}}{\emph{objects}, \emph{outstream=\textless{}\_io.TextIOWrapper name='\textless{}stdout\textgreater{}' mode='w' encoding='UTF-8'\textgreater{}}, \emph{show\_progress=False}}{}~\begin{description} \item[{\sphinxstyleemphasis{objects}}] \leavevmode A list of objects to find cycles in. It is often useful to pass in gc.garbage to find the cycles that are preventing some objects from being garbage collected. \item[{\sphinxstyleemphasis{outstream}}] \leavevmode The stream for output. \item[{\sphinxstyleemphasis{show\_progress}}] \leavevmode If True, print the number of objects reached as they are found. \end{description} \end{fulllineitems} \index{pts\_to\_midstep() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.pts_to_midstep}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{pts\_to\_midstep}}}{\emph{x}, \emph{*args}}{} Convert continuous line to mid-steps. Given a set of \sphinxcode{\sphinxupquote{N}} points convert to \sphinxcode{\sphinxupquote{2N}} points which when connected linearly give a step function which changes values at the middle of the intervals. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}array{]} The x location of the steps. May be empty. \item[{\sphinxstylestrong{y1, …, yp}}] \leavevmode{[}array{]} y arrays to be turned into steps; all must be the same length as \sphinxcode{\sphinxupquote{x}}. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{out}}] \leavevmode{[}array{]} The x and y values converted to steps in the same order as the input; can be unpacked as \sphinxcode{\sphinxupquote{x\_out, y1\_out, ..., yp\_out}}. If the input is length \sphinxcode{\sphinxupquote{N}}, each of these arrays will be length \sphinxcode{\sphinxupquote{2N}}. \end{description} \end{description}\end{quote} \paragraph{Examples} \textgreater{}\textgreater{} x\_s, y1\_s, y2\_s = pts\_to\_midstep(x, y1, y2) \end{fulllineitems} \index{pts\_to\_poststep() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.pts_to_poststep}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{pts\_to\_poststep}}}{\emph{x}, \emph{*args}}{} Convert continuous line to post-steps. Given a set of \sphinxcode{\sphinxupquote{N}} points convert to \sphinxcode{\sphinxupquote{2N + 1}} points, which when connected linearly give a step function which changes values at the end of the intervals. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}array{]} The x location of the steps. May be empty. \item[{\sphinxstylestrong{y1, …, yp}}] \leavevmode{[}array{]} y arrays to be turned into steps; all must be the same length as \sphinxcode{\sphinxupquote{x}}. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{out}}] \leavevmode{[}array{]} The x and y values converted to steps in the same order as the input; can be unpacked as \sphinxcode{\sphinxupquote{x\_out, y1\_out, ..., yp\_out}}. If the input is length \sphinxcode{\sphinxupquote{N}}, each of these arrays will be length \sphinxcode{\sphinxupquote{2N + 1}}. For \sphinxcode{\sphinxupquote{N=0}}, the length will be 0. \end{description} \end{description}\end{quote} \paragraph{Examples} \textgreater{}\textgreater{} x\_s, y1\_s, y2\_s = pts\_to\_poststep(x, y1, y2) \end{fulllineitems} \index{pts\_to\_prestep() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.pts_to_prestep}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{pts\_to\_prestep}}}{\emph{x}, \emph{*args}}{} Convert continuous line to pre-steps. Given a set of \sphinxcode{\sphinxupquote{N}} points, convert to \sphinxcode{\sphinxupquote{2N - 1}} points, which when connected linearly give a step function which changes values at the beginning of the intervals. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}array{]} The x location of the steps. May be empty. \item[{\sphinxstylestrong{y1, …, yp}}] \leavevmode{[}array{]} y arrays to be turned into steps; all must be the same length as \sphinxcode{\sphinxupquote{x}}. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{out}}] \leavevmode{[}array{]} The x and y values converted to steps in the same order as the input; can be unpacked as \sphinxcode{\sphinxupquote{x\_out, y1\_out, ..., yp\_out}}. If the input is length \sphinxcode{\sphinxupquote{N}}, each of these arrays will be length \sphinxcode{\sphinxupquote{2N + 1}}. For \sphinxcode{\sphinxupquote{N=0}}, the length will be 0. \end{description} \end{description}\end{quote} \paragraph{Examples} \textgreater{}\textgreater{} x\_s, y1\_s, y2\_s = pts\_to\_prestep(x, y1, y2) \end{fulllineitems} \index{recursive\_remove() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.recursive_remove}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{recursive\_remove}}}{\emph{path}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The recursive\_remove function was deprecated in version 2.1. Use shutil.rmtree instead. \end{fulllineitems} \index{report\_memory() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.report_memory}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{report\_memory}}}{\emph{i=0}}{} return the memory consumed by process \end{fulllineitems} \index{restrict\_dict() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.restrict_dict}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{restrict\_dict}}}{\emph{d}, \emph{keys}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The restrict\_dict function was deprecated in version 2.1. Return a dictionary that contains those keys that appear in both d and keys, with values from d. \end{fulllineitems} \index{reverse\_dict() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.reverse_dict}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{reverse\_dict}}}{\emph{d}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The reverse\_dict function was deprecated in version 2.1. reverse the dictionary \textendash{} may lose data if values are not unique! \end{fulllineitems} \index{safe\_first\_element() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.safe_first_element}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{safe\_first\_element}}}{\emph{obj}}{}~ \end{fulllineitems} \index{safe\_masked\_invalid() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.safe_masked_invalid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{safe\_masked\_invalid}}}{\emph{x}, \emph{copy=False}}{}~ \end{fulllineitems} \index{safezip() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.safezip}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{safezip}}}{\emph{*args}}{} make sure \sphinxstyleemphasis{args} are equal len before zipping \end{fulllineitems} \index{sanitize\_sequence() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.sanitize_sequence}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{sanitize\_sequence}}}{\emph{data}}{} Converts dictview object to list \end{fulllineitems} \index{silent\_list (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.silent_list}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{silent\_list}}}{\emph{type}, \emph{seq=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#list}{\sphinxcode{\sphinxupquote{list}}} override repr when returning a list of matplotlib artists to prevent long, meaningless output. This is meant to be used for a homogeneous list of a given type \end{fulllineitems} \index{simple\_linear\_interpolation() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.simple_linear_interpolation}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{simple\_linear\_interpolation}}}{\emph{a}, \emph{steps}}{} Resample an array with \sphinxcode{\sphinxupquote{steps - 1}} points between original point pairs. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{a}}] \leavevmode{[}array, shape (n, …){]} \item[{\sphinxstylestrong{steps}}] \leavevmode{[}int{]} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{array, shape {}`{}`((n - 1) * steps + 1, …){}`{}`}}] \leavevmode \item[{\sphinxstylestrong{Along each column of *a*, {}`{}`(steps - 1){}`{}` points are introduced between}}] \leavevmode \item[{\sphinxstylestrong{each original values; the values are linearly interpolated.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{soundex() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.soundex}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{soundex}}}{\emph{name}, \emph{len=4}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The soundex function was deprecated in version 2.1. soundex module conforming to Odell-Russell algorithm \end{fulllineitems} \index{strip\_math() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.strip_math}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{strip\_math}}}{\emph{s}}{} remove latex formatting from mathtext \end{fulllineitems} \index{to\_filehandle() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.to_filehandle}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{to\_filehandle}}}{\emph{fname}, \emph{flag='rU'}, \emph{return\_opened=False}, \emph{encoding=None}}{} \sphinxstyleemphasis{fname} can be an \sphinxhref{https://docs.python.org/3/library/os.html\#os.PathLike}{\sphinxcode{\sphinxupquote{os.PathLike}}} or a file handle. Support for gzipped files is automatic, if the filename ends in .gz. \sphinxstyleemphasis{flag} is a read/write flag for \sphinxcode{\sphinxupquote{file()}} \end{fulllineitems} \index{todate (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.todate}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{todate}}}{\emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.converter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cbook.converter}}}}} \DUrole{versionmodified}{Deprecated since version 2.1: }The todate class was deprecated in version 2.1. convert to a date or None \end{fulllineitems} \index{todatetime (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.todatetime}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{todatetime}}}{\emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.converter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cbook.converter}}}}} \DUrole{versionmodified}{Deprecated since version 2.1: }The todatetime class was deprecated in version 2.1. convert to a datetime or None \end{fulllineitems} \index{tofloat (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.tofloat}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{tofloat}}}{\emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.converter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cbook.converter}}}}} \DUrole{versionmodified}{Deprecated since version 2.1: }The tofloat class was deprecated in version 2.1. convert to a float or None \end{fulllineitems} \index{toint (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.toint}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{toint}}}{\emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.converter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cbook.converter}}}}} \DUrole{versionmodified}{Deprecated since version 2.1: }The toint class was deprecated in version 2.1. convert to an int or None \end{fulllineitems} \index{tostr (class in matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.tostr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{tostr}}}{\emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.converter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cbook.converter}}}}} \DUrole{versionmodified}{Deprecated since version 2.1: }The tostr class was deprecated in version 2.1. convert to string or None \end{fulllineitems} \index{unicode\_safe() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.unicode_safe}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{unicode\_safe}}}{\emph{s}}{}~ \end{fulllineitems} \index{unique() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.unique}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{unique}}}{\emph{x}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The unique function was deprecated in version 2.1. Return a list of unique elements of \sphinxstyleemphasis{x} \end{fulllineitems} \index{unmasked\_index\_ranges() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.unmasked_index_ranges}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{unmasked\_index\_ranges}}}{\emph{mask}, \emph{compressed=True}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The unmasked\_index\_ranges function was deprecated in version 2.1. Find index ranges where \sphinxstyleemphasis{mask} is \sphinxstyleemphasis{False}. \sphinxstyleemphasis{mask} will be flattened if it is not already 1-D. Returns Nx2 \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html\#numpy.ndarray}{\sphinxcode{\sphinxupquote{numpy.ndarray}}} with each row the start and stop indices for slices of the compressed \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html\#numpy.ndarray}{\sphinxcode{\sphinxupquote{numpy.ndarray}}} corresponding to each of \sphinxstyleemphasis{N} uninterrupted runs of unmasked values. If optional argument \sphinxstyleemphasis{compressed} is \sphinxstyleemphasis{False}, it returns the start and stop indices into the original \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html\#numpy.ndarray}{\sphinxcode{\sphinxupquote{numpy.ndarray}}}, not the compressed \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html\#numpy.ndarray}{\sphinxcode{\sphinxupquote{numpy.ndarray}}}. Returns \sphinxstyleemphasis{None} if there are no unmasked values. Example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{y} \PYG{o}{=} \PYG{n}{ma}\PYG{o}{.}\PYG{n}{array}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{mask} \PYG{o}{=} \PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ii} \PYG{o}{=} \PYG{n}{unmasked\PYGZus{}index\PYGZus{}ranges}\PYG{p}{(}\PYG{n}{ma}\PYG{o}{.}\PYG{n}{getmaskarray}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} returns array [[0,2,] [2,4,]]} \PYG{n}{y}\PYG{o}{.}\PYG{n}{compressed}\PYG{p}{(}\PYG{p}{)}\PYG{p}{[}\PYG{n}{ii}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{:}\PYG{n}{ii}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{]} \PYG{c+c1}{\PYGZsh{} returns array [3,4,]} \PYG{n}{ii} \PYG{o}{=} \PYG{n}{unmasked\PYGZus{}index\PYGZus{}ranges}\PYG{p}{(}\PYG{n}{ma}\PYG{o}{.}\PYG{n}{getmaskarray}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)}\PYG{p}{,} \PYG{n}{compressed}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} returns array [[0, 2], [3, 5]]} \PYG{n}{y}\PYG{o}{.}\PYG{n}{filled}\PYG{p}{(}\PYG{p}{)}\PYG{p}{[}\PYG{n}{ii}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{:}\PYG{n}{ii}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{]} \PYG{c+c1}{\PYGZsh{} returns array [3,4,]} \end{sphinxVerbatim} Prior to the transforms refactoring, this was used to support masked arrays in Line2D. \end{fulllineitems} \index{violin\_stats() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.violin_stats}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{violin\_stats}}}{\emph{X}, \emph{method}, \emph{points=100}}{} Returns a list of dictionaries of data which can be used to draw a series of violin plots. See the \sphinxcode{\sphinxupquote{Returns}} section below to view the required keys of the dictionary. Users can skip this function and pass a user-defined set of dictionaries to the \sphinxcode{\sphinxupquote{axes.vplot}} method instead of using MPL to do the calculations. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{X}}] \leavevmode{[}array-like{]} Sample data that will be used to produce the gaussian kernel density estimates. Must have 2 or fewer dimensions. \item[{\sphinxstylestrong{method}}] \leavevmode{[}callable{]} The method used to calculate the kernel density estimate for each column of data. When called via \sphinxcode{\sphinxupquote{method(v, coords)}}, it should return a vector of the values of the KDE evaluated at the values specified in coords. \item[{\sphinxstylestrong{points}}] \leavevmode{[}scalar, default = 100{]} Defines the number of points to evaluate each of the gaussian kernel density estimates at. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A list of dictionaries containing the results for each column of data.}}] \leavevmode \item[{\sphinxstylestrong{The dictionaries contain at least the following:}}] \leavevmode\begin{itemize} \item {} coords: A list of scalars containing the coordinates this particular kernel density estimate was evaluated at. \item {} vals: A list of scalars containing the values of the kernel density estimate at each of the coordinates given in \sphinxcode{\sphinxupquote{coords}}. \item {} mean: The mean value for this column of data. \item {} median: The median value for this column of data. \item {} min: The minimum value for this column of data. \item {} max: The maximum value for this column of data. \end{itemize} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{wrap() (in module matplotlib.cbook)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cbook_api:matplotlib.cbook.wrap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cbook.}}\sphinxbfcode{\sphinxupquote{wrap}}}{\emph{prefix}, \emph{text}, \emph{cols}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The wrap function was deprecated in version 2.1. Use textwrap.TextWrapper instead. wrap \sphinxstyleemphasis{text} with \sphinxstyleemphasis{prefix} at length \sphinxstyleemphasis{cols} \end{fulllineitems} \chapter{cm (colormap)} \label{\detokenize{api/cm_api:cm-colormap}}\label{\detokenize{api/cm_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.cm}}} \label{\detokenize{api/cm_api:module-matplotlib.cm}}\label{\detokenize{api/cm_api:matplotlib-cm}}\index{matplotlib.cm (module)} Builtin colormaps, colormap handling utilities, and the {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarMappable}}}}} mixin. See \DUrole{xref,std,std-doc}{/gallery/color/colormap\_reference} for a list of builtin colormaps. See {\hyperref[\detokenize{tutorials/colors/colormaps::doc}]{\sphinxcrossref{\DUrole{doc}{Colormaps in Matplotlib}}}} for an in-depth discussion of colormaps. \index{ScalarMappable (class in matplotlib.cm)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.cm.}}\sphinxbfcode{\sphinxupquote{ScalarMappable}}}{\emph{norm=None}, \emph{cmap=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} This is a mixin class to support scalar data to RGBA mapping. The ScalarMappable makes use of data normalization before returning RGBA colors from the given colormap. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance{]} The normalizing object which scales data, typically into the interval \sphinxcode{\sphinxupquote{{[}0, 1{]}}}. If \sphinxstyleemphasis{None}, \sphinxstyleemphasis{norm} defaults to a \sphinxstyleemphasis{colors.Normalize} object which initializes its scaling based on the first data processed. \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}str or {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}} instance{]} The colormap used to map normalized data values to RGBA colors. \end{description} \end{description}\end{quote} \index{add\_checker() (matplotlib.cm.ScalarMappable method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.add_checker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_checker}}}{\emph{checker}}{} Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed. \end{fulllineitems} \index{autoscale() (matplotlib.cm.ScalarMappable method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Autoscale the scalar limits on the norm instance using the current array \end{fulllineitems} \index{autoscale\_None() (matplotlib.cm.ScalarMappable method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{}{} Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None \end{fulllineitems} \index{changed() (matplotlib.cm.ScalarMappable method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{changed}}}{}{} Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal \end{fulllineitems} \index{check\_update() (matplotlib.cm.ScalarMappable method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.check_update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{check\_update}}}{\emph{checker}}{} If mappable has changed since the last check, return True; else return False \end{fulllineitems} \index{cmap (matplotlib.cm.ScalarMappable attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.cmap}}\pysigline{\sphinxbfcode{\sphinxupquote{cmap}}\sphinxbfcode{\sphinxupquote{ = None}}} The Colormap instance of this ScalarMappable. \end{fulllineitems} \index{colorbar (matplotlib.cm.ScalarMappable attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.colorbar}}\pysigline{\sphinxbfcode{\sphinxupquote{colorbar}}\sphinxbfcode{\sphinxupquote{ = None}}} The last colorbar associated with this ScalarMappable. May be None. \end{fulllineitems} \index{get\_array() (matplotlib.cm.ScalarMappable method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.get_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_array}}}{}{} Return the array \end{fulllineitems} \index{get\_clim() (matplotlib.cm.ScalarMappable method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.get_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clim}}}{}{} return the min, max of the color limits for image scaling \end{fulllineitems} \index{get\_cmap() (matplotlib.cm.ScalarMappable method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.get_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cmap}}}{}{} return the colormap \end{fulllineitems} \index{norm (matplotlib.cm.ScalarMappable attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.norm}}\pysigline{\sphinxbfcode{\sphinxupquote{norm}}\sphinxbfcode{\sphinxupquote{ = None}}} The Normalization instance of this ScalarMappable. \end{fulllineitems} \index{set\_array() (matplotlib.cm.ScalarMappable method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_array}}}{\emph{A}}{} Set the image array from numpy array \sphinxstyleemphasis{A}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A}}] \leavevmode{[}ndarray{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clim() (matplotlib.cm.ScalarMappable method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clim}}}{\emph{vmin=None}, \emph{vmax=None}}{} set the norm limits for image scaling; if \sphinxstyleemphasis{vmin} is a length2 sequence, interpret it as \sphinxcode{\sphinxupquote{(vmin, vmax)}} which is used to support setp ACCEPTS: a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \end{fulllineitems} \index{set\_cmap() (matplotlib.cm.ScalarMappable method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cmap}}}{\emph{cmap}}{} set the colormap for luminance data ACCEPTS: a colormap or registered colormap name \end{fulllineitems} \index{set\_norm() (matplotlib.cm.ScalarMappable method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_norm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_norm}}}{\emph{norm}}{} Set the normalization instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{to\_rgba() (matplotlib.cm.ScalarMappable method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.to_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_rgba}}}{\emph{x}, \emph{alpha=None}, \emph{bytes=False}, \emph{norm=True}}{} Return a normalized rgba array corresponding to \sphinxstyleemphasis{x}. In the normal case, \sphinxstyleemphasis{x} is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable. There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If \sphinxstyleemphasis{x} is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the \sphinxstyleemphasis{alpha} kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the \sphinxstyleemphasis{alpha} kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4. In either case, if \sphinxstyleemphasis{bytes} is \sphinxstyleemphasis{False} (default), the rgba array will be floats in the 0-1 range; if it is \sphinxstyleemphasis{True}, the returned rgba array will be uint8 in the 0 to 255 range. If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1). \end{fulllineitems} \end{fulllineitems} \index{get\_cmap() (in module matplotlib.cm)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.get_cmap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cm.}}\sphinxbfcode{\sphinxupquote{get\_cmap}}}{\emph{name=None}, \emph{lut=None}}{} Get a colormap instance, defaulting to rc values if \sphinxstyleemphasis{name} is None. Colormaps added with {\hyperref[\detokenize{api/cm_api:matplotlib.cm.register_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{register\_cmap()}}}}} take precedence over built-in colormaps. If \sphinxstyleemphasis{name} is a {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap}}}}} instance, it will be returned. If \sphinxstyleemphasis{lut} is not None it must be an integer giving the number of entries desired in the lookup table, and \sphinxstyleemphasis{name} must be a standard mpl colormap name. \end{fulllineitems} \index{register\_cmap() (in module matplotlib.cm)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.register_cmap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cm.}}\sphinxbfcode{\sphinxupquote{register\_cmap}}}{\emph{name=None}, \emph{cmap=None}, \emph{data=None}, \emph{lut=None}}{} Add a colormap to the set recognized by {\hyperref[\detokenize{api/cm_api:matplotlib.cm.get_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_cmap()}}}}}. It can be used in two ways: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{register\PYGZus{}cmap}\PYG{p}{(}\PYG{n}{name}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{swirly}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{n}{swirly\PYGZus{}cmap}\PYG{p}{)} \PYG{n}{register\PYGZus{}cmap}\PYG{p}{(}\PYG{n}{name}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{choppy}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{data}\PYG{o}{=}\PYG{n}{choppydata}\PYG{p}{,} \PYG{n}{lut}\PYG{o}{=}\PYG{l+m+mi}{128}\PYG{p}{)} \end{sphinxVerbatim} In the first case, \sphinxstyleemphasis{cmap} must be a {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap}}}}} instance. The \sphinxstyleemphasis{name} is optional; if absent, the name will be the \sphinxcode{\sphinxupquote{name}} attribute of the \sphinxstyleemphasis{cmap}. In the second case, the three arguments are passed to the {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.LinearSegmentedColormap:matplotlib.colors.LinearSegmentedColormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LinearSegmentedColormap}}}}} initializer, and the resulting colormap is registered. \end{fulllineitems} \index{revcmap() (in module matplotlib.cm)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/cm_api:matplotlib.cm.revcmap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.cm.}}\sphinxbfcode{\sphinxupquote{revcmap}}}{\emph{data}}{} Can only handle specification \sphinxstyleemphasis{data} in dictionary format. \end{fulllineitems} \chapter{collections} \label{\detokenize{api/collections_api:collections}}\label{\detokenize{api/collections_api::doc}} \sphinxincludegraphics[]{inheritance-7205afe372eab2f32f7394482ec599229978acda.pdf} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.collections}}} \label{\detokenize{api/collections_api:module-matplotlib.collections}}\label{\detokenize{api/collections_api:matplotlib-collections}}\index{matplotlib.collections (module)} Classes for the efficient drawing of large collections of objects that share most properties, e.g., a large number of line segments or polygons. The classes are not meant to be as flexible as their single element counterparts (e.g., you may not be able to select all line styles) but they are meant to be fast for common use cases (e.g., a large set of solid line segemnts) \index{AsteriskPolygonCollection (class in matplotlib.collections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.collections.}}\sphinxbfcode{\sphinxupquote{AsteriskPolygonCollection}}}{\emph{numsides}, \emph{rotation=0}, \emph{sizes=(1}, \emph{)}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.RegularPolyCollection}}}}} Draw a collection of regular asterisks with \sphinxstyleemphasis{numsides} points. \begin{description} \item[{\sphinxstyleemphasis{numsides}}] \leavevmode the number of sides of the polygon \item[{\sphinxstyleemphasis{rotation}}] \leavevmode the rotation of the polygon in radians \item[{\sphinxstyleemphasis{sizes}}] \leavevmode gives the area of the circle circumscribing the regular polygon in points\textasciicircum{}2 Valid Collection keyword arguments: \begin{itemize} \item {} \sphinxstyleemphasis{edgecolors}: None \item {} \sphinxstyleemphasis{facecolors}: None \item {} \sphinxstyleemphasis{linewidths}: None \item {} \sphinxstyleemphasis{antialiaseds}: None \item {} \sphinxstyleemphasis{offsets}: None \item {} \sphinxstyleemphasis{transOffset}: transforms.IdentityTransform() \item {} \sphinxstyleemphasis{norm}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \item {} \sphinxstyleemphasis{cmap}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \end{itemize} \sphinxstyleemphasis{offsets} and \sphinxstyleemphasis{transOffset} are used to translate the patch after rendering (default no offsets) If any of \sphinxstyleemphasis{edgecolors}, \sphinxstyleemphasis{facecolors}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{antialiaseds} are None, they default to their {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcParams}}}}} patch setting, in sequence form. \end{description} Example: see \sphinxcode{\sphinxupquote{examples/dynamic\_collection.py}} for complete example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{offsets} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{20}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{facecolors} \PYG{o}{=} \PYG{p}{[}\PYG{n}{cm}\PYG{o}{.}\PYG{n}{jet}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)} \PYG{k}{for} \PYG{n}{x} \PYG{o+ow}{in} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{20}\PYG{p}{)}\PYG{p}{]} \PYG{n}{black} \PYG{o}{=} \PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{collection} \PYG{o}{=} \PYG{n}{RegularPolyCollection}\PYG{p}{(} \PYG{n}{numsides}\PYG{o}{=}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} a pentagon} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{sizes}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{50}\PYG{p}{,}\PYG{p}{)}\PYG{p}{,} \PYG{n}{facecolors} \PYG{o}{=} \PYG{n}{facecolors}\PYG{p}{,} \PYG{n}{edgecolors} \PYG{o}{=} \PYG{p}{(}\PYG{n}{black}\PYG{p}{,}\PYG{p}{)}\PYG{p}{,} \PYG{n}{linewidths} \PYG{o}{=} \PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{p}{)}\PYG{p}{,} \PYG{n}{offsets} \PYG{o}{=} \PYG{n}{offsets}\PYG{p}{,} \PYG{n}{transOffset} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{p}{,} \PYG{p}{)} \end{sphinxVerbatim} \index{add\_callback() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.add_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \index{add\_checker() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.add_checker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_checker}}}{\emph{checker}}{} Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed. \end{fulllineitems} \index{aname (matplotlib.collections.AsteriskPolygonCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.aname}}\pysigline{\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \index{autoscale() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Autoscale the scalar limits on the norm instance using the current array \end{fulllineitems} \index{autoscale\_None() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{}{} Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None \end{fulllineitems} \index{axes (matplotlib.collections.AsteriskPolygonCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.axes}}\pysigline{\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \index{changed() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{changed}}}{}{} Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal \end{fulllineitems} \index{check\_update() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.check_update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{check\_update}}}{\emph{checker}}{} If mappable has changed since the last check, return True; else return False \end{fulllineitems} \index{contains() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the collection. Returns True \textbar{} False, \sphinxcode{\sphinxupquote{dict(ind=itemlist)}}, where every item in itemlist contains the event. \end{fulllineitems} \index{convert\_xunits() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.convert_xunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \index{convert\_yunits() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.convert_yunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \index{draw() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \index{findobj() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.findobj}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \index{format\_cursor\_data() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.format_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \index{get\_agg\_filter() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \index{get\_alpha() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \index{get\_animated() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \index{get\_array() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_array}}}{}{} Return the array \end{fulllineitems} \index{get\_capstyle() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{}~ \end{fulllineitems} \index{get\_children() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \index{get\_clim() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clim}}}{}{} return the min, max of the color limits for image scaling \end{fulllineitems} \index{get\_clip\_box() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \index{get\_clip\_on() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \index{get\_clip\_path() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \index{get\_cmap() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cmap}}}{}{} return the colormap \end{fulllineitems} \index{get\_contains() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \index{get\_cursor\_data() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \index{get\_dashes() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashes}}}{}{}~ \end{fulllineitems} \index{get\_datalim() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_datalim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_datalim}}}{\emph{transData}}{}~ \end{fulllineitems} \index{get\_edgecolor() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolor}}}{}{}~ \end{fulllineitems} \index{get\_edgecolors() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolors}}}{}{}~ \end{fulllineitems} \index{get\_facecolor() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{}~ \end{fulllineitems} \index{get\_facecolors() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolors}}}{}{}~ \end{fulllineitems} \index{get\_figure() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \index{get\_fill() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_fill}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fill}}}{}{} return whether fill is set \end{fulllineitems} \index{get\_gid() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \index{get\_hatch() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch}}}{}{} Return the current hatching pattern. \end{fulllineitems} \index{get\_joinstyle() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{}~ \end{fulllineitems} \index{get\_label() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \index{get\_linestyle() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyle}}}{}{}~ \end{fulllineitems} \index{get\_linestyles() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyles}}}{}{}~ \end{fulllineitems} \index{get\_linewidth() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidth}}}{}{}~ \end{fulllineitems} \index{get\_linewidths() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidths}}}{}{}~ \end{fulllineitems} \index{get\_numsides() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_numsides}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_numsides}}}{}{}~ \end{fulllineitems} \index{get\_offset\_position() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_position}}}{}{} Returns how offsets are applied for the collection. If \sphinxstyleemphasis{offset\_position} is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{get\_offset\_transform() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_offset_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_transform}}}{}{}~ \end{fulllineitems} \index{get\_offsets() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offsets}}}{}{} Return the offsets for the collection. \end{fulllineitems} \index{get\_path\_effects() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \index{get\_paths() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_paths}}}{}{}~ \end{fulllineitems} \index{get\_picker() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \index{get\_pickradius() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{}~ \end{fulllineitems} \index{get\_rasterized() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \index{get\_rotation() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_rotation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rotation}}}{}{}~ \end{fulllineitems} \index{get\_sizes() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_sizes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sizes}}}{}{} Returns the sizes of the elements in the collection. The value represents the ‘area’ of the element. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sizes}}] \leavevmode{[}array{]} The ‘area’ of each element. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_sketch\_params() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_snap() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \index{get\_transform() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \index{get\_transforms() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_transforms}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transforms}}}{}{}~ \end{fulllineitems} \index{get\_url() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \index{get\_urls() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_urls}}}{}{}~ \end{fulllineitems} \index{get\_visible() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \index{get\_window\_extent() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{get\_zorder() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.get_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \index{have\_units() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.have_units}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \index{hitlist() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.hitlist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hitlist}}}{\emph{event}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The hitlist function was deprecated in version 2.2. List the children of the artist which contain the mouse event \sphinxstyleemphasis{event}. \end{fulllineitems} \index{is\_figure\_set() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.is_figure_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_figure\_set}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }artist.figure is not None Returns whether the artist is assigned to a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \end{fulllineitems} \index{is\_transform\_set() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.is_transform_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \index{mouseover (matplotlib.collections.AsteriskPolygonCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.mouseover}}\pysigline{\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \index{pchanged() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.pchanged}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \index{pick() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.pick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \index{pickable() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.pickable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \index{properties() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \index{remove() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \index{remove\_callback() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.remove_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \index{set() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \index{set\_agg\_filter() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_alpha() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha tranparencies of the collection. \sphinxstyleemphasis{alpha} must be a float or \sphinxstyleemphasis{None}. ACCEPTS: float or None \end{fulllineitems} \index{set\_animated() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_antialiased() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiased}}}{\emph{aa}}{} Set the antialiasing state for rendering. ACCEPTS: Boolean or sequence of booleans \end{fulllineitems} \index{set\_antialiaseds() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_antialiaseds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiaseds}}}{\emph{aa}}{} alias for set\_antialiased \end{fulllineitems} \index{set\_array() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_array}}}{\emph{A}}{} Set the image array from numpy array \sphinxstyleemphasis{A}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A}}] \leavevmode{[}ndarray{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_capstyle() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_capstyle}}}{\emph{cs}}{} Set the capstyle for the collection. The capstyle can only be set globally for all elements in the collection \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cs}}] \leavevmode{[}{[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]}{]} The capstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clim() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clim}}}{\emph{vmin=None}, \emph{vmax=None}}{} set the norm limits for image scaling; if \sphinxstyleemphasis{vmin} is a length2 sequence, interpret it as \sphinxcode{\sphinxupquote{(vmin, vmax)}} which is used to support setp ACCEPTS: a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \end{fulllineitems} \index{set\_clip\_box() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_on() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_path() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \index{set\_cmap() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cmap}}}{\emph{cmap}}{} set the colormap for luminance data ACCEPTS: a colormap or registered colormap name \end{fulllineitems} \index{set\_color() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{c}}{} Set both the edgecolor and the facecolor. ACCEPTS: matplotlib color arg or sequence of rgba tuples \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_facecolor()}}}}}, {\hyperref[\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_edgecolor()}}}}}}] \leavevmode For setting the edge or face color individually. \end{description} \end{fulllineitems} \index{set\_contains() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_dashes() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashes}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_edgecolor() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolor}}}{\emph{c}}{} Set the edgecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘face’, the edge color will always be the same as the face color. If it is ‘none’, the patch boundary will not be drawn. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_edgecolors() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolors}}}{\emph{c}}{} alias for set\_edgecolor \end{fulllineitems} \index{set\_facecolor() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{c}}{} Set the facecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘none’, the patch will not be filled. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_facecolors() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolors}}}{\emph{c}}{} alias for set\_facecolor \end{fulllineitems} \index{set\_figure() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_gid() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_hatch() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_hatch}}}{\emph{hatch}}{} Set the hatching pattern \sphinxstyleemphasis{hatch} can be one of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{/} \PYG{o}{\PYGZhy{}} \PYG{n}{diagonal} \PYG{n}{hatching} \PYGZbs{} \PYG{o}{\PYGZhy{}} \PYG{n}{back} \PYG{n}{diagonal} \PYG{o}{\textbar{}} \PYG{o}{\PYGZhy{}} \PYG{n}{vertical} \PYG{o}{\PYGZhy{}} \PYG{o}{\PYGZhy{}} \PYG{n}{horizontal} \PYG{o}{+} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{x} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{diagonal} \PYG{n}{o} \PYG{o}{\PYGZhy{}} \PYG{n}{small} \PYG{n}{circle} \PYG{n}{O} \PYG{o}{\PYGZhy{}} \PYG{n}{large} \PYG{n}{circle} \PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{dots} \PYG{o}{*} \PYG{o}{\PYGZhy{}} \PYG{n}{stars} \end{sphinxVerbatim} Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member. ACCEPTS: {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \end{fulllineitems} \index{set\_joinstyle() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_joinstyle}}}{\emph{js}}{} Set the joinstyle for the collection. The joinstyle can only be set globally for all elements in the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{js}}] \leavevmode{[}{[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]}{]} The joinstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_label() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyle() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyle}}}{\emph{ls}}{} Set the linestyle(s) for the collection. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily linestyle &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} or \sphinxcode{\sphinxupquote{'solid'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} or \sphinxcode{\sphinxupquote{'dashed'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} or \sphinxcode{\sphinxupquote{'dashdot'}} & dash-dotted line \\ \hline \sphinxcode{\sphinxupquote{':'}} or \sphinxcode{\sphinxupquote{'dotted'}} & dotted line \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Alternatively a dash tuple of the following form can be provided: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{onoffseq}} is an even length tuple of on and off ink in points. \begin{description} \item[{ACCEPTS: {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{}}] \leavevmode (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \end{description} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ls}}] \leavevmode{[}\{ ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’\} and more see description{]} The line style. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyles() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyles}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_linewidth() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{lw}}{} Set the linewidth(s) for the collection. \sphinxstyleemphasis{lw} can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_linewidths() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidths}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_lw() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_lw}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_norm() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_norm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_norm}}}{\emph{norm}}{} Set the normalization instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_offset\_position() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset\_position}}}{\emph{offset\_position}}{} Set how offsets are applied. If \sphinxstyleemphasis{offset\_position} is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{set\_offsets() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offsets}}}{\emph{offsets}}{} Set the offsets for the collection. \sphinxstyleemphasis{offsets} can be a scalar or a sequence. ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_path\_effects() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_paths() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_paths}}}{}{}~ \end{fulllineitems} \index{set\_picker() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_pickradius() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{pr}}{} Set the pick radius used for containment tests. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{d}}] \leavevmode{[}float{]} Pick radius, in points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_rasterized() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sizes() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_sizes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sizes}}}{\emph{sizes}, \emph{dpi=72.0}}{} Set the sizes of each member of the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sizes}}] \leavevmode{[}ndarray or None{]} The size to set for each element of the collection. The value is the ‘area’ of the element. \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}float{]} The dpi of the canvas. Defaults to 72.0. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sketch\_params() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_snap() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_transform() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_url() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_urls() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_urls}}}{\emph{urls}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{urls}}] \leavevmode{[}List{[}str{]} or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_visible() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_zorder() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.set_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{stale (matplotlib.collections.AsteriskPolygonCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.stale}}\pysigline{\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \index{sticky\_edges (matplotlib.collections.AsteriskPolygonCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.sticky_edges}}\pysigline{\sphinxbfcode{\sphinxupquote{sticky\_edges}}} \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} sticky edge lists. When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added\textendash{}the view limit “sticks” to the edge. A typical usecase is histograms, where one usually expects no margin on the bottom edge (0) of the histogram. This attribute cannot be assigned to; however, the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} lists can be modified in place as needed. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{x}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{to\_rgba() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.to_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_rgba}}}{\emph{x}, \emph{alpha=None}, \emph{bytes=False}, \emph{norm=True}}{} Return a normalized rgba array corresponding to \sphinxstyleemphasis{x}. In the normal case, \sphinxstyleemphasis{x} is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable. There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If \sphinxstyleemphasis{x} is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the \sphinxstyleemphasis{alpha} kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the \sphinxstyleemphasis{alpha} kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4. In either case, if \sphinxstyleemphasis{bytes} is \sphinxstyleemphasis{False} (default), the rgba array will be floats in the 0-1 range; if it is \sphinxstyleemphasis{True}, the returned rgba array will be uint8 in the 0 to 255 range. If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1). \end{fulllineitems} \index{update() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \index{update\_from() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.update_from}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} copy properties from other to self \end{fulllineitems} \index{update\_scalarmappable() (matplotlib.collections.AsteriskPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.update_scalarmappable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_scalarmappable}}}{}{} If the scalar mappable array is not none, update colors from scalar data \end{fulllineitems} \index{zorder (matplotlib.collections.AsteriskPolygonCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.AsteriskPolygonCollection.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \end{fulllineitems} \index{BrokenBarHCollection (class in matplotlib.collections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.collections.}}\sphinxbfcode{\sphinxupquote{BrokenBarHCollection}}}{\emph{xranges}, \emph{yrange}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.PolyCollection}}}}} A collection of horizontal bars spanning \sphinxstyleemphasis{yrange} with a sequence of \sphinxstyleemphasis{xranges}. \begin{description} \item[{\sphinxstyleemphasis{xranges}}] \leavevmode sequence of (\sphinxstyleemphasis{xmin}, \sphinxstyleemphasis{xwidth}) \item[{\sphinxstyleemphasis{yrange}}] \leavevmode \sphinxstyleemphasis{ymin}, \sphinxstyleemphasis{ywidth} Valid Collection keyword arguments: \begin{itemize} \item {} \sphinxstyleemphasis{edgecolors}: None \item {} \sphinxstyleemphasis{facecolors}: None \item {} \sphinxstyleemphasis{linewidths}: None \item {} \sphinxstyleemphasis{antialiaseds}: None \item {} \sphinxstyleemphasis{offsets}: None \item {} \sphinxstyleemphasis{transOffset}: transforms.IdentityTransform() \item {} \sphinxstyleemphasis{norm}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \item {} \sphinxstyleemphasis{cmap}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \end{itemize} \sphinxstyleemphasis{offsets} and \sphinxstyleemphasis{transOffset} are used to translate the patch after rendering (default no offsets) If any of \sphinxstyleemphasis{edgecolors}, \sphinxstyleemphasis{facecolors}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{antialiaseds} are None, they default to their {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcParams}}}}} patch setting, in sequence form. \end{description} \index{add\_callback() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.add_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \index{add\_checker() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.add_checker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_checker}}}{\emph{checker}}{} Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed. \end{fulllineitems} \index{aname (matplotlib.collections.BrokenBarHCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.aname}}\pysigline{\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \index{autoscale() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Autoscale the scalar limits on the norm instance using the current array \end{fulllineitems} \index{autoscale\_None() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{}{} Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None \end{fulllineitems} \index{axes (matplotlib.collections.BrokenBarHCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.axes}}\pysigline{\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \index{changed() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{changed}}}{}{} Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal \end{fulllineitems} \index{check\_update() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.check_update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{check\_update}}}{\emph{checker}}{} If mappable has changed since the last check, return True; else return False \end{fulllineitems} \index{contains() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the collection. Returns True \textbar{} False, \sphinxcode{\sphinxupquote{dict(ind=itemlist)}}, where every item in itemlist contains the event. \end{fulllineitems} \index{convert\_xunits() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.convert_xunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \index{convert\_yunits() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.convert_yunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \index{draw() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \index{findobj() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.findobj}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \index{format\_cursor\_data() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.format_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \index{get\_agg\_filter() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \index{get\_alpha() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \index{get\_animated() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \index{get\_array() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_array}}}{}{} Return the array \end{fulllineitems} \index{get\_capstyle() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{}~ \end{fulllineitems} \index{get\_children() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \index{get\_clim() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clim}}}{}{} return the min, max of the color limits for image scaling \end{fulllineitems} \index{get\_clip\_box() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \index{get\_clip\_on() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \index{get\_clip\_path() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \index{get\_cmap() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cmap}}}{}{} return the colormap \end{fulllineitems} \index{get\_contains() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \index{get\_cursor\_data() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \index{get\_dashes() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashes}}}{}{}~ \end{fulllineitems} \index{get\_datalim() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_datalim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_datalim}}}{\emph{transData}}{}~ \end{fulllineitems} \index{get\_edgecolor() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolor}}}{}{}~ \end{fulllineitems} \index{get\_edgecolors() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolors}}}{}{}~ \end{fulllineitems} \index{get\_facecolor() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{}~ \end{fulllineitems} \index{get\_facecolors() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolors}}}{}{}~ \end{fulllineitems} \index{get\_figure() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \index{get\_fill() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_fill}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fill}}}{}{} return whether fill is set \end{fulllineitems} \index{get\_gid() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \index{get\_hatch() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch}}}{}{} Return the current hatching pattern. \end{fulllineitems} \index{get\_joinstyle() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{}~ \end{fulllineitems} \index{get\_label() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \index{get\_linestyle() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyle}}}{}{}~ \end{fulllineitems} \index{get\_linestyles() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyles}}}{}{}~ \end{fulllineitems} \index{get\_linewidth() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidth}}}{}{}~ \end{fulllineitems} \index{get\_linewidths() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidths}}}{}{}~ \end{fulllineitems} \index{get\_offset\_position() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_position}}}{}{} Returns how offsets are applied for the collection. If \sphinxstyleemphasis{offset\_position} is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{get\_offset\_transform() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_offset_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_transform}}}{}{}~ \end{fulllineitems} \index{get\_offsets() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offsets}}}{}{} Return the offsets for the collection. \end{fulllineitems} \index{get\_path\_effects() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \index{get\_paths() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_paths}}}{}{}~ \end{fulllineitems} \index{get\_picker() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \index{get\_pickradius() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{}~ \end{fulllineitems} \index{get\_rasterized() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \index{get\_sizes() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_sizes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sizes}}}{}{} Returns the sizes of the elements in the collection. The value represents the ‘area’ of the element. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sizes}}] \leavevmode{[}array{]} The ‘area’ of each element. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_sketch\_params() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_snap() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \index{get\_transform() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \index{get\_transforms() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_transforms}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transforms}}}{}{}~ \end{fulllineitems} \index{get\_url() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \index{get\_urls() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_urls}}}{}{}~ \end{fulllineitems} \index{get\_visible() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \index{get\_window\_extent() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{get\_zorder() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.get_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \index{have\_units() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.have_units}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \index{hitlist() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.hitlist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hitlist}}}{\emph{event}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The hitlist function was deprecated in version 2.2. List the children of the artist which contain the mouse event \sphinxstyleemphasis{event}. \end{fulllineitems} \index{is\_figure\_set() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.is_figure_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_figure\_set}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }artist.figure is not None Returns whether the artist is assigned to a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \end{fulllineitems} \index{is\_transform\_set() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.is_transform_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \index{mouseover (matplotlib.collections.BrokenBarHCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.mouseover}}\pysigline{\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \index{pchanged() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.pchanged}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \index{pick() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.pick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \index{pickable() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.pickable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \index{properties() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \index{remove() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \index{remove\_callback() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.remove_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \index{set() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \index{set\_agg\_filter() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_alpha() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha tranparencies of the collection. \sphinxstyleemphasis{alpha} must be a float or \sphinxstyleemphasis{None}. ACCEPTS: float or None \end{fulllineitems} \index{set\_animated() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_antialiased() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiased}}}{\emph{aa}}{} Set the antialiasing state for rendering. ACCEPTS: Boolean or sequence of booleans \end{fulllineitems} \index{set\_antialiaseds() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_antialiaseds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiaseds}}}{\emph{aa}}{} alias for set\_antialiased \end{fulllineitems} \index{set\_array() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_array}}}{\emph{A}}{} Set the image array from numpy array \sphinxstyleemphasis{A}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A}}] \leavevmode{[}ndarray{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_capstyle() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_capstyle}}}{\emph{cs}}{} Set the capstyle for the collection. The capstyle can only be set globally for all elements in the collection \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cs}}] \leavevmode{[}{[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]}{]} The capstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clim() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clim}}}{\emph{vmin=None}, \emph{vmax=None}}{} set the norm limits for image scaling; if \sphinxstyleemphasis{vmin} is a length2 sequence, interpret it as \sphinxcode{\sphinxupquote{(vmin, vmax)}} which is used to support setp ACCEPTS: a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \end{fulllineitems} \index{set\_clip\_box() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_on() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_path() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \index{set\_cmap() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cmap}}}{\emph{cmap}}{} set the colormap for luminance data ACCEPTS: a colormap or registered colormap name \end{fulllineitems} \index{set\_color() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{c}}{} Set both the edgecolor and the facecolor. ACCEPTS: matplotlib color arg or sequence of rgba tuples \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_facecolor()}}}}}, {\hyperref[\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_edgecolor()}}}}}}] \leavevmode For setting the edge or face color individually. \end{description} \end{fulllineitems} \index{set\_contains() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_dashes() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashes}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_edgecolor() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolor}}}{\emph{c}}{} Set the edgecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘face’, the edge color will always be the same as the face color. If it is ‘none’, the patch boundary will not be drawn. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_edgecolors() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolors}}}{\emph{c}}{} alias for set\_edgecolor \end{fulllineitems} \index{set\_facecolor() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{c}}{} Set the facecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘none’, the patch will not be filled. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_facecolors() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolors}}}{\emph{c}}{} alias for set\_facecolor \end{fulllineitems} \index{set\_figure() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_gid() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_hatch() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_hatch}}}{\emph{hatch}}{} Set the hatching pattern \sphinxstyleemphasis{hatch} can be one of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{/} \PYG{o}{\PYGZhy{}} \PYG{n}{diagonal} \PYG{n}{hatching} \PYGZbs{} \PYG{o}{\PYGZhy{}} \PYG{n}{back} \PYG{n}{diagonal} \PYG{o}{\textbar{}} \PYG{o}{\PYGZhy{}} \PYG{n}{vertical} \PYG{o}{\PYGZhy{}} \PYG{o}{\PYGZhy{}} \PYG{n}{horizontal} \PYG{o}{+} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{x} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{diagonal} \PYG{n}{o} \PYG{o}{\PYGZhy{}} \PYG{n}{small} \PYG{n}{circle} \PYG{n}{O} \PYG{o}{\PYGZhy{}} \PYG{n}{large} \PYG{n}{circle} \PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{dots} \PYG{o}{*} \PYG{o}{\PYGZhy{}} \PYG{n}{stars} \end{sphinxVerbatim} Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member. ACCEPTS: {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \end{fulllineitems} \index{set\_joinstyle() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_joinstyle}}}{\emph{js}}{} Set the joinstyle for the collection. The joinstyle can only be set globally for all elements in the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{js}}] \leavevmode{[}{[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]}{]} The joinstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_label() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyle() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyle}}}{\emph{ls}}{} Set the linestyle(s) for the collection. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily linestyle &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} or \sphinxcode{\sphinxupquote{'solid'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} or \sphinxcode{\sphinxupquote{'dashed'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} or \sphinxcode{\sphinxupquote{'dashdot'}} & dash-dotted line \\ \hline \sphinxcode{\sphinxupquote{':'}} or \sphinxcode{\sphinxupquote{'dotted'}} & dotted line \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Alternatively a dash tuple of the following form can be provided: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{onoffseq}} is an even length tuple of on and off ink in points. \begin{description} \item[{ACCEPTS: {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{}}] \leavevmode (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \end{description} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ls}}] \leavevmode{[}\{ ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’\} and more see description{]} The line style. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyles() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyles}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_linewidth() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{lw}}{} Set the linewidth(s) for the collection. \sphinxstyleemphasis{lw} can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_linewidths() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidths}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_lw() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_lw}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_norm() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_norm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_norm}}}{\emph{norm}}{} Set the normalization instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_offset\_position() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset\_position}}}{\emph{offset\_position}}{} Set how offsets are applied. If \sphinxstyleemphasis{offset\_position} is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{set\_offsets() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offsets}}}{\emph{offsets}}{} Set the offsets for the collection. \sphinxstyleemphasis{offsets} can be a scalar or a sequence. ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_path\_effects() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_paths() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_paths}}}{\emph{verts}, \emph{closed=True}}{} This allows one to delay initialization of the vertices. \end{fulllineitems} \index{set\_picker() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_pickradius() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{pr}}{} Set the pick radius used for containment tests. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{d}}] \leavevmode{[}float{]} Pick radius, in points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_rasterized() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sizes() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_sizes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sizes}}}{\emph{sizes}, \emph{dpi=72.0}}{} Set the sizes of each member of the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sizes}}] \leavevmode{[}ndarray or None{]} The size to set for each element of the collection. The value is the ‘area’ of the element. \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}float{]} The dpi of the canvas. Defaults to 72.0. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sketch\_params() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_snap() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_transform() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_url() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_urls() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_urls}}}{\emph{urls}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{urls}}] \leavevmode{[}List{[}str{]} or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_verts() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_verts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_verts}}}{\emph{verts}, \emph{closed=True}}{} This allows one to delay initialization of the vertices. \end{fulllineitems} \index{set\_verts\_and\_codes() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_verts_and_codes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_verts\_and\_codes}}}{\emph{verts}, \emph{codes}}{} This allows one to initialize vertices with path codes. \end{fulllineitems} \index{set\_visible() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_zorder() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.set_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{span\_where() (matplotlib.collections.BrokenBarHCollection static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.span_where}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{span\_where}}}{\emph{x}, \emph{ymin}, \emph{ymax}, \emph{where}, \emph{**kwargs}}{} Create a BrokenBarHCollection to plot horizontal bars from over the regions in \sphinxstyleemphasis{x} where \sphinxstyleemphasis{where} is True. The bars range on the y-axis from \sphinxstyleemphasis{ymin} to \sphinxstyleemphasis{ymax} A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BrokenBarHCollection}}}}} is returned. \sphinxstyleemphasis{kwargs} are passed on to the collection. \end{fulllineitems} \index{stale (matplotlib.collections.BrokenBarHCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.stale}}\pysigline{\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \index{sticky\_edges (matplotlib.collections.BrokenBarHCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.sticky_edges}}\pysigline{\sphinxbfcode{\sphinxupquote{sticky\_edges}}} \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} sticky edge lists. When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added\textendash{}the view limit “sticks” to the edge. A typical usecase is histograms, where one usually expects no margin on the bottom edge (0) of the histogram. This attribute cannot be assigned to; however, the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} lists can be modified in place as needed. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{x}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{to\_rgba() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.to_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_rgba}}}{\emph{x}, \emph{alpha=None}, \emph{bytes=False}, \emph{norm=True}}{} Return a normalized rgba array corresponding to \sphinxstyleemphasis{x}. In the normal case, \sphinxstyleemphasis{x} is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable. There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If \sphinxstyleemphasis{x} is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the \sphinxstyleemphasis{alpha} kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the \sphinxstyleemphasis{alpha} kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4. In either case, if \sphinxstyleemphasis{bytes} is \sphinxstyleemphasis{False} (default), the rgba array will be floats in the 0-1 range; if it is \sphinxstyleemphasis{True}, the returned rgba array will be uint8 in the 0 to 255 range. If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1). \end{fulllineitems} \index{update() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \index{update\_from() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.update_from}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} copy properties from other to self \end{fulllineitems} \index{update\_scalarmappable() (matplotlib.collections.BrokenBarHCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.update_scalarmappable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_scalarmappable}}}{}{} If the scalar mappable array is not none, update colors from scalar data \end{fulllineitems} \index{zorder (matplotlib.collections.BrokenBarHCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \end{fulllineitems} \index{CircleCollection (class in matplotlib.collections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.collections.}}\sphinxbfcode{\sphinxupquote{CircleCollection}}}{\emph{sizes}, \emph{**kwargs}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.collections.\_CollectionWithSizes}} A collection of circles, drawn using splines. \sphinxstyleemphasis{sizes} Gives the area of the circle in points\textasciicircum{}2 Valid Collection keyword arguments: \begin{itemize} \item {} \sphinxstyleemphasis{edgecolors}: None \item {} \sphinxstyleemphasis{facecolors}: None \item {} \sphinxstyleemphasis{linewidths}: None \item {} \sphinxstyleemphasis{antialiaseds}: None \item {} \sphinxstyleemphasis{offsets}: None \item {} \sphinxstyleemphasis{transOffset}: transforms.IdentityTransform() \item {} \sphinxstyleemphasis{norm}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \item {} \sphinxstyleemphasis{cmap}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \end{itemize} \sphinxstyleemphasis{offsets} and \sphinxstyleemphasis{transOffset} are used to translate the patch after rendering (default no offsets) If any of \sphinxstyleemphasis{edgecolors}, \sphinxstyleemphasis{facecolors}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{antialiaseds} are None, they default to their {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcParams}}}}} patch setting, in sequence form. \index{add\_callback() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.add_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/collections_api:matplotlib.collections.CircleCollection.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \index{add\_checker() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.add_checker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_checker}}}{\emph{checker}}{} Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed. \end{fulllineitems} \index{aname (matplotlib.collections.CircleCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.aname}}\pysigline{\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \index{autoscale() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Autoscale the scalar limits on the norm instance using the current array \end{fulllineitems} \index{autoscale\_None() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{}{} Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None \end{fulllineitems} \index{axes (matplotlib.collections.CircleCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.axes}}\pysigline{\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \index{changed() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{changed}}}{}{} Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal \end{fulllineitems} \index{check\_update() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.check_update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{check\_update}}}{\emph{checker}}{} If mappable has changed since the last check, return True; else return False \end{fulllineitems} \index{contains() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the collection. Returns True \textbar{} False, \sphinxcode{\sphinxupquote{dict(ind=itemlist)}}, where every item in itemlist contains the event. \end{fulllineitems} \index{convert\_xunits() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.convert_xunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \index{convert\_yunits() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.convert_yunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \index{draw() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \index{findobj() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.findobj}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \index{format\_cursor\_data() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.format_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \index{get\_agg\_filter() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \index{get\_alpha() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \index{get\_animated() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \index{get\_array() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_array}}}{}{} Return the array \end{fulllineitems} \index{get\_capstyle() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{}~ \end{fulllineitems} \index{get\_children() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \index{get\_clim() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clim}}}{}{} return the min, max of the color limits for image scaling \end{fulllineitems} \index{get\_clip\_box() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \index{get\_clip\_on() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \index{get\_clip\_path() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \index{get\_cmap() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cmap}}}{}{} return the colormap \end{fulllineitems} \index{get\_contains() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \index{get\_cursor\_data() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \index{get\_dashes() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashes}}}{}{}~ \end{fulllineitems} \index{get\_datalim() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_datalim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_datalim}}}{\emph{transData}}{}~ \end{fulllineitems} \index{get\_edgecolor() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolor}}}{}{}~ \end{fulllineitems} \index{get\_edgecolors() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolors}}}{}{}~ \end{fulllineitems} \index{get\_facecolor() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{}~ \end{fulllineitems} \index{get\_facecolors() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolors}}}{}{}~ \end{fulllineitems} \index{get\_figure() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \index{get\_fill() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_fill}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fill}}}{}{} return whether fill is set \end{fulllineitems} \index{get\_gid() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \index{get\_hatch() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch}}}{}{} Return the current hatching pattern. \end{fulllineitems} \index{get\_joinstyle() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{}~ \end{fulllineitems} \index{get\_label() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \index{get\_linestyle() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyle}}}{}{}~ \end{fulllineitems} \index{get\_linestyles() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyles}}}{}{}~ \end{fulllineitems} \index{get\_linewidth() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidth}}}{}{}~ \end{fulllineitems} \index{get\_linewidths() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidths}}}{}{}~ \end{fulllineitems} \index{get\_offset\_position() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_position}}}{}{} Returns how offsets are applied for the collection. If \sphinxstyleemphasis{offset\_position} is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{get\_offset\_transform() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_offset_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_transform}}}{}{}~ \end{fulllineitems} \index{get\_offsets() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offsets}}}{}{} Return the offsets for the collection. \end{fulllineitems} \index{get\_path\_effects() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \index{get\_paths() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_paths}}}{}{}~ \end{fulllineitems} \index{get\_picker() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \index{get\_pickradius() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{}~ \end{fulllineitems} \index{get\_rasterized() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \index{get\_sizes() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_sizes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sizes}}}{}{} Returns the sizes of the elements in the collection. The value represents the ‘area’ of the element. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sizes}}] \leavevmode{[}array{]} The ‘area’ of each element. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_sketch\_params() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_snap() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \index{get\_transform() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \index{get\_transforms() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_transforms}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transforms}}}{}{}~ \end{fulllineitems} \index{get\_url() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \index{get\_urls() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_urls}}}{}{}~ \end{fulllineitems} \index{get\_visible() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \index{get\_window\_extent() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{get\_zorder() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.get_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \index{have\_units() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.have_units}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \index{hitlist() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.hitlist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hitlist}}}{\emph{event}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The hitlist function was deprecated in version 2.2. List the children of the artist which contain the mouse event \sphinxstyleemphasis{event}. \end{fulllineitems} \index{is\_figure\_set() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.is_figure_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_figure\_set}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }artist.figure is not None Returns whether the artist is assigned to a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \end{fulllineitems} \index{is\_transform\_set() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.is_transform_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \index{mouseover (matplotlib.collections.CircleCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.mouseover}}\pysigline{\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \index{pchanged() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.pchanged}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \index{pick() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.pick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \index{pickable() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.pickable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \index{properties() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \index{remove() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \index{remove\_callback() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.remove_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.CircleCollection.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \index{set() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \index{set\_agg\_filter() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_alpha() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha tranparencies of the collection. \sphinxstyleemphasis{alpha} must be a float or \sphinxstyleemphasis{None}. ACCEPTS: float or None \end{fulllineitems} \index{set\_animated() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_antialiased() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiased}}}{\emph{aa}}{} Set the antialiasing state for rendering. ACCEPTS: Boolean or sequence of booleans \end{fulllineitems} \index{set\_antialiaseds() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_antialiaseds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiaseds}}}{\emph{aa}}{} alias for set\_antialiased \end{fulllineitems} \index{set\_array() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_array}}}{\emph{A}}{} Set the image array from numpy array \sphinxstyleemphasis{A}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A}}] \leavevmode{[}ndarray{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_capstyle() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_capstyle}}}{\emph{cs}}{} Set the capstyle for the collection. The capstyle can only be set globally for all elements in the collection \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cs}}] \leavevmode{[}{[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]}{]} The capstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clim() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clim}}}{\emph{vmin=None}, \emph{vmax=None}}{} set the norm limits for image scaling; if \sphinxstyleemphasis{vmin} is a length2 sequence, interpret it as \sphinxcode{\sphinxupquote{(vmin, vmax)}} which is used to support setp ACCEPTS: a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \end{fulllineitems} \index{set\_clip\_box() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_on() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_path() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \index{set\_cmap() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cmap}}}{\emph{cmap}}{} set the colormap for luminance data ACCEPTS: a colormap or registered colormap name \end{fulllineitems} \index{set\_color() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{c}}{} Set both the edgecolor and the facecolor. ACCEPTS: matplotlib color arg or sequence of rgba tuples \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_facecolor()}}}}}, {\hyperref[\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_edgecolor()}}}}}}] \leavevmode For setting the edge or face color individually. \end{description} \end{fulllineitems} \index{set\_contains() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_dashes() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashes}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_edgecolor() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolor}}}{\emph{c}}{} Set the edgecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘face’, the edge color will always be the same as the face color. If it is ‘none’, the patch boundary will not be drawn. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_edgecolors() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolors}}}{\emph{c}}{} alias for set\_edgecolor \end{fulllineitems} \index{set\_facecolor() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{c}}{} Set the facecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘none’, the patch will not be filled. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_facecolors() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolors}}}{\emph{c}}{} alias for set\_facecolor \end{fulllineitems} \index{set\_figure() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_gid() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_hatch() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_hatch}}}{\emph{hatch}}{} Set the hatching pattern \sphinxstyleemphasis{hatch} can be one of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{/} \PYG{o}{\PYGZhy{}} \PYG{n}{diagonal} \PYG{n}{hatching} \PYGZbs{} \PYG{o}{\PYGZhy{}} \PYG{n}{back} \PYG{n}{diagonal} \PYG{o}{\textbar{}} \PYG{o}{\PYGZhy{}} \PYG{n}{vertical} \PYG{o}{\PYGZhy{}} \PYG{o}{\PYGZhy{}} \PYG{n}{horizontal} \PYG{o}{+} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{x} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{diagonal} \PYG{n}{o} \PYG{o}{\PYGZhy{}} \PYG{n}{small} \PYG{n}{circle} \PYG{n}{O} \PYG{o}{\PYGZhy{}} \PYG{n}{large} \PYG{n}{circle} \PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{dots} \PYG{o}{*} \PYG{o}{\PYGZhy{}} \PYG{n}{stars} \end{sphinxVerbatim} Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member. ACCEPTS: {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \end{fulllineitems} \index{set\_joinstyle() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_joinstyle}}}{\emph{js}}{} Set the joinstyle for the collection. The joinstyle can only be set globally for all elements in the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{js}}] \leavevmode{[}{[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]}{]} The joinstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_label() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyle() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyle}}}{\emph{ls}}{} Set the linestyle(s) for the collection. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily linestyle &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} or \sphinxcode{\sphinxupquote{'solid'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} or \sphinxcode{\sphinxupquote{'dashed'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} or \sphinxcode{\sphinxupquote{'dashdot'}} & dash-dotted line \\ \hline \sphinxcode{\sphinxupquote{':'}} or \sphinxcode{\sphinxupquote{'dotted'}} & dotted line \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Alternatively a dash tuple of the following form can be provided: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{onoffseq}} is an even length tuple of on and off ink in points. \begin{description} \item[{ACCEPTS: {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{}}] \leavevmode (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \end{description} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ls}}] \leavevmode{[}\{ ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’\} and more see description{]} The line style. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyles() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyles}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_linewidth() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{lw}}{} Set the linewidth(s) for the collection. \sphinxstyleemphasis{lw} can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_linewidths() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidths}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_lw() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_lw}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_norm() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_norm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_norm}}}{\emph{norm}}{} Set the normalization instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_offset\_position() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset\_position}}}{\emph{offset\_position}}{} Set how offsets are applied. If \sphinxstyleemphasis{offset\_position} is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{set\_offsets() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offsets}}}{\emph{offsets}}{} Set the offsets for the collection. \sphinxstyleemphasis{offsets} can be a scalar or a sequence. ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_path\_effects() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_paths() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_paths}}}{}{}~ \end{fulllineitems} \index{set\_picker() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_pickradius() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{pr}}{} Set the pick radius used for containment tests. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{d}}] \leavevmode{[}float{]} Pick radius, in points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_rasterized() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sizes() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_sizes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sizes}}}{\emph{sizes}, \emph{dpi=72.0}}{} Set the sizes of each member of the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sizes}}] \leavevmode{[}ndarray or None{]} The size to set for each element of the collection. The value is the ‘area’ of the element. \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}float{]} The dpi of the canvas. Defaults to 72.0. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sketch\_params() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_snap() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_transform() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_url() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_urls() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_urls}}}{\emph{urls}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{urls}}] \leavevmode{[}List{[}str{]} or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_visible() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_zorder() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.set_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{stale (matplotlib.collections.CircleCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.stale}}\pysigline{\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \index{sticky\_edges (matplotlib.collections.CircleCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.sticky_edges}}\pysigline{\sphinxbfcode{\sphinxupquote{sticky\_edges}}} \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} sticky edge lists. When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added\textendash{}the view limit “sticks” to the edge. A typical usecase is histograms, where one usually expects no margin on the bottom edge (0) of the histogram. This attribute cannot be assigned to; however, the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} lists can be modified in place as needed. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{x}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{to\_rgba() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.to_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_rgba}}}{\emph{x}, \emph{alpha=None}, \emph{bytes=False}, \emph{norm=True}}{} Return a normalized rgba array corresponding to \sphinxstyleemphasis{x}. In the normal case, \sphinxstyleemphasis{x} is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable. There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If \sphinxstyleemphasis{x} is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the \sphinxstyleemphasis{alpha} kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the \sphinxstyleemphasis{alpha} kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4. In either case, if \sphinxstyleemphasis{bytes} is \sphinxstyleemphasis{False} (default), the rgba array will be floats in the 0-1 range; if it is \sphinxstyleemphasis{True}, the returned rgba array will be uint8 in the 0 to 255 range. If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1). \end{fulllineitems} \index{update() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \index{update\_from() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.update_from}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} copy properties from other to self \end{fulllineitems} \index{update\_scalarmappable() (matplotlib.collections.CircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.update_scalarmappable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_scalarmappable}}}{}{} If the scalar mappable array is not none, update colors from scalar data \end{fulllineitems} \index{zorder (matplotlib.collections.CircleCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.CircleCollection.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \end{fulllineitems} \index{Collection (class in matplotlib.collections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.collections.}}\sphinxbfcode{\sphinxupquote{Collection}}}{\emph{edgecolors=None}, \emph{facecolors=None}, \emph{linewidths=None}, \emph{linestyles='solid'}, \emph{capstyle=None}, \emph{joinstyle=None}, \emph{antialiaseds=None}, \emph{offsets=None}, \emph{transOffset=None}, \emph{norm=None}, \emph{cmap=None}, \emph{pickradius=5.0}, \emph{hatch=None}, \emph{urls=None}, \emph{offset\_position='screen'}, \emph{zorder=1}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.Artist}}}}}, {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}} Base class for Collections. Must be subclassed to be usable. All properties in a collection must be sequences or scalars; if scalars, they will be converted to sequences. The property of the ith element of the collection is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{prop}\PYG{p}{[}\PYG{n}{i} \PYG{o}{\PYGZpc{}} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{props}\PYG{p}{)}\PYG{p}{]} \end{sphinxVerbatim} Exceptions are \sphinxstyleemphasis{capstyle} and \sphinxstyleemphasis{joinstyle} properties, these can only be set globally for the whole collection. Keyword arguments and default values: \begin{itemize} \item {} \sphinxstyleemphasis{edgecolors}: None \item {} \sphinxstyleemphasis{facecolors}: None \item {} \sphinxstyleemphasis{linewidths}: None \item {} \sphinxstyleemphasis{capstyle}: None \item {} \sphinxstyleemphasis{joinstyle}: None \item {} \sphinxstyleemphasis{antialiaseds}: None \item {} \sphinxstyleemphasis{offsets}: None \item {} \sphinxstyleemphasis{transOffset}: transforms.IdentityTransform() \item {} \sphinxstyleemphasis{offset\_position}: ‘screen’ (default) or ‘data’ \item {} \sphinxstyleemphasis{norm}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \item {} \sphinxstyleemphasis{cmap}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \item {} \sphinxstyleemphasis{hatch}: None \item {} \sphinxstyleemphasis{zorder}: 1 \end{itemize} \sphinxstyleemphasis{offsets} and \sphinxstyleemphasis{transOffset} are used to translate the patch after rendering (default no offsets). If offset\_position is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. If any of \sphinxstyleemphasis{edgecolors}, \sphinxstyleemphasis{facecolors}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{antialiaseds} are None, they default to their {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcParams}}}}} patch setting, in sequence form. The use of {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarMappable}}}}} is optional. If the {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarMappable}}}}} matrix \_A is not None (i.e., a call to set\_array has been made), at draw time a call to scalar mappable will be made to set the face colors. Create a Collection \%(Collection)s \index{add\_callback() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.add_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \index{add\_checker() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.add_checker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_checker}}}{\emph{checker}}{} Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed. \end{fulllineitems} \index{aname (matplotlib.collections.Collection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.aname}}\pysigline{\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \index{autoscale() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Autoscale the scalar limits on the norm instance using the current array \end{fulllineitems} \index{autoscale\_None() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{}{} Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None \end{fulllineitems} \index{axes (matplotlib.collections.Collection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.axes}}\pysigline{\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \index{changed() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{changed}}}{}{} Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal \end{fulllineitems} \index{check\_update() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.check_update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{check\_update}}}{\emph{checker}}{} If mappable has changed since the last check, return True; else return False \end{fulllineitems} \index{contains() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the collection. Returns True \textbar{} False, \sphinxcode{\sphinxupquote{dict(ind=itemlist)}}, where every item in itemlist contains the event. \end{fulllineitems} \index{convert\_xunits() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.convert_xunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \index{convert\_yunits() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.convert_yunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \index{draw() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \index{findobj() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.findobj}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \index{format\_cursor\_data() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.format_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \index{get\_agg\_filter() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \index{get\_alpha() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \index{get\_animated() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \index{get\_array() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_array}}}{}{} Return the array \end{fulllineitems} \index{get\_capstyle() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{}~ \end{fulllineitems} \index{get\_children() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \index{get\_clim() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clim}}}{}{} return the min, max of the color limits for image scaling \end{fulllineitems} \index{get\_clip\_box() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \index{get\_clip\_on() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \index{get\_clip\_path() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \index{get\_cmap() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cmap}}}{}{} return the colormap \end{fulllineitems} \index{get\_contains() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \index{get\_cursor\_data() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \index{get\_dashes() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashes}}}{}{}~ \end{fulllineitems} \index{get\_datalim() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_datalim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_datalim}}}{\emph{transData}}{}~ \end{fulllineitems} \index{get\_edgecolor() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolor}}}{}{}~ \end{fulllineitems} \index{get\_edgecolors() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolors}}}{}{}~ \end{fulllineitems} \index{get\_facecolor() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{}~ \end{fulllineitems} \index{get\_facecolors() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolors}}}{}{}~ \end{fulllineitems} \index{get\_figure() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \index{get\_fill() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_fill}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fill}}}{}{} return whether fill is set \end{fulllineitems} \index{get\_gid() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \index{get\_hatch() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch}}}{}{} Return the current hatching pattern. \end{fulllineitems} \index{get\_joinstyle() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{}~ \end{fulllineitems} \index{get\_label() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \index{get\_linestyle() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyle}}}{}{}~ \end{fulllineitems} \index{get\_linestyles() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyles}}}{}{}~ \end{fulllineitems} \index{get\_linewidth() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidth}}}{}{}~ \end{fulllineitems} \index{get\_linewidths() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidths}}}{}{}~ \end{fulllineitems} \index{get\_offset\_position() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_position}}}{}{} Returns how offsets are applied for the collection. If \sphinxstyleemphasis{offset\_position} is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{get\_offset\_transform() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_offset_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_transform}}}{}{}~ \end{fulllineitems} \index{get\_offsets() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offsets}}}{}{} Return the offsets for the collection. \end{fulllineitems} \index{get\_path\_effects() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \index{get\_paths() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_paths}}}{}{}~ \end{fulllineitems} \index{get\_picker() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \index{get\_pickradius() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{}~ \end{fulllineitems} \index{get\_rasterized() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \index{get\_sketch\_params() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_snap() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \index{get\_transform() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \index{get\_transforms() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_transforms}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transforms}}}{}{}~ \end{fulllineitems} \index{get\_url() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \index{get\_urls() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_urls}}}{}{}~ \end{fulllineitems} \index{get\_visible() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \index{get\_window\_extent() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{get\_zorder() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.get_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \index{have\_units() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.have_units}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \index{hitlist() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.hitlist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hitlist}}}{\emph{event}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The hitlist function was deprecated in version 2.2. List the children of the artist which contain the mouse event \sphinxstyleemphasis{event}. \end{fulllineitems} \index{is\_figure\_set() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.is_figure_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_figure\_set}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }artist.figure is not None Returns whether the artist is assigned to a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \end{fulllineitems} \index{is\_transform\_set() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.is_transform_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \index{mouseover (matplotlib.collections.Collection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.mouseover}}\pysigline{\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \index{pchanged() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.pchanged}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \index{pick() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.pick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \index{pickable() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.pickable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \index{properties() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \index{remove() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \index{remove\_callback() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.remove_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \index{set() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \index{set\_agg\_filter() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_alpha() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha tranparencies of the collection. \sphinxstyleemphasis{alpha} must be a float or \sphinxstyleemphasis{None}. ACCEPTS: float or None \end{fulllineitems} \index{set\_animated() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_antialiased() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiased}}}{\emph{aa}}{} Set the antialiasing state for rendering. ACCEPTS: Boolean or sequence of booleans \end{fulllineitems} \index{set\_antialiaseds() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiaseds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiaseds}}}{\emph{aa}}{} alias for set\_antialiased \end{fulllineitems} \index{set\_array() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_array}}}{\emph{A}}{} Set the image array from numpy array \sphinxstyleemphasis{A}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A}}] \leavevmode{[}ndarray{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_capstyle() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_capstyle}}}{\emph{cs}}{} Set the capstyle for the collection. The capstyle can only be set globally for all elements in the collection \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cs}}] \leavevmode{[}{[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]}{]} The capstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clim() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clim}}}{\emph{vmin=None}, \emph{vmax=None}}{} set the norm limits for image scaling; if \sphinxstyleemphasis{vmin} is a length2 sequence, interpret it as \sphinxcode{\sphinxupquote{(vmin, vmax)}} which is used to support setp ACCEPTS: a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \end{fulllineitems} \index{set\_clip\_box() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_on() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_path() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \index{set\_cmap() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cmap}}}{\emph{cmap}}{} set the colormap for luminance data ACCEPTS: a colormap or registered colormap name \end{fulllineitems} \index{set\_color() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{c}}{} Set both the edgecolor and the facecolor. ACCEPTS: matplotlib color arg or sequence of rgba tuples \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_facecolor()}}}}}, {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_edgecolor()}}}}}}] \leavevmode For setting the edge or face color individually. \end{description} \end{fulllineitems} \index{set\_contains() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_dashes() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashes}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_edgecolor() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolor}}}{\emph{c}}{} Set the edgecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘face’, the edge color will always be the same as the face color. If it is ‘none’, the patch boundary will not be drawn. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_edgecolors() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolors}}}{\emph{c}}{} alias for set\_edgecolor \end{fulllineitems} \index{set\_facecolor() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{c}}{} Set the facecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘none’, the patch will not be filled. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_facecolors() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolors}}}{\emph{c}}{} alias for set\_facecolor \end{fulllineitems} \index{set\_figure() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_gid() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_hatch() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_hatch}}}{\emph{hatch}}{} Set the hatching pattern \sphinxstyleemphasis{hatch} can be one of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{/} \PYG{o}{\PYGZhy{}} \PYG{n}{diagonal} \PYG{n}{hatching} \PYGZbs{} \PYG{o}{\PYGZhy{}} \PYG{n}{back} \PYG{n}{diagonal} \PYG{o}{\textbar{}} \PYG{o}{\PYGZhy{}} \PYG{n}{vertical} \PYG{o}{\PYGZhy{}} \PYG{o}{\PYGZhy{}} \PYG{n}{horizontal} \PYG{o}{+} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{x} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{diagonal} \PYG{n}{o} \PYG{o}{\PYGZhy{}} \PYG{n}{small} \PYG{n}{circle} \PYG{n}{O} \PYG{o}{\PYGZhy{}} \PYG{n}{large} \PYG{n}{circle} \PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{dots} \PYG{o}{*} \PYG{o}{\PYGZhy{}} \PYG{n}{stars} \end{sphinxVerbatim} Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member. ACCEPTS: {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \end{fulllineitems} \index{set\_joinstyle() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_joinstyle}}}{\emph{js}}{} Set the joinstyle for the collection. The joinstyle can only be set globally for all elements in the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{js}}] \leavevmode{[}{[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]}{]} The joinstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_label() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyle() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyle}}}{\emph{ls}}{} Set the linestyle(s) for the collection. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily linestyle &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} or \sphinxcode{\sphinxupquote{'solid'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} or \sphinxcode{\sphinxupquote{'dashed'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} or \sphinxcode{\sphinxupquote{'dashdot'}} & dash-dotted line \\ \hline \sphinxcode{\sphinxupquote{':'}} or \sphinxcode{\sphinxupquote{'dotted'}} & dotted line \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Alternatively a dash tuple of the following form can be provided: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{onoffseq}} is an even length tuple of on and off ink in points. \begin{description} \item[{ACCEPTS: {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{}}] \leavevmode (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \end{description} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ls}}] \leavevmode{[}\{ ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’\} and more see description{]} The line style. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyles() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyles}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_linewidth() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{lw}}{} Set the linewidth(s) for the collection. \sphinxstyleemphasis{lw} can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_linewidths() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidths}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_lw() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_lw}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_norm() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_norm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_norm}}}{\emph{norm}}{} Set the normalization instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_offset\_position() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset\_position}}}{\emph{offset\_position}}{} Set how offsets are applied. If \sphinxstyleemphasis{offset\_position} is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{set\_offsets() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offsets}}}{\emph{offsets}}{} Set the offsets for the collection. \sphinxstyleemphasis{offsets} can be a scalar or a sequence. ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_path\_effects() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_paths() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_paths}}}{}{}~ \end{fulllineitems} \index{set\_picker() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_pickradius() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{pr}}{} Set the pick radius used for containment tests. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{d}}] \leavevmode{[}float{]} Pick radius, in points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_rasterized() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sketch\_params() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_snap() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_transform() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_url() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_urls() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_urls}}}{\emph{urls}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{urls}}] \leavevmode{[}List{[}str{]} or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_visible() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_zorder() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.set_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{stale (matplotlib.collections.Collection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.stale}}\pysigline{\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \index{sticky\_edges (matplotlib.collections.Collection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.sticky_edges}}\pysigline{\sphinxbfcode{\sphinxupquote{sticky\_edges}}} \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} sticky edge lists. When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added\textendash{}the view limit “sticks” to the edge. A typical usecase is histograms, where one usually expects no margin on the bottom edge (0) of the histogram. This attribute cannot be assigned to; however, the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} lists can be modified in place as needed. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{x}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{to\_rgba() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.to_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_rgba}}}{\emph{x}, \emph{alpha=None}, \emph{bytes=False}, \emph{norm=True}}{} Return a normalized rgba array corresponding to \sphinxstyleemphasis{x}. In the normal case, \sphinxstyleemphasis{x} is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable. There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If \sphinxstyleemphasis{x} is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the \sphinxstyleemphasis{alpha} kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the \sphinxstyleemphasis{alpha} kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4. In either case, if \sphinxstyleemphasis{bytes} is \sphinxstyleemphasis{False} (default), the rgba array will be floats in the 0-1 range; if it is \sphinxstyleemphasis{True}, the returned rgba array will be uint8 in the 0 to 255 range. If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1). \end{fulllineitems} \index{update() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \index{update\_from() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.update_from}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} copy properties from other to self \end{fulllineitems} \index{update\_scalarmappable() (matplotlib.collections.Collection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.update_scalarmappable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_scalarmappable}}}{}{} If the scalar mappable array is not none, update colors from scalar data \end{fulllineitems} \index{zorder (matplotlib.collections.Collection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.Collection.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \end{fulllineitems} \index{EllipseCollection (class in matplotlib.collections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.collections.}}\sphinxbfcode{\sphinxupquote{EllipseCollection}}}{\emph{widths}, \emph{heights}, \emph{angles}, \emph{units='points'}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.Collection}}}}} A collection of ellipses, drawn using splines. \begin{description} \item[{\sphinxstyleemphasis{widths}: sequence}] \leavevmode lengths of first axes (e.g., major axis lengths) \item[{\sphinxstyleemphasis{heights}: sequence}] \leavevmode lengths of second axes \item[{\sphinxstyleemphasis{angles}: sequence}] \leavevmode angles of first axes, degrees CCW from the X-axis \end{description} \sphinxstyleemphasis{units}: {[}‘points’ \textbar{} ‘inches’ \textbar{} ‘dots’ \textbar{} ‘width’ \textbar{} ‘height’ \textbar{} ‘x’ \textbar{} ‘y’ \textbar{} ‘xy’{]} \begin{quote} units in which majors and minors are given; ‘width’ and ‘height’ refer to the dimensions of the axes, while ‘x’ and ‘y’ refer to the \sphinxstyleemphasis{offsets} data units. ‘xy’ differs from all others in that the angle as plotted varies with the aspect ratio, and equals the specified angle only when the aspect ratio is unity. Hence it behaves the same as the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Ellipse:matplotlib.patches.Ellipse}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Ellipse}}}}} with axes.transData as its transform. \end{quote} Additional kwargs inherited from the base {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Collection}}}}}: \begin{quote} Valid Collection keyword arguments: \begin{itemize} \item {} \sphinxstyleemphasis{edgecolors}: None \item {} \sphinxstyleemphasis{facecolors}: None \item {} \sphinxstyleemphasis{linewidths}: None \item {} \sphinxstyleemphasis{antialiaseds}: None \item {} \sphinxstyleemphasis{offsets}: None \item {} \sphinxstyleemphasis{transOffset}: transforms.IdentityTransform() \item {} \sphinxstyleemphasis{norm}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \item {} \sphinxstyleemphasis{cmap}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \end{itemize} \sphinxstyleemphasis{offsets} and \sphinxstyleemphasis{transOffset} are used to translate the patch after rendering (default no offsets) If any of \sphinxstyleemphasis{edgecolors}, \sphinxstyleemphasis{facecolors}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{antialiaseds} are None, they default to their {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcParams}}}}} patch setting, in sequence form. \end{quote} \index{add\_callback() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.add_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \index{add\_checker() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.add_checker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_checker}}}{\emph{checker}}{} Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed. \end{fulllineitems} \index{aname (matplotlib.collections.EllipseCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.aname}}\pysigline{\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \index{autoscale() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Autoscale the scalar limits on the norm instance using the current array \end{fulllineitems} \index{autoscale\_None() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{}{} Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None \end{fulllineitems} \index{axes (matplotlib.collections.EllipseCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.axes}}\pysigline{\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \index{changed() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{changed}}}{}{} Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal \end{fulllineitems} \index{check\_update() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.check_update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{check\_update}}}{\emph{checker}}{} If mappable has changed since the last check, return True; else return False \end{fulllineitems} \index{contains() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the collection. Returns True \textbar{} False, \sphinxcode{\sphinxupquote{dict(ind=itemlist)}}, where every item in itemlist contains the event. \end{fulllineitems} \index{convert\_xunits() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.convert_xunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \index{convert\_yunits() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.convert_yunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \index{draw() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \index{findobj() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.findobj}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \index{format\_cursor\_data() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.format_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \index{get\_agg\_filter() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \index{get\_alpha() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \index{get\_animated() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \index{get\_array() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_array}}}{}{} Return the array \end{fulllineitems} \index{get\_capstyle() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{}~ \end{fulllineitems} \index{get\_children() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \index{get\_clim() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clim}}}{}{} return the min, max of the color limits for image scaling \end{fulllineitems} \index{get\_clip\_box() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \index{get\_clip\_on() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \index{get\_clip\_path() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \index{get\_cmap() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cmap}}}{}{} return the colormap \end{fulllineitems} \index{get\_contains() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \index{get\_cursor\_data() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \index{get\_dashes() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashes}}}{}{}~ \end{fulllineitems} \index{get\_datalim() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_datalim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_datalim}}}{\emph{transData}}{}~ \end{fulllineitems} \index{get\_edgecolor() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolor}}}{}{}~ \end{fulllineitems} \index{get\_edgecolors() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolors}}}{}{}~ \end{fulllineitems} \index{get\_facecolor() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{}~ \end{fulllineitems} \index{get\_facecolors() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolors}}}{}{}~ \end{fulllineitems} \index{get\_figure() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \index{get\_fill() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_fill}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fill}}}{}{} return whether fill is set \end{fulllineitems} \index{get\_gid() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \index{get\_hatch() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch}}}{}{} Return the current hatching pattern. \end{fulllineitems} \index{get\_joinstyle() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{}~ \end{fulllineitems} \index{get\_label() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \index{get\_linestyle() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyle}}}{}{}~ \end{fulllineitems} \index{get\_linestyles() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyles}}}{}{}~ \end{fulllineitems} \index{get\_linewidth() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidth}}}{}{}~ \end{fulllineitems} \index{get\_linewidths() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidths}}}{}{}~ \end{fulllineitems} \index{get\_offset\_position() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_position}}}{}{} Returns how offsets are applied for the collection. If \sphinxstyleemphasis{offset\_position} is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{get\_offset\_transform() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_offset_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_transform}}}{}{}~ \end{fulllineitems} \index{get\_offsets() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offsets}}}{}{} Return the offsets for the collection. \end{fulllineitems} \index{get\_path\_effects() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \index{get\_paths() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_paths}}}{}{}~ \end{fulllineitems} \index{get\_picker() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \index{get\_pickradius() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{}~ \end{fulllineitems} \index{get\_rasterized() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \index{get\_sketch\_params() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_snap() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \index{get\_transform() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \index{get\_transforms() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_transforms}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transforms}}}{}{}~ \end{fulllineitems} \index{get\_url() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \index{get\_urls() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_urls}}}{}{}~ \end{fulllineitems} \index{get\_visible() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \index{get\_window\_extent() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{get\_zorder() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.get_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \index{have\_units() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.have_units}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \index{hitlist() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.hitlist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hitlist}}}{\emph{event}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The hitlist function was deprecated in version 2.2. List the children of the artist which contain the mouse event \sphinxstyleemphasis{event}. \end{fulllineitems} \index{is\_figure\_set() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.is_figure_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_figure\_set}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }artist.figure is not None Returns whether the artist is assigned to a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \end{fulllineitems} \index{is\_transform\_set() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.is_transform_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \index{mouseover (matplotlib.collections.EllipseCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.mouseover}}\pysigline{\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \index{pchanged() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.pchanged}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \index{pick() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.pick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \index{pickable() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.pickable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \index{properties() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \index{remove() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \index{remove\_callback() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.remove_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \index{set() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \index{set\_agg\_filter() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_alpha() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha tranparencies of the collection. \sphinxstyleemphasis{alpha} must be a float or \sphinxstyleemphasis{None}. ACCEPTS: float or None \end{fulllineitems} \index{set\_animated() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_antialiased() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiased}}}{\emph{aa}}{} Set the antialiasing state for rendering. ACCEPTS: Boolean or sequence of booleans \end{fulllineitems} \index{set\_antialiaseds() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_antialiaseds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiaseds}}}{\emph{aa}}{} alias for set\_antialiased \end{fulllineitems} \index{set\_array() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_array}}}{\emph{A}}{} Set the image array from numpy array \sphinxstyleemphasis{A}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A}}] \leavevmode{[}ndarray{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_capstyle() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_capstyle}}}{\emph{cs}}{} Set the capstyle for the collection. The capstyle can only be set globally for all elements in the collection \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cs}}] \leavevmode{[}{[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]}{]} The capstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clim() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clim}}}{\emph{vmin=None}, \emph{vmax=None}}{} set the norm limits for image scaling; if \sphinxstyleemphasis{vmin} is a length2 sequence, interpret it as \sphinxcode{\sphinxupquote{(vmin, vmax)}} which is used to support setp ACCEPTS: a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \end{fulllineitems} \index{set\_clip\_box() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_on() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_path() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \index{set\_cmap() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cmap}}}{\emph{cmap}}{} set the colormap for luminance data ACCEPTS: a colormap or registered colormap name \end{fulllineitems} \index{set\_color() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{c}}{} Set both the edgecolor and the facecolor. ACCEPTS: matplotlib color arg or sequence of rgba tuples \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_facecolor()}}}}}, {\hyperref[\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_edgecolor()}}}}}}] \leavevmode For setting the edge or face color individually. \end{description} \end{fulllineitems} \index{set\_contains() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_dashes() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashes}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_edgecolor() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolor}}}{\emph{c}}{} Set the edgecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘face’, the edge color will always be the same as the face color. If it is ‘none’, the patch boundary will not be drawn. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_edgecolors() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolors}}}{\emph{c}}{} alias for set\_edgecolor \end{fulllineitems} \index{set\_facecolor() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{c}}{} Set the facecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘none’, the patch will not be filled. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_facecolors() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolors}}}{\emph{c}}{} alias for set\_facecolor \end{fulllineitems} \index{set\_figure() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_gid() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_hatch() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_hatch}}}{\emph{hatch}}{} Set the hatching pattern \sphinxstyleemphasis{hatch} can be one of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{/} \PYG{o}{\PYGZhy{}} \PYG{n}{diagonal} \PYG{n}{hatching} \PYGZbs{} \PYG{o}{\PYGZhy{}} \PYG{n}{back} \PYG{n}{diagonal} \PYG{o}{\textbar{}} \PYG{o}{\PYGZhy{}} \PYG{n}{vertical} \PYG{o}{\PYGZhy{}} \PYG{o}{\PYGZhy{}} \PYG{n}{horizontal} \PYG{o}{+} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{x} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{diagonal} \PYG{n}{o} \PYG{o}{\PYGZhy{}} \PYG{n}{small} \PYG{n}{circle} \PYG{n}{O} \PYG{o}{\PYGZhy{}} \PYG{n}{large} \PYG{n}{circle} \PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{dots} \PYG{o}{*} \PYG{o}{\PYGZhy{}} \PYG{n}{stars} \end{sphinxVerbatim} Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member. ACCEPTS: {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \end{fulllineitems} \index{set\_joinstyle() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_joinstyle}}}{\emph{js}}{} Set the joinstyle for the collection. The joinstyle can only be set globally for all elements in the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{js}}] \leavevmode{[}{[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]}{]} The joinstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_label() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyle() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyle}}}{\emph{ls}}{} Set the linestyle(s) for the collection. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily linestyle &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} or \sphinxcode{\sphinxupquote{'solid'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} or \sphinxcode{\sphinxupquote{'dashed'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} or \sphinxcode{\sphinxupquote{'dashdot'}} & dash-dotted line \\ \hline \sphinxcode{\sphinxupquote{':'}} or \sphinxcode{\sphinxupquote{'dotted'}} & dotted line \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Alternatively a dash tuple of the following form can be provided: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{onoffseq}} is an even length tuple of on and off ink in points. \begin{description} \item[{ACCEPTS: {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{}}] \leavevmode (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \end{description} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ls}}] \leavevmode{[}\{ ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’\} and more see description{]} The line style. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyles() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyles}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_linewidth() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{lw}}{} Set the linewidth(s) for the collection. \sphinxstyleemphasis{lw} can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_linewidths() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidths}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_lw() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_lw}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_norm() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_norm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_norm}}}{\emph{norm}}{} Set the normalization instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_offset\_position() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset\_position}}}{\emph{offset\_position}}{} Set how offsets are applied. If \sphinxstyleemphasis{offset\_position} is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{set\_offsets() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offsets}}}{\emph{offsets}}{} Set the offsets for the collection. \sphinxstyleemphasis{offsets} can be a scalar or a sequence. ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_path\_effects() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_paths() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_paths}}}{}{}~ \end{fulllineitems} \index{set\_picker() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_pickradius() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{pr}}{} Set the pick radius used for containment tests. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{d}}] \leavevmode{[}float{]} Pick radius, in points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_rasterized() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sketch\_params() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_snap() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_transform() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_url() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_urls() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_urls}}}{\emph{urls}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{urls}}] \leavevmode{[}List{[}str{]} or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_visible() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_zorder() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.set_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{stale (matplotlib.collections.EllipseCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.stale}}\pysigline{\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \index{sticky\_edges (matplotlib.collections.EllipseCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.sticky_edges}}\pysigline{\sphinxbfcode{\sphinxupquote{sticky\_edges}}} \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} sticky edge lists. When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added\textendash{}the view limit “sticks” to the edge. A typical usecase is histograms, where one usually expects no margin on the bottom edge (0) of the histogram. This attribute cannot be assigned to; however, the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} lists can be modified in place as needed. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{x}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{to\_rgba() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.to_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_rgba}}}{\emph{x}, \emph{alpha=None}, \emph{bytes=False}, \emph{norm=True}}{} Return a normalized rgba array corresponding to \sphinxstyleemphasis{x}. In the normal case, \sphinxstyleemphasis{x} is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable. There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If \sphinxstyleemphasis{x} is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the \sphinxstyleemphasis{alpha} kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the \sphinxstyleemphasis{alpha} kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4. In either case, if \sphinxstyleemphasis{bytes} is \sphinxstyleemphasis{False} (default), the rgba array will be floats in the 0-1 range; if it is \sphinxstyleemphasis{True}, the returned rgba array will be uint8 in the 0 to 255 range. If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1). \end{fulllineitems} \index{update() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \index{update\_from() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.update_from}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} copy properties from other to self \end{fulllineitems} \index{update\_scalarmappable() (matplotlib.collections.EllipseCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.update_scalarmappable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_scalarmappable}}}{}{} If the scalar mappable array is not none, update colors from scalar data \end{fulllineitems} \index{zorder (matplotlib.collections.EllipseCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EllipseCollection.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \end{fulllineitems} \index{EventCollection (class in matplotlib.collections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.collections.}}\sphinxbfcode{\sphinxupquote{EventCollection}}}{\emph{positions}, \emph{orientation=None}, \emph{lineoffset=0}, \emph{linelength=1}, \emph{linewidth=None}, \emph{color=None}, \emph{linestyle='solid'}, \emph{antialiased=None}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} A collection of discrete events. The events are given by a 1-dimensional array, usually the position of something along an axis, such as time or length. They do not have an amplitude and are displayed as vertical or horizontal parallel bars. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{positions}}] \leavevmode{[}1D array-like object{]} Each value is an event. \item[{\sphinxstylestrong{orientation}}] \leavevmode{[}\{None, ‘horizontal’, ‘vertical’\}, optional{]} The orientation of the \sphinxstylestrong{collection} (the event bars are along the orthogonal direction). Defaults to ‘horizontal’ if not specified or None. \item[{\sphinxstylestrong{lineoffset}}] \leavevmode{[}scalar, optional, default: 0{]} The offset of the center of the markers from the origin, in the direction orthogonal to \sphinxstyleemphasis{orientation}. \item[{\sphinxstylestrong{linelength}}] \leavevmode{[}scalar, optional, default: 1{]} The total height of the marker (i.e. the marker stretches from \sphinxcode{\sphinxupquote{lineoffset - linelength/2}} to \sphinxcode{\sphinxupquote{lineoffset + linelength/2}}). \item[{\sphinxstylestrong{linewidth}}] \leavevmode{[}scalar or None, optional, default: None{]} If it is None, defaults to its rcParams setting, in sequence form. \item[{\sphinxstylestrong{color}}] \leavevmode{[}color, sequence of colors or None, optional, default: None{]} If it is None, defaults to its rcParams setting, in sequence form. \item[{\sphinxstylestrong{linestyle}}] \leavevmode{[}str or tuple, optional, default: ‘solid’{]} Valid strings are {[}‘solid’, ‘dashed’, ‘dashdot’, ‘dotted’, ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’{]}. Dash tuples should be of the form: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxstyleemphasis{onoffseq} is an even length tuple of on and off ink in points. \item[{\sphinxstylestrong{antialiased}}] \leavevmode{[}\{None, 1, 2\}, optional{]} If it is None, defaults to its rcParams setting, in sequence form. \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}optional{]} Other keyword arguments are line collection properties. See {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} for a list of the valid properties. \end{description} \end{description}\end{quote} \paragraph{Examples} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{eventcollection_demo}.pdf} \end{figure} \index{add\_callback() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.add_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/collections_api:matplotlib.collections.EventCollection.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \index{add\_checker() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.add_checker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_checker}}}{\emph{checker}}{} Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed. \end{fulllineitems} \index{add\_positions() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.add_positions}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_positions}}}{\emph{position}}{} add one or more events at the specified positions \end{fulllineitems} \index{aname (matplotlib.collections.EventCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.aname}}\pysigline{\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \index{append\_positions() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.append_positions}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{append\_positions}}}{\emph{position}}{} add one or more events at the specified positions \end{fulllineitems} \index{autoscale() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Autoscale the scalar limits on the norm instance using the current array \end{fulllineitems} \index{autoscale\_None() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{}{} Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None \end{fulllineitems} \index{axes (matplotlib.collections.EventCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.axes}}\pysigline{\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \index{changed() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{changed}}}{}{} Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal \end{fulllineitems} \index{check\_update() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.check_update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{check\_update}}}{\emph{checker}}{} If mappable has changed since the last check, return True; else return False \end{fulllineitems} \index{contains() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the collection. Returns True \textbar{} False, \sphinxcode{\sphinxupquote{dict(ind=itemlist)}}, where every item in itemlist contains the event. \end{fulllineitems} \index{convert\_xunits() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.convert_xunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \index{convert\_yunits() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.convert_yunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \index{draw() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \index{extend\_positions() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.extend_positions}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{extend\_positions}}}{\emph{position}}{} add one or more events at the specified positions \end{fulllineitems} \index{findobj() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.findobj}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \index{format\_cursor\_data() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.format_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \index{get\_agg\_filter() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \index{get\_alpha() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \index{get\_animated() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \index{get\_array() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_array}}}{}{} Return the array \end{fulllineitems} \index{get\_capstyle() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{}~ \end{fulllineitems} \index{get\_children() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \index{get\_clim() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clim}}}{}{} return the min, max of the color limits for image scaling \end{fulllineitems} \index{get\_clip\_box() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \index{get\_clip\_on() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \index{get\_clip\_path() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \index{get\_cmap() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cmap}}}{}{} return the colormap \end{fulllineitems} \index{get\_color() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_color}}}{}{} get the color of the lines used to mark each event \end{fulllineitems} \index{get\_colors() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_colors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_colors}}}{}{}~ \end{fulllineitems} \index{get\_contains() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \index{get\_cursor\_data() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \index{get\_dashes() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashes}}}{}{}~ \end{fulllineitems} \index{get\_datalim() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_datalim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_datalim}}}{\emph{transData}}{}~ \end{fulllineitems} \index{get\_edgecolor() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolor}}}{}{}~ \end{fulllineitems} \index{get\_edgecolors() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolors}}}{}{}~ \end{fulllineitems} \index{get\_facecolor() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{}~ \end{fulllineitems} \index{get\_facecolors() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolors}}}{}{}~ \end{fulllineitems} \index{get\_figure() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \index{get\_fill() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_fill}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fill}}}{}{} return whether fill is set \end{fulllineitems} \index{get\_gid() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \index{get\_hatch() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch}}}{}{} Return the current hatching pattern. \end{fulllineitems} \index{get\_joinstyle() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{}~ \end{fulllineitems} \index{get\_label() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \index{get\_linelength() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_linelength}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linelength}}}{}{} get the length of the lines used to mark each event \end{fulllineitems} \index{get\_lineoffset() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_lineoffset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_lineoffset}}}{}{} get the offset of the lines used to mark each event \end{fulllineitems} \index{get\_linestyle() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyle}}}{}{} get the style of the lines used to mark each event {[} ‘solid’ \textbar{} ‘dashed’ \textbar{} ‘dashdot’ \textbar{} ‘dotted’ {]} \end{fulllineitems} \index{get\_linestyles() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyles}}}{}{}~ \end{fulllineitems} \index{get\_linewidth() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidth}}}{}{} get the width of the lines used to mark each event \end{fulllineitems} \index{get\_linewidths() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidths}}}{}{}~ \end{fulllineitems} \index{get\_offset\_position() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_position}}}{}{} Returns how offsets are applied for the collection. If \sphinxstyleemphasis{offset\_position} is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{get\_offset\_transform() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_offset_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_transform}}}{}{}~ \end{fulllineitems} \index{get\_offsets() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offsets}}}{}{} Return the offsets for the collection. \end{fulllineitems} \index{get\_orientation() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_orientation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_orientation}}}{}{} get the orientation of the event line, may be: {[} ‘horizontal’ \textbar{} ‘vertical’ {]} \end{fulllineitems} \index{get\_path\_effects() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \index{get\_paths() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_paths}}}{}{}~ \end{fulllineitems} \index{get\_picker() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \index{get\_pickradius() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{}~ \end{fulllineitems} \index{get\_positions() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_positions}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_positions}}}{}{} return an array containing the floating-point values of the positions \end{fulllineitems} \index{get\_rasterized() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \index{get\_segments() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_segments}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_segments}}}{}{}~\begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{segments}}] \leavevmode{[}list{]} List of segments in the LineCollection. Each list item contains an array of vertices. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_sketch\_params() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_snap() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \index{get\_transform() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \index{get\_transforms() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_transforms}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transforms}}}{}{}~ \end{fulllineitems} \index{get\_url() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \index{get\_urls() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_urls}}}{}{}~ \end{fulllineitems} \index{get\_visible() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \index{get\_window\_extent() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{get\_zorder() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.get_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \index{have\_units() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.have_units}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \index{hitlist() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.hitlist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hitlist}}}{\emph{event}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The hitlist function was deprecated in version 2.2. List the children of the artist which contain the mouse event \sphinxstyleemphasis{event}. \end{fulllineitems} \index{is\_figure\_set() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.is_figure_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_figure\_set}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }artist.figure is not None Returns whether the artist is assigned to a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \end{fulllineitems} \index{is\_horizontal() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.is_horizontal}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_horizontal}}}{}{} True if the eventcollection is horizontal, False if vertical \end{fulllineitems} \index{is\_transform\_set() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.is_transform_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \index{mouseover (matplotlib.collections.EventCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.mouseover}}\pysigline{\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \index{pchanged() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.pchanged}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \index{pick() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.pick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \index{pickable() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.pickable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \index{properties() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \index{remove() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \index{remove\_callback() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.remove_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.EventCollection.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \index{set() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \index{set\_agg\_filter() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_alpha() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha tranparencies of the collection. \sphinxstyleemphasis{alpha} must be a float or \sphinxstyleemphasis{None}. ACCEPTS: float or None \end{fulllineitems} \index{set\_animated() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_antialiased() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiased}}}{\emph{aa}}{} Set the antialiasing state for rendering. ACCEPTS: Boolean or sequence of booleans \end{fulllineitems} \index{set\_antialiaseds() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_antialiaseds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiaseds}}}{\emph{aa}}{} alias for set\_antialiased \end{fulllineitems} \index{set\_array() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_array}}}{\emph{A}}{} Set the image array from numpy array \sphinxstyleemphasis{A}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A}}] \leavevmode{[}ndarray{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_capstyle() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_capstyle}}}{\emph{cs}}{} Set the capstyle for the collection. The capstyle can only be set globally for all elements in the collection \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cs}}] \leavevmode{[}{[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]}{]} The capstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clim() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clim}}}{\emph{vmin=None}, \emph{vmax=None}}{} set the norm limits for image scaling; if \sphinxstyleemphasis{vmin} is a length2 sequence, interpret it as \sphinxcode{\sphinxupquote{(vmin, vmax)}} which is used to support setp ACCEPTS: a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \end{fulllineitems} \index{set\_clip\_box() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_on() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_path() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \index{set\_cmap() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cmap}}}{\emph{cmap}}{} set the colormap for luminance data ACCEPTS: a colormap or registered colormap name \end{fulllineitems} \index{set\_color() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{c}}{} Set the color(s) of the LineCollection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{c :}}] \leavevmode Matplotlib color argument (all patches have same color), or a sequence or rgba tuples; if it is a sequence the patches will cycle through the sequence. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_contains() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_dashes() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashes}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_edgecolor() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolor}}}{\emph{c}}{} Set the edgecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘face’, the edge color will always be the same as the face color. If it is ‘none’, the patch boundary will not be drawn. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_edgecolors() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolors}}}{\emph{c}}{} alias for set\_edgecolor \end{fulllineitems} \index{set\_facecolor() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{c}}{} Set the facecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘none’, the patch will not be filled. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_facecolors() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolors}}}{\emph{c}}{} alias for set\_facecolor \end{fulllineitems} \index{set\_figure() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_gid() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_hatch() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_hatch}}}{\emph{hatch}}{} Set the hatching pattern \sphinxstyleemphasis{hatch} can be one of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{/} \PYG{o}{\PYGZhy{}} \PYG{n}{diagonal} \PYG{n}{hatching} \PYGZbs{} \PYG{o}{\PYGZhy{}} \PYG{n}{back} \PYG{n}{diagonal} \PYG{o}{\textbar{}} \PYG{o}{\PYGZhy{}} \PYG{n}{vertical} \PYG{o}{\PYGZhy{}} \PYG{o}{\PYGZhy{}} \PYG{n}{horizontal} \PYG{o}{+} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{x} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{diagonal} \PYG{n}{o} \PYG{o}{\PYGZhy{}} \PYG{n}{small} \PYG{n}{circle} \PYG{n}{O} \PYG{o}{\PYGZhy{}} \PYG{n}{large} \PYG{n}{circle} \PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{dots} \PYG{o}{*} \PYG{o}{\PYGZhy{}} \PYG{n}{stars} \end{sphinxVerbatim} Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member. ACCEPTS: {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \end{fulllineitems} \index{set\_joinstyle() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_joinstyle}}}{\emph{js}}{} Set the joinstyle for the collection. The joinstyle can only be set globally for all elements in the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{js}}] \leavevmode{[}{[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]}{]} The joinstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_label() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linelength() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_linelength}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linelength}}}{\emph{linelength}}{} set the length of the lines used to mark each event \end{fulllineitems} \index{set\_lineoffset() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_lineoffset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_lineoffset}}}{\emph{lineoffset}}{} set the offset of the lines used to mark each event \end{fulllineitems} \index{set\_linestyle() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyle}}}{\emph{ls}}{} Set the linestyle(s) for the collection. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily linestyle &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} or \sphinxcode{\sphinxupquote{'solid'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} or \sphinxcode{\sphinxupquote{'dashed'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} or \sphinxcode{\sphinxupquote{'dashdot'}} & dash-dotted line \\ \hline \sphinxcode{\sphinxupquote{':'}} or \sphinxcode{\sphinxupquote{'dotted'}} & dotted line \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Alternatively a dash tuple of the following form can be provided: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{onoffseq}} is an even length tuple of on and off ink in points. \begin{description} \item[{ACCEPTS: {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{}}] \leavevmode (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \end{description} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ls}}] \leavevmode{[}\{ ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’\} and more see description{]} The line style. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyles() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyles}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_linewidth() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{lw}}{} Set the linewidth(s) for the collection. \sphinxstyleemphasis{lw} can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_linewidths() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidths}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_lw() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_lw}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_norm() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_norm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_norm}}}{\emph{norm}}{} Set the normalization instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_offset\_position() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset\_position}}}{\emph{offset\_position}}{} Set how offsets are applied. If \sphinxstyleemphasis{offset\_position} is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{set\_offsets() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offsets}}}{\emph{offsets}}{} Set the offsets for the collection. \sphinxstyleemphasis{offsets} can be a scalar or a sequence. ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_orientation() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_orientation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_orientation}}}{\emph{orientation=None}}{} set the orientation of the event line {[} ‘horizontal’ \textbar{} ‘vertical’ \textbar{} None {]} defaults to ‘horizontal’ if not specified or None \end{fulllineitems} \index{set\_path\_effects() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_paths() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_paths}}}{\emph{segments}}{}~ \end{fulllineitems} \index{set\_picker() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_pickradius() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{pr}}{} Set the pick radius used for containment tests. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{d}}] \leavevmode{[}float{]} Pick radius, in points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_positions() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_positions}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_positions}}}{\emph{positions}}{} set the positions of the events to the specified value \end{fulllineitems} \index{set\_rasterized() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_segments() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_segments}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_segments}}}{\emph{segments}}{}~ \end{fulllineitems} \index{set\_sketch\_params() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_snap() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_transform() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_url() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_urls() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_urls}}}{\emph{urls}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{urls}}] \leavevmode{[}List{[}str{]} or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_verts() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_verts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_verts}}}{\emph{segments}}{}~ \end{fulllineitems} \index{set\_visible() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_zorder() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.set_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{stale (matplotlib.collections.EventCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.stale}}\pysigline{\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \index{sticky\_edges (matplotlib.collections.EventCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.sticky_edges}}\pysigline{\sphinxbfcode{\sphinxupquote{sticky\_edges}}} \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} sticky edge lists. When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added\textendash{}the view limit “sticks” to the edge. A typical usecase is histograms, where one usually expects no margin on the bottom edge (0) of the histogram. This attribute cannot be assigned to; however, the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} lists can be modified in place as needed. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{x}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{switch\_orientation() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.switch_orientation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{switch\_orientation}}}{}{} switch the orientation of the event line, either from vertical to horizontal or vice versus \end{fulllineitems} \index{to\_rgba() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.to_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_rgba}}}{\emph{x}, \emph{alpha=None}, \emph{bytes=False}, \emph{norm=True}}{} Return a normalized rgba array corresponding to \sphinxstyleemphasis{x}. In the normal case, \sphinxstyleemphasis{x} is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable. There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If \sphinxstyleemphasis{x} is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the \sphinxstyleemphasis{alpha} kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the \sphinxstyleemphasis{alpha} kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4. In either case, if \sphinxstyleemphasis{bytes} is \sphinxstyleemphasis{False} (default), the rgba array will be floats in the 0-1 range; if it is \sphinxstyleemphasis{True}, the returned rgba array will be uint8 in the 0 to 255 range. If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1). \end{fulllineitems} \index{update() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \index{update\_from() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.update_from}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} copy properties from other to self \end{fulllineitems} \index{update\_scalarmappable() (matplotlib.collections.EventCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.update_scalarmappable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_scalarmappable}}}{}{} If the scalar mappable array is not none, update colors from scalar data \end{fulllineitems} \index{zorder (matplotlib.collections.EventCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.EventCollection.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \end{fulllineitems} \index{LineCollection (class in matplotlib.collections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.collections.}}\sphinxbfcode{\sphinxupquote{LineCollection}}}{\emph{segments}, \emph{linewidths=None}, \emph{colors=None}, \emph{antialiaseds=None}, \emph{linestyles='solid'}, \emph{offsets=None}, \emph{transOffset=None}, \emph{norm=None}, \emph{cmap=None}, \emph{pickradius=5}, \emph{zorder=2}, \emph{facecolors='none'}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.Collection}}}}} All parameters must be sequences or scalars; if scalars, they will be converted to sequences. The property of the ith line segment is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{prop}\PYG{p}{[}\PYG{n}{i} \PYG{o}{\PYGZpc{}} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{props}\PYG{p}{)}\PYG{p}{]} \end{sphinxVerbatim} i.e., the properties cycle if the \sphinxcode{\sphinxupquote{len}} of props is less than the number of segments. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{segments :}}] \leavevmode A sequence of (\sphinxstyleemphasis{line0}, \sphinxstyleemphasis{line1}, \sphinxstyleemphasis{line2}), where: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{linen} \PYG{o}{=} \PYG{p}{(}\PYG{n}{x0}\PYG{p}{,} \PYG{n}{y0}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.} \PYG{p}{(}\PYG{n}{xm}\PYG{p}{,} \PYG{n}{ym}\PYG{p}{)} \end{sphinxVerbatim} or the equivalent numpy array with two columns. Each line can be a different length. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}sequence, optional{]} A sequence of RGBA tuples (e.g., arbitrary color strings, etc, not allowed). \item[{\sphinxstylestrong{antialiaseds}}] \leavevmode{[}sequence, optional{]} A sequence of ones or zeros. \item[{\sphinxstylestrong{linestyles}}] \leavevmode{[}string, tuple, optional{]} Either one of {[} ‘solid’ \textbar{} ‘dashed’ \textbar{} ‘dashdot’ \textbar{} ‘dotted’ {]}, or a dash tuple. The dash tuple is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{onoffseq}} is an even length tuple of on and off ink in points. \item[{\sphinxstylestrong{norm}}] \leavevmode{[}Normalize, optional{]} {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} instance. \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}string or Colormap, optional{]} Colormap name or {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}} instance. \item[{\sphinxstylestrong{pickradius}}] \leavevmode{[}float, optional{]} The tolerance in points for mouse clicks picking a line. Default is 5 pt. \item[{\sphinxstylestrong{zorder}}] \leavevmode{[}int, optional{]} zorder of the LineCollection. Default is 2. \item[{\sphinxstylestrong{facecolors}}] \leavevmode{[}optional{]} The facecolors of the LineCollection. Default is ‘none’. Setting to a value other than ‘none’ will lead to a filled polygon being drawn between points on each line. \end{description} \end{description}\end{quote} \paragraph{Notes} If \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{colors}, or \sphinxstyleemphasis{antialiaseds} is None, they default to their rcParams setting, in sequence form. If \sphinxstyleemphasis{offsets} and \sphinxstyleemphasis{transOffset} are not None, then \sphinxstyleemphasis{offsets} are transformed by \sphinxstyleemphasis{transOffset} and applied after the segments have been transformed to display coordinates. If \sphinxstyleemphasis{offsets} is not None but \sphinxstyleemphasis{transOffset} is None, then the \sphinxstyleemphasis{offsets} are added to the segments before any transformation. In this case, a single offset can be specified as: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{offsets}\PYG{o}{=}\PYG{p}{(}\PYG{n}{xo}\PYG{p}{,}\PYG{n}{yo}\PYG{p}{)} \end{sphinxVerbatim} and this value will be added cumulatively to each successive segment, so as to produce a set of successively offset curves. The use of {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarMappable}}}}} is optional. If the {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarMappable}}}}} array \sphinxcode{\sphinxupquote{\_A}} is not None (i.e., a call to {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_array()}}}}} has been made), at draw time a call to scalar mappable will be made to set the colors. \index{add\_callback() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.add_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \index{add\_checker() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.add_checker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_checker}}}{\emph{checker}}{} Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed. \end{fulllineitems} \index{aname (matplotlib.collections.LineCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.aname}}\pysigline{\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \index{autoscale() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Autoscale the scalar limits on the norm instance using the current array \end{fulllineitems} \index{autoscale\_None() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{}{} Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None \end{fulllineitems} \index{axes (matplotlib.collections.LineCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.axes}}\pysigline{\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \index{changed() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{changed}}}{}{} Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal \end{fulllineitems} \index{check\_update() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.check_update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{check\_update}}}{\emph{checker}}{} If mappable has changed since the last check, return True; else return False \end{fulllineitems} \index{contains() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the collection. Returns True \textbar{} False, \sphinxcode{\sphinxupquote{dict(ind=itemlist)}}, where every item in itemlist contains the event. \end{fulllineitems} \index{convert\_xunits() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.convert_xunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \index{convert\_yunits() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.convert_yunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \index{draw() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \index{findobj() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.findobj}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \index{format\_cursor\_data() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.format_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \index{get\_agg\_filter() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \index{get\_alpha() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \index{get\_animated() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \index{get\_array() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_array}}}{}{} Return the array \end{fulllineitems} \index{get\_capstyle() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{}~ \end{fulllineitems} \index{get\_children() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \index{get\_clim() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clim}}}{}{} return the min, max of the color limits for image scaling \end{fulllineitems} \index{get\_clip\_box() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \index{get\_clip\_on() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \index{get\_clip\_path() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \index{get\_cmap() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cmap}}}{}{} return the colormap \end{fulllineitems} \index{get\_color() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_color}}}{}{}~ \end{fulllineitems} \index{get\_colors() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_colors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_colors}}}{}{}~ \end{fulllineitems} \index{get\_contains() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \index{get\_cursor\_data() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \index{get\_dashes() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashes}}}{}{}~ \end{fulllineitems} \index{get\_datalim() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_datalim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_datalim}}}{\emph{transData}}{}~ \end{fulllineitems} \index{get\_edgecolor() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolor}}}{}{}~ \end{fulllineitems} \index{get\_edgecolors() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolors}}}{}{}~ \end{fulllineitems} \index{get\_facecolor() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{}~ \end{fulllineitems} \index{get\_facecolors() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolors}}}{}{}~ \end{fulllineitems} \index{get\_figure() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \index{get\_fill() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_fill}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fill}}}{}{} return whether fill is set \end{fulllineitems} \index{get\_gid() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \index{get\_hatch() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch}}}{}{} Return the current hatching pattern. \end{fulllineitems} \index{get\_joinstyle() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{}~ \end{fulllineitems} \index{get\_label() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \index{get\_linestyle() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyle}}}{}{}~ \end{fulllineitems} \index{get\_linestyles() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyles}}}{}{}~ \end{fulllineitems} \index{get\_linewidth() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidth}}}{}{}~ \end{fulllineitems} \index{get\_linewidths() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidths}}}{}{}~ \end{fulllineitems} \index{get\_offset\_position() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_position}}}{}{} Returns how offsets are applied for the collection. If \sphinxstyleemphasis{offset\_position} is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{get\_offset\_transform() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_offset_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_transform}}}{}{}~ \end{fulllineitems} \index{get\_offsets() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offsets}}}{}{} Return the offsets for the collection. \end{fulllineitems} \index{get\_path\_effects() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \index{get\_paths() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_paths}}}{}{}~ \end{fulllineitems} \index{get\_picker() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \index{get\_pickradius() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{}~ \end{fulllineitems} \index{get\_rasterized() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \index{get\_segments() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_segments}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_segments}}}{}{}~\begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{segments}}] \leavevmode{[}list{]} List of segments in the LineCollection. Each list item contains an array of vertices. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_sketch\_params() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_snap() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \index{get\_transform() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \index{get\_transforms() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_transforms}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transforms}}}{}{}~ \end{fulllineitems} \index{get\_url() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \index{get\_urls() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_urls}}}{}{}~ \end{fulllineitems} \index{get\_visible() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \index{get\_window\_extent() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{get\_zorder() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.get_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \index{have\_units() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.have_units}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \index{hitlist() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.hitlist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hitlist}}}{\emph{event}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The hitlist function was deprecated in version 2.2. List the children of the artist which contain the mouse event \sphinxstyleemphasis{event}. \end{fulllineitems} \index{is\_figure\_set() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.is_figure_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_figure\_set}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }artist.figure is not None Returns whether the artist is assigned to a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \end{fulllineitems} \index{is\_transform\_set() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.is_transform_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \index{mouseover (matplotlib.collections.LineCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.mouseover}}\pysigline{\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \index{pchanged() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.pchanged}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \index{pick() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.pick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \index{pickable() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.pickable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \index{properties() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \index{remove() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \index{remove\_callback() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.remove_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \index{set() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \index{set\_agg\_filter() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_alpha() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha tranparencies of the collection. \sphinxstyleemphasis{alpha} must be a float or \sphinxstyleemphasis{None}. ACCEPTS: float or None \end{fulllineitems} \index{set\_animated() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_antialiased() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiased}}}{\emph{aa}}{} Set the antialiasing state for rendering. ACCEPTS: Boolean or sequence of booleans \end{fulllineitems} \index{set\_antialiaseds() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_antialiaseds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiaseds}}}{\emph{aa}}{} alias for set\_antialiased \end{fulllineitems} \index{set\_array() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_array}}}{\emph{A}}{} Set the image array from numpy array \sphinxstyleemphasis{A}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A}}] \leavevmode{[}ndarray{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_capstyle() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_capstyle}}}{\emph{cs}}{} Set the capstyle for the collection. The capstyle can only be set globally for all elements in the collection \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cs}}] \leavevmode{[}{[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]}{]} The capstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clim() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clim}}}{\emph{vmin=None}, \emph{vmax=None}}{} set the norm limits for image scaling; if \sphinxstyleemphasis{vmin} is a length2 sequence, interpret it as \sphinxcode{\sphinxupquote{(vmin, vmax)}} which is used to support setp ACCEPTS: a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \end{fulllineitems} \index{set\_clip\_box() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_on() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_path() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \index{set\_cmap() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cmap}}}{\emph{cmap}}{} set the colormap for luminance data ACCEPTS: a colormap or registered colormap name \end{fulllineitems} \index{set\_color() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{c}}{} Set the color(s) of the LineCollection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{c :}}] \leavevmode Matplotlib color argument (all patches have same color), or a sequence or rgba tuples; if it is a sequence the patches will cycle through the sequence. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_contains() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_dashes() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashes}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_edgecolor() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolor}}}{\emph{c}}{} Set the edgecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘face’, the edge color will always be the same as the face color. If it is ‘none’, the patch boundary will not be drawn. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_edgecolors() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolors}}}{\emph{c}}{} alias for set\_edgecolor \end{fulllineitems} \index{set\_facecolor() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{c}}{} Set the facecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘none’, the patch will not be filled. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_facecolors() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolors}}}{\emph{c}}{} alias for set\_facecolor \end{fulllineitems} \index{set\_figure() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_gid() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_hatch() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_hatch}}}{\emph{hatch}}{} Set the hatching pattern \sphinxstyleemphasis{hatch} can be one of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{/} \PYG{o}{\PYGZhy{}} \PYG{n}{diagonal} \PYG{n}{hatching} \PYGZbs{} \PYG{o}{\PYGZhy{}} \PYG{n}{back} \PYG{n}{diagonal} \PYG{o}{\textbar{}} \PYG{o}{\PYGZhy{}} \PYG{n}{vertical} \PYG{o}{\PYGZhy{}} \PYG{o}{\PYGZhy{}} \PYG{n}{horizontal} \PYG{o}{+} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{x} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{diagonal} \PYG{n}{o} \PYG{o}{\PYGZhy{}} \PYG{n}{small} \PYG{n}{circle} \PYG{n}{O} \PYG{o}{\PYGZhy{}} \PYG{n}{large} \PYG{n}{circle} \PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{dots} \PYG{o}{*} \PYG{o}{\PYGZhy{}} \PYG{n}{stars} \end{sphinxVerbatim} Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member. ACCEPTS: {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \end{fulllineitems} \index{set\_joinstyle() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_joinstyle}}}{\emph{js}}{} Set the joinstyle for the collection. The joinstyle can only be set globally for all elements in the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{js}}] \leavevmode{[}{[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]}{]} The joinstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_label() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyle() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyle}}}{\emph{ls}}{} Set the linestyle(s) for the collection. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily linestyle &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} or \sphinxcode{\sphinxupquote{'solid'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} or \sphinxcode{\sphinxupquote{'dashed'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} or \sphinxcode{\sphinxupquote{'dashdot'}} & dash-dotted line \\ \hline \sphinxcode{\sphinxupquote{':'}} or \sphinxcode{\sphinxupquote{'dotted'}} & dotted line \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Alternatively a dash tuple of the following form can be provided: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{onoffseq}} is an even length tuple of on and off ink in points. \begin{description} \item[{ACCEPTS: {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{}}] \leavevmode (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \end{description} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ls}}] \leavevmode{[}\{ ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’\} and more see description{]} The line style. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyles() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyles}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_linewidth() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{lw}}{} Set the linewidth(s) for the collection. \sphinxstyleemphasis{lw} can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_linewidths() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidths}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_lw() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_lw}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_norm() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_norm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_norm}}}{\emph{norm}}{} Set the normalization instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_offset\_position() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset\_position}}}{\emph{offset\_position}}{} Set how offsets are applied. If \sphinxstyleemphasis{offset\_position} is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{set\_offsets() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offsets}}}{\emph{offsets}}{} Set the offsets for the collection. \sphinxstyleemphasis{offsets} can be a scalar or a sequence. ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_path\_effects() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_paths() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_paths}}}{\emph{segments}}{}~ \end{fulllineitems} \index{set\_picker() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_pickradius() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{pr}}{} Set the pick radius used for containment tests. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{d}}] \leavevmode{[}float{]} Pick radius, in points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_rasterized() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_segments() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_segments}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_segments}}}{\emph{segments}}{}~ \end{fulllineitems} \index{set\_sketch\_params() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_snap() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_transform() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_url() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_urls() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_urls}}}{\emph{urls}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{urls}}] \leavevmode{[}List{[}str{]} or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_verts() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_verts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_verts}}}{\emph{segments}}{}~ \end{fulllineitems} \index{set\_visible() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_zorder() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.set_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{stale (matplotlib.collections.LineCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.stale}}\pysigline{\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \index{sticky\_edges (matplotlib.collections.LineCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.sticky_edges}}\pysigline{\sphinxbfcode{\sphinxupquote{sticky\_edges}}} \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} sticky edge lists. When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added\textendash{}the view limit “sticks” to the edge. A typical usecase is histograms, where one usually expects no margin on the bottom edge (0) of the histogram. This attribute cannot be assigned to; however, the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} lists can be modified in place as needed. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{x}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{to\_rgba() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.to_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_rgba}}}{\emph{x}, \emph{alpha=None}, \emph{bytes=False}, \emph{norm=True}}{} Return a normalized rgba array corresponding to \sphinxstyleemphasis{x}. In the normal case, \sphinxstyleemphasis{x} is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable. There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If \sphinxstyleemphasis{x} is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the \sphinxstyleemphasis{alpha} kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the \sphinxstyleemphasis{alpha} kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4. In either case, if \sphinxstyleemphasis{bytes} is \sphinxstyleemphasis{False} (default), the rgba array will be floats in the 0-1 range; if it is \sphinxstyleemphasis{True}, the returned rgba array will be uint8 in the 0 to 255 range. If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1). \end{fulllineitems} \index{update() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \index{update\_from() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.update_from}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} copy properties from other to self \end{fulllineitems} \index{update\_scalarmappable() (matplotlib.collections.LineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.update_scalarmappable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_scalarmappable}}}{}{} If the scalar mappable array is not none, update colors from scalar data \end{fulllineitems} \index{zorder (matplotlib.collections.LineCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.LineCollection.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \end{fulllineitems} \index{PatchCollection (class in matplotlib.collections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.collections.}}\sphinxbfcode{\sphinxupquote{PatchCollection}}}{\emph{patches}, \emph{match\_original=False}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.Collection}}}}} A generic collection of patches. This makes it easier to assign a color map to a heterogeneous collection of patches. This also may improve plotting speed, since PatchCollection will draw faster than a large number of patches. \begin{description} \item[{\sphinxstyleemphasis{patches}}] \leavevmode a sequence of Patch objects. This list may include a heterogeneous assortment of different patch types. \item[{\sphinxstyleemphasis{match\_original}}] \leavevmode If True, use the colors and linewidths of the original patches. If False, new colors may be assigned by providing the standard collection arguments, facecolor, edgecolor, linewidths, norm or cmap. \end{description} If any of \sphinxstyleemphasis{edgecolors}, \sphinxstyleemphasis{facecolors}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{antialiaseds} are None, they default to their {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcParams}}}}} patch setting, in sequence form. The use of {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarMappable}}}}} is optional. If the {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarMappable}}}}} matrix \_A is not None (i.e., a call to set\_array has been made), at draw time a call to scalar mappable will be made to set the face colors. \index{add\_callback() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.add_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PatchCollection.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \index{add\_checker() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.add_checker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_checker}}}{\emph{checker}}{} Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed. \end{fulllineitems} \index{aname (matplotlib.collections.PatchCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.aname}}\pysigline{\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \index{autoscale() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Autoscale the scalar limits on the norm instance using the current array \end{fulllineitems} \index{autoscale\_None() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{}{} Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None \end{fulllineitems} \index{axes (matplotlib.collections.PatchCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.axes}}\pysigline{\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \index{changed() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{changed}}}{}{} Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal \end{fulllineitems} \index{check\_update() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.check_update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{check\_update}}}{\emph{checker}}{} If mappable has changed since the last check, return True; else return False \end{fulllineitems} \index{contains() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the collection. Returns True \textbar{} False, \sphinxcode{\sphinxupquote{dict(ind=itemlist)}}, where every item in itemlist contains the event. \end{fulllineitems} \index{convert\_xunits() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.convert_xunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \index{convert\_yunits() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.convert_yunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \index{draw() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \index{findobj() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.findobj}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \index{format\_cursor\_data() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.format_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \index{get\_agg\_filter() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \index{get\_alpha() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \index{get\_animated() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \index{get\_array() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_array}}}{}{} Return the array \end{fulllineitems} \index{get\_capstyle() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{}~ \end{fulllineitems} \index{get\_children() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \index{get\_clim() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clim}}}{}{} return the min, max of the color limits for image scaling \end{fulllineitems} \index{get\_clip\_box() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \index{get\_clip\_on() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \index{get\_clip\_path() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \index{get\_cmap() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cmap}}}{}{} return the colormap \end{fulllineitems} \index{get\_contains() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \index{get\_cursor\_data() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \index{get\_dashes() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashes}}}{}{}~ \end{fulllineitems} \index{get\_datalim() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_datalim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_datalim}}}{\emph{transData}}{}~ \end{fulllineitems} \index{get\_edgecolor() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolor}}}{}{}~ \end{fulllineitems} \index{get\_edgecolors() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolors}}}{}{}~ \end{fulllineitems} \index{get\_facecolor() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{}~ \end{fulllineitems} \index{get\_facecolors() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolors}}}{}{}~ \end{fulllineitems} \index{get\_figure() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \index{get\_fill() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_fill}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fill}}}{}{} return whether fill is set \end{fulllineitems} \index{get\_gid() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \index{get\_hatch() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch}}}{}{} Return the current hatching pattern. \end{fulllineitems} \index{get\_joinstyle() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{}~ \end{fulllineitems} \index{get\_label() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \index{get\_linestyle() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyle}}}{}{}~ \end{fulllineitems} \index{get\_linestyles() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyles}}}{}{}~ \end{fulllineitems} \index{get\_linewidth() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidth}}}{}{}~ \end{fulllineitems} \index{get\_linewidths() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidths}}}{}{}~ \end{fulllineitems} \index{get\_offset\_position() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_position}}}{}{} Returns how offsets are applied for the collection. If \sphinxstyleemphasis{offset\_position} is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{get\_offset\_transform() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_offset_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_transform}}}{}{}~ \end{fulllineitems} \index{get\_offsets() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offsets}}}{}{} Return the offsets for the collection. \end{fulllineitems} \index{get\_path\_effects() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \index{get\_paths() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_paths}}}{}{}~ \end{fulllineitems} \index{get\_picker() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \index{get\_pickradius() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{}~ \end{fulllineitems} \index{get\_rasterized() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \index{get\_sketch\_params() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_snap() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \index{get\_transform() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \index{get\_transforms() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_transforms}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transforms}}}{}{}~ \end{fulllineitems} \index{get\_url() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \index{get\_urls() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_urls}}}{}{}~ \end{fulllineitems} \index{get\_visible() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \index{get\_window\_extent() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{get\_zorder() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.get_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \index{have\_units() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.have_units}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \index{hitlist() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.hitlist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hitlist}}}{\emph{event}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The hitlist function was deprecated in version 2.2. List the children of the artist which contain the mouse event \sphinxstyleemphasis{event}. \end{fulllineitems} \index{is\_figure\_set() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.is_figure_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_figure\_set}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }artist.figure is not None Returns whether the artist is assigned to a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \end{fulllineitems} \index{is\_transform\_set() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.is_transform_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \index{mouseover (matplotlib.collections.PatchCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.mouseover}}\pysigline{\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \index{pchanged() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.pchanged}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \index{pick() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.pick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \index{pickable() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.pickable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \index{properties() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \index{remove() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \index{remove\_callback() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.remove_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.PatchCollection.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \index{set() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \index{set\_agg\_filter() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_alpha() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha tranparencies of the collection. \sphinxstyleemphasis{alpha} must be a float or \sphinxstyleemphasis{None}. ACCEPTS: float or None \end{fulllineitems} \index{set\_animated() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_antialiased() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiased}}}{\emph{aa}}{} Set the antialiasing state for rendering. ACCEPTS: Boolean or sequence of booleans \end{fulllineitems} \index{set\_antialiaseds() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_antialiaseds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiaseds}}}{\emph{aa}}{} alias for set\_antialiased \end{fulllineitems} \index{set\_array() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_array}}}{\emph{A}}{} Set the image array from numpy array \sphinxstyleemphasis{A}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A}}] \leavevmode{[}ndarray{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_capstyle() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_capstyle}}}{\emph{cs}}{} Set the capstyle for the collection. The capstyle can only be set globally for all elements in the collection \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cs}}] \leavevmode{[}{[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]}{]} The capstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clim() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clim}}}{\emph{vmin=None}, \emph{vmax=None}}{} set the norm limits for image scaling; if \sphinxstyleemphasis{vmin} is a length2 sequence, interpret it as \sphinxcode{\sphinxupquote{(vmin, vmax)}} which is used to support setp ACCEPTS: a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \end{fulllineitems} \index{set\_clip\_box() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_on() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_path() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \index{set\_cmap() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cmap}}}{\emph{cmap}}{} set the colormap for luminance data ACCEPTS: a colormap or registered colormap name \end{fulllineitems} \index{set\_color() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{c}}{} Set both the edgecolor and the facecolor. ACCEPTS: matplotlib color arg or sequence of rgba tuples \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_facecolor()}}}}}, {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_edgecolor()}}}}}}] \leavevmode For setting the edge or face color individually. \end{description} \end{fulllineitems} \index{set\_contains() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_dashes() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashes}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_edgecolor() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolor}}}{\emph{c}}{} Set the edgecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘face’, the edge color will always be the same as the face color. If it is ‘none’, the patch boundary will not be drawn. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_edgecolors() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolors}}}{\emph{c}}{} alias for set\_edgecolor \end{fulllineitems} \index{set\_facecolor() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{c}}{} Set the facecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘none’, the patch will not be filled. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_facecolors() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolors}}}{\emph{c}}{} alias for set\_facecolor \end{fulllineitems} \index{set\_figure() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_gid() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_hatch() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_hatch}}}{\emph{hatch}}{} Set the hatching pattern \sphinxstyleemphasis{hatch} can be one of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{/} \PYG{o}{\PYGZhy{}} \PYG{n}{diagonal} \PYG{n}{hatching} \PYGZbs{} \PYG{o}{\PYGZhy{}} \PYG{n}{back} \PYG{n}{diagonal} \PYG{o}{\textbar{}} \PYG{o}{\PYGZhy{}} \PYG{n}{vertical} \PYG{o}{\PYGZhy{}} \PYG{o}{\PYGZhy{}} \PYG{n}{horizontal} \PYG{o}{+} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{x} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{diagonal} \PYG{n}{o} \PYG{o}{\PYGZhy{}} \PYG{n}{small} \PYG{n}{circle} \PYG{n}{O} \PYG{o}{\PYGZhy{}} \PYG{n}{large} \PYG{n}{circle} \PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{dots} \PYG{o}{*} \PYG{o}{\PYGZhy{}} \PYG{n}{stars} \end{sphinxVerbatim} Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member. ACCEPTS: {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \end{fulllineitems} \index{set\_joinstyle() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_joinstyle}}}{\emph{js}}{} Set the joinstyle for the collection. The joinstyle can only be set globally for all elements in the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{js}}] \leavevmode{[}{[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]}{]} The joinstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_label() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyle() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyle}}}{\emph{ls}}{} Set the linestyle(s) for the collection. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily linestyle &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} or \sphinxcode{\sphinxupquote{'solid'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} or \sphinxcode{\sphinxupquote{'dashed'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} or \sphinxcode{\sphinxupquote{'dashdot'}} & dash-dotted line \\ \hline \sphinxcode{\sphinxupquote{':'}} or \sphinxcode{\sphinxupquote{'dotted'}} & dotted line \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Alternatively a dash tuple of the following form can be provided: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{onoffseq}} is an even length tuple of on and off ink in points. \begin{description} \item[{ACCEPTS: {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{}}] \leavevmode (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \end{description} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ls}}] \leavevmode{[}\{ ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’\} and more see description{]} The line style. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyles() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyles}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_linewidth() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{lw}}{} Set the linewidth(s) for the collection. \sphinxstyleemphasis{lw} can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_linewidths() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidths}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_lw() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_lw}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_norm() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_norm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_norm}}}{\emph{norm}}{} Set the normalization instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_offset\_position() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset\_position}}}{\emph{offset\_position}}{} Set how offsets are applied. If \sphinxstyleemphasis{offset\_position} is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{set\_offsets() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offsets}}}{\emph{offsets}}{} Set the offsets for the collection. \sphinxstyleemphasis{offsets} can be a scalar or a sequence. ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_path\_effects() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_paths() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_paths}}}{\emph{patches}}{}~ \end{fulllineitems} \index{set\_picker() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_pickradius() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{pr}}{} Set the pick radius used for containment tests. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{d}}] \leavevmode{[}float{]} Pick radius, in points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_rasterized() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sketch\_params() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_snap() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_transform() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_url() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_urls() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_urls}}}{\emph{urls}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{urls}}] \leavevmode{[}List{[}str{]} or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_visible() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_zorder() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.set_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{stale (matplotlib.collections.PatchCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.stale}}\pysigline{\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \index{sticky\_edges (matplotlib.collections.PatchCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.sticky_edges}}\pysigline{\sphinxbfcode{\sphinxupquote{sticky\_edges}}} \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} sticky edge lists. When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added\textendash{}the view limit “sticks” to the edge. A typical usecase is histograms, where one usually expects no margin on the bottom edge (0) of the histogram. This attribute cannot be assigned to; however, the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} lists can be modified in place as needed. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{x}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{to\_rgba() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.to_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_rgba}}}{\emph{x}, \emph{alpha=None}, \emph{bytes=False}, \emph{norm=True}}{} Return a normalized rgba array corresponding to \sphinxstyleemphasis{x}. In the normal case, \sphinxstyleemphasis{x} is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable. There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If \sphinxstyleemphasis{x} is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the \sphinxstyleemphasis{alpha} kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the \sphinxstyleemphasis{alpha} kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4. In either case, if \sphinxstyleemphasis{bytes} is \sphinxstyleemphasis{False} (default), the rgba array will be floats in the 0-1 range; if it is \sphinxstyleemphasis{True}, the returned rgba array will be uint8 in the 0 to 255 range. If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1). \end{fulllineitems} \index{update() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \index{update\_from() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.update_from}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} copy properties from other to self \end{fulllineitems} \index{update\_scalarmappable() (matplotlib.collections.PatchCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.update_scalarmappable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_scalarmappable}}}{}{} If the scalar mappable array is not none, update colors from scalar data \end{fulllineitems} \index{zorder (matplotlib.collections.PatchCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PatchCollection.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \end{fulllineitems} \index{PathCollection (class in matplotlib.collections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.collections.}}\sphinxbfcode{\sphinxupquote{PathCollection}}}{\emph{paths}, \emph{sizes=None}, \emph{**kwargs}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.collections.\_CollectionWithSizes}} This is the most basic {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Collection}}}}} subclass. \sphinxstyleemphasis{paths} is a sequence of {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.path.Path}}}}} instances. \begin{quote} Valid Collection keyword arguments: \begin{itemize} \item {} \sphinxstyleemphasis{edgecolors}: None \item {} \sphinxstyleemphasis{facecolors}: None \item {} \sphinxstyleemphasis{linewidths}: None \item {} \sphinxstyleemphasis{antialiaseds}: None \item {} \sphinxstyleemphasis{offsets}: None \item {} \sphinxstyleemphasis{transOffset}: transforms.IdentityTransform() \item {} \sphinxstyleemphasis{norm}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \item {} \sphinxstyleemphasis{cmap}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \end{itemize} \sphinxstyleemphasis{offsets} and \sphinxstyleemphasis{transOffset} are used to translate the patch after rendering (default no offsets) If any of \sphinxstyleemphasis{edgecolors}, \sphinxstyleemphasis{facecolors}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{antialiaseds} are None, they default to their {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcParams}}}}} patch setting, in sequence form. \end{quote} \index{add\_callback() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.add_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PathCollection.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \index{add\_checker() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.add_checker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_checker}}}{\emph{checker}}{} Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed. \end{fulllineitems} \index{aname (matplotlib.collections.PathCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.aname}}\pysigline{\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \index{autoscale() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Autoscale the scalar limits on the norm instance using the current array \end{fulllineitems} \index{autoscale\_None() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{}{} Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None \end{fulllineitems} \index{axes (matplotlib.collections.PathCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.axes}}\pysigline{\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \index{changed() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{changed}}}{}{} Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal \end{fulllineitems} \index{check\_update() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.check_update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{check\_update}}}{\emph{checker}}{} If mappable has changed since the last check, return True; else return False \end{fulllineitems} \index{contains() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the collection. Returns True \textbar{} False, \sphinxcode{\sphinxupquote{dict(ind=itemlist)}}, where every item in itemlist contains the event. \end{fulllineitems} \index{convert\_xunits() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.convert_xunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \index{convert\_yunits() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.convert_yunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \index{draw() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \index{findobj() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.findobj}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \index{format\_cursor\_data() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.format_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \index{get\_agg\_filter() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \index{get\_alpha() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \index{get\_animated() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \index{get\_array() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_array}}}{}{} Return the array \end{fulllineitems} \index{get\_capstyle() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{}~ \end{fulllineitems} \index{get\_children() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \index{get\_clim() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clim}}}{}{} return the min, max of the color limits for image scaling \end{fulllineitems} \index{get\_clip\_box() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \index{get\_clip\_on() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \index{get\_clip\_path() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \index{get\_cmap() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cmap}}}{}{} return the colormap \end{fulllineitems} \index{get\_contains() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \index{get\_cursor\_data() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \index{get\_dashes() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashes}}}{}{}~ \end{fulllineitems} \index{get\_datalim() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_datalim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_datalim}}}{\emph{transData}}{}~ \end{fulllineitems} \index{get\_edgecolor() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolor}}}{}{}~ \end{fulllineitems} \index{get\_edgecolors() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolors}}}{}{}~ \end{fulllineitems} \index{get\_facecolor() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{}~ \end{fulllineitems} \index{get\_facecolors() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolors}}}{}{}~ \end{fulllineitems} \index{get\_figure() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \index{get\_fill() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_fill}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fill}}}{}{} return whether fill is set \end{fulllineitems} \index{get\_gid() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \index{get\_hatch() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch}}}{}{} Return the current hatching pattern. \end{fulllineitems} \index{get\_joinstyle() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{}~ \end{fulllineitems} \index{get\_label() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \index{get\_linestyle() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyle}}}{}{}~ \end{fulllineitems} \index{get\_linestyles() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyles}}}{}{}~ \end{fulllineitems} \index{get\_linewidth() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidth}}}{}{}~ \end{fulllineitems} \index{get\_linewidths() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidths}}}{}{}~ \end{fulllineitems} \index{get\_offset\_position() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_position}}}{}{} Returns how offsets are applied for the collection. If \sphinxstyleemphasis{offset\_position} is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{get\_offset\_transform() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_offset_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_transform}}}{}{}~ \end{fulllineitems} \index{get\_offsets() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offsets}}}{}{} Return the offsets for the collection. \end{fulllineitems} \index{get\_path\_effects() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \index{get\_paths() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_paths}}}{}{}~ \end{fulllineitems} \index{get\_picker() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \index{get\_pickradius() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{}~ \end{fulllineitems} \index{get\_rasterized() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \index{get\_sizes() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_sizes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sizes}}}{}{} Returns the sizes of the elements in the collection. The value represents the ‘area’ of the element. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sizes}}] \leavevmode{[}array{]} The ‘area’ of each element. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_sketch\_params() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_snap() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \index{get\_transform() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \index{get\_transforms() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_transforms}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transforms}}}{}{}~ \end{fulllineitems} \index{get\_url() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \index{get\_urls() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_urls}}}{}{}~ \end{fulllineitems} \index{get\_visible() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \index{get\_window\_extent() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{get\_zorder() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.get_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \index{have\_units() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.have_units}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \index{hitlist() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.hitlist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hitlist}}}{\emph{event}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The hitlist function was deprecated in version 2.2. List the children of the artist which contain the mouse event \sphinxstyleemphasis{event}. \end{fulllineitems} \index{is\_figure\_set() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.is_figure_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_figure\_set}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }artist.figure is not None Returns whether the artist is assigned to a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \end{fulllineitems} \index{is\_transform\_set() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.is_transform_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \index{mouseover (matplotlib.collections.PathCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.mouseover}}\pysigline{\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \index{pchanged() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.pchanged}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \index{pick() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.pick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \index{pickable() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.pickable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \index{properties() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \index{remove() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \index{remove\_callback() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.remove_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.PathCollection.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \index{set() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \index{set\_agg\_filter() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_alpha() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha tranparencies of the collection. \sphinxstyleemphasis{alpha} must be a float or \sphinxstyleemphasis{None}. ACCEPTS: float or None \end{fulllineitems} \index{set\_animated() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_antialiased() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiased}}}{\emph{aa}}{} Set the antialiasing state for rendering. ACCEPTS: Boolean or sequence of booleans \end{fulllineitems} \index{set\_antialiaseds() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_antialiaseds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiaseds}}}{\emph{aa}}{} alias for set\_antialiased \end{fulllineitems} \index{set\_array() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_array}}}{\emph{A}}{} Set the image array from numpy array \sphinxstyleemphasis{A}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A}}] \leavevmode{[}ndarray{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_capstyle() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_capstyle}}}{\emph{cs}}{} Set the capstyle for the collection. The capstyle can only be set globally for all elements in the collection \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cs}}] \leavevmode{[}{[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]}{]} The capstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clim() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clim}}}{\emph{vmin=None}, \emph{vmax=None}}{} set the norm limits for image scaling; if \sphinxstyleemphasis{vmin} is a length2 sequence, interpret it as \sphinxcode{\sphinxupquote{(vmin, vmax)}} which is used to support setp ACCEPTS: a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \end{fulllineitems} \index{set\_clip\_box() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_on() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_path() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \index{set\_cmap() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cmap}}}{\emph{cmap}}{} set the colormap for luminance data ACCEPTS: a colormap or registered colormap name \end{fulllineitems} \index{set\_color() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{c}}{} Set both the edgecolor and the facecolor. ACCEPTS: matplotlib color arg or sequence of rgba tuples \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_facecolor()}}}}}, {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_edgecolor()}}}}}}] \leavevmode For setting the edge or face color individually. \end{description} \end{fulllineitems} \index{set\_contains() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_dashes() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashes}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_edgecolor() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolor}}}{\emph{c}}{} Set the edgecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘face’, the edge color will always be the same as the face color. If it is ‘none’, the patch boundary will not be drawn. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_edgecolors() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolors}}}{\emph{c}}{} alias for set\_edgecolor \end{fulllineitems} \index{set\_facecolor() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{c}}{} Set the facecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘none’, the patch will not be filled. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_facecolors() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolors}}}{\emph{c}}{} alias for set\_facecolor \end{fulllineitems} \index{set\_figure() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_gid() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_hatch() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_hatch}}}{\emph{hatch}}{} Set the hatching pattern \sphinxstyleemphasis{hatch} can be one of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{/} \PYG{o}{\PYGZhy{}} \PYG{n}{diagonal} \PYG{n}{hatching} \PYGZbs{} \PYG{o}{\PYGZhy{}} \PYG{n}{back} \PYG{n}{diagonal} \PYG{o}{\textbar{}} \PYG{o}{\PYGZhy{}} \PYG{n}{vertical} \PYG{o}{\PYGZhy{}} \PYG{o}{\PYGZhy{}} \PYG{n}{horizontal} \PYG{o}{+} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{x} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{diagonal} \PYG{n}{o} \PYG{o}{\PYGZhy{}} \PYG{n}{small} \PYG{n}{circle} \PYG{n}{O} \PYG{o}{\PYGZhy{}} \PYG{n}{large} \PYG{n}{circle} \PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{dots} \PYG{o}{*} \PYG{o}{\PYGZhy{}} \PYG{n}{stars} \end{sphinxVerbatim} Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member. ACCEPTS: {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \end{fulllineitems} \index{set\_joinstyle() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_joinstyle}}}{\emph{js}}{} Set the joinstyle for the collection. The joinstyle can only be set globally for all elements in the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{js}}] \leavevmode{[}{[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]}{]} The joinstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_label() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyle() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyle}}}{\emph{ls}}{} Set the linestyle(s) for the collection. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily linestyle &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} or \sphinxcode{\sphinxupquote{'solid'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} or \sphinxcode{\sphinxupquote{'dashed'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} or \sphinxcode{\sphinxupquote{'dashdot'}} & dash-dotted line \\ \hline \sphinxcode{\sphinxupquote{':'}} or \sphinxcode{\sphinxupquote{'dotted'}} & dotted line \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Alternatively a dash tuple of the following form can be provided: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{onoffseq}} is an even length tuple of on and off ink in points. \begin{description} \item[{ACCEPTS: {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{}}] \leavevmode (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \end{description} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ls}}] \leavevmode{[}\{ ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’\} and more see description{]} The line style. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyles() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyles}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_linewidth() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{lw}}{} Set the linewidth(s) for the collection. \sphinxstyleemphasis{lw} can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_linewidths() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidths}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_lw() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_lw}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_norm() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_norm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_norm}}}{\emph{norm}}{} Set the normalization instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_offset\_position() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset\_position}}}{\emph{offset\_position}}{} Set how offsets are applied. If \sphinxstyleemphasis{offset\_position} is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{set\_offsets() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offsets}}}{\emph{offsets}}{} Set the offsets for the collection. \sphinxstyleemphasis{offsets} can be a scalar or a sequence. ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_path\_effects() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_paths() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_paths}}}{\emph{paths}}{}~ \end{fulllineitems} \index{set\_picker() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_pickradius() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{pr}}{} Set the pick radius used for containment tests. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{d}}] \leavevmode{[}float{]} Pick radius, in points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_rasterized() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sizes() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_sizes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sizes}}}{\emph{sizes}, \emph{dpi=72.0}}{} Set the sizes of each member of the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sizes}}] \leavevmode{[}ndarray or None{]} The size to set for each element of the collection. The value is the ‘area’ of the element. \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}float{]} The dpi of the canvas. Defaults to 72.0. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sketch\_params() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_snap() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_transform() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_url() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_urls() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_urls}}}{\emph{urls}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{urls}}] \leavevmode{[}List{[}str{]} or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_visible() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_zorder() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.set_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{stale (matplotlib.collections.PathCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.stale}}\pysigline{\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \index{sticky\_edges (matplotlib.collections.PathCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.sticky_edges}}\pysigline{\sphinxbfcode{\sphinxupquote{sticky\_edges}}} \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} sticky edge lists. When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added\textendash{}the view limit “sticks” to the edge. A typical usecase is histograms, where one usually expects no margin on the bottom edge (0) of the histogram. This attribute cannot be assigned to; however, the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} lists can be modified in place as needed. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{x}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{to\_rgba() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.to_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_rgba}}}{\emph{x}, \emph{alpha=None}, \emph{bytes=False}, \emph{norm=True}}{} Return a normalized rgba array corresponding to \sphinxstyleemphasis{x}. In the normal case, \sphinxstyleemphasis{x} is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable. There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If \sphinxstyleemphasis{x} is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the \sphinxstyleemphasis{alpha} kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the \sphinxstyleemphasis{alpha} kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4. In either case, if \sphinxstyleemphasis{bytes} is \sphinxstyleemphasis{False} (default), the rgba array will be floats in the 0-1 range; if it is \sphinxstyleemphasis{True}, the returned rgba array will be uint8 in the 0 to 255 range. If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1). \end{fulllineitems} \index{update() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \index{update\_from() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.update_from}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} copy properties from other to self \end{fulllineitems} \index{update\_scalarmappable() (matplotlib.collections.PathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.update_scalarmappable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_scalarmappable}}}{}{} If the scalar mappable array is not none, update colors from scalar data \end{fulllineitems} \index{zorder (matplotlib.collections.PathCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PathCollection.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \end{fulllineitems} \index{PolyCollection (class in matplotlib.collections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.collections.}}\sphinxbfcode{\sphinxupquote{PolyCollection}}}{\emph{verts}, \emph{sizes=None}, \emph{closed=True}, \emph{**kwargs}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.collections.\_CollectionWithSizes}} \sphinxstyleemphasis{verts} is a sequence of ( \sphinxstyleemphasis{verts0}, \sphinxstyleemphasis{verts1}, …) where \sphinxstyleemphasis{verts\_i} is a sequence of \sphinxstyleemphasis{xy} tuples of vertices, or an equivalent \sphinxhref{https://docs.scipy.org/doc/numpy/reference/index.html\#module-numpy}{\sphinxcode{\sphinxupquote{numpy}}} array of shape (\sphinxstyleemphasis{nv}, 2). \sphinxstyleemphasis{sizes} is \sphinxstyleemphasis{None} (default) or a sequence of floats that scale the corresponding \sphinxstyleemphasis{verts\_i}. The scaling is applied before the Artist master transform; if the latter is an identity transform, then the overall scaling is such that if \sphinxstyleemphasis{verts\_i} specify a unit square, then \sphinxstyleemphasis{sizes\_i} is the area of that square in points\textasciicircum{}2. If len(\sphinxstyleemphasis{sizes}) \textless{} \sphinxstyleemphasis{nv}, the additional values will be taken cyclically from the array. \sphinxstyleemphasis{closed}, when \sphinxstyleemphasis{True}, will explicitly close the polygon. \begin{quote} Valid Collection keyword arguments: \begin{itemize} \item {} \sphinxstyleemphasis{edgecolors}: None \item {} \sphinxstyleemphasis{facecolors}: None \item {} \sphinxstyleemphasis{linewidths}: None \item {} \sphinxstyleemphasis{antialiaseds}: None \item {} \sphinxstyleemphasis{offsets}: None \item {} \sphinxstyleemphasis{transOffset}: transforms.IdentityTransform() \item {} \sphinxstyleemphasis{norm}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \item {} \sphinxstyleemphasis{cmap}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \end{itemize} \sphinxstyleemphasis{offsets} and \sphinxstyleemphasis{transOffset} are used to translate the patch after rendering (default no offsets) If any of \sphinxstyleemphasis{edgecolors}, \sphinxstyleemphasis{facecolors}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{antialiaseds} are None, they default to their {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcParams}}}}} patch setting, in sequence form. \end{quote} \index{add\_callback() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.add_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \index{add\_checker() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.add_checker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_checker}}}{\emph{checker}}{} Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed. \end{fulllineitems} \index{aname (matplotlib.collections.PolyCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.aname}}\pysigline{\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \index{autoscale() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Autoscale the scalar limits on the norm instance using the current array \end{fulllineitems} \index{autoscale\_None() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{}{} Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None \end{fulllineitems} \index{axes (matplotlib.collections.PolyCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.axes}}\pysigline{\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \index{changed() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{changed}}}{}{} Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal \end{fulllineitems} \index{check\_update() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.check_update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{check\_update}}}{\emph{checker}}{} If mappable has changed since the last check, return True; else return False \end{fulllineitems} \index{contains() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the collection. Returns True \textbar{} False, \sphinxcode{\sphinxupquote{dict(ind=itemlist)}}, where every item in itemlist contains the event. \end{fulllineitems} \index{convert\_xunits() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.convert_xunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \index{convert\_yunits() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.convert_yunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \index{draw() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \index{findobj() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.findobj}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \index{format\_cursor\_data() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.format_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \index{get\_agg\_filter() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \index{get\_alpha() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \index{get\_animated() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \index{get\_array() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_array}}}{}{} Return the array \end{fulllineitems} \index{get\_capstyle() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{}~ \end{fulllineitems} \index{get\_children() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \index{get\_clim() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clim}}}{}{} return the min, max of the color limits for image scaling \end{fulllineitems} \index{get\_clip\_box() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \index{get\_clip\_on() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \index{get\_clip\_path() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \index{get\_cmap() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cmap}}}{}{} return the colormap \end{fulllineitems} \index{get\_contains() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \index{get\_cursor\_data() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \index{get\_dashes() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashes}}}{}{}~ \end{fulllineitems} \index{get\_datalim() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_datalim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_datalim}}}{\emph{transData}}{}~ \end{fulllineitems} \index{get\_edgecolor() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolor}}}{}{}~ \end{fulllineitems} \index{get\_edgecolors() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolors}}}{}{}~ \end{fulllineitems} \index{get\_facecolor() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{}~ \end{fulllineitems} \index{get\_facecolors() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolors}}}{}{}~ \end{fulllineitems} \index{get\_figure() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \index{get\_fill() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_fill}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fill}}}{}{} return whether fill is set \end{fulllineitems} \index{get\_gid() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \index{get\_hatch() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch}}}{}{} Return the current hatching pattern. \end{fulllineitems} \index{get\_joinstyle() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{}~ \end{fulllineitems} \index{get\_label() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \index{get\_linestyle() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyle}}}{}{}~ \end{fulllineitems} \index{get\_linestyles() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyles}}}{}{}~ \end{fulllineitems} \index{get\_linewidth() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidth}}}{}{}~ \end{fulllineitems} \index{get\_linewidths() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidths}}}{}{}~ \end{fulllineitems} \index{get\_offset\_position() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_position}}}{}{} Returns how offsets are applied for the collection. If \sphinxstyleemphasis{offset\_position} is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{get\_offset\_transform() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_offset_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_transform}}}{}{}~ \end{fulllineitems} \index{get\_offsets() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offsets}}}{}{} Return the offsets for the collection. \end{fulllineitems} \index{get\_path\_effects() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \index{get\_paths() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_paths}}}{}{}~ \end{fulllineitems} \index{get\_picker() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \index{get\_pickradius() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{}~ \end{fulllineitems} \index{get\_rasterized() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \index{get\_sizes() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_sizes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sizes}}}{}{} Returns the sizes of the elements in the collection. The value represents the ‘area’ of the element. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sizes}}] \leavevmode{[}array{]} The ‘area’ of each element. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_sketch\_params() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_snap() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \index{get\_transform() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \index{get\_transforms() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_transforms}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transforms}}}{}{}~ \end{fulllineitems} \index{get\_url() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \index{get\_urls() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_urls}}}{}{}~ \end{fulllineitems} \index{get\_visible() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \index{get\_window\_extent() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{get\_zorder() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \index{have\_units() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.have_units}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \index{hitlist() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.hitlist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hitlist}}}{\emph{event}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The hitlist function was deprecated in version 2.2. List the children of the artist which contain the mouse event \sphinxstyleemphasis{event}. \end{fulllineitems} \index{is\_figure\_set() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.is_figure_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_figure\_set}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }artist.figure is not None Returns whether the artist is assigned to a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \end{fulllineitems} \index{is\_transform\_set() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.is_transform_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \index{mouseover (matplotlib.collections.PolyCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.mouseover}}\pysigline{\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \index{pchanged() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.pchanged}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \index{pick() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.pick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \index{pickable() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.pickable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \index{properties() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \index{remove() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \index{remove\_callback() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.remove_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \index{set() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \index{set\_agg\_filter() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_alpha() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha tranparencies of the collection. \sphinxstyleemphasis{alpha} must be a float or \sphinxstyleemphasis{None}. ACCEPTS: float or None \end{fulllineitems} \index{set\_animated() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_antialiased() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiased}}}{\emph{aa}}{} Set the antialiasing state for rendering. ACCEPTS: Boolean or sequence of booleans \end{fulllineitems} \index{set\_antialiaseds() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_antialiaseds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiaseds}}}{\emph{aa}}{} alias for set\_antialiased \end{fulllineitems} \index{set\_array() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_array}}}{\emph{A}}{} Set the image array from numpy array \sphinxstyleemphasis{A}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A}}] \leavevmode{[}ndarray{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_capstyle() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_capstyle}}}{\emph{cs}}{} Set the capstyle for the collection. The capstyle can only be set globally for all elements in the collection \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cs}}] \leavevmode{[}{[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]}{]} The capstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clim() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clim}}}{\emph{vmin=None}, \emph{vmax=None}}{} set the norm limits for image scaling; if \sphinxstyleemphasis{vmin} is a length2 sequence, interpret it as \sphinxcode{\sphinxupquote{(vmin, vmax)}} which is used to support setp ACCEPTS: a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \end{fulllineitems} \index{set\_clip\_box() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_on() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_path() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \index{set\_cmap() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cmap}}}{\emph{cmap}}{} set the colormap for luminance data ACCEPTS: a colormap or registered colormap name \end{fulllineitems} \index{set\_color() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{c}}{} Set both the edgecolor and the facecolor. ACCEPTS: matplotlib color arg or sequence of rgba tuples \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_facecolor()}}}}}, {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_edgecolor()}}}}}}] \leavevmode For setting the edge or face color individually. \end{description} \end{fulllineitems} \index{set\_contains() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_dashes() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashes}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_edgecolor() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolor}}}{\emph{c}}{} Set the edgecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘face’, the edge color will always be the same as the face color. If it is ‘none’, the patch boundary will not be drawn. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_edgecolors() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolors}}}{\emph{c}}{} alias for set\_edgecolor \end{fulllineitems} \index{set\_facecolor() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{c}}{} Set the facecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘none’, the patch will not be filled. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_facecolors() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolors}}}{\emph{c}}{} alias for set\_facecolor \end{fulllineitems} \index{set\_figure() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_gid() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_hatch() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_hatch}}}{\emph{hatch}}{} Set the hatching pattern \sphinxstyleemphasis{hatch} can be one of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{/} \PYG{o}{\PYGZhy{}} \PYG{n}{diagonal} \PYG{n}{hatching} \PYGZbs{} \PYG{o}{\PYGZhy{}} \PYG{n}{back} \PYG{n}{diagonal} \PYG{o}{\textbar{}} \PYG{o}{\PYGZhy{}} \PYG{n}{vertical} \PYG{o}{\PYGZhy{}} \PYG{o}{\PYGZhy{}} \PYG{n}{horizontal} \PYG{o}{+} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{x} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{diagonal} \PYG{n}{o} \PYG{o}{\PYGZhy{}} \PYG{n}{small} \PYG{n}{circle} \PYG{n}{O} \PYG{o}{\PYGZhy{}} \PYG{n}{large} \PYG{n}{circle} \PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{dots} \PYG{o}{*} \PYG{o}{\PYGZhy{}} \PYG{n}{stars} \end{sphinxVerbatim} Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member. ACCEPTS: {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \end{fulllineitems} \index{set\_joinstyle() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_joinstyle}}}{\emph{js}}{} Set the joinstyle for the collection. The joinstyle can only be set globally for all elements in the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{js}}] \leavevmode{[}{[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]}{]} The joinstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_label() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyle() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyle}}}{\emph{ls}}{} Set the linestyle(s) for the collection. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily linestyle &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} or \sphinxcode{\sphinxupquote{'solid'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} or \sphinxcode{\sphinxupquote{'dashed'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} or \sphinxcode{\sphinxupquote{'dashdot'}} & dash-dotted line \\ \hline \sphinxcode{\sphinxupquote{':'}} or \sphinxcode{\sphinxupquote{'dotted'}} & dotted line \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Alternatively a dash tuple of the following form can be provided: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{onoffseq}} is an even length tuple of on and off ink in points. \begin{description} \item[{ACCEPTS: {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{}}] \leavevmode (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \end{description} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ls}}] \leavevmode{[}\{ ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’\} and more see description{]} The line style. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyles() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyles}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_linewidth() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{lw}}{} Set the linewidth(s) for the collection. \sphinxstyleemphasis{lw} can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_linewidths() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidths}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_lw() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_lw}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_norm() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_norm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_norm}}}{\emph{norm}}{} Set the normalization instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_offset\_position() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset\_position}}}{\emph{offset\_position}}{} Set how offsets are applied. If \sphinxstyleemphasis{offset\_position} is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{set\_offsets() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offsets}}}{\emph{offsets}}{} Set the offsets for the collection. \sphinxstyleemphasis{offsets} can be a scalar or a sequence. ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_path\_effects() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_paths() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_paths}}}{\emph{verts}, \emph{closed=True}}{} This allows one to delay initialization of the vertices. \end{fulllineitems} \index{set\_picker() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_pickradius() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{pr}}{} Set the pick radius used for containment tests. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{d}}] \leavevmode{[}float{]} Pick radius, in points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_rasterized() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sizes() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_sizes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sizes}}}{\emph{sizes}, \emph{dpi=72.0}}{} Set the sizes of each member of the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sizes}}] \leavevmode{[}ndarray or None{]} The size to set for each element of the collection. The value is the ‘area’ of the element. \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}float{]} The dpi of the canvas. Defaults to 72.0. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sketch\_params() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_snap() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_transform() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_url() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_urls() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_urls}}}{\emph{urls}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{urls}}] \leavevmode{[}List{[}str{]} or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_verts() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_verts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_verts}}}{\emph{verts}, \emph{closed=True}}{} This allows one to delay initialization of the vertices. \end{fulllineitems} \index{set\_verts\_and\_codes() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_verts_and_codes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_verts\_and\_codes}}}{\emph{verts}, \emph{codes}}{} This allows one to initialize vertices with path codes. \end{fulllineitems} \index{set\_visible() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_zorder() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.set_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{stale (matplotlib.collections.PolyCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.stale}}\pysigline{\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \index{sticky\_edges (matplotlib.collections.PolyCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.sticky_edges}}\pysigline{\sphinxbfcode{\sphinxupquote{sticky\_edges}}} \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} sticky edge lists. When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added\textendash{}the view limit “sticks” to the edge. A typical usecase is histograms, where one usually expects no margin on the bottom edge (0) of the histogram. This attribute cannot be assigned to; however, the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} lists can be modified in place as needed. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{x}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{to\_rgba() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.to_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_rgba}}}{\emph{x}, \emph{alpha=None}, \emph{bytes=False}, \emph{norm=True}}{} Return a normalized rgba array corresponding to \sphinxstyleemphasis{x}. In the normal case, \sphinxstyleemphasis{x} is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable. There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If \sphinxstyleemphasis{x} is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the \sphinxstyleemphasis{alpha} kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the \sphinxstyleemphasis{alpha} kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4. In either case, if \sphinxstyleemphasis{bytes} is \sphinxstyleemphasis{False} (default), the rgba array will be floats in the 0-1 range; if it is \sphinxstyleemphasis{True}, the returned rgba array will be uint8 in the 0 to 255 range. If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1). \end{fulllineitems} \index{update() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \index{update\_from() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.update_from}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} copy properties from other to self \end{fulllineitems} \index{update\_scalarmappable() (matplotlib.collections.PolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.update_scalarmappable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_scalarmappable}}}{}{} If the scalar mappable array is not none, update colors from scalar data \end{fulllineitems} \index{zorder (matplotlib.collections.PolyCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.PolyCollection.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \end{fulllineitems} \index{QuadMesh (class in matplotlib.collections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.collections.}}\sphinxbfcode{\sphinxupquote{QuadMesh}}}{\emph{meshWidth}, \emph{meshHeight}, \emph{coordinates}, \emph{antialiased=True}, \emph{shading='flat'}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.Collection}}}}} Class for the efficient drawing of a quadrilateral mesh. A quadrilateral mesh consists of a grid of vertices. The dimensions of this array are (\sphinxstyleemphasis{meshWidth} + 1, \sphinxstyleemphasis{meshHeight} + 1). Each vertex in the mesh has a different set of “mesh coordinates” representing its position in the topology of the mesh. For any values (\sphinxstyleemphasis{m}, \sphinxstyleemphasis{n}) such that 0 \textless{}= \sphinxstyleemphasis{m} \textless{}= \sphinxstyleemphasis{meshWidth} and 0 \textless{}= \sphinxstyleemphasis{n} \textless{}= \sphinxstyleemphasis{meshHeight}, the vertices at mesh coordinates (\sphinxstyleemphasis{m}, \sphinxstyleemphasis{n}), (\sphinxstyleemphasis{m}, \sphinxstyleemphasis{n} + 1), (\sphinxstyleemphasis{m} + 1, \sphinxstyleemphasis{n} + 1), and (\sphinxstyleemphasis{m} + 1, \sphinxstyleemphasis{n}) form one of the quadrilaterals in the mesh. There are thus (\sphinxstyleemphasis{meshWidth} * \sphinxstyleemphasis{meshHeight}) quadrilaterals in the mesh. The mesh need not be regular and the polygons need not be convex. A quadrilateral mesh is represented by a (2 x ((\sphinxstyleemphasis{meshWidth} + 1) * (\sphinxstyleemphasis{meshHeight} + 1))) numpy array \sphinxstyleemphasis{coordinates}, where each row is the \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} coordinates of one of the vertices. To define the function that maps from a data point to its corresponding color, use the {\hyperref[\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_cmap()}}}}} method. Each of these arrays is indexed in row-major order by the mesh coordinates of the vertex (or the mesh coordinates of the lower left vertex, in the case of the colors). For example, the first entry in \sphinxstyleemphasis{coordinates} is the coordinates of the vertex at mesh coordinates (0, 0), then the one at (0, 1), then at (0, 2) .. (0, meshWidth), (1, 0), (1, 1), and so on. \sphinxstyleemphasis{shading} may be ‘flat’, or ‘gouraud’ \index{add\_callback() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.add_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/collections_api:matplotlib.collections.QuadMesh.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \index{add\_checker() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.add_checker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_checker}}}{\emph{checker}}{} Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed. \end{fulllineitems} \index{aname (matplotlib.collections.QuadMesh attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.aname}}\pysigline{\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \index{autoscale() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Autoscale the scalar limits on the norm instance using the current array \end{fulllineitems} \index{autoscale\_None() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{}{} Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None \end{fulllineitems} \index{axes (matplotlib.collections.QuadMesh attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.axes}}\pysigline{\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \index{changed() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{changed}}}{}{} Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal \end{fulllineitems} \index{check\_update() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.check_update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{check\_update}}}{\emph{checker}}{} If mappable has changed since the last check, return True; else return False \end{fulllineitems} \index{contains() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the collection. Returns True \textbar{} False, \sphinxcode{\sphinxupquote{dict(ind=itemlist)}}, where every item in itemlist contains the event. \end{fulllineitems} \index{convert\_mesh\_to\_paths() (matplotlib.collections.QuadMesh static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.convert_mesh_to_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{convert\_mesh\_to\_paths}}}{\emph{meshWidth}, \emph{meshHeight}, \emph{coordinates}}{} Converts a given mesh into a sequence of {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.path.Path}}}}} objects for easier rendering by backends that do not directly support quadmeshes. This function is primarily of use to backend implementers. \end{fulllineitems} \index{convert\_mesh\_to\_triangles() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.convert_mesh_to_triangles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_mesh\_to\_triangles}}}{\emph{meshWidth}, \emph{meshHeight}, \emph{coordinates}}{} Converts a given mesh into a sequence of triangles, each point with its own color. This is useful for experiments using \sphinxcode{\sphinxupquote{draw\_qouraud\_triangle}}. \end{fulllineitems} \index{convert\_xunits() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.convert_xunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \index{convert\_yunits() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.convert_yunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \index{draw() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \index{findobj() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.findobj}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \index{format\_cursor\_data() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.format_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \index{get\_agg\_filter() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \index{get\_alpha() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \index{get\_animated() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \index{get\_array() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_array}}}{}{} Return the array \end{fulllineitems} \index{get\_capstyle() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{}~ \end{fulllineitems} \index{get\_children() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \index{get\_clim() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clim}}}{}{} return the min, max of the color limits for image scaling \end{fulllineitems} \index{get\_clip\_box() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \index{get\_clip\_on() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \index{get\_clip\_path() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \index{get\_cmap() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cmap}}}{}{} return the colormap \end{fulllineitems} \index{get\_contains() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \index{get\_cursor\_data() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \index{get\_dashes() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashes}}}{}{}~ \end{fulllineitems} \index{get\_datalim() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_datalim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_datalim}}}{\emph{transData}}{}~ \end{fulllineitems} \index{get\_edgecolor() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolor}}}{}{}~ \end{fulllineitems} \index{get\_edgecolors() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolors}}}{}{}~ \end{fulllineitems} \index{get\_facecolor() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{}~ \end{fulllineitems} \index{get\_facecolors() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolors}}}{}{}~ \end{fulllineitems} \index{get\_figure() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \index{get\_fill() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_fill}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fill}}}{}{} return whether fill is set \end{fulllineitems} \index{get\_gid() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \index{get\_hatch() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch}}}{}{} Return the current hatching pattern. \end{fulllineitems} \index{get\_joinstyle() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{}~ \end{fulllineitems} \index{get\_label() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \index{get\_linestyle() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyle}}}{}{}~ \end{fulllineitems} \index{get\_linestyles() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyles}}}{}{}~ \end{fulllineitems} \index{get\_linewidth() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidth}}}{}{}~ \end{fulllineitems} \index{get\_linewidths() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidths}}}{}{}~ \end{fulllineitems} \index{get\_offset\_position() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_position}}}{}{} Returns how offsets are applied for the collection. If \sphinxstyleemphasis{offset\_position} is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{get\_offset\_transform() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_offset_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_transform}}}{}{}~ \end{fulllineitems} \index{get\_offsets() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offsets}}}{}{} Return the offsets for the collection. \end{fulllineitems} \index{get\_path\_effects() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \index{get\_paths() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_paths}}}{}{}~ \end{fulllineitems} \index{get\_picker() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \index{get\_pickradius() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{}~ \end{fulllineitems} \index{get\_rasterized() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \index{get\_sketch\_params() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_snap() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \index{get\_transform() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \index{get\_transforms() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_transforms}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transforms}}}{}{}~ \end{fulllineitems} \index{get\_url() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \index{get\_urls() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_urls}}}{}{}~ \end{fulllineitems} \index{get\_visible() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \index{get\_window\_extent() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{get\_zorder() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.get_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \index{have\_units() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.have_units}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \index{hitlist() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.hitlist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hitlist}}}{\emph{event}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The hitlist function was deprecated in version 2.2. List the children of the artist which contain the mouse event \sphinxstyleemphasis{event}. \end{fulllineitems} \index{is\_figure\_set() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.is_figure_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_figure\_set}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }artist.figure is not None Returns whether the artist is assigned to a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \end{fulllineitems} \index{is\_transform\_set() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.is_transform_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \index{mouseover (matplotlib.collections.QuadMesh attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.mouseover}}\pysigline{\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \index{pchanged() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.pchanged}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \index{pick() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.pick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \index{pickable() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.pickable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \index{properties() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \index{remove() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \index{remove\_callback() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.remove_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.QuadMesh.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \index{set() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \index{set\_agg\_filter() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_alpha() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha tranparencies of the collection. \sphinxstyleemphasis{alpha} must be a float or \sphinxstyleemphasis{None}. ACCEPTS: float or None \end{fulllineitems} \index{set\_animated() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_antialiased() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiased}}}{\emph{aa}}{} Set the antialiasing state for rendering. ACCEPTS: Boolean or sequence of booleans \end{fulllineitems} \index{set\_antialiaseds() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_antialiaseds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiaseds}}}{\emph{aa}}{} alias for set\_antialiased \end{fulllineitems} \index{set\_array() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_array}}}{\emph{A}}{} Set the image array from numpy array \sphinxstyleemphasis{A}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A}}] \leavevmode{[}ndarray{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_capstyle() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_capstyle}}}{\emph{cs}}{} Set the capstyle for the collection. The capstyle can only be set globally for all elements in the collection \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cs}}] \leavevmode{[}{[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]}{]} The capstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clim() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clim}}}{\emph{vmin=None}, \emph{vmax=None}}{} set the norm limits for image scaling; if \sphinxstyleemphasis{vmin} is a length2 sequence, interpret it as \sphinxcode{\sphinxupquote{(vmin, vmax)}} which is used to support setp ACCEPTS: a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \end{fulllineitems} \index{set\_clip\_box() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_on() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_path() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \index{set\_cmap() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cmap}}}{\emph{cmap}}{} set the colormap for luminance data ACCEPTS: a colormap or registered colormap name \end{fulllineitems} \index{set\_color() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{c}}{} Set both the edgecolor and the facecolor. ACCEPTS: matplotlib color arg or sequence of rgba tuples \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_facecolor()}}}}}, {\hyperref[\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_edgecolor()}}}}}}] \leavevmode For setting the edge or face color individually. \end{description} \end{fulllineitems} \index{set\_contains() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_dashes() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashes}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_edgecolor() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolor}}}{\emph{c}}{} Set the edgecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘face’, the edge color will always be the same as the face color. If it is ‘none’, the patch boundary will not be drawn. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_edgecolors() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolors}}}{\emph{c}}{} alias for set\_edgecolor \end{fulllineitems} \index{set\_facecolor() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{c}}{} Set the facecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘none’, the patch will not be filled. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_facecolors() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolors}}}{\emph{c}}{} alias for set\_facecolor \end{fulllineitems} \index{set\_figure() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_gid() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_hatch() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_hatch}}}{\emph{hatch}}{} Set the hatching pattern \sphinxstyleemphasis{hatch} can be one of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{/} \PYG{o}{\PYGZhy{}} \PYG{n}{diagonal} \PYG{n}{hatching} \PYGZbs{} \PYG{o}{\PYGZhy{}} \PYG{n}{back} \PYG{n}{diagonal} \PYG{o}{\textbar{}} \PYG{o}{\PYGZhy{}} \PYG{n}{vertical} \PYG{o}{\PYGZhy{}} \PYG{o}{\PYGZhy{}} \PYG{n}{horizontal} \PYG{o}{+} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{x} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{diagonal} \PYG{n}{o} \PYG{o}{\PYGZhy{}} \PYG{n}{small} \PYG{n}{circle} \PYG{n}{O} \PYG{o}{\PYGZhy{}} \PYG{n}{large} \PYG{n}{circle} \PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{dots} \PYG{o}{*} \PYG{o}{\PYGZhy{}} \PYG{n}{stars} \end{sphinxVerbatim} Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member. ACCEPTS: {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \end{fulllineitems} \index{set\_joinstyle() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_joinstyle}}}{\emph{js}}{} Set the joinstyle for the collection. The joinstyle can only be set globally for all elements in the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{js}}] \leavevmode{[}{[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]}{]} The joinstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_label() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyle() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyle}}}{\emph{ls}}{} Set the linestyle(s) for the collection. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily linestyle &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} or \sphinxcode{\sphinxupquote{'solid'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} or \sphinxcode{\sphinxupquote{'dashed'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} or \sphinxcode{\sphinxupquote{'dashdot'}} & dash-dotted line \\ \hline \sphinxcode{\sphinxupquote{':'}} or \sphinxcode{\sphinxupquote{'dotted'}} & dotted line \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Alternatively a dash tuple of the following form can be provided: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{onoffseq}} is an even length tuple of on and off ink in points. \begin{description} \item[{ACCEPTS: {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{}}] \leavevmode (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \end{description} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ls}}] \leavevmode{[}\{ ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’\} and more see description{]} The line style. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyles() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyles}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_linewidth() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{lw}}{} Set the linewidth(s) for the collection. \sphinxstyleemphasis{lw} can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_linewidths() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidths}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_lw() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_lw}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_norm() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_norm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_norm}}}{\emph{norm}}{} Set the normalization instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_offset\_position() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset\_position}}}{\emph{offset\_position}}{} Set how offsets are applied. If \sphinxstyleemphasis{offset\_position} is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{set\_offsets() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offsets}}}{\emph{offsets}}{} Set the offsets for the collection. \sphinxstyleemphasis{offsets} can be a scalar or a sequence. ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_path\_effects() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_paths() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_paths}}}{}{}~ \end{fulllineitems} \index{set\_picker() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_pickradius() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{pr}}{} Set the pick radius used for containment tests. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{d}}] \leavevmode{[}float{]} Pick radius, in points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_rasterized() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sketch\_params() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_snap() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_transform() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_url() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_urls() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_urls}}}{\emph{urls}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{urls}}] \leavevmode{[}List{[}str{]} or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_visible() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_zorder() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.set_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{stale (matplotlib.collections.QuadMesh attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.stale}}\pysigline{\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \index{sticky\_edges (matplotlib.collections.QuadMesh attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.sticky_edges}}\pysigline{\sphinxbfcode{\sphinxupquote{sticky\_edges}}} \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} sticky edge lists. When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added\textendash{}the view limit “sticks” to the edge. A typical usecase is histograms, where one usually expects no margin on the bottom edge (0) of the histogram. This attribute cannot be assigned to; however, the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} lists can be modified in place as needed. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{x}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{to\_rgba() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.to_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_rgba}}}{\emph{x}, \emph{alpha=None}, \emph{bytes=False}, \emph{norm=True}}{} Return a normalized rgba array corresponding to \sphinxstyleemphasis{x}. In the normal case, \sphinxstyleemphasis{x} is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable. There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If \sphinxstyleemphasis{x} is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the \sphinxstyleemphasis{alpha} kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the \sphinxstyleemphasis{alpha} kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4. In either case, if \sphinxstyleemphasis{bytes} is \sphinxstyleemphasis{False} (default), the rgba array will be floats in the 0-1 range; if it is \sphinxstyleemphasis{True}, the returned rgba array will be uint8 in the 0 to 255 range. If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1). \end{fulllineitems} \index{update() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \index{update\_from() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.update_from}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} copy properties from other to self \end{fulllineitems} \index{update\_scalarmappable() (matplotlib.collections.QuadMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.update_scalarmappable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_scalarmappable}}}{}{} If the scalar mappable array is not none, update colors from scalar data \end{fulllineitems} \index{zorder (matplotlib.collections.QuadMesh attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.QuadMesh.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \end{fulllineitems} \index{RegularPolyCollection (class in matplotlib.collections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.collections.}}\sphinxbfcode{\sphinxupquote{RegularPolyCollection}}}{\emph{numsides}, \emph{rotation=0}, \emph{sizes=(1}, \emph{)}, \emph{**kwargs}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.collections.\_CollectionWithSizes}} Draw a collection of regular polygons with \sphinxstyleemphasis{numsides}. \begin{description} \item[{\sphinxstyleemphasis{numsides}}] \leavevmode the number of sides of the polygon \item[{\sphinxstyleemphasis{rotation}}] \leavevmode the rotation of the polygon in radians \item[{\sphinxstyleemphasis{sizes}}] \leavevmode gives the area of the circle circumscribing the regular polygon in points\textasciicircum{}2 Valid Collection keyword arguments: \begin{itemize} \item {} \sphinxstyleemphasis{edgecolors}: None \item {} \sphinxstyleemphasis{facecolors}: None \item {} \sphinxstyleemphasis{linewidths}: None \item {} \sphinxstyleemphasis{antialiaseds}: None \item {} \sphinxstyleemphasis{offsets}: None \item {} \sphinxstyleemphasis{transOffset}: transforms.IdentityTransform() \item {} \sphinxstyleemphasis{norm}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \item {} \sphinxstyleemphasis{cmap}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \end{itemize} \sphinxstyleemphasis{offsets} and \sphinxstyleemphasis{transOffset} are used to translate the patch after rendering (default no offsets) If any of \sphinxstyleemphasis{edgecolors}, \sphinxstyleemphasis{facecolors}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{antialiaseds} are None, they default to their {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcParams}}}}} patch setting, in sequence form. \end{description} Example: see \sphinxcode{\sphinxupquote{examples/dynamic\_collection.py}} for complete example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{offsets} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{20}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{facecolors} \PYG{o}{=} \PYG{p}{[}\PYG{n}{cm}\PYG{o}{.}\PYG{n}{jet}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)} \PYG{k}{for} \PYG{n}{x} \PYG{o+ow}{in} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{20}\PYG{p}{)}\PYG{p}{]} \PYG{n}{black} \PYG{o}{=} \PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{collection} \PYG{o}{=} \PYG{n}{RegularPolyCollection}\PYG{p}{(} \PYG{n}{numsides}\PYG{o}{=}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} a pentagon} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{sizes}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{50}\PYG{p}{,}\PYG{p}{)}\PYG{p}{,} \PYG{n}{facecolors} \PYG{o}{=} \PYG{n}{facecolors}\PYG{p}{,} \PYG{n}{edgecolors} \PYG{o}{=} \PYG{p}{(}\PYG{n}{black}\PYG{p}{,}\PYG{p}{)}\PYG{p}{,} \PYG{n}{linewidths} \PYG{o}{=} \PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{p}{)}\PYG{p}{,} \PYG{n}{offsets} \PYG{o}{=} \PYG{n}{offsets}\PYG{p}{,} \PYG{n}{transOffset} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{p}{,} \PYG{p}{)} \end{sphinxVerbatim} \index{add\_callback() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.add_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \index{add\_checker() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.add_checker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_checker}}}{\emph{checker}}{} Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed. \end{fulllineitems} \index{aname (matplotlib.collections.RegularPolyCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.aname}}\pysigline{\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \index{autoscale() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Autoscale the scalar limits on the norm instance using the current array \end{fulllineitems} \index{autoscale\_None() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{}{} Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None \end{fulllineitems} \index{axes (matplotlib.collections.RegularPolyCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.axes}}\pysigline{\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \index{changed() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{changed}}}{}{} Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal \end{fulllineitems} \index{check\_update() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.check_update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{check\_update}}}{\emph{checker}}{} If mappable has changed since the last check, return True; else return False \end{fulllineitems} \index{contains() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the collection. Returns True \textbar{} False, \sphinxcode{\sphinxupquote{dict(ind=itemlist)}}, where every item in itemlist contains the event. \end{fulllineitems} \index{convert\_xunits() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.convert_xunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \index{convert\_yunits() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.convert_yunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \index{draw() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \index{findobj() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.findobj}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \index{format\_cursor\_data() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.format_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \index{get\_agg\_filter() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \index{get\_alpha() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \index{get\_animated() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \index{get\_array() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_array}}}{}{} Return the array \end{fulllineitems} \index{get\_capstyle() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{}~ \end{fulllineitems} \index{get\_children() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \index{get\_clim() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clim}}}{}{} return the min, max of the color limits for image scaling \end{fulllineitems} \index{get\_clip\_box() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \index{get\_clip\_on() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \index{get\_clip\_path() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \index{get\_cmap() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cmap}}}{}{} return the colormap \end{fulllineitems} \index{get\_contains() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \index{get\_cursor\_data() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \index{get\_dashes() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashes}}}{}{}~ \end{fulllineitems} \index{get\_datalim() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_datalim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_datalim}}}{\emph{transData}}{}~ \end{fulllineitems} \index{get\_edgecolor() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolor}}}{}{}~ \end{fulllineitems} \index{get\_edgecolors() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolors}}}{}{}~ \end{fulllineitems} \index{get\_facecolor() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{}~ \end{fulllineitems} \index{get\_facecolors() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolors}}}{}{}~ \end{fulllineitems} \index{get\_figure() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \index{get\_fill() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_fill}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fill}}}{}{} return whether fill is set \end{fulllineitems} \index{get\_gid() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \index{get\_hatch() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch}}}{}{} Return the current hatching pattern. \end{fulllineitems} \index{get\_joinstyle() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{}~ \end{fulllineitems} \index{get\_label() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \index{get\_linestyle() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyle}}}{}{}~ \end{fulllineitems} \index{get\_linestyles() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyles}}}{}{}~ \end{fulllineitems} \index{get\_linewidth() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidth}}}{}{}~ \end{fulllineitems} \index{get\_linewidths() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidths}}}{}{}~ \end{fulllineitems} \index{get\_numsides() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_numsides}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_numsides}}}{}{}~ \end{fulllineitems} \index{get\_offset\_position() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_position}}}{}{} Returns how offsets are applied for the collection. If \sphinxstyleemphasis{offset\_position} is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{get\_offset\_transform() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_offset_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_transform}}}{}{}~ \end{fulllineitems} \index{get\_offsets() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offsets}}}{}{} Return the offsets for the collection. \end{fulllineitems} \index{get\_path\_effects() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \index{get\_paths() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_paths}}}{}{}~ \end{fulllineitems} \index{get\_picker() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \index{get\_pickradius() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{}~ \end{fulllineitems} \index{get\_rasterized() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \index{get\_rotation() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_rotation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rotation}}}{}{}~ \end{fulllineitems} \index{get\_sizes() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_sizes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sizes}}}{}{} Returns the sizes of the elements in the collection. The value represents the ‘area’ of the element. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sizes}}] \leavevmode{[}array{]} The ‘area’ of each element. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_sketch\_params() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_snap() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \index{get\_transform() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \index{get\_transforms() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_transforms}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transforms}}}{}{}~ \end{fulllineitems} \index{get\_url() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \index{get\_urls() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_urls}}}{}{}~ \end{fulllineitems} \index{get\_visible() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \index{get\_window\_extent() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{get\_zorder() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.get_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \index{have\_units() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.have_units}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \index{hitlist() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.hitlist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hitlist}}}{\emph{event}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The hitlist function was deprecated in version 2.2. List the children of the artist which contain the mouse event \sphinxstyleemphasis{event}. \end{fulllineitems} \index{is\_figure\_set() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.is_figure_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_figure\_set}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }artist.figure is not None Returns whether the artist is assigned to a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \end{fulllineitems} \index{is\_transform\_set() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.is_transform_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \index{mouseover (matplotlib.collections.RegularPolyCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.mouseover}}\pysigline{\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \index{pchanged() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.pchanged}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \index{pick() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.pick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \index{pickable() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.pickable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \index{properties() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \index{remove() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \index{remove\_callback() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.remove_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \index{set() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \index{set\_agg\_filter() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_alpha() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha tranparencies of the collection. \sphinxstyleemphasis{alpha} must be a float or \sphinxstyleemphasis{None}. ACCEPTS: float or None \end{fulllineitems} \index{set\_animated() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_antialiased() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiased}}}{\emph{aa}}{} Set the antialiasing state for rendering. ACCEPTS: Boolean or sequence of booleans \end{fulllineitems} \index{set\_antialiaseds() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_antialiaseds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiaseds}}}{\emph{aa}}{} alias for set\_antialiased \end{fulllineitems} \index{set\_array() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_array}}}{\emph{A}}{} Set the image array from numpy array \sphinxstyleemphasis{A}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A}}] \leavevmode{[}ndarray{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_capstyle() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_capstyle}}}{\emph{cs}}{} Set the capstyle for the collection. The capstyle can only be set globally for all elements in the collection \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cs}}] \leavevmode{[}{[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]}{]} The capstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clim() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clim}}}{\emph{vmin=None}, \emph{vmax=None}}{} set the norm limits for image scaling; if \sphinxstyleemphasis{vmin} is a length2 sequence, interpret it as \sphinxcode{\sphinxupquote{(vmin, vmax)}} which is used to support setp ACCEPTS: a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \end{fulllineitems} \index{set\_clip\_box() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_on() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_path() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \index{set\_cmap() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cmap}}}{\emph{cmap}}{} set the colormap for luminance data ACCEPTS: a colormap or registered colormap name \end{fulllineitems} \index{set\_color() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{c}}{} Set both the edgecolor and the facecolor. ACCEPTS: matplotlib color arg or sequence of rgba tuples \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_facecolor()}}}}}, {\hyperref[\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_edgecolor()}}}}}}] \leavevmode For setting the edge or face color individually. \end{description} \end{fulllineitems} \index{set\_contains() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_dashes() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashes}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_edgecolor() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolor}}}{\emph{c}}{} Set the edgecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘face’, the edge color will always be the same as the face color. If it is ‘none’, the patch boundary will not be drawn. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_edgecolors() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolors}}}{\emph{c}}{} alias for set\_edgecolor \end{fulllineitems} \index{set\_facecolor() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{c}}{} Set the facecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘none’, the patch will not be filled. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_facecolors() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolors}}}{\emph{c}}{} alias for set\_facecolor \end{fulllineitems} \index{set\_figure() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_gid() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_hatch() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_hatch}}}{\emph{hatch}}{} Set the hatching pattern \sphinxstyleemphasis{hatch} can be one of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{/} \PYG{o}{\PYGZhy{}} \PYG{n}{diagonal} \PYG{n}{hatching} \PYGZbs{} \PYG{o}{\PYGZhy{}} \PYG{n}{back} \PYG{n}{diagonal} \PYG{o}{\textbar{}} \PYG{o}{\PYGZhy{}} \PYG{n}{vertical} \PYG{o}{\PYGZhy{}} \PYG{o}{\PYGZhy{}} \PYG{n}{horizontal} \PYG{o}{+} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{x} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{diagonal} \PYG{n}{o} \PYG{o}{\PYGZhy{}} \PYG{n}{small} \PYG{n}{circle} \PYG{n}{O} \PYG{o}{\PYGZhy{}} \PYG{n}{large} \PYG{n}{circle} \PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{dots} \PYG{o}{*} \PYG{o}{\PYGZhy{}} \PYG{n}{stars} \end{sphinxVerbatim} Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member. ACCEPTS: {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \end{fulllineitems} \index{set\_joinstyle() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_joinstyle}}}{\emph{js}}{} Set the joinstyle for the collection. The joinstyle can only be set globally for all elements in the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{js}}] \leavevmode{[}{[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]}{]} The joinstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_label() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyle() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyle}}}{\emph{ls}}{} Set the linestyle(s) for the collection. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily linestyle &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} or \sphinxcode{\sphinxupquote{'solid'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} or \sphinxcode{\sphinxupquote{'dashed'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} or \sphinxcode{\sphinxupquote{'dashdot'}} & dash-dotted line \\ \hline \sphinxcode{\sphinxupquote{':'}} or \sphinxcode{\sphinxupquote{'dotted'}} & dotted line \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Alternatively a dash tuple of the following form can be provided: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{onoffseq}} is an even length tuple of on and off ink in points. \begin{description} \item[{ACCEPTS: {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{}}] \leavevmode (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \end{description} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ls}}] \leavevmode{[}\{ ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’\} and more see description{]} The line style. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyles() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyles}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_linewidth() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{lw}}{} Set the linewidth(s) for the collection. \sphinxstyleemphasis{lw} can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_linewidths() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidths}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_lw() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_lw}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_norm() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_norm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_norm}}}{\emph{norm}}{} Set the normalization instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_offset\_position() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset\_position}}}{\emph{offset\_position}}{} Set how offsets are applied. If \sphinxstyleemphasis{offset\_position} is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{set\_offsets() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offsets}}}{\emph{offsets}}{} Set the offsets for the collection. \sphinxstyleemphasis{offsets} can be a scalar or a sequence. ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_path\_effects() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_paths() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_paths}}}{}{}~ \end{fulllineitems} \index{set\_picker() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_pickradius() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{pr}}{} Set the pick radius used for containment tests. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{d}}] \leavevmode{[}float{]} Pick radius, in points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_rasterized() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sizes() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_sizes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sizes}}}{\emph{sizes}, \emph{dpi=72.0}}{} Set the sizes of each member of the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sizes}}] \leavevmode{[}ndarray or None{]} The size to set for each element of the collection. The value is the ‘area’ of the element. \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}float{]} The dpi of the canvas. Defaults to 72.0. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sketch\_params() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_snap() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_transform() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_url() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_urls() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_urls}}}{\emph{urls}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{urls}}] \leavevmode{[}List{[}str{]} or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_visible() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_zorder() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.set_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{stale (matplotlib.collections.RegularPolyCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.stale}}\pysigline{\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \index{sticky\_edges (matplotlib.collections.RegularPolyCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.sticky_edges}}\pysigline{\sphinxbfcode{\sphinxupquote{sticky\_edges}}} \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} sticky edge lists. When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added\textendash{}the view limit “sticks” to the edge. A typical usecase is histograms, where one usually expects no margin on the bottom edge (0) of the histogram. This attribute cannot be assigned to; however, the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} lists can be modified in place as needed. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{x}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{to\_rgba() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.to_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_rgba}}}{\emph{x}, \emph{alpha=None}, \emph{bytes=False}, \emph{norm=True}}{} Return a normalized rgba array corresponding to \sphinxstyleemphasis{x}. In the normal case, \sphinxstyleemphasis{x} is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable. There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If \sphinxstyleemphasis{x} is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the \sphinxstyleemphasis{alpha} kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the \sphinxstyleemphasis{alpha} kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4. In either case, if \sphinxstyleemphasis{bytes} is \sphinxstyleemphasis{False} (default), the rgba array will be floats in the 0-1 range; if it is \sphinxstyleemphasis{True}, the returned rgba array will be uint8 in the 0 to 255 range. If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1). \end{fulllineitems} \index{update() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \index{update\_from() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.update_from}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} copy properties from other to self \end{fulllineitems} \index{update\_scalarmappable() (matplotlib.collections.RegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.update_scalarmappable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_scalarmappable}}}{}{} If the scalar mappable array is not none, update colors from scalar data \end{fulllineitems} \index{zorder (matplotlib.collections.RegularPolyCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \end{fulllineitems} \index{StarPolygonCollection (class in matplotlib.collections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.collections.}}\sphinxbfcode{\sphinxupquote{StarPolygonCollection}}}{\emph{numsides}, \emph{rotation=0}, \emph{sizes=(1}, \emph{)}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/collections_api:matplotlib.collections.RegularPolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.RegularPolyCollection}}}}} Draw a collection of regular stars with \sphinxstyleemphasis{numsides} points. \begin{description} \item[{\sphinxstyleemphasis{numsides}}] \leavevmode the number of sides of the polygon \item[{\sphinxstyleemphasis{rotation}}] \leavevmode the rotation of the polygon in radians \item[{\sphinxstyleemphasis{sizes}}] \leavevmode gives the area of the circle circumscribing the regular polygon in points\textasciicircum{}2 Valid Collection keyword arguments: \begin{itemize} \item {} \sphinxstyleemphasis{edgecolors}: None \item {} \sphinxstyleemphasis{facecolors}: None \item {} \sphinxstyleemphasis{linewidths}: None \item {} \sphinxstyleemphasis{antialiaseds}: None \item {} \sphinxstyleemphasis{offsets}: None \item {} \sphinxstyleemphasis{transOffset}: transforms.IdentityTransform() \item {} \sphinxstyleemphasis{norm}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \item {} \sphinxstyleemphasis{cmap}: None (optional for {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}) \end{itemize} \sphinxstyleemphasis{offsets} and \sphinxstyleemphasis{transOffset} are used to translate the patch after rendering (default no offsets) If any of \sphinxstyleemphasis{edgecolors}, \sphinxstyleemphasis{facecolors}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{antialiaseds} are None, they default to their {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcParams}}}}} patch setting, in sequence form. \end{description} Example: see \sphinxcode{\sphinxupquote{examples/dynamic\_collection.py}} for complete example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{offsets} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{20}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{facecolors} \PYG{o}{=} \PYG{p}{[}\PYG{n}{cm}\PYG{o}{.}\PYG{n}{jet}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)} \PYG{k}{for} \PYG{n}{x} \PYG{o+ow}{in} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{20}\PYG{p}{)}\PYG{p}{]} \PYG{n}{black} \PYG{o}{=} \PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{collection} \PYG{o}{=} \PYG{n}{RegularPolyCollection}\PYG{p}{(} \PYG{n}{numsides}\PYG{o}{=}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{c+c1}{\PYGZsh{} a pentagon} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{sizes}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{50}\PYG{p}{,}\PYG{p}{)}\PYG{p}{,} \PYG{n}{facecolors} \PYG{o}{=} \PYG{n}{facecolors}\PYG{p}{,} \PYG{n}{edgecolors} \PYG{o}{=} \PYG{p}{(}\PYG{n}{black}\PYG{p}{,}\PYG{p}{)}\PYG{p}{,} \PYG{n}{linewidths} \PYG{o}{=} \PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{p}{)}\PYG{p}{,} \PYG{n}{offsets} \PYG{o}{=} \PYG{n}{offsets}\PYG{p}{,} \PYG{n}{transOffset} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{p}{,} \PYG{p}{)} \end{sphinxVerbatim} \index{add\_callback() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.add_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \index{add\_checker() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.add_checker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_checker}}}{\emph{checker}}{} Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed. \end{fulllineitems} \index{aname (matplotlib.collections.StarPolygonCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.aname}}\pysigline{\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \index{autoscale() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Autoscale the scalar limits on the norm instance using the current array \end{fulllineitems} \index{autoscale\_None() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{}{} Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None \end{fulllineitems} \index{axes (matplotlib.collections.StarPolygonCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.axes}}\pysigline{\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \index{changed() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{changed}}}{}{} Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal \end{fulllineitems} \index{check\_update() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.check_update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{check\_update}}}{\emph{checker}}{} If mappable has changed since the last check, return True; else return False \end{fulllineitems} \index{contains() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the collection. Returns True \textbar{} False, \sphinxcode{\sphinxupquote{dict(ind=itemlist)}}, where every item in itemlist contains the event. \end{fulllineitems} \index{convert\_xunits() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.convert_xunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \index{convert\_yunits() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.convert_yunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \index{draw() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \index{findobj() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.findobj}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \index{format\_cursor\_data() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.format_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \index{get\_agg\_filter() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \index{get\_alpha() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \index{get\_animated() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \index{get\_array() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_array}}}{}{} Return the array \end{fulllineitems} \index{get\_capstyle() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{}~ \end{fulllineitems} \index{get\_children() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \index{get\_clim() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clim}}}{}{} return the min, max of the color limits for image scaling \end{fulllineitems} \index{get\_clip\_box() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \index{get\_clip\_on() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \index{get\_clip\_path() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \index{get\_cmap() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cmap}}}{}{} return the colormap \end{fulllineitems} \index{get\_contains() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \index{get\_cursor\_data() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \index{get\_dashes() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashes}}}{}{}~ \end{fulllineitems} \index{get\_datalim() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_datalim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_datalim}}}{\emph{transData}}{}~ \end{fulllineitems} \index{get\_edgecolor() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolor}}}{}{}~ \end{fulllineitems} \index{get\_edgecolors() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolors}}}{}{}~ \end{fulllineitems} \index{get\_facecolor() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{}~ \end{fulllineitems} \index{get\_facecolors() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolors}}}{}{}~ \end{fulllineitems} \index{get\_figure() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \index{get\_fill() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_fill}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fill}}}{}{} return whether fill is set \end{fulllineitems} \index{get\_gid() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \index{get\_hatch() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch}}}{}{} Return the current hatching pattern. \end{fulllineitems} \index{get\_joinstyle() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{}~ \end{fulllineitems} \index{get\_label() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \index{get\_linestyle() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyle}}}{}{}~ \end{fulllineitems} \index{get\_linestyles() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyles}}}{}{}~ \end{fulllineitems} \index{get\_linewidth() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidth}}}{}{}~ \end{fulllineitems} \index{get\_linewidths() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidths}}}{}{}~ \end{fulllineitems} \index{get\_numsides() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_numsides}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_numsides}}}{}{}~ \end{fulllineitems} \index{get\_offset\_position() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_position}}}{}{} Returns how offsets are applied for the collection. If \sphinxstyleemphasis{offset\_position} is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{get\_offset\_transform() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_offset_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_transform}}}{}{}~ \end{fulllineitems} \index{get\_offsets() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offsets}}}{}{} Return the offsets for the collection. \end{fulllineitems} \index{get\_path\_effects() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \index{get\_paths() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_paths}}}{}{}~ \end{fulllineitems} \index{get\_picker() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \index{get\_pickradius() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{}~ \end{fulllineitems} \index{get\_rasterized() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \index{get\_rotation() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_rotation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rotation}}}{}{}~ \end{fulllineitems} \index{get\_sizes() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_sizes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sizes}}}{}{} Returns the sizes of the elements in the collection. The value represents the ‘area’ of the element. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sizes}}] \leavevmode{[}array{]} The ‘area’ of each element. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_sketch\_params() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_snap() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \index{get\_transform() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \index{get\_transforms() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_transforms}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transforms}}}{}{}~ \end{fulllineitems} \index{get\_url() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \index{get\_urls() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_urls}}}{}{}~ \end{fulllineitems} \index{get\_visible() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \index{get\_window\_extent() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{get\_zorder() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.get_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \index{have\_units() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.have_units}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \index{hitlist() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.hitlist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hitlist}}}{\emph{event}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The hitlist function was deprecated in version 2.2. List the children of the artist which contain the mouse event \sphinxstyleemphasis{event}. \end{fulllineitems} \index{is\_figure\_set() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.is_figure_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_figure\_set}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }artist.figure is not None Returns whether the artist is assigned to a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \end{fulllineitems} \index{is\_transform\_set() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.is_transform_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \index{mouseover (matplotlib.collections.StarPolygonCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.mouseover}}\pysigline{\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \index{pchanged() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.pchanged}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \index{pick() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.pick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \index{pickable() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.pickable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \index{properties() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \index{remove() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \index{remove\_callback() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.remove_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \index{set() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \index{set\_agg\_filter() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_alpha() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha tranparencies of the collection. \sphinxstyleemphasis{alpha} must be a float or \sphinxstyleemphasis{None}. ACCEPTS: float or None \end{fulllineitems} \index{set\_animated() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_antialiased() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiased}}}{\emph{aa}}{} Set the antialiasing state for rendering. ACCEPTS: Boolean or sequence of booleans \end{fulllineitems} \index{set\_antialiaseds() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_antialiaseds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiaseds}}}{\emph{aa}}{} alias for set\_antialiased \end{fulllineitems} \index{set\_array() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_array}}}{\emph{A}}{} Set the image array from numpy array \sphinxstyleemphasis{A}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A}}] \leavevmode{[}ndarray{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_capstyle() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_capstyle}}}{\emph{cs}}{} Set the capstyle for the collection. The capstyle can only be set globally for all elements in the collection \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cs}}] \leavevmode{[}{[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]}{]} The capstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clim() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clim}}}{\emph{vmin=None}, \emph{vmax=None}}{} set the norm limits for image scaling; if \sphinxstyleemphasis{vmin} is a length2 sequence, interpret it as \sphinxcode{\sphinxupquote{(vmin, vmax)}} which is used to support setp ACCEPTS: a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \end{fulllineitems} \index{set\_clip\_box() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_on() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_path() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \index{set\_cmap() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cmap}}}{\emph{cmap}}{} set the colormap for luminance data ACCEPTS: a colormap or registered colormap name \end{fulllineitems} \index{set\_color() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{c}}{} Set both the edgecolor and the facecolor. ACCEPTS: matplotlib color arg or sequence of rgba tuples \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_facecolor()}}}}}, {\hyperref[\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_edgecolor()}}}}}}] \leavevmode For setting the edge or face color individually. \end{description} \end{fulllineitems} \index{set\_contains() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_dashes() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashes}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_edgecolor() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolor}}}{\emph{c}}{} Set the edgecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘face’, the edge color will always be the same as the face color. If it is ‘none’, the patch boundary will not be drawn. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_edgecolors() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolors}}}{\emph{c}}{} alias for set\_edgecolor \end{fulllineitems} \index{set\_facecolor() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{c}}{} Set the facecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘none’, the patch will not be filled. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_facecolors() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolors}}}{\emph{c}}{} alias for set\_facecolor \end{fulllineitems} \index{set\_figure() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_gid() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_hatch() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_hatch}}}{\emph{hatch}}{} Set the hatching pattern \sphinxstyleemphasis{hatch} can be one of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{/} \PYG{o}{\PYGZhy{}} \PYG{n}{diagonal} \PYG{n}{hatching} \PYGZbs{} \PYG{o}{\PYGZhy{}} \PYG{n}{back} \PYG{n}{diagonal} \PYG{o}{\textbar{}} \PYG{o}{\PYGZhy{}} \PYG{n}{vertical} \PYG{o}{\PYGZhy{}} \PYG{o}{\PYGZhy{}} \PYG{n}{horizontal} \PYG{o}{+} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{x} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{diagonal} \PYG{n}{o} \PYG{o}{\PYGZhy{}} \PYG{n}{small} \PYG{n}{circle} \PYG{n}{O} \PYG{o}{\PYGZhy{}} \PYG{n}{large} \PYG{n}{circle} \PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{dots} \PYG{o}{*} \PYG{o}{\PYGZhy{}} \PYG{n}{stars} \end{sphinxVerbatim} Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member. ACCEPTS: {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \end{fulllineitems} \index{set\_joinstyle() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_joinstyle}}}{\emph{js}}{} Set the joinstyle for the collection. The joinstyle can only be set globally for all elements in the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{js}}] \leavevmode{[}{[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]}{]} The joinstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_label() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyle() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyle}}}{\emph{ls}}{} Set the linestyle(s) for the collection. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily linestyle &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} or \sphinxcode{\sphinxupquote{'solid'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} or \sphinxcode{\sphinxupquote{'dashed'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} or \sphinxcode{\sphinxupquote{'dashdot'}} & dash-dotted line \\ \hline \sphinxcode{\sphinxupquote{':'}} or \sphinxcode{\sphinxupquote{'dotted'}} & dotted line \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Alternatively a dash tuple of the following form can be provided: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{onoffseq}} is an even length tuple of on and off ink in points. \begin{description} \item[{ACCEPTS: {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{}}] \leavevmode (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \end{description} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ls}}] \leavevmode{[}\{ ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’\} and more see description{]} The line style. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyles() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyles}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_linewidth() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{lw}}{} Set the linewidth(s) for the collection. \sphinxstyleemphasis{lw} can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_linewidths() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidths}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_lw() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_lw}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_norm() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_norm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_norm}}}{\emph{norm}}{} Set the normalization instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_offset\_position() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset\_position}}}{\emph{offset\_position}}{} Set how offsets are applied. If \sphinxstyleemphasis{offset\_position} is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{set\_offsets() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offsets}}}{\emph{offsets}}{} Set the offsets for the collection. \sphinxstyleemphasis{offsets} can be a scalar or a sequence. ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_path\_effects() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_paths() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_paths}}}{}{}~ \end{fulllineitems} \index{set\_picker() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_pickradius() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{pr}}{} Set the pick radius used for containment tests. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{d}}] \leavevmode{[}float{]} Pick radius, in points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_rasterized() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sizes() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_sizes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sizes}}}{\emph{sizes}, \emph{dpi=72.0}}{} Set the sizes of each member of the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sizes}}] \leavevmode{[}ndarray or None{]} The size to set for each element of the collection. The value is the ‘area’ of the element. \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}float{]} The dpi of the canvas. Defaults to 72.0. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sketch\_params() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_snap() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_transform() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_url() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_urls() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_urls}}}{\emph{urls}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{urls}}] \leavevmode{[}List{[}str{]} or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_visible() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_zorder() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.set_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{stale (matplotlib.collections.StarPolygonCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.stale}}\pysigline{\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \index{sticky\_edges (matplotlib.collections.StarPolygonCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.sticky_edges}}\pysigline{\sphinxbfcode{\sphinxupquote{sticky\_edges}}} \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} sticky edge lists. When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added\textendash{}the view limit “sticks” to the edge. A typical usecase is histograms, where one usually expects no margin on the bottom edge (0) of the histogram. This attribute cannot be assigned to; however, the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} lists can be modified in place as needed. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{x}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{to\_rgba() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.to_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_rgba}}}{\emph{x}, \emph{alpha=None}, \emph{bytes=False}, \emph{norm=True}}{} Return a normalized rgba array corresponding to \sphinxstyleemphasis{x}. In the normal case, \sphinxstyleemphasis{x} is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable. There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If \sphinxstyleemphasis{x} is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the \sphinxstyleemphasis{alpha} kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the \sphinxstyleemphasis{alpha} kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4. In either case, if \sphinxstyleemphasis{bytes} is \sphinxstyleemphasis{False} (default), the rgba array will be floats in the 0-1 range; if it is \sphinxstyleemphasis{True}, the returned rgba array will be uint8 in the 0 to 255 range. If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1). \end{fulllineitems} \index{update() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \index{update\_from() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.update_from}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} copy properties from other to self \end{fulllineitems} \index{update\_scalarmappable() (matplotlib.collections.StarPolygonCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.update_scalarmappable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_scalarmappable}}}{}{} If the scalar mappable array is not none, update colors from scalar data \end{fulllineitems} \index{zorder (matplotlib.collections.StarPolygonCollection attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.StarPolygonCollection.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \end{fulllineitems} \index{TriMesh (class in matplotlib.collections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.collections.}}\sphinxbfcode{\sphinxupquote{TriMesh}}}{\emph{triangulation}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.Collection}}}}} Class for the efficient drawing of a triangular mesh using Gouraud shading. A triangular mesh is a {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} object. \index{add\_callback() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.add_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/collections_api:matplotlib.collections.TriMesh.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \index{add\_checker() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.add_checker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_checker}}}{\emph{checker}}{} Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed. \end{fulllineitems} \index{aname (matplotlib.collections.TriMesh attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.aname}}\pysigline{\sphinxbfcode{\sphinxupquote{aname}}\sphinxbfcode{\sphinxupquote{ = 'Artist'}}} \end{fulllineitems} \index{autoscale() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Autoscale the scalar limits on the norm instance using the current array \end{fulllineitems} \index{autoscale\_None() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{}{} Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None \end{fulllineitems} \index{axes (matplotlib.collections.TriMesh attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.axes}}\pysigline{\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \index{changed() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{changed}}}{}{} Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal \end{fulllineitems} \index{check\_update() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.check_update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{check\_update}}}{\emph{checker}}{} If mappable has changed since the last check, return True; else return False \end{fulllineitems} \index{contains() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the collection. Returns True \textbar{} False, \sphinxcode{\sphinxupquote{dict(ind=itemlist)}}, where every item in itemlist contains the event. \end{fulllineitems} \index{convert\_mesh\_to\_paths() (matplotlib.collections.TriMesh static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.convert_mesh_to_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{convert\_mesh\_to\_paths}}}{\emph{tri}}{} Converts a given mesh into a sequence of {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.path.Path}}}}} objects for easier rendering by backends that do not directly support meshes. This function is primarily of use to backend implementers. \end{fulllineitems} \index{convert\_xunits() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.convert_xunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_xunits}}}{\emph{x}}{} For artists in an axes, if the xaxis has units support, convert \sphinxstyleemphasis{x} using xaxis unit type \end{fulllineitems} \index{convert\_yunits() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.convert_yunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_yunits}}}{\emph{y}}{} For artists in an axes, if the yaxis has units support, convert \sphinxstyleemphasis{y} using yaxis unit type \end{fulllineitems} \index{draw() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \index{findobj() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.findobj}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \index{format\_cursor\_data() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.format_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_cursor\_data}}}{\emph{data}}{} Return \sphinxstyleemphasis{cursor data} string formatted. \end{fulllineitems} \index{get\_agg\_filter() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_agg\_filter}}}{}{} Return filter function to be used for agg filter. \end{fulllineitems} \index{get\_alpha() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} Return the alpha value used for blending - not supported on all backends \end{fulllineitems} \index{get\_animated() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_animated}}}{}{} Return the artist’s animated state \end{fulllineitems} \index{get\_array() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_array}}}{}{} Return the array \end{fulllineitems} \index{get\_capstyle() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{}~ \end{fulllineitems} \index{get\_children() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \index{get\_clim() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clim}}}{}{} return the min, max of the color limits for image scaling \end{fulllineitems} \index{get\_clip\_box() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_box}}}{}{} Return artist clipbox \end{fulllineitems} \index{get\_clip\_on() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_on}}}{}{} Return whether artist uses clipping \end{fulllineitems} \index{get\_clip\_path() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_clip\_path}}}{}{} Return artist clip path \end{fulllineitems} \index{get\_cmap() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cmap}}}{}{} return the colormap \end{fulllineitems} \index{get\_contains() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_contains}}}{}{} Return the \_contains test used by the artist, or \sphinxstyleemphasis{None} for default. \end{fulllineitems} \index{get\_cursor\_data() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event. \end{fulllineitems} \index{get\_dashes() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashes}}}{}{}~ \end{fulllineitems} \index{get\_datalim() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_datalim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_datalim}}}{\emph{transData}}{}~ \end{fulllineitems} \index{get\_edgecolor() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolor}}}{}{}~ \end{fulllineitems} \index{get\_edgecolors() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolors}}}{}{}~ \end{fulllineitems} \index{get\_facecolor() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{}~ \end{fulllineitems} \index{get\_facecolors() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolors}}}{}{}~ \end{fulllineitems} \index{get\_figure() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \end{fulllineitems} \index{get\_fill() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_fill}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fill}}}{}{} return whether fill is set \end{fulllineitems} \index{get\_gid() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_gid}}}{}{} Returns the group id. \end{fulllineitems} \index{get\_hatch() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch}}}{}{} Return the current hatching pattern. \end{fulllineitems} \index{get\_joinstyle() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{}~ \end{fulllineitems} \index{get\_label() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \index{get\_linestyle() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyle}}}{}{}~ \end{fulllineitems} \index{get\_linestyles() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyles}}}{}{}~ \end{fulllineitems} \index{get\_linewidth() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidth}}}{}{}~ \end{fulllineitems} \index{get\_linewidths() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidths}}}{}{}~ \end{fulllineitems} \index{get\_offset\_position() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_position}}}{}{} Returns how offsets are applied for the collection. If \sphinxstyleemphasis{offset\_position} is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{get\_offset\_transform() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_offset_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset\_transform}}}{}{}~ \end{fulllineitems} \index{get\_offsets() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offsets}}}{}{} Return the offsets for the collection. \end{fulllineitems} \index{get\_path\_effects() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path\_effects}}}{}{}~ \end{fulllineitems} \index{get\_paths() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_paths}}}{}{}~ \end{fulllineitems} \index{get\_picker() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_picker}}}{}{} Return the picker object used by this artist. \end{fulllineitems} \index{get\_pickradius() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{}~ \end{fulllineitems} \index{get\_rasterized() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rasterized}}}{}{} Return whether the artist is to be rasterized. \end{fulllineitems} \index{get\_sketch\_params() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sketch\_params}}}{}{} Returns the sketch parameters for the artist. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{sketch\_params}}] \leavevmode{[}tuple or \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}{]} \item[{\sphinxstylestrong{A 3-tuple with the following elements:}}] \leavevmode\begin{itemize} \item {} \sphinxcode{\sphinxupquote{scale}}: The amplitude of the wiggle perpendicular to the source line. \item {} \sphinxcode{\sphinxupquote{length}}: The length of the wiggle along the line. \item {} \sphinxcode{\sphinxupquote{randomness}}: The scale factor by which the length is shrunken or expanded. \end{itemize} \item[{\sphinxstylestrong{May return {}`None{}` if no sketch parameters were set.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_snap() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_snap}}}{}{} Returns the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \end{fulllineitems} \index{get\_transform() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \index{get\_transformed\_clip\_path\_and\_affine() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_transformed_clip_path_and_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transformed\_clip\_path\_and\_affine}}}{}{} Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. \end{fulllineitems} \index{get\_transforms() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_transforms}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transforms}}}{}{}~ \end{fulllineitems} \index{get\_url() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_url}}}{}{} Returns the url. \end{fulllineitems} \index{get\_urls() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_urls}}}{}{}~ \end{fulllineitems} \index{get\_visible() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_visible}}}{}{} Return the artist’s visiblity \end{fulllineitems} \index{get\_window\_extent() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{get\_zorder() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.get_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zorder}}}{}{} Return the artist’s zorder. \end{fulllineitems} \index{have\_units() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.have_units}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axes \end{fulllineitems} \index{hitlist() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.hitlist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hitlist}}}{\emph{event}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The hitlist function was deprecated in version 2.2. List the children of the artist which contain the mouse event \sphinxstyleemphasis{event}. \end{fulllineitems} \index{is\_figure\_set() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.is_figure_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_figure\_set}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }artist.figure is not None Returns whether the artist is assigned to a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}. \end{fulllineitems} \index{is\_transform\_set() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.is_transform_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_transform\_set}}}{}{} Returns \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} has a transform explicitly set. \end{fulllineitems} \index{mouseover (matplotlib.collections.TriMesh attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.mouseover}}\pysigline{\sphinxbfcode{\sphinxupquote{mouseover}}}~ \end{fulllineitems} \index{pchanged() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.pchanged}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \index{pick() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.pick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pick}}}{\emph{mouseevent}}{} Process pick event each child artist will fire a pick event if \sphinxstyleemphasis{mouseevent} is over the artist and the artist has picker set \end{fulllineitems} \index{pickable() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.pickable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pickable}}}{}{} Return \sphinxstyleemphasis{True} if \sphinxcode{\sphinxupquote{Artist}} is pickable. \end{fulllineitems} \index{properties() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{properties}}}{}{} return a dictionary mapping property name -\textgreater{} value for all Artist props \end{fulllineitems} \index{remove() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with \sphinxcode{\sphinxupquote{matplotlib.axes.Axes.draw\_idle()}}. Call {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.relim()}}}}} to update the axes limits if desired. Note: {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.relim:matplotlib.axes.Axes.relim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{relim()}}}}} will not see collections even if the collection was added to axes with \sphinxstyleemphasis{autolim} = True. Note: there is no support for removing the artist’s legend entry. \end{fulllineitems} \index{remove\_callback() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.remove_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.TriMesh.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \index{set() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{**kwargs}}{} A property batch setter. Pass \sphinxstyleemphasis{kwargs} to set properties. \end{fulllineitems} \index{set\_agg\_filter() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_agg_filter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_agg\_filter}}}{\emph{filter\_func}}{} Set the agg filter. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filter\_func}}] \leavevmode{[}callable{]} A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_alpha() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha tranparencies of the collection. \sphinxstyleemphasis{alpha} must be a float or \sphinxstyleemphasis{None}. ACCEPTS: float or None \end{fulllineitems} \index{set\_animated() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{b}}{} Set the artist’s animation state. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_antialiased() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiased}}}{\emph{aa}}{} Set the antialiasing state for rendering. ACCEPTS: Boolean or sequence of booleans \end{fulllineitems} \index{set\_antialiaseds() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_antialiaseds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiaseds}}}{\emph{aa}}{} alias for set\_antialiased \end{fulllineitems} \index{set\_array() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_array}}}{\emph{A}}{} Set the image array from numpy array \sphinxstyleemphasis{A}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A}}] \leavevmode{[}ndarray{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_capstyle() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_capstyle}}}{\emph{cs}}{} Set the capstyle for the collection. The capstyle can only be set globally for all elements in the collection \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cs}}] \leavevmode{[}{[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]}{]} The capstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clim() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_clim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clim}}}{\emph{vmin=None}, \emph{vmax=None}}{} set the norm limits for image scaling; if \sphinxstyleemphasis{vmin} is a length2 sequence, interpret it as \sphinxcode{\sphinxupquote{(vmin, vmax)}} which is used to support setp ACCEPTS: a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \end{fulllineitems} \index{set\_clip\_box() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{clipbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_on() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False artists will be visible out side of the axes which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_path() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance; or \item {} a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance, which will be applied to the path before using it for clipping, must be provided; or \item {} \sphinxcode{\sphinxupquote{None}}, to remove a previously set clipping path. \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxcode{\sphinxupquote{None}}. ACCEPTS: {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \end{fulllineitems} \index{set\_cmap() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cmap}}}{\emph{cmap}}{} set the colormap for luminance data ACCEPTS: a colormap or registered colormap name \end{fulllineitems} \index{set\_color() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{c}}{} Set both the edgecolor and the facecolor. ACCEPTS: matplotlib color arg or sequence of rgba tuples \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_facecolor()}}}}}, {\hyperref[\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_edgecolor()}}}}}}] \leavevmode For setting the edge or face color individually. \end{description} \end{fulllineitems} \index{set\_contains() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_contains}}}{\emph{picker}}{} Replace the contains test used by this artist. The new picker should be a callable function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} If the mouse event is over the artist, return \sphinxstyleemphasis{hit} = \sphinxstyleemphasis{True} and \sphinxstyleemphasis{props} is a dictionary of properties you want returned with the contains test. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_dashes() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashes}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_edgecolor() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolor}}}{\emph{c}}{} Set the edgecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘face’, the edge color will always be the same as the face color. If it is ‘none’, the patch boundary will not be drawn. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_edgecolors() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolors}}}{\emph{c}}{} alias for set\_edgecolor \end{fulllineitems} \index{set\_facecolor() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{c}}{} Set the facecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘none’, the patch will not be filled. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_facecolors() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolors}}}{\emph{c}}{} alias for set\_facecolor \end{fulllineitems} \index{set\_figure() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_gid() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_gid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_gid}}}{\emph{gid}}{} Sets the (group) id for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gid}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_hatch() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_hatch}}}{\emph{hatch}}{} Set the hatching pattern \sphinxstyleemphasis{hatch} can be one of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{/} \PYG{o}{\PYGZhy{}} \PYG{n}{diagonal} \PYG{n}{hatching} \PYGZbs{} \PYG{o}{\PYGZhy{}} \PYG{n}{back} \PYG{n}{diagonal} \PYG{o}{\textbar{}} \PYG{o}{\PYGZhy{}} \PYG{n}{vertical} \PYG{o}{\PYGZhy{}} \PYG{o}{\PYGZhy{}} \PYG{n}{horizontal} \PYG{o}{+} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{x} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{diagonal} \PYG{n}{o} \PYG{o}{\PYGZhy{}} \PYG{n}{small} \PYG{n}{circle} \PYG{n}{O} \PYG{o}{\PYGZhy{}} \PYG{n}{large} \PYG{n}{circle} \PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{dots} \PYG{o}{*} \PYG{o}{\PYGZhy{}} \PYG{n}{stars} \end{sphinxVerbatim} Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member. ACCEPTS: {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \end{fulllineitems} \index{set\_joinstyle() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_joinstyle}}}{\emph{js}}{} Set the joinstyle for the collection. The joinstyle can only be set globally for all elements in the collection. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{js}}] \leavevmode{[}{[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]}{]} The joinstyle \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_label() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}object{]} \sphinxstyleemphasis{s} will be converted to a string by calling \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} (\sphinxcode{\sphinxupquote{unicode}} on Py2). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyle() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyle}}}{\emph{ls}}{} Set the linestyle(s) for the collection. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily linestyle &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} or \sphinxcode{\sphinxupquote{'solid'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} or \sphinxcode{\sphinxupquote{'dashed'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} or \sphinxcode{\sphinxupquote{'dashdot'}} & dash-dotted line \\ \hline \sphinxcode{\sphinxupquote{':'}} or \sphinxcode{\sphinxupquote{'dotted'}} & dotted line \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Alternatively a dash tuple of the following form can be provided: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{onoffseq}} is an even length tuple of on and off ink in points. \begin{description} \item[{ACCEPTS: {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{}}] \leavevmode (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \end{description} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ls}}] \leavevmode{[}\{ ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’\} and more see description{]} The line style. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linestyles() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_linestyles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyles}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_linewidth() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{lw}}{} Set the linewidth(s) for the collection. \sphinxstyleemphasis{lw} can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_linewidths() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_linewidths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidths}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_lw() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_lw}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_norm() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_norm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_norm}}}{\emph{norm}}{} Set the normalization instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_offset\_position() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_offset_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset\_position}}}{\emph{offset\_position}}{} Set how offsets are applied. If \sphinxstyleemphasis{offset\_position} is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset\_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates. \end{fulllineitems} \index{set\_offsets() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offsets}}}{\emph{offsets}}{} Set the offsets for the collection. \sphinxstyleemphasis{offsets} can be a scalar or a sequence. ACCEPTS: float or sequence of floats \end{fulllineitems} \index{set\_path\_effects() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_path_effects}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_path\_effects}}}{\emph{path\_effects}}{} Set the path effects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}{\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_paths() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_paths}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_paths}}}{}{}~ \end{fulllineitems} \index{set\_picker() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{picker}}{} Set the epsilon for picking used by this artist \sphinxstyleemphasis{picker} can be one of the following: \begin{itemize} \item {} \sphinxstyleemphasis{None}: picking is disabled for this artist (default) \item {} A boolean: if \sphinxstyleemphasis{True} then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist \item {} A float: if picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if it’s data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event \item {} A function: if picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hit}\PYG{p}{,} \PYG{n}{props} \PYG{o}{=} \PYG{n}{picker}\PYG{p}{(}\PYG{n}{artist}\PYG{p}{,} \PYG{n}{mouseevent}\PYG{p}{)} \end{sphinxVerbatim} to determine the hit test. if the mouse event is over the artist, return \sphinxstyleemphasis{hit=True} and props is a dictionary of properties you want added to the PickEvent attributes. \end{itemize} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{picker}}] \leavevmode{[}None or bool or float or callable{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_pickradius() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{pr}}{} Set the pick radius used for containment tests. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{d}}] \leavevmode{[}float{]} Pick radius, in points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_rasterized() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_rasterized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rasterized}}}{\emph{rasterized}}{} Force rasterized (bitmap) drawing in vector backend output. Defaults to None, which implies the backend’s default behavior. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rasterized}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_sketch\_params() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_sketch_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sketch\_params}}}{\emph{scale=None}, \emph{length=None}, \emph{randomness=None}}{} Sets the sketch parameters. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, or not provided, no sketch filter will be provided. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line, in pixels (default 128.0) \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded (default 16.0) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_snap() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_snap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_snap}}}{\emph{snap}}{} Sets the snap setting which may be: \begin{itemize} \item {} True: snap vertices to the nearest pixel center \item {} False: leave vertices as-is \item {} None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center \end{itemize} Only supported by the Agg and MacOSX backends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_transform() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_url() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_url}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_url}}}{\emph{url}}{} Sets the url for the artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{url}}] \leavevmode{[}str{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_urls() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_urls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_urls}}}{\emph{urls}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{urls}}] \leavevmode{[}List{[}str{]} or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_visible() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{b}}{} Set the artist’s visibility. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_zorder() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.set_zorder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zorder}}}{\emph{level}}{} Set the zorder for the artist. Artists with lower zorder values are drawn first. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{level}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{stale (matplotlib.collections.TriMesh attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.stale}}\pysigline{\sphinxbfcode{\sphinxupquote{stale}}} If the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist. \end{fulllineitems} \index{sticky\_edges (matplotlib.collections.TriMesh attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.sticky_edges}}\pysigline{\sphinxbfcode{\sphinxupquote{sticky\_edges}}} \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} sticky edge lists. When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added\textendash{}the view limit “sticks” to the edge. A typical usecase is histograms, where one usually expects no margin on the bottom edge (0) of the histogram. This attribute cannot be assigned to; however, the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} lists can be modified in place as needed. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{x}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{artist}\PYG{o}{.}\PYG{n}{sticky\PYGZus{}edges}\PYG{o}{.}\PYG{n}{y}\PYG{p}{[}\PYG{p}{:}\PYG{p}{]} \PYG{o}{=} \PYG{p}{(}\PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{to\_rgba() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.to_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_rgba}}}{\emph{x}, \emph{alpha=None}, \emph{bytes=False}, \emph{norm=True}}{} Return a normalized rgba array corresponding to \sphinxstyleemphasis{x}. In the normal case, \sphinxstyleemphasis{x} is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable. There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If \sphinxstyleemphasis{x} is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the \sphinxstyleemphasis{alpha} kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the \sphinxstyleemphasis{alpha} kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4. In either case, if \sphinxstyleemphasis{bytes} is \sphinxstyleemphasis{False} (default), the rgba array will be floats in the 0-1 range; if it is \sphinxstyleemphasis{True}, the returned rgba array will be uint8 in the 0 to 255 range. If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1). \end{fulllineitems} \index{update() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{\emph{props}}{} Update this artist’s properties from the dictionary \sphinxstyleemphasis{prop}. \end{fulllineitems} \index{update\_from() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.update_from}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} copy properties from other to self \end{fulllineitems} \index{update\_scalarmappable() (matplotlib.collections.TriMesh method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.update_scalarmappable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_scalarmappable}}}{}{} If the scalar mappable array is not none, update colors from scalar data \end{fulllineitems} \index{zorder (matplotlib.collections.TriMesh attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/collections_api:matplotlib.collections.TriMesh.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \end{fulllineitems} \chapter{colorbar} \label{\detokenize{api/colorbar_api:colorbar}}\label{\detokenize{api/colorbar_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.colorbar}}} \label{\detokenize{api/colorbar_api:module-matplotlib.colorbar}}\label{\detokenize{api/colorbar_api:matplotlib-colorbar}}\index{matplotlib.colorbar (module)} Colorbar toolkit with two classes and a function: \begin{quote} \begin{description} \item[{{\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ColorbarBase}}}}}}] \leavevmode the base class with full colorbar drawing functionality. It can be used as-is to make a colorbar for a given colormap; a mappable object (e.g., image) is not needed. \item[{{\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.Colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colorbar}}}}}}] \leavevmode the derived class for use with images or contour plots. \item[{{\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.make_axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{make\_axes()}}}}}}] \leavevmode a function for resizing an axes and adding a second axes suitable for a colorbar \end{description} \end{quote} The {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} method uses {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.make_axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{make\_axes()}}}}} and {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.Colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colorbar}}}}}; the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.colorbar:matplotlib.pyplot.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} function is a thin wrapper over {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}}. \index{Colorbar (class in matplotlib.colorbar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.Colorbar}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.colorbar.}}\sphinxbfcode{\sphinxupquote{Colorbar}}}{\emph{ax}, \emph{mappable}, \emph{**kw}}{} Bases: {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colorbar.ColorbarBase}}}}} This class connects a {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ColorbarBase}}}}} to a {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarMappable}}}}} such as a {\hyperref[\detokenize{api/image_api:matplotlib.image.AxesImage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AxesImage}}}}} generated via {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.imshow:matplotlib.axes.Axes.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow()}}}}}. It is not intended to be instantiated directly; instead, use {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.colorbar:matplotlib.pyplot.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} to make your colorbar. \index{add\_lines() (matplotlib.colorbar.Colorbar method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.Colorbar.add_lines}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_lines}}}{\emph{CS}, \emph{erase=True}}{} Add the lines from a non-filled {\hyperref[\detokenize{api/contour_api:matplotlib.contour.ContourSet}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ContourSet}}}}} to the colorbar. Set \sphinxstyleemphasis{erase} to False if these lines should be added to any pre-existing lines. \end{fulllineitems} \index{on\_mappable\_changed() (matplotlib.colorbar.Colorbar method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.Colorbar.on_mappable_changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{on\_mappable\_changed}}}{\emph{mappable}}{} Updates this colorbar to match the mappable’s properties. Typically this is automatically registered as an event handler by {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.colorbar_factory}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar\_factory()}}}}} and should not be called manually. \end{fulllineitems} \index{remove() (matplotlib.colorbar.Colorbar method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.Colorbar.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove this colorbar from the figure. If the colorbar was created with \sphinxcode{\sphinxupquote{use\_gridspec=True}} then restore the gridspec to its previous value. \end{fulllineitems} \index{update\_bruteforce() (matplotlib.colorbar.Colorbar method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.Colorbar.update_bruteforce}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_bruteforce}}}{\emph{mappable}}{} Destroy and rebuild the colorbar. This is intended to become obsolete, and will probably be deprecated and then removed. It is not called when the pyplot.colorbar function or the Figure.colorbar method are used to create the colorbar. \end{fulllineitems} \index{update\_normal() (matplotlib.colorbar.Colorbar method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.Colorbar.update_normal}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_normal}}}{\emph{mappable}}{} update solid, lines, etc. Unlike update\_bruteforce, it does not clear the axes. This is meant to be called when the image or contour plot to which this colorbar belongs is changed. \end{fulllineitems} \end{fulllineitems} \index{ColorbarBase (class in matplotlib.colorbar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.colorbar.}}\sphinxbfcode{\sphinxupquote{ColorbarBase}}}{\emph{ax}, \emph{cmap=None}, \emph{norm=None}, \emph{alpha=None}, \emph{values=None}, \emph{boundaries=None}, \emph{orientation='vertical'}, \emph{ticklocation='auto'}, \emph{extend='neither'}, \emph{spacing='uniform'}, \emph{ticks=None}, \emph{format=None}, \emph{drawedges=False}, \emph{filled=True}, \emph{extendfrac=None}, \emph{extendrect=False}, \emph{label=''}}{} Bases: {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}} Draw a colorbar in an existing axes. This is a base class for the {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.Colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colorbar}}}}} class, which is the basis for the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.colorbar:matplotlib.pyplot.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} function and the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} method, which are the usual ways of creating a colorbar. It is also useful by itself for showing a colormap. If the \sphinxstyleemphasis{cmap} kwarg is given but \sphinxstyleemphasis{boundaries} and \sphinxstyleemphasis{values} are left as None, then the colormap will be displayed on a 0-1 scale. To show the under- and over-value colors, specify the \sphinxstyleemphasis{norm} as: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{colors}\PYG{o}{.}\PYG{n}{Normalize}\PYG{p}{(}\PYG{n}{clip}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{)} \end{sphinxVerbatim} To show the colors versus index instead of on the 0-1 scale, use: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{norm}\PYG{o}{=}\PYG{n}{colors}\PYG{o}{.}\PYG{n}{NoNorm}\PYG{o}{.} \end{sphinxVerbatim} Useful public methods are {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_label()}}}}} and {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.add_lines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_lines()}}}}}. \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ax}}] \leavevmode{[}Axes{]} The \sphinxcode{\sphinxupquote{Axes}} instance in which the colorbar is drawn. \item[{\sphinxstylestrong{lines}}] \leavevmode{[}list{]} A list of \sphinxcode{\sphinxupquote{LineCollection}} if lines were drawn, otherwise an empty list. \item[{\sphinxstylestrong{dividers}}] \leavevmode{[}LineCollection{]} A LineCollection if \sphinxstyleemphasis{drawedges} is \sphinxcode{\sphinxupquote{True}}, otherwise \sphinxcode{\sphinxupquote{None}}. \end{description} \end{description}\end{quote} \index{add\_lines() (matplotlib.colorbar.ColorbarBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.add_lines}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_lines}}}{\emph{levels}, \emph{colors}, \emph{linewidths}, \emph{erase=True}}{} Draw lines on the colorbar. \sphinxstyleemphasis{colors} and \sphinxstyleemphasis{linewidths} must be scalars or sequences the same length as \sphinxstyleemphasis{levels}. Set \sphinxstyleemphasis{erase} to False to add lines without first removing any previously added lines. \end{fulllineitems} \index{ax (matplotlib.colorbar.ColorbarBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.ax}}\pysigline{\sphinxbfcode{\sphinxupquote{ax}}\sphinxbfcode{\sphinxupquote{ = None}}} The axes that this colorbar lives in. \end{fulllineitems} \index{config\_axis() (matplotlib.colorbar.ColorbarBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.config_axis}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{config\_axis}}}{}{}~ \end{fulllineitems} \index{draw\_all() (matplotlib.colorbar.ColorbarBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.draw_all}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_all}}}{}{} Calculate any free parameters based on the current cmap and norm, and do all the drawing. \end{fulllineitems} \index{get\_ticks() (matplotlib.colorbar.ColorbarBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.get_ticks}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_ticks}}}{\emph{minor=False}}{} Return the x ticks as a list of locations \end{fulllineitems} \index{n\_rasterize (matplotlib.colorbar.ColorbarBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.n_rasterize}}\pysigline{\sphinxbfcode{\sphinxupquote{n\_rasterize}}\sphinxbfcode{\sphinxupquote{ = 50}}} \end{fulllineitems} \index{remove() (matplotlib.colorbar.ColorbarBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{}{} Remove this colorbar from the figure \end{fulllineitems} \index{set\_alpha() (matplotlib.colorbar.ColorbarBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{}~ \end{fulllineitems} \index{set\_label() (matplotlib.colorbar.ColorbarBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.set_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{label}, \emph{**kw}}{} Label the long axis of the colorbar \end{fulllineitems} \index{set\_ticklabels() (matplotlib.colorbar.ColorbarBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.set_ticklabels}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_ticklabels}}}{\emph{ticklabels}, \emph{update\_ticks=True}}{} set tick labels. Tick labels are updated immediately unless update\_ticks is \sphinxstyleemphasis{False}. To manually update the ticks, call \sphinxstyleemphasis{update\_ticks} method explicitly. \end{fulllineitems} \index{set\_ticks() (matplotlib.colorbar.ColorbarBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.set_ticks}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_ticks}}}{\emph{ticks}, \emph{update\_ticks=True}}{} Set tick locations. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ticks}}] \leavevmode{[}\{None, sequence, {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Locator}}}}} instance\}{]} If None, a default Locator will be used. \item[{\sphinxstylestrong{update\_ticks}}] \leavevmode{[}\{True, False\}, optional{]} If True, tick locations are updated immediately. If False, use {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.update_ticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{update\_ticks()}}}}} to manually update the ticks. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{update\_ticks() (matplotlib.colorbar.ColorbarBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.update_ticks}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_ticks}}}{}{} Force the update of the ticks and ticklabels. This must be called whenever the tick locator and/or tick formatter changes. \end{fulllineitems} \end{fulllineitems} \index{ColorbarPatch (class in matplotlib.colorbar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarPatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.colorbar.}}\sphinxbfcode{\sphinxupquote{ColorbarPatch}}}{\emph{ax}, \emph{mappable}, \emph{**kw}}{} Bases: {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.Colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colorbar.Colorbar}}}}} A Colorbar which is created using {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} rather than the default \sphinxcode{\sphinxupquote{pcolor()}}. It uses a list of Patch instances instead of a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PatchCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PatchCollection}}}}} because the latter does not allow the hatch pattern to vary among the members of the collection. \end{fulllineitems} \index{colorbar\_factory() (in module matplotlib.colorbar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.colorbar_factory}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.colorbar.}}\sphinxbfcode{\sphinxupquote{colorbar\_factory}}}{\emph{cax}, \emph{mappable}, \emph{**kwargs}}{} Creates a colorbar on the given axes for the given mappable. Typically, for automatic colorbar placement given only a mappable use {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}}. \end{fulllineitems} \index{make\_axes() (in module matplotlib.colorbar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.make_axes}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.colorbar.}}\sphinxbfcode{\sphinxupquote{make\_axes}}}{\emph{parents}, \emph{location=None}, \emph{orientation=None}, \emph{fraction=0.15}, \emph{shrink=1.0}, \emph{aspect=20}, \emph{**kw}}{} Resize and reposition parent axes, and return a child axes suitable for a colorbar. Keyword arguments may include the following (with defaults): \begin{quote} \begin{description} \item[{location}] \leavevmode{[}{[}None\textbar{}’left’\textbar{}’right’\textbar{}’top’\textbar{}’bottom’{]}{]} The position, relative to \sphinxstylestrong{parents}, where the colorbar axes should be created. If None, the value will either come from the given \sphinxcode{\sphinxupquote{orientation}}, else it will default to ‘right’. \item[{orientation}] \leavevmode{[}{[}None\textbar{}’vertical’\textbar{}’horizontal’{]}{]} The orientation of the colorbar. Typically, this keyword shouldn’t be used, as it can be derived from the \sphinxcode{\sphinxupquote{location}} keyword. \end{description} \end{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{orientation} & vertical or horizontal \\ \hline \sphinxstyleemphasis{fraction} & 0.15; fraction of original axes to use for colorbar \\ \hline \sphinxstyleemphasis{pad} & 0.05 if vertical, 0.15 if horizontal; fraction of original axes between colorbar and new image axes \\ \hline \sphinxstyleemphasis{shrink} & 1.0; fraction by which to multiply the size of the colorbar \\ \hline \sphinxstyleemphasis{aspect} & 20; ratio of long to short dimensions \\ \hline \sphinxstyleemphasis{anchor} & (0.0, 0.5) if vertical; (0.5, 1.0) if horizontal; the anchor point of the colorbar axes \\ \hline \sphinxstyleemphasis{panchor} & (1.0, 0.5) if vertical; (0.5, 0.0) if horizontal; the anchor point of the colorbar parent axes. If False, the parent axes’ anchor will be unchanged \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Returns (cax, kw), the child axes and the reduced kw dictionary to be passed when creating the colorbar instance. \end{fulllineitems} \index{make\_axes\_gridspec() (in module matplotlib.colorbar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/colorbar_api:matplotlib.colorbar.make_axes_gridspec}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.colorbar.}}\sphinxbfcode{\sphinxupquote{make\_axes\_gridspec}}}{\emph{parent}, \emph{**kw}}{} Resize and reposition a parent axes, and return a child axes suitable for a colorbar. This function is similar to make\_axes. Prmary differences are \begin{itemize} \item {} \sphinxstyleemphasis{make\_axes\_gridspec} only handles the \sphinxstyleemphasis{orientation} keyword and cannot handle the “location” keyword. \item {} \sphinxstyleemphasis{make\_axes\_gridspec} should only be used with a subplot parent. \item {} \begin{description} \item[{\sphinxstyleemphasis{make\_axes} creates an instance of Axes. \sphinxstyleemphasis{make\_axes\_gridspec}}] \leavevmode creates an instance of Subplot. \end{description} \item {} \begin{description} \item[{\sphinxstyleemphasis{make\_axes} updates the position of the}] \leavevmode parent. \sphinxstyleemphasis{make\_axes\_gridspec} replaces the grid\_spec attribute of the parent with a new one. \end{description} \end{itemize} While this function is meant to be compatible with \sphinxstyleemphasis{make\_axes}, there could be some minor differences. Keyword arguments may include the following (with defaults): \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{orientation}}] \leavevmode ‘vertical’ or ‘horizontal’ \end{description} \end{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{orientation} & vertical or horizontal \\ \hline \sphinxstyleemphasis{fraction} & 0.15; fraction of original axes to use for colorbar \\ \hline \sphinxstyleemphasis{pad} & 0.05 if vertical, 0.15 if horizontal; fraction of original axes between colorbar and new image axes \\ \hline \sphinxstyleemphasis{shrink} & 1.0; fraction by which to multiply the size of the colorbar \\ \hline \sphinxstyleemphasis{aspect} & 20; ratio of long to short dimensions \\ \hline \sphinxstyleemphasis{anchor} & (0.0, 0.5) if vertical; (0.5, 1.0) if horizontal; the anchor point of the colorbar axes \\ \hline \sphinxstyleemphasis{panchor} & (1.0, 0.5) if vertical; (0.5, 0.0) if horizontal; the anchor point of the colorbar parent axes. If False, the parent axes’ anchor will be unchanged \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} All but the first of these are stripped from the input kw set. Returns (cax, kw), the child axes and the reduced kw dictionary to be passed when creating the colorbar instance. \end{fulllineitems} \chapter{colors} \label{\detokenize{api/colors_api:colors}}\label{\detokenize{api/colors_api::doc}} For a visual representation of the Matplotlib colormaps, see: \begin{itemize} \item {} The \DUrole{xref,std,std-ref}{color\_examples} examples for examples of controlling color with Matplotlib. \item {} The {\hyperref[\detokenize{tutorials/index:tutorials-colors}]{\sphinxcrossref{\DUrole{std,std-ref}{Colors}}}} tutorial for an in-depth guide on controlling color. \end{itemize} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.colors}}} \label{\detokenize{api/colors_api:module-matplotlib.colors}}\label{\detokenize{api/colors_api:matplotlib-colors}}\index{matplotlib.colors (module)} A module for converting numbers or color arguments to \sphinxstyleemphasis{RGB} or \sphinxstyleemphasis{RGBA} \sphinxstyleemphasis{RGB} and \sphinxstyleemphasis{RGBA} are sequences of, respectively, 3 or 4 floats in the range 0-1. This module includes functions and classes for color specification conversions, and for mapping numbers to colors in a 1-D array of colors called a colormap. Colormapping typically involves two steps: a data array is first mapped onto the range 0-1 using an instance of {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} or of a subclass; then this number in the 0-1 range is mapped to a color using an instance of a subclass of {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}}. Two are provided here: {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.LinearSegmentedColormap:matplotlib.colors.LinearSegmentedColormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LinearSegmentedColormap}}}}}, which is used to generate all the built-in colormap instances, but is also useful for making custom colormaps, and {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.ListedColormap:matplotlib.colors.ListedColormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ListedColormap}}}}}, which is used for generating a custom colormap from a list of color specifications. The module also provides functions for checking whether an object can be interpreted as a color ({\hyperref[\detokenize{api/_as_gen/matplotlib.colors.is_color_like:matplotlib.colors.is_color_like}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{is\_color\_like()}}}}}), for converting such an object to an RGBA tuple ({\hyperref[\detokenize{api/_as_gen/matplotlib.colors.to_rgba:matplotlib.colors.to_rgba}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{to\_rgba()}}}}}) or to an HTML-like hex string in the \sphinxcode{\sphinxupquote{\#rrggbb}} format ({\hyperref[\detokenize{api/_as_gen/matplotlib.colors.to_hex:matplotlib.colors.to_hex}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{to\_hex()}}}}}), and a sequence of colors to an \sphinxcode{\sphinxupquote{(n, 4)}} RGBA array ({\hyperref[\detokenize{api/_as_gen/matplotlib.colors.to_rgba_array:matplotlib.colors.to_rgba_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{to\_rgba\_array()}}}}}). Caching is used for efficiency. Matplotlib recognizes the following formats to specify a color: \begin{itemize} \item {} an RGB or RGBA tuple of float values in \sphinxcode{\sphinxupquote{{[}0, 1{]}}} (e.g., \sphinxcode{\sphinxupquote{(0.1, 0.2, 0.5)}} or \sphinxcode{\sphinxupquote{(0.1, 0.2, 0.5, 0.3)}}); \item {} a hex RGB or RGBA string (e.g., \sphinxcode{\sphinxupquote{'\#0F0F0F'}} or \sphinxcode{\sphinxupquote{'\#0F0F0F0F'}}); \item {} a string representation of a float value in \sphinxcode{\sphinxupquote{{[}0, 1{]}}} inclusive for gray level (e.g., \sphinxcode{\sphinxupquote{'0.5'}}); \item {} one of \sphinxcode{\sphinxupquote{\{'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'\}}}; \item {} a X11/CSS4 color name; \item {} a name from the \sphinxhref{https://xkcd.com/color/rgb/}{xkcd color survey}; prefixed with \sphinxcode{\sphinxupquote{'xkcd:'}} (e.g., \sphinxcode{\sphinxupquote{'xkcd:sky blue'}}); \item {} one of \sphinxcode{\sphinxupquote{\{'tab:blue', 'tab:orange', 'tab:green', 'tab:red', 'tab:purple', 'tab:brown', 'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan'\}}} which are the Tableau Colors from the ‘T10’ categorical palette (which is the default color cycle); \item {} a “CN” color spec, i.e. \sphinxcode{\sphinxupquote{'C'}} followed by a single digit, which is an index into the default property cycle (\sphinxcode{\sphinxupquote{matplotlib.rcParams{[}'axes.prop\_cycle'{]}}}); the indexing occurs at artist creation time and defaults to black if the cycle does not include color. \end{itemize} All string specifications of color, other than “CN”, are case-insensitive. \subsection{Classes} \label{\detokenize{api/colors_api:classes}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.BoundaryNorm:matplotlib.colors.BoundaryNorm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BoundaryNorm}}}}}(boundaries, ncolors{[}, clip{]}) & Generate a colormap index based on discrete intervals. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}}(name{[}, N{]}) & Baseclass for all scalar to RGBA mappings. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LightSource}}}}}({[}azdeg, altdeg, hsv\_min\_val, …{]}) & Create a light source coming from the specified azimuth and elevation. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.LinearSegmentedColormap:matplotlib.colors.LinearSegmentedColormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LinearSegmentedColormap}}}}}(name, segmentdata{[}, …{]}) & Colormap objects based on lookup tables using linear segments. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.ListedColormap:matplotlib.colors.ListedColormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ListedColormap}}}}}(colors{[}, name, N{]}) & Colormap object generated from a list of colors. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.LogNorm:matplotlib.colors.LogNorm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogNorm}}}}}({[}vmin, vmax, clip{]}) & Normalize a given value to the 0-1 range on a log scale \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.NoNorm:matplotlib.colors.NoNorm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{NoNorm}}}}}({[}vmin, vmax, clip{]}) & Dummy replacement for Normalize, for the case where we want to use indices directly in a {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarMappable}}}}} . \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}({[}vmin, vmax, clip{]}) & A class which, when called, can normalize data into the \sphinxcode{\sphinxupquote{{[}0.0, 1.0{]}}} interval. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.PowerNorm:matplotlib.colors.PowerNorm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PowerNorm}}}}}(gamma{[}, vmin, vmax, clip{]}) & Normalize a given value to the \sphinxcode{\sphinxupquote{{[}0, 1{]}}} interval with a power-law scaling. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.SymLogNorm:matplotlib.colors.SymLogNorm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SymLogNorm}}}}}(linthresh{[}, linscale, vmin, …{]}) & The symmetrical logarithmic scale is logarithmic in both the positive and negative directions from the origin. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.colors.BoundaryNorm} \label{\detokenize{api/_as_gen/matplotlib.colors.BoundaryNorm:matplotlib-colors-boundarynorm}}\label{\detokenize{api/_as_gen/matplotlib.colors.BoundaryNorm::doc}}\index{BoundaryNorm (class in matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.BoundaryNorm:matplotlib.colors.BoundaryNorm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{BoundaryNorm}}}{\emph{boundaries}, \emph{ncolors}, \emph{clip=False}}{} Generate a colormap index based on discrete intervals. Unlike {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.LogNorm:matplotlib.colors.LogNorm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogNorm}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.BoundaryNorm:matplotlib.colors.BoundaryNorm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BoundaryNorm}}}}} maps values to integers instead of to the interval 0-1. Mapping to the 0-1 interval could have been done via piece-wise linear interpolation, but using integers seems simpler, and reduces the number of conversions back and forth between integer and floating point. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{boundaries}}] \leavevmode{[}array-like{]} Monotonically increasing sequence of boundaries \item[{\sphinxstylestrong{ncolors}}] \leavevmode{[}int{]} Number of colors in the colormap to be used \item[{\sphinxstylestrong{clip}}] \leavevmode{[}bool, optional{]} If clip is \sphinxcode{\sphinxupquote{True}}, out of range values are mapped to 0 if they are below \sphinxcode{\sphinxupquote{boundaries{[}0{]}}} or mapped to ncolors - 1 if they are above \sphinxcode{\sphinxupquote{boundaries{[}-1{]}}}. If clip is \sphinxcode{\sphinxupquote{False}}, out of range values are mapped to -1 if they are below \sphinxcode{\sphinxupquote{boundaries{[}0{]}}} or mapped to ncolors if they are above \sphinxcode{\sphinxupquote{boundaries{[}-1{]}}}. These are then converted to valid indices by \sphinxcode{\sphinxupquote{Colormap.\_\_call\_\_()}}. \end{description} \end{description}\end{quote} \paragraph{Notes} \sphinxstyleemphasis{boundaries} defines the edges of bins, and data falling within a bin is mapped to the color with the same index. If the number of bins doesn’t equal \sphinxstyleemphasis{ncolors}, the color is chosen by linear interpolation of the bin number onto color numbers. \index{inverse() (matplotlib.colors.BoundaryNorm method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.BoundaryNorm:matplotlib.colors.BoundaryNorm.inverse}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverse}}}{\emph{value}}{}~\begin{quote}\begin{description} \item[{Raises}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ValueError}}] \leavevmode BoundaryNorm is not invertible, so calling this method will always raise an error \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.colors.BoundaryNorm}}} \label{\detokenize{api/_as_gen/matplotlib.colors.BoundaryNorm:examples-using-matplotlib-colors-boundarynorm}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_multicolored\_line.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_pcolormesh\_levels.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_masked.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_annotated\_heatmap.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_leftventricle\_bulleye.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations\_bounds.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/colors/colorbar_only:sphx-glr-tutorials-colors-colorbar-only-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customized Colorbars Tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/colors/colormapnorms:sphx-glr-tutorials-colors-colormapnorms-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Colormap Normalization}}}} \end{itemize} \subsubsection{matplotlib.colors.Colormap} \label{\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib-colors-colormap}}\label{\detokenize{api/_as_gen/matplotlib.colors.Colormap::doc}}\index{Colormap (class in matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{Colormap}}}{\emph{name}, \emph{N=256}}{} Baseclass for all scalar to RGBA mappings. Typically Colormap instances are used to convert data values (floats) from the interval \sphinxcode{\sphinxupquote{{[}0, 1{]}}} to the RGBA color that the respective Colormap represents. For scaling of data into the \sphinxcode{\sphinxupquote{{[}0, 1{]}}} interval see {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}}. It is worth noting that {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}} subclasses make heavy use of this \sphinxcode{\sphinxupquote{data-\textgreater{}normalize-\textgreater{}map-to-color}} processing chain. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{name}}] \leavevmode{[}str{]} The name of the colormap. \item[{\sphinxstylestrong{N}}] \leavevmode{[}int{]} The number of rgb quantization levels. \end{description} \end{description}\end{quote} \index{colorbar\_extend (matplotlib.colors.Colormap attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.colorbar_extend}}\pysigline{\sphinxbfcode{\sphinxupquote{colorbar\_extend}}\sphinxbfcode{\sphinxupquote{ = None}}} When this colormap exists on a scalar mappable and colorbar\_extend is not False, colorbar creation will pick up \sphinxcode{\sphinxupquote{colorbar\_extend}} as the default value for the \sphinxcode{\sphinxupquote{extend}} keyword in the {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.Colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colorbar.Colorbar}}}}} constructor. \end{fulllineitems} \index{is\_gray() (matplotlib.colors.Colormap method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.is_gray}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_gray}}}{}{}~ \end{fulllineitems} \index{reversed() (matplotlib.colors.Colormap method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.reversed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{reversed}}}{\emph{name=None}}{} Make a reversed instance of the Colormap. \begin{sphinxadmonition}{note}{Note:} Function not implemented for base class. \end{sphinxadmonition} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{name}}] \leavevmode{[}str, optional{]} The name for the reversed colormap. If it’s None the name will be the name of the parent colormap + “\_r”. \end{description} \end{description}\end{quote} \paragraph{Notes} See {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.LinearSegmentedColormap:matplotlib.colors.LinearSegmentedColormap.reversed}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LinearSegmentedColormap.reversed()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.ListedColormap:matplotlib.colors.ListedColormap.reversed}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ListedColormap.reversed()}}}}} \end{fulllineitems} \index{set\_bad() (matplotlib.colors.Colormap method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_bad}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_bad}}}{\emph{color='k'}, \emph{alpha=None}}{} Set color to be used for masked values. \end{fulllineitems} \index{set\_over() (matplotlib.colors.Colormap method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_over}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_over}}}{\emph{color='k'}, \emph{alpha=None}}{} Set color to be used for high out-of-range values. Requires norm.clip = False \end{fulllineitems} \index{set\_under() (matplotlib.colors.Colormap method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_under}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_under}}}{\emph{color='k'}, \emph{alpha=None}}{} Set color to be used for low out-of-range values. Requires norm.clip = False \end{fulllineitems} \end{fulllineitems} \subsubsection{matplotlib.colors.LightSource} \label{\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib-colors-lightsource}}\label{\detokenize{api/_as_gen/matplotlib.colors.LightSource::doc}}\index{LightSource (class in matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{LightSource}}}{\emph{azdeg=315}, \emph{altdeg=45}, \emph{hsv\_min\_val=0}, \emph{hsv\_max\_val=1}, \emph{hsv\_min\_sat=1}, \emph{hsv\_max\_sat=0}}{} Create a light source coming from the specified azimuth and elevation. Angles are in degrees, with the azimuth measured clockwise from north and elevation up from the zero plane of the surface. The {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource.shade}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{shade()}}}}} is used to produce “shaded” rgb values for a data array. {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource.shade_rgb}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{shade\_rgb()}}}}} can be used to combine an rgb image with The {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource.shade_rgb}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{shade\_rgb()}}}}} The {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource.hillshade}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hillshade()}}}}} produces an illumination map of a surface. Specify the azimuth (measured clockwise from south) and altitude (measured up from the plane of the surface) of the light source in degrees. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{azdeg}}] \leavevmode{[}number, optional{]} The azimuth (0-360, degrees clockwise from North) of the light source. Defaults to 315 degrees (from the northwest). \item[{\sphinxstylestrong{altdeg}}] \leavevmode{[}number, optional{]} The altitude (0-90, degrees up from horizontal) of the light source. Defaults to 45 degrees from horizontal. \end{description} \end{description}\end{quote} \paragraph{Notes} For backwards compatibility, the parameters \sphinxstyleemphasis{hsv\_min\_val}, \sphinxstyleemphasis{hsv\_max\_val}, \sphinxstyleemphasis{hsv\_min\_sat}, and \sphinxstyleemphasis{hsv\_max\_sat} may be supplied at initialization as well. However, these parameters will only be used if “blend\_mode=’hsv’” is passed into {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource.shade}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{shade()}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource.shade_rgb}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{shade\_rgb()}}}}}. See the documentation for {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource.blend_hsv}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{blend\_hsv()}}}}} for more details. \index{blend\_hsv() (matplotlib.colors.LightSource method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource.blend_hsv}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{blend\_hsv}}}{\emph{rgb}, \emph{intensity}, \emph{hsv\_max\_sat=None}, \emph{hsv\_max\_val=None}, \emph{hsv\_min\_val=None}, \emph{hsv\_min\_sat=None}}{} Take the input data array, convert to HSV values in the given colormap, then adjust those color values to give the impression of a shaded relief map with a specified light source. RGBA values are returned, which can then be used to plot the shaded image with imshow. The color of the resulting image will be darkened by moving the (s,v) values (in hsv colorspace) toward (hsv\_min\_sat, hsv\_min\_val) in the shaded regions, or lightened by sliding (s,v) toward (hsv\_max\_sat hsv\_max\_val) in regions that are illuminated. The default extremes are chose so that completely shaded points are nearly black (s = 1, v = 0) and completely illuminated points are nearly white (s = 0, v = 1). \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rgb}}] \leavevmode{[}ndarray{]} An MxNx3 RGB array of floats ranging from 0 to 1 (color image). \item[{\sphinxstylestrong{intensity}}] \leavevmode{[}ndarray{]} An MxNx1 array of floats ranging from 0 to 1 (grayscale image). \item[{\sphinxstylestrong{hsv\_max\_sat}}] \leavevmode{[}number, optional{]} The maximum saturation value that the \sphinxstyleemphasis{intensity} map can shift the output image to. Defaults to 1. \item[{\sphinxstylestrong{hsv\_min\_sat}}] \leavevmode{[}number, optional{]} The minimum saturation value that the \sphinxstyleemphasis{intensity} map can shift the output image to. Defaults to 0. \item[{\sphinxstylestrong{hsv\_max\_val}}] \leavevmode{[}number, optional{]} The maximum value (“v” in “hsv”) that the \sphinxstyleemphasis{intensity} map can shift the output image to. Defaults to 1. \item[{\sphinxstylestrong{hsv\_min\_val: number, optional}}] \leavevmode The minimum value (“v” in “hsv”) that the \sphinxstyleemphasis{intensity} map can shift the output image to. Defaults to 0. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rgb}}] \leavevmode{[}ndarray{]} An MxNx3 RGB array representing the combined images. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{blend\_overlay() (matplotlib.colors.LightSource method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource.blend_overlay}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{blend\_overlay}}}{\emph{rgb}, \emph{intensity}}{} Combines an rgb image with an intensity map using “overlay” blending. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rgb}}] \leavevmode{[}ndarray{]} An MxNx3 RGB array of floats ranging from 0 to 1 (color image). \item[{\sphinxstylestrong{intensity}}] \leavevmode{[}ndarray{]} An MxNx1 array of floats ranging from 0 to 1 (grayscale image). \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rgb}}] \leavevmode{[}ndarray{]} An MxNx3 RGB array representing the combined images. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{blend\_soft\_light() (matplotlib.colors.LightSource method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource.blend_soft_light}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{blend\_soft\_light}}}{\emph{rgb}, \emph{intensity}}{} Combines an rgb image with an intensity map using “soft light” blending. Uses the “pegtop” formula. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rgb}}] \leavevmode{[}ndarray{]} An MxNx3 RGB array of floats ranging from 0 to 1 (color image). \item[{\sphinxstylestrong{intensity}}] \leavevmode{[}ndarray{]} An MxNx1 array of floats ranging from 0 to 1 (grayscale image). \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rgb}}] \leavevmode{[}ndarray{]} An MxNx3 RGB array representing the combined images. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{direction (matplotlib.colors.LightSource attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource.direction}}\pysigline{\sphinxbfcode{\sphinxupquote{direction}}} The unit vector direction towards the light source \end{fulllineitems} \index{hillshade() (matplotlib.colors.LightSource method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource.hillshade}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hillshade}}}{\emph{elevation}, \emph{vert\_exag=1}, \emph{dx=1}, \emph{dy=1}, \emph{fraction=1.0}}{} Calculates the illumination intensity for a surface using the defined azimuth and elevation for the light source. This computes the normal vectors for the surface, and then passes them on to {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource.shade_normals}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{shade\_normals}}}}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{elevation}}] \leavevmode{[}array-like{]} A 2d array (or equivalent) of the height values used to generate an illumination map \item[{\sphinxstylestrong{vert\_exag}}] \leavevmode{[}number, optional{]} The amount to exaggerate the elevation values by when calculating illumination. This can be used either to correct for differences in units between the x-y coordinate system and the elevation coordinate system (e.g. decimal degrees vs meters) or to exaggerate or de-emphasize topographic effects. \item[{\sphinxstylestrong{dx}}] \leavevmode{[}number, optional{]} The x-spacing (columns) of the input \sphinxstyleemphasis{elevation} grid. \item[{\sphinxstylestrong{dy}}] \leavevmode{[}number, optional{]} The y-spacing (rows) of the input \sphinxstyleemphasis{elevation} grid. \item[{\sphinxstylestrong{fraction}}] \leavevmode{[}number, optional{]} Increases or decreases the contrast of the hillshade. Values greater than one will cause intermediate values to move closer to full illumination or shadow (and clipping any values that move beyond 0 or 1). Note that this is not visually or mathematically the same as vertical exaggeration. \item[{\sphinxstylestrong{Returns}}] \leavevmode \item[{\sphinxstylestrong{——-}}] \leavevmode \item[{\sphinxstylestrong{intensity}}] \leavevmode{[}ndarray{]} A 2d array of illumination values between 0-1, where 0 is completely in shadow and 1 is completely illuminated. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{shade() (matplotlib.colors.LightSource method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource.shade}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{shade}}}{\emph{data}, \emph{cmap}, \emph{norm=None}, \emph{blend\_mode='overlay'}, \emph{vmin=None}, \emph{vmax=None}, \emph{vert\_exag=1}, \emph{dx=1}, \emph{dy=1}, \emph{fraction=1}, \emph{**kwargs}}{} Combine colormapped data values with an illumination intensity map (a.k.a. “hillshade”) of the values. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{data}}] \leavevmode{[}array-like{]} A 2d array (or equivalent) of the height values used to generate a shaded map. \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}} instance{]} The colormap used to color the \sphinxstyleemphasis{data} array. Note that this must be a {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}} instance. For example, rather than passing in \sphinxcode{\sphinxupquote{cmap='gist\_earth'}}, use \sphinxcode{\sphinxupquote{cmap=plt.get\_cmap('gist\_earth')}} instead. \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} instance, optional{]} The normalization used to scale values before colormapping. If None, the input will be linearly scaled between its min and max. \item[{\sphinxstylestrong{blend\_mode}}] \leavevmode{[}\{‘hsv’, ‘overlay’, ‘soft’\} or callable, optional{]} The type of blending used to combine the colormapped data values with the illumination intensity. Default is “overlay”. Note that for most topographic surfaces, “overlay” or “soft” appear more visually realistic. If a user-defined function is supplied, it is expected to combine an MxNx3 RGB array of floats (ranging 0 to 1) with an MxNx1 hillshade array (also 0 to 1). (Call signature \sphinxcode{\sphinxupquote{func(rgb, illum, **kwargs)}}) Additional kwargs supplied to this function will be passed on to the \sphinxstyleemphasis{blend\_mode} function. \item[{\sphinxstylestrong{vmin}}] \leavevmode{[}scalar or None, optional{]} The minimum value used in colormapping \sphinxstyleemphasis{data}. If \sphinxstyleemphasis{None} the minimum value in \sphinxstyleemphasis{data} is used. If \sphinxstyleemphasis{norm} is specified, then this argument will be ignored. \item[{\sphinxstylestrong{vmax}}] \leavevmode{[}scalar or None, optional{]} The maximum value used in colormapping \sphinxstyleemphasis{data}. If \sphinxstyleemphasis{None} the maximum value in \sphinxstyleemphasis{data} is used. If \sphinxstyleemphasis{norm} is specified, then this argument will be ignored. \item[{\sphinxstylestrong{vert\_exag}}] \leavevmode{[}number, optional{]} The amount to exaggerate the elevation values by when calculating illumination. This can be used either to correct for differences in units between the x-y coordinate system and the elevation coordinate system (e.g. decimal degrees vs meters) or to exaggerate or de-emphasize topography. \item[{\sphinxstylestrong{dx}}] \leavevmode{[}number, optional{]} The x-spacing (columns) of the input \sphinxstyleemphasis{elevation} grid. \item[{\sphinxstylestrong{dy}}] \leavevmode{[}number, optional{]} The y-spacing (rows) of the input \sphinxstyleemphasis{elevation} grid. \item[{\sphinxstylestrong{fraction}}] \leavevmode{[}number, optional{]} Increases or decreases the contrast of the hillshade. Values greater than one will cause intermediate values to move closer to full illumination or shadow (and clipping any values that move beyond 0 or 1). Note that this is not visually or mathematically the same as vertical exaggeration. \item[{\sphinxstylestrong{Additional kwargs are passed on to the *blend\_mode* function.}}] \leavevmode \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rgba}}] \leavevmode{[}ndarray{]} An MxNx4 array of floats ranging between 0-1. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{shade\_normals() (matplotlib.colors.LightSource method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource.shade_normals}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{shade\_normals}}}{\emph{normals}, \emph{fraction=1.0}}{} Calculates the illumination intensity for the normal vectors of a surface using the defined azimuth and elevation for the light source. Imagine an artificial sun placed at infinity in some azimuth and elevation position illuminating our surface. The parts of the surface that slope toward the sun should brighten while those sides facing away should become darker. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fraction}}] \leavevmode{[}number, optional{]} Increases or decreases the contrast of the hillshade. Values greater than one will cause intermediate values to move closer to full illumination or shadow (and clipping any values that move beyond 0 or 1). Note that this is not visually or mathematically the same as vertical exaggeration. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{intensity}}] \leavevmode{[}ndarray{]} A 2d array of illumination values between 0-1, where 0 is completely in shadow and 1 is completely illuminated. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{shade\_rgb() (matplotlib.colors.LightSource method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.LightSource:matplotlib.colors.LightSource.shade_rgb}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{shade\_rgb}}}{\emph{rgb}, \emph{elevation}, \emph{fraction=1.0}, \emph{blend\_mode='hsv'}, \emph{vert\_exag=1}, \emph{dx=1}, \emph{dy=1}, \emph{**kwargs}}{} Take the input RGB array (ny*nx*3) adjust their color values to given the impression of a shaded relief map with a specified light source using the elevation (ny*nx). A new RGB array ((ny*nx*3)) is returned. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rgb}}] \leavevmode{[}array-like{]} An MxNx3 RGB array, assumed to be in the range of 0 to 1. \item[{\sphinxstylestrong{elevation}}] \leavevmode{[}array-like{]} A 2d array (or equivalent) of the height values used to generate a shaded map. \item[{\sphinxstylestrong{fraction}}] \leavevmode{[}number{]} Increases or decreases the contrast of the hillshade. Values greater than one will cause intermediate values to move closer to full illumination or shadow (and clipping any values that move beyond 0 or 1). Note that this is not visually or mathematically the same as vertical exaggeration. \item[{\sphinxstylestrong{blend\_mode}}] \leavevmode{[}\{‘hsv’, ‘overlay’, ‘soft’\} or callable, optional{]} The type of blending used to combine the colormapped data values with the illumination intensity. For backwards compatibility, this defaults to “hsv”. Note that for most topographic surfaces, “overlay” or “soft” appear more visually realistic. If a user-defined function is supplied, it is expected to combine an MxNx3 RGB array of floats (ranging 0 to 1) with an MxNx1 hillshade array (also 0 to 1). (Call signature \sphinxcode{\sphinxupquote{func(rgb, illum, **kwargs)}}) Additional kwargs supplied to this function will be passed on to the \sphinxstyleemphasis{blend\_mode} function. \item[{\sphinxstylestrong{vert\_exag}}] \leavevmode{[}number, optional{]} The amount to exaggerate the elevation values by when calculating illumination. This can be used either to correct for differences in units between the x-y coordinate system and the elevation coordinate system (e.g. decimal degrees vs meters) or to exaggerate or de-emphasize topography. \item[{\sphinxstylestrong{dx}}] \leavevmode{[}number, optional{]} The x-spacing (columns) of the input \sphinxstyleemphasis{elevation} grid. \item[{\sphinxstylestrong{dy}}] \leavevmode{[}number, optional{]} The y-spacing (rows) of the input \sphinxstyleemphasis{elevation} grid. \item[{\sphinxstylestrong{Additional kwargs are passed on to the *blend\_mode* function.}}] \leavevmode \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{shaded\_rgb}}] \leavevmode{[}ndarray{]} An MxNx3 array of floats ranging between 0-1. \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.colors.LightSource}}} \label{\detokenize{api/_as_gen/matplotlib.colors.LightSource:examples-using-matplotlib-colors-lightsource}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_shading\_example.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_mandelbrot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_frontpage\_3D.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_demo\_agg\_filter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_custom\_shaded\_3d\_surface.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_advanced\_hillshading.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_topographic\_hillshading.py} \end{itemize} \subsubsection{matplotlib.colors.LinearSegmentedColormap} \label{\detokenize{api/_as_gen/matplotlib.colors.LinearSegmentedColormap:matplotlib-colors-linearsegmentedcolormap}}\label{\detokenize{api/_as_gen/matplotlib.colors.LinearSegmentedColormap::doc}}\index{LinearSegmentedColormap (class in matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.LinearSegmentedColormap:matplotlib.colors.LinearSegmentedColormap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{LinearSegmentedColormap}}}{\emph{name}, \emph{segmentdata}, \emph{N=256}, \emph{gamma=1.0}}{} Colormap objects based on lookup tables using linear segments. The lookup table is generated using linear interpolation for each primary color, with the 0-1 domain divided into any number of segments. Create color map from linear mapping segments segmentdata argument is a dictionary with a red, green and blue entries. Each entry should be a list of \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y0}, \sphinxstyleemphasis{y1} tuples, forming rows in a table. Entries for alpha are optional. Example: suppose you want red to increase from 0 to 1 over the bottom half, green to do the same over the middle half, and blue over the top half. Then you would use: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{cdict} \PYG{o}{=} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{p}{[}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{0.0}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{)}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{green}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{p}{[}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{0.0}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mf}{0.25}\PYG{p}{,} \PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{0.0}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mf}{0.75}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{)}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{blue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{p}{[}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{0.0}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{0.0}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{)}\PYG{p}{]}\PYG{p}{\PYGZcb{}} \end{sphinxVerbatim} Each row in the table for a given color is a sequence of \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y0}, \sphinxstyleemphasis{y1} tuples. In each sequence, \sphinxstyleemphasis{x} must increase monotonically from 0 to 1. For any input value \sphinxstyleemphasis{z} falling between \sphinxstyleemphasis{x{[}i{]}} and \sphinxstyleemphasis{x{[}i+1{]}}, the output value of a given color will be linearly interpolated between \sphinxstyleemphasis{y1{[}i{]}} and \sphinxstyleemphasis{y0{[}i+1{]}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{row} \PYG{n}{i}\PYG{p}{:} \PYG{n}{x} \PYG{n}{y0} \PYG{n}{y1} \PYG{o}{/} \PYG{o}{/} \PYG{n}{row} \PYG{n}{i}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{:} \PYG{n}{x} \PYG{n}{y0} \PYG{n}{y1} \end{sphinxVerbatim} Hence y0 in the first row and y1 in the last row are never used. \sphinxstrong{See also:} {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.LinearSegmentedColormap:matplotlib.colors.LinearSegmentedColormap.from_list}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LinearSegmentedColormap.from\_list()}}}}} Static method; factory function for generating a smoothly-varying LinearSegmentedColormap. {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.makeMappingArray:matplotlib.colors.makeMappingArray}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{makeMappingArray()}}}}} For information about making a mapping array. \index{from\_list() (matplotlib.colors.LinearSegmentedColormap static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.LinearSegmentedColormap:matplotlib.colors.LinearSegmentedColormap.from_list}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{from\_list}}}{\emph{name}, \emph{colors}, \emph{N=256}, \emph{gamma=1.0}}{} Make a linear segmented colormap with \sphinxstyleemphasis{name} from a sequence of \sphinxstyleemphasis{colors} which evenly transitions from colors{[}0{]} at val=0 to colors{[}-1{]} at val=1. \sphinxstyleemphasis{N} is the number of rgb quantization levels. Alternatively, a list of (value, color) tuples can be given to divide the range unevenly. \end{fulllineitems} \index{reversed() (matplotlib.colors.LinearSegmentedColormap method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.LinearSegmentedColormap:matplotlib.colors.LinearSegmentedColormap.reversed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{reversed}}}{\emph{name=None}}{} Make a reversed instance of the Colormap. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{name}}] \leavevmode{[}str, optional{]} The name for the reversed colormap. If it’s None the name will be the name of the parent colormap + “\_r”. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{LinearSegmentedColormap}}] \leavevmode The reversed colormap. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_gamma() (matplotlib.colors.LinearSegmentedColormap method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.LinearSegmentedColormap:matplotlib.colors.LinearSegmentedColormap.set_gamma}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_gamma}}}{\emph{gamma}}{} Set a new gamma value and regenerate color map. \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.colors.LinearSegmentedColormap}}} \label{\detokenize{api/_as_gen/matplotlib.colors.LinearSegmentedColormap:examples-using-matplotlib-colors-linearsegmentedcolormap}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_custom\_cmap.py} \end{itemize} \subsubsection{matplotlib.colors.ListedColormap} \label{\detokenize{api/_as_gen/matplotlib.colors.ListedColormap:matplotlib-colors-listedcolormap}}\label{\detokenize{api/_as_gen/matplotlib.colors.ListedColormap::doc}}\index{ListedColormap (class in matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.ListedColormap:matplotlib.colors.ListedColormap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{ListedColormap}}}{\emph{colors}, \emph{name='from\_list'}, \emph{N=None}}{} Colormap object generated from a list of colors. This may be most useful when indexing directly into a colormap, but it can also be used to generate special colormaps for ordinary mapping. Make a colormap from a list of colors. \begin{description} \item[{\sphinxstyleemphasis{colors}}] \leavevmode a list of matplotlib color specifications, or an equivalent Nx3 or Nx4 floating point array (\sphinxstyleemphasis{N} rgb or rgba values) \item[{\sphinxstyleemphasis{name}}] \leavevmode a string to identify the colormap \item[{\sphinxstyleemphasis{N}}] \leavevmode the number of entries in the map. The default is \sphinxstyleemphasis{None}, in which case there is one colormap entry for each element in the list of colors. If: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{N} \PYG{o}{\PYGZlt{}} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{colors}\PYG{p}{)} \end{sphinxVerbatim} the list will be truncated at \sphinxstyleemphasis{N}. If: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{N} \PYG{o}{\PYGZgt{}} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{colors}\PYG{p}{)} \end{sphinxVerbatim} the list will be extended by repetition. \end{description} \index{reversed() (matplotlib.colors.ListedColormap method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.ListedColormap:matplotlib.colors.ListedColormap.reversed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{reversed}}}{\emph{name=None}}{} Make a reversed instance of the Colormap. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{name}}] \leavevmode{[}str, optional{]} The name for the reversed colormap. If it’s None the name will be the name of the parent colormap + “\_r”. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ListedColormap}}] \leavevmode A reversed instance of the colormap. \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.colors.ListedColormap}}} \label{\detokenize{api/_as_gen/matplotlib.colors.ListedColormap:examples-using-matplotlib-colors-listedcolormap}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_multicolored\_line.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_leftventricle\_bulleye.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/colors/colorbar_only:sphx-glr-tutorials-colors-colorbar-only-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customized Colorbars Tutorial}}}} \end{itemize} \subsubsection{matplotlib.colors.LogNorm} \label{\detokenize{api/_as_gen/matplotlib.colors.LogNorm:matplotlib-colors-lognorm}}\label{\detokenize{api/_as_gen/matplotlib.colors.LogNorm::doc}}\index{LogNorm (class in matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.LogNorm:matplotlib.colors.LogNorm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{LogNorm}}}{\emph{vmin=None}, \emph{vmax=None}, \emph{clip=False}}{} Normalize a given value to the 0-1 range on a log scale If \sphinxstyleemphasis{vmin} or \sphinxstyleemphasis{vmax} is not given, they are initialized from the minimum and maximum value respectively of the first input processed. That is, \sphinxstyleemphasis{\_\_call\_\_(A)} calls \sphinxstyleemphasis{autoscale\_None(A)}. If \sphinxstyleemphasis{clip} is \sphinxstyleemphasis{True} and the given value falls outside the range, the returned value will be 0 or 1, whichever is closer. Returns 0 if: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{vmin}\PYG{o}{==}\PYG{n}{vmax} \end{sphinxVerbatim} Works with scalars or arrays, including masked arrays. If \sphinxstyleemphasis{clip} is \sphinxstyleemphasis{True}, masked values are set to 1; otherwise they remain masked. Clipping silently defeats the purpose of setting the over, under, and masked colors in the colormap, so it is likely to lead to surprises; therefore the default is \sphinxstyleemphasis{clip} = \sphinxstyleemphasis{False}. \index{autoscale() (matplotlib.colors.LogNorm method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.LogNorm:matplotlib.colors.LogNorm.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{\emph{A}}{} Set \sphinxstyleemphasis{vmin}, \sphinxstyleemphasis{vmax} to min, max of \sphinxstyleemphasis{A}. \end{fulllineitems} \index{autoscale\_None() (matplotlib.colors.LogNorm method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.LogNorm:matplotlib.colors.LogNorm.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{\emph{A}}{} autoscale only None-valued vmin or vmax. \end{fulllineitems} \index{inverse() (matplotlib.colors.LogNorm method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.LogNorm:matplotlib.colors.LogNorm.inverse}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverse}}}{\emph{value}}{}~ \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.colors.LogNorm}}} \label{\detokenize{api/_as_gen/matplotlib.colors.LogNorm:examples-using-matplotlib-colors-lognorm}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_hist.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_pcolor\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations\_lognorm.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/colors/colormapnorms:sphx-glr-tutorials-colors-colormapnorms-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Colormap Normalization}}}} \end{itemize} \subsubsection{matplotlib.colors.NoNorm} \label{\detokenize{api/_as_gen/matplotlib.colors.NoNorm:matplotlib-colors-nonorm}}\label{\detokenize{api/_as_gen/matplotlib.colors.NoNorm::doc}}\index{NoNorm (class in matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.NoNorm:matplotlib.colors.NoNorm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{NoNorm}}}{\emph{vmin=None}, \emph{vmax=None}, \emph{clip=False}}{} Dummy replacement for Normalize, for the case where we want to use indices directly in a {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarMappable}}}}} . If \sphinxstyleemphasis{vmin} or \sphinxstyleemphasis{vmax} is not given, they are initialized from the minimum and maximum value respectively of the first input processed. That is, \sphinxstyleemphasis{\_\_call\_\_(A)} calls \sphinxstyleemphasis{autoscale\_None(A)}. If \sphinxstyleemphasis{clip} is \sphinxstyleemphasis{True} and the given value falls outside the range, the returned value will be 0 or 1, whichever is closer. Returns 0 if: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{vmin}\PYG{o}{==}\PYG{n}{vmax} \end{sphinxVerbatim} Works with scalars or arrays, including masked arrays. If \sphinxstyleemphasis{clip} is \sphinxstyleemphasis{True}, masked values are set to 1; otherwise they remain masked. Clipping silently defeats the purpose of setting the over, under, and masked colors in the colormap, so it is likely to lead to surprises; therefore the default is \sphinxstyleemphasis{clip} = \sphinxstyleemphasis{False}. \index{inverse() (matplotlib.colors.NoNorm method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.NoNorm:matplotlib.colors.NoNorm.inverse}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverse}}}{\emph{value}}{}~ \end{fulllineitems} \end{fulllineitems} \subsubsection{matplotlib.colors.Normalize} \label{\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib-colors-normalize}}\label{\detokenize{api/_as_gen/matplotlib.colors.Normalize::doc}}\index{Normalize (class in matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{Normalize}}}{\emph{vmin=None}, \emph{vmax=None}, \emph{clip=False}}{} A class which, when called, can normalize data into the \sphinxcode{\sphinxupquote{{[}0.0, 1.0{]}}} interval. If \sphinxstyleemphasis{vmin} or \sphinxstyleemphasis{vmax} is not given, they are initialized from the minimum and maximum value respectively of the first input processed. That is, \sphinxstyleemphasis{\_\_call\_\_(A)} calls \sphinxstyleemphasis{autoscale\_None(A)}. If \sphinxstyleemphasis{clip} is \sphinxstyleemphasis{True} and the given value falls outside the range, the returned value will be 0 or 1, whichever is closer. Returns 0 if: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{vmin}\PYG{o}{==}\PYG{n}{vmax} \end{sphinxVerbatim} Works with scalars or arrays, including masked arrays. If \sphinxstyleemphasis{clip} is \sphinxstyleemphasis{True}, masked values are set to 1; otherwise they remain masked. Clipping silently defeats the purpose of setting the over, under, and masked colors in the colormap, so it is likely to lead to surprises; therefore the default is \sphinxstyleemphasis{clip} = \sphinxstyleemphasis{False}. \index{autoscale() (matplotlib.colors.Normalize method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{\emph{A}}{} Set \sphinxstyleemphasis{vmin}, \sphinxstyleemphasis{vmax} to min, max of \sphinxstyleemphasis{A}. \end{fulllineitems} \index{autoscale\_None() (matplotlib.colors.Normalize method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{\emph{A}}{} autoscale only None-valued vmin or vmax. \end{fulllineitems} \index{inverse() (matplotlib.colors.Normalize method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize.inverse}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverse}}}{\emph{value}}{}~ \end{fulllineitems} \index{process\_value() (matplotlib.colors.Normalize static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize.process_value}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{process\_value}}}{\emph{value}}{} Homogenize the input \sphinxstyleemphasis{value} for easy and efficient normalization. \sphinxstyleemphasis{value} can be a scalar or sequence. Returns \sphinxstyleemphasis{result}, \sphinxstyleemphasis{is\_scalar}, where \sphinxstyleemphasis{result} is a masked array matching \sphinxstyleemphasis{value}. Float dtypes are preserved; integer types with two bytes or smaller are converted to np.float32, and larger types are converted to np.float64. Preserving float32 when possible, and using in-place operations, can greatly improve speed for large arrays. Experimental; we may want to add an option to force the use of float32. \end{fulllineitems} \index{scaled() (matplotlib.colors.Normalize method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize.scaled}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{scaled}}}{}{} return true if vmin and vmax set \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.colors.Normalize}}} \label{\detokenize{api/_as_gen/matplotlib.colors.Normalize:examples-using-matplotlib-colors-normalize}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_hist.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_multi\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_masked.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_transparency\_blend.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_advanced\_hillshading.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_leftventricle\_bulleye.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations\_custom.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/constrainedlayout_guide:sphx-glr-tutorials-intermediate-constrainedlayout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Constrained Layout Guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/colors/colorbar_only:sphx-glr-tutorials-colors-colorbar-only-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customized Colorbars Tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/colors/colormapnorms:sphx-glr-tutorials-colors-colormapnorms-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Colormap Normalization}}}} \end{itemize} \subsubsection{matplotlib.colors.PowerNorm} \label{\detokenize{api/_as_gen/matplotlib.colors.PowerNorm:matplotlib-colors-powernorm}}\label{\detokenize{api/_as_gen/matplotlib.colors.PowerNorm::doc}}\index{PowerNorm (class in matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.PowerNorm:matplotlib.colors.PowerNorm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{PowerNorm}}}{\emph{gamma}, \emph{vmin=None}, \emph{vmax=None}, \emph{clip=False}}{} Normalize a given value to the \sphinxcode{\sphinxupquote{{[}0, 1{]}}} interval with a power-law scaling. This will clip any negative data points to 0. \index{autoscale() (matplotlib.colors.PowerNorm method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.PowerNorm:matplotlib.colors.PowerNorm.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{\emph{A}}{} Set \sphinxstyleemphasis{vmin}, \sphinxstyleemphasis{vmax} to min, max of \sphinxstyleemphasis{A}. \end{fulllineitems} \index{autoscale\_None() (matplotlib.colors.PowerNorm method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.PowerNorm:matplotlib.colors.PowerNorm.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{\emph{A}}{} autoscale only None-valued vmin or vmax. \end{fulllineitems} \index{inverse() (matplotlib.colors.PowerNorm method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.PowerNorm:matplotlib.colors.PowerNorm.inverse}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverse}}}{\emph{value}}{}~ \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.colors.PowerNorm}}} \label{\detokenize{api/_as_gen/matplotlib.colors.PowerNorm:examples-using-matplotlib-colors-powernorm}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_power\_norm.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_mandelbrot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations\_power.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/colors/colormapnorms:sphx-glr-tutorials-colors-colormapnorms-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Colormap Normalization}}}} \end{itemize} \subsubsection{matplotlib.colors.SymLogNorm} \label{\detokenize{api/_as_gen/matplotlib.colors.SymLogNorm:matplotlib-colors-symlognorm}}\label{\detokenize{api/_as_gen/matplotlib.colors.SymLogNorm::doc}}\index{SymLogNorm (class in matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.SymLogNorm:matplotlib.colors.SymLogNorm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{SymLogNorm}}}{\emph{linthresh}, \emph{linscale=1.0}, \emph{vmin=None}, \emph{vmax=None}, \emph{clip=False}}{} The symmetrical logarithmic scale is logarithmic in both the positive and negative directions from the origin. Since the values close to zero tend toward infinity, there is a need to have a range around zero that is linear. The parameter \sphinxstyleemphasis{linthresh} allows the user to specify the size of this range (-\sphinxstyleemphasis{linthresh}, \sphinxstyleemphasis{linthresh}). \sphinxstyleemphasis{linthresh}: The range within which the plot is linear (to avoid having the plot go to infinity around zero). \sphinxstyleemphasis{linscale}: This allows the linear range (-\sphinxstyleemphasis{linthresh} to \sphinxstyleemphasis{linthresh}) to be stretched relative to the logarithmic range. Its value is the number of decades to use for each half of the linear range. For example, when \sphinxstyleemphasis{linscale} == 1.0 (the default), the space used for the positive and negative halves of the linear range will be equal to one decade in the logarithmic range. Defaults to 1. \index{autoscale() (matplotlib.colors.SymLogNorm method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.SymLogNorm:matplotlib.colors.SymLogNorm.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{\emph{A}}{} Set \sphinxstyleemphasis{vmin}, \sphinxstyleemphasis{vmax} to min, max of \sphinxstyleemphasis{A}. \end{fulllineitems} \index{autoscale\_None() (matplotlib.colors.SymLogNorm method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.SymLogNorm:matplotlib.colors.SymLogNorm.autoscale_None}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_None}}}{\emph{A}}{} autoscale only None-valued vmin or vmax. \end{fulllineitems} \index{inverse() (matplotlib.colors.SymLogNorm method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.SymLogNorm:matplotlib.colors.SymLogNorm.inverse}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverse}}}{\emph{value}}{}~ \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.colors.SymLogNorm}}} \label{\detokenize{api/_as_gen/matplotlib.colors.SymLogNorm:examples-using-matplotlib-colors-symlognorm}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations\_symlognorm.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/colors/colormapnorms:sphx-glr-tutorials-colors-colormapnorms-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Colormap Normalization}}}} \end{itemize} \subsection{Functions} \label{\detokenize{api/colors_api:functions}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.from_levels_and_colors:matplotlib.colors.from_levels_and_colors}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{from\_levels\_and\_colors}}}}}(levels, colors{[}, extend{]}) & A helper routine to generate a cmap and a norm instance which behave similar to contourf’s levels and colors arguments. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.hsv_to_rgb:matplotlib.colors.hsv_to_rgb}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hsv\_to\_rgb}}}}}(hsv) & convert hsv values in a numpy array to rgb values all values assumed to be in range {[}0, 1{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.rgb_to_hsv:matplotlib.colors.rgb_to_hsv}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rgb\_to\_hsv}}}}}(arr) & convert float rgb values (in the range {[}0, 1{]}), in a numpy array to hsv values. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.to_hex:matplotlib.colors.to_hex}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{to\_hex}}}}}(c{[}, keep\_alpha{]}) & Convert \sphinxstyleemphasis{c} to a hex color. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.to_rgb:matplotlib.colors.to_rgb}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{to\_rgb}}}}}(c) & Convert \sphinxstyleemphasis{c} to an RGB color, silently dropping the alpha channel. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.to_rgba:matplotlib.colors.to_rgba}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{to\_rgba}}}}}(c{[}, alpha{]}) & Convert \sphinxstyleemphasis{c} to an RGBA color. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.to_rgba_array:matplotlib.colors.to_rgba_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{to\_rgba\_array}}}}}(c{[}, alpha{]}) & Convert \sphinxstyleemphasis{c} to a (n, 4) array of RGBA colors. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.is_color_like:matplotlib.colors.is_color_like}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{is\_color\_like}}}}}(c) & Return whether \sphinxstyleemphasis{c} can be interpreted as an RGB(A) color. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.makeMappingArray:matplotlib.colors.makeMappingArray}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{makeMappingArray}}}}}(N, data{[}, gamma{]}) & Create an \sphinxstyleemphasis{N} -element 1-d lookup table \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.get_named_colors_mapping:matplotlib.colors.get_named_colors_mapping}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_named\_colors\_mapping}}}}}() & Return the global mapping of names to named colors. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.colors.from\_levels\_and\_colors} \label{\detokenize{api/_as_gen/matplotlib.colors.from_levels_and_colors:matplotlib-colors-from-levels-and-colors}}\label{\detokenize{api/_as_gen/matplotlib.colors.from_levels_and_colors::doc}}\index{from\_levels\_and\_colors() (in module matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.from_levels_and_colors:matplotlib.colors.from_levels_and_colors}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{from\_levels\_and\_colors}}}{\emph{levels}, \emph{colors}, \emph{extend='neither'}}{} A helper routine to generate a cmap and a norm instance which behave similar to contourf’s levels and colors arguments. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{levels}}] \leavevmode{[}sequence of numbers{]} The quantization levels used to construct the {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.BoundaryNorm:matplotlib.colors.BoundaryNorm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BoundaryNorm}}}}}. Values \sphinxcode{\sphinxupquote{v}} are quantizized to level \sphinxcode{\sphinxupquote{i}} if \sphinxcode{\sphinxupquote{lev{[}i{]} \textless{}= v \textless{} lev{[}i+1{]}}}. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}sequence of colors{]} The fill color to use for each level. If \sphinxcode{\sphinxupquote{extend}} is “neither” there must be \sphinxcode{\sphinxupquote{n\_level - 1}} colors. For an \sphinxcode{\sphinxupquote{extend}} of “min” or “max” add one extra color, and for an \sphinxcode{\sphinxupquote{extend}} of “both” add two colors. \item[{\sphinxstylestrong{extend}}] \leavevmode{[}\{‘neither’, ‘min’, ‘max’, ‘both’\}, optional{]} The behaviour when a value falls out of range of the given levels. See {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}} for details. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{(cmap, norm)}}] \leavevmode{[}tuple containing a {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}} and a {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} instance{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.colors.hsv\_to\_rgb} \label{\detokenize{api/_as_gen/matplotlib.colors.hsv_to_rgb:matplotlib-colors-hsv-to-rgb}}\label{\detokenize{api/_as_gen/matplotlib.colors.hsv_to_rgb::doc}}\index{hsv\_to\_rgb() (in module matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.hsv_to_rgb:matplotlib.colors.hsv_to_rgb}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{hsv\_to\_rgb}}}{\emph{hsv}}{} convert hsv values in a numpy array to rgb values all values assumed to be in range {[}0, 1{]} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{hsv}}] \leavevmode{[}(…, 3) array-like{]} All values assumed to be in range {[}0, 1{]} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rgb}}] \leavevmode{[}(…, 3) ndarray{]} Colors converted to RGB values in range {[}0, 1{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{matplotlib.colors.rgb\_to\_hsv} \label{\detokenize{api/_as_gen/matplotlib.colors.rgb_to_hsv:matplotlib-colors-rgb-to-hsv}}\label{\detokenize{api/_as_gen/matplotlib.colors.rgb_to_hsv::doc}}\index{rgb\_to\_hsv() (in module matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.rgb_to_hsv:matplotlib.colors.rgb_to_hsv}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{rgb\_to\_hsv}}}{\emph{arr}}{} convert float rgb values (in the range {[}0, 1{]}), in a numpy array to hsv values. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{arr}}] \leavevmode{[}(…, 3) array-like{]} All values must be in the range {[}0, 1{]} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{hsv}}] \leavevmode{[}(…, 3) ndarray{]} Colors converted to hsv values in range {[}0, 1{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.colors.rgb\_to\_hsv}}} \label{\detokenize{api/_as_gen/matplotlib.colors.rgb_to_hsv:examples-using-matplotlib-colors-rgb-to-hsv}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_color\_named\_colors.py} \end{itemize} \subsubsection{matplotlib.colors.to\_hex} \label{\detokenize{api/_as_gen/matplotlib.colors.to_hex:matplotlib-colors-to-hex}}\label{\detokenize{api/_as_gen/matplotlib.colors.to_hex::doc}}\index{to\_hex() (in module matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.to_hex:matplotlib.colors.to_hex}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{to\_hex}}}{\emph{c}, \emph{keep\_alpha=False}}{} Convert \sphinxstyleemphasis{c} to a hex color. Uses the \sphinxcode{\sphinxupquote{\#rrggbb}} format if \sphinxstyleemphasis{keep\_alpha} is False (the default), \sphinxcode{\sphinxupquote{\#rrggbbaa}} otherwise. \end{fulllineitems} \subsubsection{matplotlib.colors.to\_rgb} \label{\detokenize{api/_as_gen/matplotlib.colors.to_rgb:matplotlib-colors-to-rgb}}\label{\detokenize{api/_as_gen/matplotlib.colors.to_rgb::doc}}\index{to\_rgb() (in module matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.to_rgb:matplotlib.colors.to_rgb}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{to\_rgb}}}{\emph{c}}{} Convert \sphinxstyleemphasis{c} to an RGB color, silently dropping the alpha channel. \end{fulllineitems} \subsubsection{matplotlib.colors.to\_rgba} \label{\detokenize{api/_as_gen/matplotlib.colors.to_rgba:matplotlib-colors-to-rgba}}\label{\detokenize{api/_as_gen/matplotlib.colors.to_rgba::doc}}\index{to\_rgba() (in module matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.to_rgba:matplotlib.colors.to_rgba}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{to\_rgba}}}{\emph{c}, \emph{alpha=None}}{} Convert \sphinxstyleemphasis{c} to an RGBA color. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{c}}] \leavevmode{[}Matplotlib color{]} \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}scalar, optional{]} If \sphinxstyleemphasis{alpha} is not \sphinxcode{\sphinxupquote{None}}, it forces the alpha value, except if \sphinxstyleemphasis{c} is \sphinxcode{\sphinxupquote{"none"}} (case-insensitive), which always maps to \sphinxcode{\sphinxupquote{(0, 0, 0, 0)}}. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{tuple}}] \leavevmode Tuple of \sphinxcode{\sphinxupquote{(r, g, b, a)}} scalars. \end{description} \end{description}\end{quote} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.colors.to\_rgba}}} \label{\detokenize{api/_as_gen/matplotlib.colors.to_rgba:examples-using-matplotlib-colors-to-rgba}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_color\_named\_colors.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_line\_collection.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_collections.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_lasso\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_polys3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_menu.py} \end{itemize} \subsubsection{matplotlib.colors.to\_rgba\_array} \label{\detokenize{api/_as_gen/matplotlib.colors.to_rgba_array:matplotlib-colors-to-rgba-array}}\label{\detokenize{api/_as_gen/matplotlib.colors.to_rgba_array::doc}}\index{to\_rgba\_array() (in module matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.to_rgba_array:matplotlib.colors.to_rgba_array}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{to\_rgba\_array}}}{\emph{c}, \emph{alpha=None}}{} Convert \sphinxstyleemphasis{c} to a (n, 4) array of RGBA colors. If \sphinxstyleemphasis{alpha} is not \sphinxcode{\sphinxupquote{None}}, it forces the alpha value. If \sphinxstyleemphasis{c} is \sphinxcode{\sphinxupquote{"none"}} (case-insensitive) or an empty list, an empty array is returned. \end{fulllineitems} \subsubsection{matplotlib.colors.is\_color\_like} \label{\detokenize{api/_as_gen/matplotlib.colors.is_color_like:matplotlib-colors-is-color-like}}\label{\detokenize{api/_as_gen/matplotlib.colors.is_color_like::doc}}\index{is\_color\_like() (in module matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.is_color_like:matplotlib.colors.is_color_like}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{is\_color\_like}}}{\emph{c}}{} Return whether \sphinxstyleemphasis{c} can be interpreted as an RGB(A) color. \end{fulllineitems} \subsubsection{matplotlib.colors.makeMappingArray} \label{\detokenize{api/_as_gen/matplotlib.colors.makeMappingArray:matplotlib-colors-makemappingarray}}\label{\detokenize{api/_as_gen/matplotlib.colors.makeMappingArray::doc}}\index{makeMappingArray() (in module matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.makeMappingArray:matplotlib.colors.makeMappingArray}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{makeMappingArray}}}{\emph{N}, \emph{data}, \emph{gamma=1.0}}{} Create an \sphinxstyleemphasis{N} -element 1-d lookup table \sphinxstyleemphasis{data} represented by a list of x,y0,y1 mapping correspondences. Each element in this list represents how a value between 0 and 1 (inclusive) represented by x is mapped to a corresponding value between 0 and 1 (inclusive). The two values of y are to allow for discontinuous mapping functions (say as might be found in a sawtooth) where y0 represents the value of y for values of x \textless{}= to that given, and y1 is the value to be used for x \textgreater{} than that given). The list must start with x=0, end with x=1, and all values of x must be in increasing order. Values between the given mapping points are determined by simple linear interpolation. Alternatively, data can be a function mapping values between 0 - 1 to 0 - 1. The function returns an array “result” where \sphinxcode{\sphinxupquote{result{[}x*(N-1){]}}} gives the closest value for values of x between 0 and 1. \end{fulllineitems} \subsubsection{matplotlib.colors.get\_named\_colors\_mapping} \label{\detokenize{api/_as_gen/matplotlib.colors.get_named_colors_mapping:matplotlib-colors-get-named-colors-mapping}}\label{\detokenize{api/_as_gen/matplotlib.colors.get_named_colors_mapping::doc}}\index{get\_named\_colors\_mapping() (in module matplotlib.colors)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.colors.get_named_colors_mapping:matplotlib.colors.get_named_colors_mapping}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.colors.}}\sphinxbfcode{\sphinxupquote{get\_named\_colors\_mapping}}}{}{} Return the global mapping of names to named colors. \end{fulllineitems} \chapter{contour} \label{\detokenize{api/contour_api:contour}}\label{\detokenize{api/contour_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.contour}}} \label{\detokenize{api/contour_api:module-matplotlib.contour}}\label{\detokenize{api/contour_api:matplotlib-contour}}\index{matplotlib.contour (module)} These are classes to support contour plotting and labelling for the Axes class. \index{ClabelText (class in matplotlib.contour)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ClabelText}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.contour.}}\sphinxbfcode{\sphinxupquote{ClabelText}}}{\emph{x=0}, \emph{y=0}, \emph{text=''}, \emph{color=None}, \emph{verticalalignment='baseline'}, \emph{horizontalalignment='left'}, \emph{multialignment=None}, \emph{fontproperties=None}, \emph{rotation=None}, \emph{linespacing=None}, \emph{rotation\_mode=None}, \emph{usetex=None}, \emph{wrap=False}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}} Unlike the ordinary text, the get\_rotation returns an updated angle in the pixel coordinate assuming that the input rotation is an angle in data coordinate (or whatever transform set). Create a {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instance at \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} with string \sphinxstyleemphasis{text}. Valid kwargs are \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_backgroundcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{backgroundcolor}}}}} & any matplotlib color \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bbox}}}}} & FancyBboxPatch prop dict \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[} ({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_family}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{family}}}}} or fontfamily or fontname or name & {[}FONTNAME \textbar{} ‘serif’ \textbar{} ‘sans-serif’ \textbar{} ‘cursive’ \textbar{} ‘fantasy’ \textbar{} ‘monospace’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_fontproperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fontproperties}}}}} or font\_properties & a {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_horizontalalignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{horizontalalignment}}}}} or ha & {[} ‘center’ \textbar{} ‘right’ \textbar{} ‘left’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_linespacing}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linespacing}}}}} & float (multiple of font size) \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_multialignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{multialignment}}}}} or ma & {[}‘left’ \textbar{} ‘right’ \textbar{} ‘center’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{position}}}}} & (x,y) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_rotation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotation}}}}} & {[} angle in degrees \textbar{} ‘vertical’ \textbar{} ‘horizontal’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_rotation_mode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotation\_mode}}}}} & {[} None \textbar{} “default” \textbar{} “anchor” {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_size}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{size}}}}} or fontsize & {[}size in points \textbar{} ‘xx-small’ \textbar{} ‘x-small’ \textbar{} ‘small’ \textbar{} ‘medium’ \textbar{} ‘large’ \textbar{} ‘x-large’ \textbar{} ‘xx-large’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_stretch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stretch}}}}} or fontstretch & {[}a numeric value in range 0-1000 \textbar{} ‘ultra-condensed’ \textbar{} ‘extra-condensed’ \textbar{} ‘condensed’ \textbar{} ‘semi-condensed’ \textbar{} ‘normal’ \textbar{} ‘semi-expanded’ \textbar{} ‘expanded’ \textbar{} ‘extra-expanded’ \textbar{} ‘ultra-expanded’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_style}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{style}}}}} or fontstyle & {[} ‘normal’ \textbar{} ‘italic’ \textbar{} ‘oblique’{]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text}}}}} & string or anything printable with ‘\%s’ conversion. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_usetex}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{usetex}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_variant}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{variant}}}}} or fontvariant & {[} ‘normal’ \textbar{} ‘small-caps’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_verticalalignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{verticalalignment}}}}} or va & {[} ‘center’ \textbar{} ‘top’ \textbar{} ‘bottom’ \textbar{} ‘baseline’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_weight}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{weight}}}}} or fontweight & {[}a numeric value in range 0-1000 \textbar{} ‘ultralight’ \textbar{} ‘light’ \textbar{} ‘normal’ \textbar{} ‘regular’ \textbar{} ‘book’ \textbar{} ‘medium’ \textbar{} ‘roman’ \textbar{} ‘semibold’ \textbar{} ‘demibold’ \textbar{} ‘demi’ \textbar{} ‘bold’ \textbar{} ‘heavy’ \textbar{} ‘extra bold’ \textbar{} ‘black’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_wrap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{wrap}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_x}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x}}}}} & float \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_y}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y}}}}} & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} \index{get\_rotation() (matplotlib.contour.ClabelText method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ClabelText.get_rotation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rotation}}}{}{} return the text angle as float in degrees \end{fulllineitems} \end{fulllineitems} \index{ContourLabeler (class in matplotlib.contour)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourLabeler}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.contour.}}\sphinxbfcode{\sphinxupquote{ContourLabeler}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Mixin to provide labelling capability to ContourSet \index{add\_label() (matplotlib.contour.ContourLabeler method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourLabeler.add_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_label}}}{\emph{x}, \emph{y}, \emph{rotation}, \emph{lev}, \emph{cvalue}}{} Add contour label using {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} class. \end{fulllineitems} \index{add\_label\_clabeltext() (matplotlib.contour.ContourLabeler method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourLabeler.add_label_clabeltext}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_label\_clabeltext}}}{\emph{x}, \emph{y}, \emph{rotation}, \emph{lev}, \emph{cvalue}}{} Add contour label using {\hyperref[\detokenize{api/contour_api:matplotlib.contour.ClabelText}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ClabelText}}}}} class. \end{fulllineitems} \index{add\_label\_near() (matplotlib.contour.ContourLabeler method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourLabeler.add_label_near}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_label\_near}}}{\emph{x}, \emph{y}, \emph{inline=True}, \emph{inline\_spacing=5}, \emph{transform=None}}{} Add a label near the point (x, y). If transform is None (default), (x, y) is in data coordinates; if transform is False, (x, y) is in display coordinates; otherwise, the specified transform will be used to translate (x, y) into display coordinates. \begin{description} \item[{\sphinxstyleemphasis{inline}:}] \leavevmode controls whether the underlying contour is removed or not. Default is \sphinxstyleemphasis{True}. \item[{\sphinxstyleemphasis{inline\_spacing}:}] \leavevmode space in pixels to leave on each side of label when placing inline. Defaults to 5. This spacing will be exact for labels at locations where the contour is straight, less so for labels on curved contours. \end{description} \end{fulllineitems} \index{calc\_label\_rot\_and\_inline() (matplotlib.contour.ContourLabeler method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourLabeler.calc_label_rot_and_inline}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{calc\_label\_rot\_and\_inline}}}{\emph{slc}, \emph{ind}, \emph{lw}, \emph{lc=None}, \emph{spacing=5}}{} This function calculates the appropriate label rotation given the linecontour coordinates in screen units, the index of the label location and the label width. It will also break contour and calculate inlining if \sphinxstyleemphasis{lc} is not empty (lc defaults to the empty list if None). \sphinxstyleemphasis{spacing} is the space around the label in pixels to leave empty. Do both of these tasks at once to avoid calculating path lengths multiple times, which is relatively costly. The method used here involves calculating the path length along the contour in pixel coordinates and then looking approximately label width / 2 away from central point to determine rotation and then to break contour if desired. \end{fulllineitems} \index{clabel() (matplotlib.contour.ContourLabeler method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourLabeler.clabel}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{clabel}}}{\emph{*args}, \emph{**kwargs}}{} Label a contour plot. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{clabel}\PYG{p}{(}\PYG{n}{cs}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Adds labels to line contours in \sphinxstyleemphasis{cs}, where \sphinxstyleemphasis{cs} is a {\hyperref[\detokenize{api/contour_api:matplotlib.contour.ContourSet}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ContourSet}}}}} object returned by contour. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{clabel}\PYG{p}{(}\PYG{n}{cs}\PYG{p}{,} \PYG{n}{v}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} only labels contours listed in \sphinxstyleemphasis{v}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fontsize}}] \leavevmode{[}string or float, optional{]} Size in points or relative size e.g., ‘smaller’, ‘x-large’. See \sphinxcode{\sphinxupquote{Text.set\_size}} for accepted string values. \item[{\sphinxstylestrong{colors :}}] \leavevmode Color of each label \begin{itemize} \item {} if \sphinxstyleemphasis{None}, the color of each label matches the color of the corresponding contour \item {} if one string color, e.g., \sphinxstyleemphasis{colors} = ‘r’ or \sphinxstyleemphasis{colors} = ‘red’, all labels will be plotted in this color \item {} if a tuple of matplotlib color args (string, float, rgb, etc), different labels will be plotted in different colors in the order specified \end{itemize} \item[{\sphinxstylestrong{inline}}] \leavevmode{[}bool, optional{]} If \sphinxcode{\sphinxupquote{True}} the underlying contour is removed where the label is placed. Default is \sphinxcode{\sphinxupquote{True}}. \item[{\sphinxstylestrong{inline\_spacing}}] \leavevmode{[}float, optional{]} Space in pixels to leave on each side of label when placing inline. Defaults to 5. This spacing will be exact for labels at locations where the contour is straight, less so for labels on curved contours. \item[{\sphinxstylestrong{fmt}}] \leavevmode{[}string or dict, optional{]} A format string for the label. Default is ‘\%1.3f’ Alternatively, this can be a dictionary matching contour levels with arbitrary strings to use for each contour level (i.e., fmt{[}level{]}=string), or it can be any callable, such as a {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Formatter}}}}} instance, that returns a string when called with a numeric contour level. \item[{\sphinxstylestrong{manual}}] \leavevmode{[}bool or iterable, optional{]} If \sphinxcode{\sphinxupquote{True}}, contour labels will be placed manually using mouse clicks. Click the first button near a contour to add a label, click the second button (or potentially both mouse buttons at once) to finish adding labels. The third button can be used to remove the last label added, but only if labels are not inline. Alternatively, the keyboard can be used to select label locations (enter to end label placement, delete or backspace act like the third mouse button, and any other key will select a label location). \sphinxstyleemphasis{manual} can also be an iterable object of x,y tuples. Contour labels will be created as if mouse is clicked at each x,y positions. \item[{\sphinxstylestrong{rightside\_up}}] \leavevmode{[}bool, optional{]} If \sphinxcode{\sphinxupquote{True}}, label rotations will always be plus or minus 90 degrees from level. Default is \sphinxcode{\sphinxupquote{True}}. \item[{\sphinxstylestrong{use\_clabeltext}}] \leavevmode{[}bool, optional{]} If \sphinxcode{\sphinxupquote{True}}, {\hyperref[\detokenize{api/contour_api:matplotlib.contour.ClabelText}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ClabelText}}}}} class (instead of \sphinxcode{\sphinxupquote{Text}}) is used to create labels. {\hyperref[\detokenize{api/contour_api:matplotlib.contour.ClabelText}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ClabelText}}}}} recalculates rotation angles of texts during the drawing time, therefore this can be used if aspect of the axes changes. Default is \sphinxcode{\sphinxupquote{False}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_label\_coords() (matplotlib.contour.ContourLabeler method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourLabeler.get_label_coords}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_label\_coords}}}{\emph{distances}, \emph{XX}, \emph{YY}, \emph{ysize}, \emph{lw}}{} Return x, y, and the index of a label location. Labels are plotted at a location with the smallest deviation of the contour from a straight line unless there is another label nearby, in which case the next best place on the contour is picked up. If all such candidates are rejected, the beginning of the contour is chosen. \end{fulllineitems} \index{get\_label\_width() (matplotlib.contour.ContourLabeler method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourLabeler.get_label_width}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_label\_width}}}{\emph{lev}, \emph{fmt}, \emph{fsize}}{} Return the width of the label in points. \end{fulllineitems} \index{get\_real\_label\_width() (matplotlib.contour.ContourLabeler method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourLabeler.get_real_label_width}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_real\_label\_width}}}{\emph{lev}, \emph{fmt}, \emph{fsize}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The get\_real\_label\_width function was deprecated in version 2.2. This computes actual onscreen label width. This uses some black magic to determine onscreen extent of non-drawn label. This magic may not be very robust. This method is not being used, and may be modified or removed. \end{fulllineitems} \index{get\_text() (matplotlib.contour.ContourLabeler method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourLabeler.get_text}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_text}}}{\emph{lev}, \emph{fmt}}{} get the text of the label \end{fulllineitems} \index{labels() (matplotlib.contour.ContourLabeler method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourLabeler.labels}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{labels}}}{\emph{inline}, \emph{inline\_spacing}}{}~ \end{fulllineitems} \index{locate\_label() (matplotlib.contour.ContourLabeler method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourLabeler.locate_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{locate\_label}}}{\emph{linecontour}, \emph{labelwidth}}{} Find good place to draw a label (relatively flat part of the contour). \end{fulllineitems} \index{pop\_label() (matplotlib.contour.ContourLabeler method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourLabeler.pop_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pop\_label}}}{\emph{index=-1}}{} Defaults to removing last label, but any index can be supplied \end{fulllineitems} \index{print\_label() (matplotlib.contour.ContourLabeler method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourLabeler.print_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{print\_label}}}{\emph{linecontour}, \emph{labelwidth}}{} Return \sphinxstyleemphasis{False} if contours are too short for a label. \end{fulllineitems} \index{set\_label\_props() (matplotlib.contour.ContourLabeler method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourLabeler.set_label_props}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_label\_props}}}{\emph{label}, \emph{text}, \emph{color}}{} set the label properties - color, fontsize, text \end{fulllineitems} \index{too\_close() (matplotlib.contour.ContourLabeler method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourLabeler.too_close}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{too\_close}}}{\emph{x}, \emph{y}, \emph{lw}}{} Return \sphinxstyleemphasis{True} if a label is already near this location. \end{fulllineitems} \end{fulllineitems} \index{ContourSet (class in matplotlib.contour)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourSet}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.contour.}}\sphinxbfcode{\sphinxupquote{ContourSet}}}{\emph{ax}, \emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.ScalarMappable}}}}}, {\hyperref[\detokenize{api/contour_api:matplotlib.contour.ContourLabeler}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.contour.ContourLabeler}}}}} Store a set of contour lines or filled regions. User-callable method: clabel \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ax:}}] \leavevmode The axes object in which the contours are drawn. \item[{\sphinxstylestrong{collections:}}] \leavevmode A silent\_list of LineCollections or PolyCollections. \item[{\sphinxstylestrong{levels:}}] \leavevmode Contour levels. \item[{\sphinxstylestrong{layers:}}] \leavevmode Same as levels for line contours; half-way between levels for filled contours. See \sphinxcode{\sphinxupquote{\_process\_colors()}}. \end{description} \end{description}\end{quote} Draw contour lines or filled regions, depending on whether keyword arg \sphinxstyleemphasis{filled} is \sphinxcode{\sphinxupquote{False}} (default) or \sphinxcode{\sphinxupquote{True}}. The first three arguments must be: \begin{quote} \sphinxstyleemphasis{ax}: axes object. \begin{description} \item[{\sphinxstyleemphasis{levels}: {[}level0, level1, …, leveln{]}}] \leavevmode A list of floating point numbers indicating the contour levels. \item[{\sphinxstyleemphasis{allsegs}: {[}level0segs, level1segs, …{]}}] \leavevmode List of all the polygon segments for all the \sphinxstyleemphasis{levels}. For contour lines \sphinxcode{\sphinxupquote{len(allsegs) == len(levels)}}, and for filled contour regions \sphinxcode{\sphinxupquote{len(allsegs) = len(levels)-1}}. The lists should look like: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{level0segs} \PYG{o}{=} \PYG{p}{[}\PYG{n}{polygon0}\PYG{p}{,} \PYG{n}{polygon1}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{]} \PYG{n}{polygon0} \PYG{o}{=} \PYG{n}{array\PYGZus{}like} \PYG{p}{[}\PYG{p}{[}\PYG{n}{x0}\PYG{p}{,}\PYG{n}{y0}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{n}{x1}\PYG{p}{,}\PYG{n}{y1}\PYG{p}{]}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{]} \end{sphinxVerbatim} \item[{\sphinxstyleemphasis{allkinds}: \sphinxstyleemphasis{None} or {[}level0kinds, level1kinds, …{]}}] \leavevmode Optional list of all the polygon vertex kinds (code types), as described and used in Path. This is used to allow multiply- connected paths such as holes within filled polygons. If not \sphinxcode{\sphinxupquote{None}}, \sphinxcode{\sphinxupquote{len(allkinds) == len(allsegs)}}. The lists should look like: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{level0kinds} \PYG{o}{=} \PYG{p}{[}\PYG{n}{polygon0kinds}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{]} \PYG{n}{polygon0kinds} \PYG{o}{=} \PYG{p}{[}\PYG{n}{vertexcode0}\PYG{p}{,} \PYG{n}{vertexcode1}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{]} \end{sphinxVerbatim} If \sphinxstyleemphasis{allkinds} is not \sphinxcode{\sphinxupquote{None}}, usually all polygons for a particular contour level are grouped together so that \sphinxcode{\sphinxupquote{level0segs = {[}polygon0{]}}} and \sphinxcode{\sphinxupquote{level0kinds = {[}polygon0kinds{]}}}. \end{description} \end{quote} Keyword arguments are as described in the docstring of {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contour:matplotlib.axes.Axes.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour}}}}}. \index{changed() (matplotlib.contour.ContourSet method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourSet.changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{changed}}}{}{} Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal \end{fulllineitems} \index{find\_nearest\_contour() (matplotlib.contour.ContourSet method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourSet.find_nearest_contour}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{find\_nearest\_contour}}}{\emph{x}, \emph{y}, \emph{indices=None}, \emph{pixel=True}}{} Finds contour that is closest to a point. Defaults to measuring distance in pixels (screen space - useful for manual contour labeling), but this can be controlled via a keyword argument. Returns a tuple containing the contour, segment, index of segment, x \& y of segment point and distance to minimum point. Optional keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{indices}:}] \leavevmode Indexes of contour levels to consider when looking for nearest point. Defaults to using all levels. \item[{\sphinxstyleemphasis{pixel}:}] \leavevmode If \sphinxstyleemphasis{True}, measure distance in pixel space, if not, measure distance in axes space. Defaults to \sphinxstyleemphasis{True}. \end{description} \end{quote} \end{fulllineitems} \index{get\_alpha() (matplotlib.contour.ContourSet method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourSet.get_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alpha}}}{}{} returns alpha to be applied to all ContourSet artists \end{fulllineitems} \index{get\_transform() (matplotlib.contour.ContourSet method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourSet.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this ContourSet. \end{fulllineitems} \index{legend\_elements() (matplotlib.contour.ContourSet method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourSet.legend_elements}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{legend\_elements}}}{\emph{variable\_name='x'}, \emph{str\_format=\textless{}class 'str'\textgreater{}}}{} Return a list of artist and labels suitable for passing through to \sphinxcode{\sphinxupquote{plt.legend()}} which represent this ContourSet. Args: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{variable\_name}: the string used inside the inequality used}] \leavevmode on the labels \end{description} \sphinxstyleemphasis{str\_format}: function used to format the numbers in the labels \end{quote} \end{fulllineitems} \index{set\_alpha() (matplotlib.contour.ContourSet method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.ContourSet.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} sets alpha for all ContourSet artists \end{fulllineitems} \end{fulllineitems} \index{QuadContourSet (class in matplotlib.contour)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/contour_api:matplotlib.contour.QuadContourSet}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.contour.}}\sphinxbfcode{\sphinxupquote{QuadContourSet}}}{\emph{ax}, \emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/contour_api:matplotlib.contour.ContourSet}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.contour.ContourSet}}}}} Create and store a set of contour lines or filled regions. User-callable method: \sphinxcode{\sphinxupquote{clabel()}} \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ax:}}] \leavevmode The axes object in which the contours are drawn. \item[{\sphinxstylestrong{collections:}}] \leavevmode A silent\_list of LineCollections or PolyCollections. \item[{\sphinxstylestrong{levels:}}] \leavevmode Contour levels. \item[{\sphinxstylestrong{layers:}}] \leavevmode Same as levels for line contours; half-way between levels for filled contours. See \sphinxcode{\sphinxupquote{\_process\_colors()}} method. \end{description} \end{description}\end{quote} Draw contour lines or filled regions, depending on whether keyword arg \sphinxstyleemphasis{filled} is \sphinxcode{\sphinxupquote{False}} (default) or \sphinxcode{\sphinxupquote{True}}. The first three arguments must be: \begin{quote} \sphinxstyleemphasis{ax}: axes object. \begin{description} \item[{\sphinxstyleemphasis{levels}: {[}level0, level1, …, leveln{]}}] \leavevmode A list of floating point numbers indicating the contour levels. \item[{\sphinxstyleemphasis{allsegs}: {[}level0segs, level1segs, …{]}}] \leavevmode List of all the polygon segments for all the \sphinxstyleemphasis{levels}. For contour lines \sphinxcode{\sphinxupquote{len(allsegs) == len(levels)}}, and for filled contour regions \sphinxcode{\sphinxupquote{len(allsegs) = len(levels)-1}}. The lists should look like: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{level0segs} \PYG{o}{=} \PYG{p}{[}\PYG{n}{polygon0}\PYG{p}{,} \PYG{n}{polygon1}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{]} \PYG{n}{polygon0} \PYG{o}{=} \PYG{n}{array\PYGZus{}like} \PYG{p}{[}\PYG{p}{[}\PYG{n}{x0}\PYG{p}{,}\PYG{n}{y0}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{n}{x1}\PYG{p}{,}\PYG{n}{y1}\PYG{p}{]}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{]} \end{sphinxVerbatim} \item[{\sphinxstyleemphasis{allkinds}: \sphinxstyleemphasis{None} or {[}level0kinds, level1kinds, …{]}}] \leavevmode Optional list of all the polygon vertex kinds (code types), as described and used in Path. This is used to allow multiply- connected paths such as holes within filled polygons. If not \sphinxcode{\sphinxupquote{None}}, \sphinxcode{\sphinxupquote{len(allkinds) == len(allsegs)}}. The lists should look like: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{level0kinds} \PYG{o}{=} \PYG{p}{[}\PYG{n}{polygon0kinds}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{]} \PYG{n}{polygon0kinds} \PYG{o}{=} \PYG{p}{[}\PYG{n}{vertexcode0}\PYG{p}{,} \PYG{n}{vertexcode1}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{]} \end{sphinxVerbatim} If \sphinxstyleemphasis{allkinds} is not \sphinxcode{\sphinxupquote{None}}, usually all polygons for a particular contour level are grouped together so that \sphinxcode{\sphinxupquote{level0segs = {[}polygon0{]}}} and \sphinxcode{\sphinxupquote{level0kinds = {[}polygon0kinds{]}}}. \end{description} \end{quote} Keyword arguments are as described in the docstring of {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contour:matplotlib.axes.Axes.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour}}}}}. \end{fulllineitems} \chapter{container} \label{\detokenize{api/container_api:container}}\label{\detokenize{api/container_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.container}}} \label{\detokenize{api/container_api:module-matplotlib.container}}\label{\detokenize{api/container_api:matplotlib-container}}\index{matplotlib.container (module)}\index{BarContainer (class in matplotlib.container)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/container_api:matplotlib.container.BarContainer}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.container.}}\sphinxbfcode{\sphinxupquote{BarContainer}}}{\emph{patches}, \emph{errorbar=None}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/container_api:matplotlib.container.Container}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.container.Container}}}}} Container for the artists of bar plots (e.g. created by {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.bar:matplotlib.axes.Axes.bar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.bar}}}}}). The container can be treated as a tuple of the \sphinxstyleemphasis{patches} themselves. Additionally, you can access these and further parameters by the attributes. \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{patches}}] \leavevmode{[}list of {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}}{]} The artists of the bars. \item[{\sphinxstylestrong{errorbar}}] \leavevmode{[}None or {\hyperref[\detokenize{api/container_api:matplotlib.container.ErrorbarContainer}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ErrorbarContainer}}}}}{]} A container for the error bar artists if error bars are present. \sphinxstyleemphasis{None} otherwise. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{Container (class in matplotlib.container)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/container_api:matplotlib.container.Container}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.container.}}\sphinxbfcode{\sphinxupquote{Container}}}{\emph{kl}, \emph{label=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#tuple}{\sphinxcode{\sphinxupquote{tuple}}} Base class for containers. Containers are classes that collect semantically related Artists such as the bars of a bar plot. \index{add\_callback() (matplotlib.container.Container method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/container_api:matplotlib.container.Container.add_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_callback}}}{\emph{func}}{} Adds a callback function that will be called whenever one of the \sphinxcode{\sphinxupquote{Artist}}’s properties changes. Returns an \sphinxstyleemphasis{id} that is useful for removing the callback with {\hyperref[\detokenize{api/container_api:matplotlib.container.Container.remove_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{remove\_callback()}}}}} later. \end{fulllineitems} \index{get\_children() (matplotlib.container.Container method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/container_api:matplotlib.container.Container.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{}~ \end{fulllineitems} \index{get\_label() (matplotlib.container.Container method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/container_api:matplotlib.container.Container.get_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_label}}}{}{} Get the label used for this artist in the legend. \end{fulllineitems} \index{pchanged() (matplotlib.container.Container method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/container_api:matplotlib.container.Container.pchanged}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pchanged}}}{}{} Fire an event when property changed, calling all of the registered callbacks. \end{fulllineitems} \index{remove() (matplotlib.container.Container method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/container_api:matplotlib.container.Container.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{}{}~ \end{fulllineitems} \index{remove\_callback() (matplotlib.container.Container method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/container_api:matplotlib.container.Container.remove_callback}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove\_callback}}}{\emph{oid}}{} Remove a callback based on its \sphinxstyleemphasis{id}. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/container_api:matplotlib.container.Container.add_callback}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_callback()}}}}}}] \leavevmode For adding callbacks \end{description} \end{fulllineitems} \index{set\_label() (matplotlib.container.Container method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/container_api:matplotlib.container.Container.set_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_label}}}{\emph{s}}{} Set the label to \sphinxstyleemphasis{s} for auto legend. ACCEPTS: string or anything printable with ‘\%s’ conversion. \end{fulllineitems} \index{set\_remove\_method() (matplotlib.container.Container method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/container_api:matplotlib.container.Container.set_remove_method}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_remove\_method}}}{\emph{f}}{}~ \end{fulllineitems} \end{fulllineitems} \index{ErrorbarContainer (class in matplotlib.container)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/container_api:matplotlib.container.ErrorbarContainer}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.container.}}\sphinxbfcode{\sphinxupquote{ErrorbarContainer}}}{\emph{lines}, \emph{has\_xerr=False}, \emph{has\_yerr=False}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/container_api:matplotlib.container.Container}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.container.Container}}}}} Container for the artists of error bars (e.g. created by {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.errorbar:matplotlib.axes.Axes.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.errorbar}}}}}). The container can be treated as the \sphinxstyleemphasis{lines} tuple itself. Additionally, you can access these and further parameters by the attributes. \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lines}}] \leavevmode{[}tuple{]} Tuple of \sphinxcode{\sphinxupquote{(data\_line, caplines, barlinecols)}}. \begin{itemize} \item {} data\_line : {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instance of x, y plot markers and/or line. \item {} caplines : tuple of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instances of the error bar caps. \item {} barlinecols : list of {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} with the horizontal and vertical error ranges. \end{itemize} \item[{\sphinxstylestrong{has\_xerr, has\_yerr}}] \leavevmode{[}bool{]} \sphinxcode{\sphinxupquote{True}} if the errorbar has x/y errors. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{StemContainer (class in matplotlib.container)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/container_api:matplotlib.container.StemContainer}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.container.}}\sphinxbfcode{\sphinxupquote{StemContainer}}}{\emph{markerline\_stemlines\_baseline}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/container_api:matplotlib.container.Container}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.container.Container}}}}} Container for the artists created in a {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.stem:matplotlib.axes.Axes.stem}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.stem()}}}}} plot. The container can be treated like a namedtuple \sphinxcode{\sphinxupquote{(markerline, stemlines, baseline)}}. \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{markerline}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}}{]} The artist of the markers at the stem heads. \item[{\sphinxstylestrong{stemlines}}] \leavevmode{[}list of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}}{]} The artists of the vertical lines for all stems. \item[{\sphinxstylestrong{baseline}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}}{]} The artist of the horizontal baseline. \end{description} \end{description}\end{quote} \end{fulllineitems} \chapter{dates} \label{\detokenize{api/dates_api:dates}}\label{\detokenize{api/dates_api::doc}} \sphinxincludegraphics[]{inheritance-a291d1aa1c835234490b3eee568b4b65bd91a88c.pdf} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.dates}}} \label{\detokenize{api/dates_api:module-matplotlib.dates}}\label{\detokenize{api/dates_api:matplotlib-dates}}\index{matplotlib.dates (module)} Matplotlib provides sophisticated date plotting capabilities, standing on the shoulders of python \sphinxhref{https://docs.python.org/3/library/datetime.html\#module-datetime}{\sphinxcode{\sphinxupquote{datetime}}}, the add-on modules \sphinxcode{\sphinxupquote{pytz}} and \sphinxcode{\sphinxupquote{dateutil}}. \subsection{Matplotlib date format} \label{\detokenize{api/dates_api:matplotlib-date-format}}\label{\detokenize{api/dates_api:date-format}} Matplotlib represents dates using floating point numbers specifying the number of days since 0001-01-01 UTC, plus 1. For example, 0001-01-01, 06:00 is 1.25, not 0.25. Values \textless{} 1, i.e. dates before 0001-01-01 UTC are not supported. There are a number of helper functions to convert between \sphinxhref{https://docs.python.org/3/library/datetime.html\#module-datetime}{\sphinxcode{\sphinxupquote{datetime}}} objects and Matplotlib dates: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/dates_api:matplotlib.dates.date2num}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{date2num}}}}} & Convert datetime objects to Matplotlib dates. \\ \hline {\hyperref[\detokenize{api/dates_api:matplotlib.dates.num2date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{num2date}}}}} & Convert Matplotlib dates to \sphinxhref{https://docs.python.org/3/library/datetime.html\#datetime.datetime}{\sphinxcode{\sphinxupquote{datetime}}} objects. \\ \hline {\hyperref[\detokenize{api/dates_api:matplotlib.dates.num2timedelta}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{num2timedelta}}}}} & Convert number of days to a \sphinxhref{https://docs.python.org/3/library/datetime.html\#datetime.timedelta}{\sphinxcode{\sphinxupquote{timedelta}}} object. \\ \hline {\hyperref[\detokenize{api/dates_api:matplotlib.dates.epoch2num}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{epoch2num}}}}} & Convert an epoch or sequence of epochs to the new date format, that is days since 0001. \\ \hline {\hyperref[\detokenize{api/dates_api:matplotlib.dates.num2epoch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{num2epoch}}}}} & Convert days since 0001 to epoch. \\ \hline {\hyperref[\detokenize{api/dates_api:matplotlib.dates.mx2num}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mx2num}}}}} & Convert mx \sphinxcode{\sphinxupquote{datetime}} instance (or sequence of mx instances) to the new date format. \\ \hline {\hyperref[\detokenize{api/dates_api:matplotlib.dates.drange}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drange}}}}} & Return a sequence of equally spaced Matplotlib dates. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \begin{sphinxadmonition}{note}{Note:} Like Python’s datetime, mpl uses the Gregorian calendar for all conversions between dates and floating point numbers. This practice is not universal, and calendar differences can cause confusing differences between what Python and mpl give as the number of days since 0001-01-01 and what other software and databases yield. For example, the US Naval Observatory uses a calendar that switches from Julian to Gregorian in October, 1582. Hence, using their calculator, the number of days between 0001-01-01 and 2006-04-01 is 732403, whereas using the Gregorian calendar via the datetime module we find: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{In} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{:} \PYG{n}{date}\PYG{p}{(}\PYG{l+m+mi}{2006}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{o}{.}\PYG{n}{toordinal}\PYG{p}{(}\PYG{p}{)} \PYG{o}{\PYGZhy{}} \PYG{n}{date}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)}\PYG{o}{.}\PYG{n}{toordinal}\PYG{p}{(}\PYG{p}{)} \PYG{n}{Out}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{:} \PYG{l+m+mi}{732401} \end{sphinxVerbatim} \end{sphinxadmonition} All the Matplotlib date converters, tickers and formatters are timezone aware. If no explicit timezone is provided, the rcParam \sphinxcode{\sphinxupquote{timezone}} is assumend. If you want to use a custom time zone, pass a \sphinxcode{\sphinxupquote{pytz.timezone}} instance with the tz keyword argument to {\hyperref[\detokenize{api/dates_api:matplotlib.dates.num2date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{num2date()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot_date:matplotlib.pyplot.plot_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot\_date()}}}}}, and any custom date tickers or locators you create. See \sphinxhref{http://pythonhosted.org/pytz/}{pytz} for information on \sphinxcode{\sphinxupquote{pytz}} and timezone handling. A wide range of specific and general purpose date tick locators and formatters are provided in this module. See {\hyperref[\detokenize{api/ticker_api:module-matplotlib.ticker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker}}}}} for general information on tick locators and formatters. These are described below. The \sphinxhref{https://dateutil.readthedocs.io/en/stable/}{dateutil module} provides additional code to handle date ticking, making it easy to place ticks on any kinds of dates. See examples below. \subsection{Date tickers} \label{\detokenize{api/dates_api:date-tickers}} Most of the date tickers can locate single or multiple values. For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} import constants for the days of the week} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{dates} \PYG{k}{import} \PYG{n}{MO}\PYG{p}{,} \PYG{n}{TU}\PYG{p}{,} \PYG{n}{WE}\PYG{p}{,} \PYG{n}{TH}\PYG{p}{,} \PYG{n}{FR}\PYG{p}{,} \PYG{n}{SA}\PYG{p}{,} \PYG{n}{SU} \PYG{c+c1}{\PYGZsh{} tick on mondays every week} \PYG{n}{loc} \PYG{o}{=} \PYG{n}{WeekdayLocator}\PYG{p}{(}\PYG{n}{byweekday}\PYG{o}{=}\PYG{n}{MO}\PYG{p}{,} \PYG{n}{tz}\PYG{o}{=}\PYG{n}{tz}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} tick on mondays and saturdays} \PYG{n}{loc} \PYG{o}{=} \PYG{n}{WeekdayLocator}\PYG{p}{(}\PYG{n}{byweekday}\PYG{o}{=}\PYG{p}{(}\PYG{n}{MO}\PYG{p}{,} \PYG{n}{SA}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} In addition, most of the constructors take an interval argument: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} tick on mondays every second week} \PYG{n}{loc} \PYG{o}{=} \PYG{n}{WeekdayLocator}\PYG{p}{(}\PYG{n}{byweekday}\PYG{o}{=}\PYG{n}{MO}\PYG{p}{,} \PYG{n}{interval}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \end{sphinxVerbatim} The rrule locator allows completely general date ticking: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} tick every 5th easter} \PYG{n}{rule} \PYG{o}{=} \PYG{n}{rrulewrapper}\PYG{p}{(}\PYG{n}{YEARLY}\PYG{p}{,} \PYG{n}{byeaster}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{interval}\PYG{o}{=}\PYG{l+m+mi}{5}\PYG{p}{)} \PYG{n}{loc} \PYG{o}{=} \PYG{n}{RRuleLocator}\PYG{p}{(}\PYG{n}{rule}\PYG{p}{)} \end{sphinxVerbatim} Here are all the date tickers: \begin{itemize} \item {} {\hyperref[\detokenize{api/dates_api:matplotlib.dates.MicrosecondLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MicrosecondLocator}}}}}: locate microseconds \item {} {\hyperref[\detokenize{api/dates_api:matplotlib.dates.SecondLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SecondLocator}}}}}: locate seconds \item {} {\hyperref[\detokenize{api/dates_api:matplotlib.dates.MinuteLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MinuteLocator}}}}}: locate minutes \item {} {\hyperref[\detokenize{api/dates_api:matplotlib.dates.HourLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{HourLocator}}}}}: locate hours \item {} {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DayLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{DayLocator}}}}}: locate specified days of the month \item {} {\hyperref[\detokenize{api/dates_api:matplotlib.dates.WeekdayLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{WeekdayLocator}}}}}: Locate days of the week, e.g., MO, TU \item {} {\hyperref[\detokenize{api/dates_api:matplotlib.dates.MonthLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MonthLocator}}}}}: locate months, e.g., 7 for july \item {} {\hyperref[\detokenize{api/dates_api:matplotlib.dates.YearLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YearLocator}}}}}: locate years that are multiples of base \item {} {\hyperref[\detokenize{api/dates_api:matplotlib.dates.RRuleLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RRuleLocator}}}}}: locate using a \sphinxcode{\sphinxupquote{matplotlib.dates.rrulewrapper}}. The \sphinxcode{\sphinxupquote{rrulewrapper}} is a simple wrapper around a \sphinxcode{\sphinxupquote{dateutil.rrule}} (\sphinxhref{https://dateutil.readthedocs.io/en/stable/}{dateutil}) which allow almost arbitrary date tick specifications. See \sphinxhref{../gallery/ticks\_and\_spines/date\_demo\_rrule.html}{rrule example}. \item {} {\hyperref[\detokenize{api/dates_api:matplotlib.dates.AutoDateLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AutoDateLocator}}}}}: On autoscale, this class picks the best {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{DateLocator}}}}} (e.g., {\hyperref[\detokenize{api/dates_api:matplotlib.dates.RRuleLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RRuleLocator}}}}}) to set the view limits and the tick locations. If called with \sphinxcode{\sphinxupquote{interval\_multiples=True}} it will make ticks line up with sensible multiples of the tick intervals. E.g. if the interval is 4 hours, it will pick hours 0, 4, 8, etc as ticks. This behaviour is not guaranteed by default. \end{itemize} \subsection{Date formatters} \label{\detokenize{api/dates_api:date-formatters}} Here all all the date formatters: \begin{itemize} \item {} {\hyperref[\detokenize{api/dates_api:matplotlib.dates.AutoDateFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AutoDateFormatter}}}}}: attempts to figure out the best format to use. This is most useful when used with the {\hyperref[\detokenize{api/dates_api:matplotlib.dates.AutoDateLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AutoDateLocator}}}}}. \item {} {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{DateFormatter}}}}}: use \sphinxcode{\sphinxupquote{strftime()}} format strings \item {} {\hyperref[\detokenize{api/dates_api:matplotlib.dates.IndexDateFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{IndexDateFormatter}}}}}: date plots with implicit \sphinxstyleemphasis{x} indexing. \end{itemize} \index{date2num() (in module matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.date2num}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{date2num}}}{\emph{d}}{} Convert datetime objects to Matplotlib dates. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{d}}] \leavevmode{[}\sphinxhref{https://docs.python.org/3/library/datetime.html\#datetime.datetime}{\sphinxcode{\sphinxupquote{datetime.datetime}}} or \sphinxcode{\sphinxupquote{numpy.datetime64}} or sequences of these{]} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{float or sequence of floats}}] \leavevmode Number of days (fraction part represents hours, minutes, seconds, ms) since 0001-01-01 00:00:00 UTC, plus one. \end{description} \end{description}\end{quote} \paragraph{Notes} The addition of one here is a historical artifact. Also, note that the Gregorian calendar is assumed; this is not universal practice. For details see the module docstring. \end{fulllineitems} \index{num2date() (in module matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.num2date}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{num2date}}}{\emph{x}, \emph{tz=None}}{} Convert Matplotlib dates to \sphinxhref{https://docs.python.org/3/library/datetime.html\#datetime.datetime}{\sphinxcode{\sphinxupquote{datetime}}} objects. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}float or sequence of floats{]} Number of days (fraction part represents hours, minutes, seconds) since 0001-01-01 00:00:00 UTC, plus one. \item[{\sphinxstylestrong{tz}}] \leavevmode{[}string, optional{]} Timezone of \sphinxstyleemphasis{x} (defaults to rcparams \sphinxcode{\sphinxupquote{timezone}}). \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{{}`\textasciitilde{}datetime.datetime{}` or sequence of {}`\textasciitilde{}datetime.datetime{}`}}] \leavevmode Dates are returned in timezone \sphinxstyleemphasis{tz}. If \sphinxstyleemphasis{x} is a sequence, a sequence of \sphinxcode{\sphinxupquote{datetime}} objects will be returned. \end{description} \end{description}\end{quote} \paragraph{Notes} The addition of one here is a historical artifact. Also, note that the Gregorian calendar is assumed; this is not universal practice. For details, see the module docstring. \end{fulllineitems} \index{num2timedelta() (in module matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.num2timedelta}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{num2timedelta}}}{\emph{x}}{} Convert number of days to a \sphinxhref{https://docs.python.org/3/library/datetime.html\#datetime.timedelta}{\sphinxcode{\sphinxupquote{timedelta}}} object. If \sphinxstyleemphasis{x} is a sequence, a sequence of \sphinxhref{https://docs.python.org/3/library/datetime.html\#datetime.timedelta}{\sphinxcode{\sphinxupquote{timedelta}}} objects will be returned. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}float, sequence of floats{]} Number of days. The fraction part represents hours, minutes, seconds. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{{}`datetime.timedelta{}` or list{[}{}`datetime.timedelta{}`{]}}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{drange() (in module matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.drange}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{drange}}}{\emph{dstart}, \emph{dend}, \emph{delta}}{} Return a sequence of equally spaced Matplotlib dates. The dates start at \sphinxstyleemphasis{dstart} and reach up to, but not including \sphinxstyleemphasis{dend}. They are spaced by \sphinxstyleemphasis{delta}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{dstart, dend}}] \leavevmode{[}\sphinxhref{https://docs.python.org/3/library/datetime.html\#datetime.datetime}{\sphinxcode{\sphinxupquote{datetime}}}{]} The date limits. \item[{\sphinxstylestrong{delta}}] \leavevmode{[}\sphinxhref{https://docs.python.org/3/library/datetime.html\#datetime.timedelta}{\sphinxcode{\sphinxupquote{datetime.timedelta}}}{]} Spacing of the dates. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{drange}}] \leavevmode{[}\sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html\#numpy.array}{\sphinxcode{\sphinxupquote{numpy.array}}}{]} A list floats representing Matplotlib dates. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{epoch2num() (in module matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.epoch2num}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{epoch2num}}}{\emph{e}}{} Convert an epoch or sequence of epochs to the new date format, that is days since 0001. \end{fulllineitems} \index{num2epoch() (in module matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.num2epoch}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{num2epoch}}}{\emph{d}}{} Convert days since 0001 to epoch. \sphinxstyleemphasis{d} can be a number or sequence. \end{fulllineitems} \index{mx2num() (in module matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.mx2num}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{mx2num}}}{\emph{mxdates}}{} Convert mx \sphinxcode{\sphinxupquote{datetime}} instance (or sequence of mx instances) to the new date format. \end{fulllineitems} \index{DateFormatter (class in matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.DateFormatter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{DateFormatter}}}{\emph{fmt}, \emph{tz=None}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Formatter}}}}} Tick location is seconds since the epoch. Use a {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateFormatter.strftime}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{strftime()}}}}} format string. Python only supports \sphinxhref{https://docs.python.org/3/library/datetime.html\#module-datetime}{\sphinxcode{\sphinxupquote{datetime}}} {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateFormatter.strftime}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{strftime()}}}}} formatting for years greater than 1900. Thanks to Andrew Dalke, Dalke Scientific Software who contributed the {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateFormatter.strftime}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{strftime()}}}}} code below to include dates earlier than this year. \begin{description} \item[{\sphinxstyleemphasis{fmt} is a {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateFormatter.strftime}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{strftime()}}}}} format string; \sphinxstyleemphasis{tz} is the}] \leavevmode \sphinxcode{\sphinxupquote{tzinfo}} instance. \end{description} \index{illegal\_s (matplotlib.dates.DateFormatter attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.DateFormatter.illegal_s}}\pysigline{\sphinxbfcode{\sphinxupquote{illegal\_s}}\sphinxbfcode{\sphinxupquote{ = re.compile('((\textasciicircum{}\textbar{}{[}\textasciicircum{}\%{]})(\%\%)*\%s)')}}} \end{fulllineitems} \index{set\_tzinfo() (matplotlib.dates.DateFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.DateFormatter.set_tzinfo}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_tzinfo}}}{\emph{tz}}{}~ \end{fulllineitems} \index{strftime() (matplotlib.dates.DateFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.DateFormatter.strftime}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{strftime}}}{\emph{dt}, \emph{fmt=None}}{} Refer to documentation for \sphinxhref{https://docs.python.org/3/library/datetime.html\#datetime.datetime.strftime}{\sphinxcode{\sphinxupquote{datetime.datetime.strftime()}}} \sphinxstyleemphasis{fmt} is a \sphinxhref{https://docs.python.org/3/library/datetime.html\#datetime.datetime.strftime}{\sphinxcode{\sphinxupquote{datetime.datetime.strftime()}}} format string. Warning: For years before 1900, depending upon the current locale it is possible that the year displayed with \%x might be incorrect. For years before 100, \%y and \%Y will yield zero-padded strings. \end{fulllineitems} \index{strftime\_pre\_1900() (matplotlib.dates.DateFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.DateFormatter.strftime_pre_1900}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{strftime\_pre\_1900}}}{\emph{dt}, \emph{fmt=None}}{} Call time.strftime for years before 1900 by rolling forward a multiple of 28 years. \sphinxstyleemphasis{fmt} is a {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateFormatter.strftime}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{strftime()}}}}} format string. Dalke: I hope I did this math right. Every 28 years the calendar repeats, except through century leap years excepting the 400 year leap years. But only if you’re using the Gregorian calendar. \end{fulllineitems} \end{fulllineitems} \index{IndexDateFormatter (class in matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.IndexDateFormatter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{IndexDateFormatter}}}{\emph{t}, \emph{fmt}, \emph{tz=None}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Formatter}}}}} Use with {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.IndexLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{IndexLocator}}}}} to cycle format strings by index. \sphinxstyleemphasis{t} is a sequence of dates (floating point days). \sphinxstyleemphasis{fmt} is a \sphinxcode{\sphinxupquote{strftime()}} format string. \end{fulllineitems} \index{AutoDateFormatter (class in matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.AutoDateFormatter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{AutoDateFormatter}}}{\emph{locator}, \emph{tz=None}, \emph{defaultfmt='\%Y-\%m-\%d'}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Formatter}}}}} This class attempts to figure out the best format to use. This is most useful when used with the {\hyperref[\detokenize{api/dates_api:matplotlib.dates.AutoDateLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AutoDateLocator}}}}}. The AutoDateFormatter has a scale dictionary that maps the scale of the tick (the distance in days between one major tick) and a format string. The default looks like this: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{scaled} \PYG{o}{=} \PYG{p}{\PYGZob{}} \PYG{n}{DAYS\PYGZus{}PER\PYGZus{}YEAR}\PYG{p}{:} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date.autoformat.year}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{n}{DAYS\PYGZus{}PER\PYGZus{}MONTH}\PYG{p}{:} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date.autoformat.month}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{:} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date.autoformat.day}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{l+m+mf}{1.} \PYG{o}{/} \PYG{n}{HOURS\PYGZus{}PER\PYGZus{}DAY}\PYG{p}{:} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date.autoformat.hour}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{l+m+mf}{1.} \PYG{o}{/} \PYG{p}{(}\PYG{n}{MINUTES\PYGZus{}PER\PYGZus{}DAY}\PYG{p}{)}\PYG{p}{:} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date.autoformat.minute}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{l+m+mf}{1.} \PYG{o}{/} \PYG{p}{(}\PYG{n}{SEC\PYGZus{}PER\PYGZus{}DAY}\PYG{p}{)}\PYG{p}{:} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date.autoformat.second}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{l+m+mf}{1.} \PYG{o}{/} \PYG{p}{(}\PYG{n}{MUSECONDS\PYGZus{}PER\PYGZus{}DAY}\PYG{p}{)}\PYG{p}{:} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date.autoformat.microsecond}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{p}{\PYGZcb{}} \end{sphinxVerbatim} The algorithm picks the key in the dictionary that is \textgreater{}= the current scale and uses that format string. You can customize this dictionary by doing: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{locator} \PYG{o}{=} \PYG{n}{AutoDateLocator}\PYG{p}{(}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{formatter} \PYG{o}{=} \PYG{n}{AutoDateFormatter}\PYG{p}{(}\PYG{n}{locator}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{formatter}\PYG{o}{.}\PYG{n}{scaled}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{o}{/}\PYG{p}{(}\PYG{l+m+mf}{24.}\PYG{o}{*}\PYG{l+m+mf}{60.}\PYG{p}{)}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{M:}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{S}\PYG{l+s+s1}{\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} only show min and sec} \end{sphinxVerbatim} A custom {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.FuncFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FuncFormatter}}}}} can also be used. The following example shows how to use a custom format function to strip trailing zeros from decimal seconds and adds the date to the first ticklabel: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k}{def} \PYG{n+nf}{my\PYGZus{}format\PYGZus{}function}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{pos}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)}\PYG{p}{:} \PYG{g+gp}{... } \PYG{n}{x} \PYG{o}{=} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{dates}\PYG{o}{.}\PYG{n}{num2date}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)} \PYG{g+gp}{... } \PYG{k}{if} \PYG{n}{pos} \PYG{o}{==} \PYG{l+m+mi}{0}\PYG{p}{:} \PYG{g+gp}{... } \PYG{n}{fmt} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{D }\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{H:}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{M:}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{S.}\PYG{l+s+si}{\PYGZpc{}f}\PYG{l+s+s1}{\PYGZsq{}} \PYG{g+gp}{... } \PYG{k}{else}\PYG{p}{:} \PYG{g+gp}{... } \PYG{n}{fmt} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{H:}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{M:}\PYG{l+s+s1}{\PYGZpc{}}\PYG{l+s+s1}{S.}\PYG{l+s+si}{\PYGZpc{}f}\PYG{l+s+s1}{\PYGZsq{}} \PYG{g+gp}{... } \PYG{n}{label} \PYG{o}{=} \PYG{n}{x}\PYG{o}{.}\PYG{n}{strftime}\PYG{p}{(}\PYG{n}{fmt}\PYG{p}{)} \PYG{g+gp}{... } \PYG{n}{label} \PYG{o}{=} \PYG{n}{label}\PYG{o}{.}\PYG{n}{rstrip}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{0}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{g+gp}{... } \PYG{n}{label} \PYG{o}{=} \PYG{n}{label}\PYG{o}{.}\PYG{n}{rstrip}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{.}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{g+gp}{... } \PYG{k}{return} \PYG{n}{label} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{ticker} \PYG{k}{import} \PYG{n}{FuncFormatter} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{formatter}\PYG{o}{.}\PYG{n}{scaled}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{o}{/}\PYG{p}{(}\PYG{l+m+mf}{24.}\PYG{o}{*}\PYG{l+m+mf}{60.}\PYG{p}{)}\PYG{p}{]} \PYG{o}{=} \PYG{n}{FuncFormatter}\PYG{p}{(}\PYG{n}{my\PYGZus{}format\PYGZus{}function}\PYG{p}{)} \end{sphinxVerbatim} Autoformat the date labels. The default format is the one to use if none of the values in \sphinxcode{\sphinxupquote{self.scaled}} are greater than the unit returned by \sphinxcode{\sphinxupquote{locator.\_get\_unit()}}. \end{fulllineitems} \index{DateLocator (class in matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.DateLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{DateLocator}}}{\emph{tz=None}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Locator}}}}} Determines the tick locations when plotting dates. This class is subclassed by other Locators and is not meant to be used on its own. \sphinxstyleemphasis{tz} is a \sphinxcode{\sphinxupquote{tzinfo}} instance. \index{datalim\_to\_dt() (matplotlib.dates.DateLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.DateLocator.datalim_to_dt}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{datalim\_to\_dt}}}{}{} Convert axis data interval to datetime objects. \end{fulllineitems} \index{hms0d (matplotlib.dates.DateLocator attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.DateLocator.hms0d}}\pysigline{\sphinxbfcode{\sphinxupquote{hms0d}}\sphinxbfcode{\sphinxupquote{ = \{'byhour': 0, 'byminute': 0, 'bysecond': 0\}}}} \end{fulllineitems} \index{nonsingular() (matplotlib.dates.DateLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.DateLocator.nonsingular}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{nonsingular}}}{\emph{vmin}, \emph{vmax}}{} Given the proposed upper and lower extent, adjust the range if it is too close to being singular (i.e. a range of \textasciitilde{}0). \end{fulllineitems} \index{set\_tzinfo() (matplotlib.dates.DateLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.DateLocator.set_tzinfo}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_tzinfo}}}{\emph{tz}}{} Set time zone info. \end{fulllineitems} \index{viewlim\_to\_dt() (matplotlib.dates.DateLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.DateLocator.viewlim_to_dt}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{viewlim\_to\_dt}}}{}{} Converts the view interval to datetime objects. \end{fulllineitems} \end{fulllineitems} \index{RRuleLocator (class in matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.RRuleLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{RRuleLocator}}}{\emph{o}, \emph{tz=None}}{} Bases: {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.DateLocator}}}}} \index{autoscale() (matplotlib.dates.RRuleLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.RRuleLocator.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Set the view limits to include the data range. \end{fulllineitems} \index{get\_unit\_generic() (matplotlib.dates.RRuleLocator static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.RRuleLocator.get_unit_generic}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{get\_unit\_generic}}}{\emph{freq}}{}~ \end{fulllineitems} \index{tick\_values() (matplotlib.dates.RRuleLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.RRuleLocator.tick_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tick\_values}}}{\emph{vmin}, \emph{vmax}}{} Return the values of the located ticks given \sphinxstylestrong{vmin} and \sphinxstylestrong{vmax}. \begin{sphinxadmonition}{note}{Note:} To get tick locations with the vmin and vmax values defined automatically for the associated \sphinxcode{\sphinxupquote{axis}} simply call the Locator instance: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n+nb}{type}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{\PYGZlt{}type \PYGZsq{}Locator\PYGZsq{}\PYGZgt{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{[1, 2, 3, 4]} \end{sphinxVerbatim} \end{sphinxadmonition} \end{fulllineitems} \end{fulllineitems} \index{AutoDateLocator (class in matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.AutoDateLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{AutoDateLocator}}}{\emph{tz=None}, \emph{minticks=5}, \emph{maxticks=None}, \emph{interval\_multiples=False}}{} Bases: {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.DateLocator}}}}} On autoscale, this class picks the best {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{DateLocator}}}}} to set the view limits and the tick locations. \sphinxstyleemphasis{minticks} is the minimum number of ticks desired, which is used to select the type of ticking (yearly, monthly, etc.). \sphinxstyleemphasis{maxticks} is the maximum number of ticks desired, which controls any interval between ticks (ticking every other, every 3, etc.). For really fine-grained control, this can be a dictionary mapping individual rrule frequency constants (YEARLY, MONTHLY, etc.) to their own maximum number of ticks. This can be used to keep the number of ticks appropriate to the format chosen in {\hyperref[\detokenize{api/dates_api:matplotlib.dates.AutoDateFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AutoDateFormatter}}}}}. Any frequency not specified in this dictionary is given a default value. \sphinxstyleemphasis{tz} is a \sphinxcode{\sphinxupquote{tzinfo}} instance. \sphinxstyleemphasis{interval\_multiples} is a boolean that indicates whether ticks should be chosen to be multiple of the interval. This will lock ticks to ‘nicer’ locations. For example, this will force the ticks to be at hours 0,6,12,18 when hourly ticking is done at 6 hour intervals. The AutoDateLocator has an interval dictionary that maps the frequency of the tick (a constant from dateutil.rrule) and a multiple allowed for that ticking. The default looks like this: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{intervald} \PYG{o}{=} \PYG{p}{\PYGZob{}} \PYG{n}{YEARLY} \PYG{p}{:} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mi}{20}\PYG{p}{,} \PYG{l+m+mi}{40}\PYG{p}{,} \PYG{l+m+mi}{50}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{,} \PYG{l+m+mi}{200}\PYG{p}{,} \PYG{l+m+mi}{400}\PYG{p}{,} \PYG{l+m+mi}{500}\PYG{p}{,} \PYG{l+m+mi}{1000}\PYG{p}{,} \PYG{l+m+mi}{2000}\PYG{p}{,} \PYG{l+m+mi}{4000}\PYG{p}{,} \PYG{l+m+mi}{5000}\PYG{p}{,} \PYG{l+m+mi}{10000}\PYG{p}{]}\PYG{p}{,} \PYG{n}{MONTHLY} \PYG{p}{:} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{6}\PYG{p}{]}\PYG{p}{,} \PYG{n}{DAILY} \PYG{p}{:} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{7}\PYG{p}{,} \PYG{l+m+mi}{14}\PYG{p}{]}\PYG{p}{,} \PYG{n}{HOURLY} \PYG{p}{:} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{6}\PYG{p}{,} \PYG{l+m+mi}{12}\PYG{p}{]}\PYG{p}{,} \PYG{n}{MINUTELY}\PYG{p}{:} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mi}{15}\PYG{p}{,} \PYG{l+m+mi}{30}\PYG{p}{]}\PYG{p}{,} \PYG{n}{SECONDLY}\PYG{p}{:} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mi}{15}\PYG{p}{,} \PYG{l+m+mi}{30}\PYG{p}{]}\PYG{p}{,} \PYG{n}{MICROSECONDLY}\PYG{p}{:} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mi}{20}\PYG{p}{,} \PYG{l+m+mi}{50}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{,} \PYG{l+m+mi}{200}\PYG{p}{,} \PYG{l+m+mi}{500}\PYG{p}{,} \PYG{l+m+mi}{1000}\PYG{p}{,} \PYG{l+m+mi}{2000}\PYG{p}{,} \PYG{l+m+mi}{5000}\PYG{p}{,} \PYG{l+m+mi}{10000}\PYG{p}{,} \PYG{l+m+mi}{20000}\PYG{p}{,} \PYG{l+m+mi}{50000}\PYG{p}{,} \PYG{l+m+mi}{100000}\PYG{p}{,} \PYG{l+m+mi}{200000}\PYG{p}{,} \PYG{l+m+mi}{500000}\PYG{p}{,} \PYG{l+m+mi}{1000000}\PYG{p}{]}\PYG{p}{,} \PYG{p}{\PYGZcb{}} \end{sphinxVerbatim} The interval is used to specify multiples that are appropriate for the frequency of ticking. For instance, every 7 days is sensible for daily ticks, but for minutes/seconds, 15 or 30 make sense. You can customize this dictionary by doing: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{locator} \PYG{o}{=} \PYG{n}{AutoDateLocator}\PYG{p}{(}\PYG{p}{)} \PYG{n}{locator}\PYG{o}{.}\PYG{n}{intervald}\PYG{p}{[}\PYG{n}{HOURLY}\PYG{p}{]} \PYG{o}{=} \PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{]} \PYG{c+c1}{\PYGZsh{} only show every 3 hours} \end{sphinxVerbatim} \index{autoscale() (matplotlib.dates.AutoDateLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.AutoDateLocator.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Try to choose the view limits intelligently. \end{fulllineitems} \index{get\_locator() (matplotlib.dates.AutoDateLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.AutoDateLocator.get_locator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_locator}}}{\emph{dmin}, \emph{dmax}}{} Pick the best locator based on a distance. \end{fulllineitems} \index{nonsingular() (matplotlib.dates.AutoDateLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.AutoDateLocator.nonsingular}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{nonsingular}}}{\emph{vmin}, \emph{vmax}}{} Given the proposed upper and lower extent, adjust the range if it is too close to being singular (i.e. a range of \textasciitilde{}0). \end{fulllineitems} \index{refresh() (matplotlib.dates.AutoDateLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.AutoDateLocator.refresh}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{refresh}}}{}{} Refresh internal information based on current limits. \end{fulllineitems} \index{set\_axis() (matplotlib.dates.AutoDateLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.AutoDateLocator.set_axis}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_axis}}}{\emph{axis}}{}~ \end{fulllineitems} \index{tick\_values() (matplotlib.dates.AutoDateLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.AutoDateLocator.tick_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tick\_values}}}{\emph{vmin}, \emph{vmax}}{} Return the values of the located ticks given \sphinxstylestrong{vmin} and \sphinxstylestrong{vmax}. \begin{sphinxadmonition}{note}{Note:} To get tick locations with the vmin and vmax values defined automatically for the associated \sphinxcode{\sphinxupquote{axis}} simply call the Locator instance: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n+nb}{type}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{\PYGZlt{}type \PYGZsq{}Locator\PYGZsq{}\PYGZgt{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{[1, 2, 3, 4]} \end{sphinxVerbatim} \end{sphinxadmonition} \end{fulllineitems} \end{fulllineitems} \index{YearLocator (class in matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.YearLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{YearLocator}}}{\emph{base=1}, \emph{month=1}, \emph{day=1}, \emph{tz=None}}{} Bases: {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.DateLocator}}}}} Make ticks on a given day of each year that is a multiple of base. Examples: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} Tick every year on Jan 1st} \PYG{n}{locator} \PYG{o}{=} \PYG{n}{YearLocator}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Tick every 5 years on July 4th} \PYG{n}{locator} \PYG{o}{=} \PYG{n}{YearLocator}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{n}{month}\PYG{o}{=}\PYG{l+m+mi}{7}\PYG{p}{,} \PYG{n}{day}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{)} \end{sphinxVerbatim} Mark years that are multiple of base on a given month and day (default jan 1). \index{autoscale() (matplotlib.dates.YearLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.YearLocator.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} Set the view limits to include the data range. \end{fulllineitems} \index{tick\_values() (matplotlib.dates.YearLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.YearLocator.tick_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tick\_values}}}{\emph{vmin}, \emph{vmax}}{} Return the values of the located ticks given \sphinxstylestrong{vmin} and \sphinxstylestrong{vmax}. \begin{sphinxadmonition}{note}{Note:} To get tick locations with the vmin and vmax values defined automatically for the associated \sphinxcode{\sphinxupquote{axis}} simply call the Locator instance: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n+nb}{type}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{\PYGZlt{}type \PYGZsq{}Locator\PYGZsq{}\PYGZgt{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{[1, 2, 3, 4]} \end{sphinxVerbatim} \end{sphinxadmonition} \end{fulllineitems} \end{fulllineitems} \index{MonthLocator (class in matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.MonthLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{MonthLocator}}}{\emph{bymonth=None}, \emph{bymonthday=1}, \emph{interval=1}, \emph{tz=None}}{} Bases: {\hyperref[\detokenize{api/dates_api:matplotlib.dates.RRuleLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.RRuleLocator}}}}} Make ticks on occurrences of each month, e.g., 1, 3, 12. Mark every month in \sphinxstyleemphasis{bymonth}; \sphinxstyleemphasis{bymonth} can be an int or sequence. Default is \sphinxcode{\sphinxupquote{range(1,13)}}, i.e. every month. \sphinxstyleemphasis{interval} is the interval between each iteration. For example, if \sphinxcode{\sphinxupquote{interval=2}}, mark every second occurrence. \end{fulllineitems} \index{WeekdayLocator (class in matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.WeekdayLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{WeekdayLocator}}}{\emph{byweekday=1}, \emph{interval=1}, \emph{tz=None}}{} Bases: {\hyperref[\detokenize{api/dates_api:matplotlib.dates.RRuleLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.RRuleLocator}}}}} Make ticks on occurrences of each weekday. Mark every weekday in \sphinxstyleemphasis{byweekday}; \sphinxstyleemphasis{byweekday} can be a number or sequence. Elements of \sphinxstyleemphasis{byweekday} must be one of MO, TU, WE, TH, FR, SA, SU, the constants from \sphinxcode{\sphinxupquote{dateutil.rrule}}, which have been imported into the {\hyperref[\detokenize{api/dates_api:module-matplotlib.dates}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates}}}}} namespace. \sphinxstyleemphasis{interval} specifies the number of weeks to skip. For example, \sphinxcode{\sphinxupquote{interval=2}} plots every second week. \end{fulllineitems} \index{DayLocator (class in matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.DayLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{DayLocator}}}{\emph{bymonthday=None}, \emph{interval=1}, \emph{tz=None}}{} Bases: {\hyperref[\detokenize{api/dates_api:matplotlib.dates.RRuleLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.RRuleLocator}}}}} Make ticks on occurrences of each day of the month. For example, 1, 15, 30. Mark every day in \sphinxstyleemphasis{bymonthday}; \sphinxstyleemphasis{bymonthday} can be an int or sequence. Default is to tick every day of the month: \sphinxcode{\sphinxupquote{bymonthday=range(1,32)}} \end{fulllineitems} \index{HourLocator (class in matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.HourLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{HourLocator}}}{\emph{byhour=None}, \emph{interval=1}, \emph{tz=None}}{} Bases: {\hyperref[\detokenize{api/dates_api:matplotlib.dates.RRuleLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.RRuleLocator}}}}} Make ticks on occurrences of each hour. Mark every hour in \sphinxstyleemphasis{byhour}; \sphinxstyleemphasis{byhour} can be an int or sequence. Default is to tick every hour: \sphinxcode{\sphinxupquote{byhour=range(24)}} \sphinxstyleemphasis{interval} is the interval between each iteration. For example, if \sphinxcode{\sphinxupquote{interval=2}}, mark every second occurrence. \end{fulllineitems} \index{MinuteLocator (class in matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.MinuteLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{MinuteLocator}}}{\emph{byminute=None}, \emph{interval=1}, \emph{tz=None}}{} Bases: {\hyperref[\detokenize{api/dates_api:matplotlib.dates.RRuleLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.RRuleLocator}}}}} Make ticks on occurrences of each minute. Mark every minute in \sphinxstyleemphasis{byminute}; \sphinxstyleemphasis{byminute} can be an int or sequence. Default is to tick every minute: \sphinxcode{\sphinxupquote{byminute=range(60)}} \sphinxstyleemphasis{interval} is the interval between each iteration. For example, if \sphinxcode{\sphinxupquote{interval=2}}, mark every second occurrence. \end{fulllineitems} \index{SecondLocator (class in matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.SecondLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{SecondLocator}}}{\emph{bysecond=None}, \emph{interval=1}, \emph{tz=None}}{} Bases: {\hyperref[\detokenize{api/dates_api:matplotlib.dates.RRuleLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.RRuleLocator}}}}} Make ticks on occurrences of each second. Mark every second in \sphinxstyleemphasis{bysecond}; \sphinxstyleemphasis{bysecond} can be an int or sequence. Default is to tick every second: \sphinxcode{\sphinxupquote{bysecond = range(60)}} \sphinxstyleemphasis{interval} is the interval between each iteration. For example, if \sphinxcode{\sphinxupquote{interval=2}}, mark every second occurrence. \end{fulllineitems} \index{MicrosecondLocator (class in matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.MicrosecondLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{MicrosecondLocator}}}{\emph{interval=1}, \emph{tz=None}}{} Bases: {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.DateLocator}}}}} Make ticks on regular intervals of one or more microsecond(s). \begin{sphinxadmonition}{note}{Note:} Due to the floating point representation of time in days since 0001-01-01 UTC (plus 1), plotting data with microsecond time resolution does not work well with current dates. If you want microsecond resolution time plots, it is strongly recommended to use floating point seconds, not datetime-like time representation. If you really must use datetime.datetime() or similar and still need microsecond precision, your only chance is to use very early years; using year 0001 is recommended. \end{sphinxadmonition} \sphinxstyleemphasis{interval} is the interval between each iteration. For example, if \sphinxcode{\sphinxupquote{interval=2}}, mark every second microsecond. \index{set\_axis() (matplotlib.dates.MicrosecondLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.MicrosecondLocator.set_axis}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_axis}}}{\emph{axis}}{}~ \end{fulllineitems} \index{set\_data\_interval() (matplotlib.dates.MicrosecondLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.MicrosecondLocator.set_data_interval}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_data\_interval}}}{\emph{vmin}, \emph{vmax}}{}~ \end{fulllineitems} \index{set\_view\_interval() (matplotlib.dates.MicrosecondLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.MicrosecondLocator.set_view_interval}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_view\_interval}}}{\emph{vmin}, \emph{vmax}}{}~ \end{fulllineitems} \index{tick\_values() (matplotlib.dates.MicrosecondLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.MicrosecondLocator.tick_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tick\_values}}}{\emph{vmin}, \emph{vmax}}{} Return the values of the located ticks given \sphinxstylestrong{vmin} and \sphinxstylestrong{vmax}. \begin{sphinxadmonition}{note}{Note:} To get tick locations with the vmin and vmax values defined automatically for the associated \sphinxcode{\sphinxupquote{axis}} simply call the Locator instance: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n+nb}{type}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{\PYGZlt{}type \PYGZsq{}Locator\PYGZsq{}\PYGZgt{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{[1, 2, 3, 4]} \end{sphinxVerbatim} \end{sphinxadmonition} \end{fulllineitems} \end{fulllineitems} \index{rrule (class in matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.rrule}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{rrule}}}{\emph{freq}, \emph{dtstart=None}, \emph{interval=1}, \emph{wkst=None}, \emph{count=None}, \emph{until=None}, \emph{bysetpos=None}, \emph{bymonth=None}, \emph{bymonthday=None}, \emph{byyearday=None}, \emph{byeaster=None}, \emph{byweekno=None}, \emph{byweekday=None}, \emph{byhour=None}, \emph{byminute=None}, \emph{bysecond=None}, \emph{cache=False}}{} Bases: \sphinxcode{\sphinxupquote{dateutil.rrule.rrulebase}} That’s the base of the rrule operation. It accepts all the keywords defined in the RFC as its constructor parameters (except byday, which was renamed to byweekday) and more. The constructor prototype is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{rrule}\PYG{p}{(}\PYG{n}{freq}\PYG{p}{)} \end{sphinxVerbatim} Where freq must be one of YEARLY, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, or SECONDLY. \begin{sphinxadmonition}{note}{Note:} Per RFC section 3.3.10, recurrence instances falling on invalid dates and times are ignored rather than coerced: \begin{quote} Recurrence rules may generate recurrence instances with an invalid date (e.g., February 30) or nonexistent local time (e.g., 1:30 AM on a day where the local time is moved forward by an hour at 1:00 AM). Such recurrence instances MUST be ignored and MUST NOT be counted as part of the recurrence set. \end{quote} This can lead to possibly surprising behavior when, for example, the start date occurs at the end of the month: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{dateutil}\PYG{n+nn}{.}\PYG{n+nn}{rrule} \PYG{k}{import} \PYG{n}{rrule}\PYG{p}{,} \PYG{n}{MONTHLY} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{datetime} \PYG{k}{import} \PYG{n}{datetime} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{start\PYGZus{}date} \PYG{o}{=} \PYG{n}{datetime}\PYG{p}{(}\PYG{l+m+mi}{2014}\PYG{p}{,} \PYG{l+m+mi}{12}\PYG{p}{,} \PYG{l+m+mi}{31}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{list}\PYG{p}{(}\PYG{n}{rrule}\PYG{p}{(}\PYG{n}{freq}\PYG{o}{=}\PYG{n}{MONTHLY}\PYG{p}{,} \PYG{n}{count}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{n}{dtstart}\PYG{o}{=}\PYG{n}{start\PYGZus{}date}\PYG{p}{)}\PYG{p}{)} \PYG{g+gp}{... } \PYG{g+go}{[datetime.datetime(2014, 12, 31, 0, 0),} \PYG{g+go}{ datetime.datetime(2015, 1, 31, 0, 0),} \PYG{g+go}{ datetime.datetime(2015, 3, 31, 0, 0),} \PYG{g+go}{ datetime.datetime(2015, 5, 31, 0, 0)]} \end{sphinxVerbatim} \end{sphinxadmonition} Additionally, it supports the following keyword arguments: \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{itemize} \item {} \sphinxstyleliteralstrong{\sphinxupquote{dtstart}} \textendash{} The recurrence start. Besides being the base for the recurrence, missing parameters in the final recurrence instances will also be extracted from this date. If not given, datetime.now() will be used instead. \item {} \sphinxstyleliteralstrong{\sphinxupquote{interval}} \textendash{} The interval between each freq iteration. For example, when using YEARLY, an interval of 2 means once every two years, but with HOURLY, it means once every two hours. The default interval is 1. \item {} \sphinxstyleliteralstrong{\sphinxupquote{wkst}} \textendash{} The week start day. Must be one of the MO, TU, WE constants, or an integer, specifying the first day of the week. This will affect recurrences based on weekly periods. The default week start is got from calendar.firstweekday(), and may be modified by calendar.setfirstweekday(). \item {} \sphinxstyleliteralstrong{\sphinxupquote{count}} \textendash{} How many occurrences will be generated. \begin{sphinxadmonition}{note}{Note:} As of version 2.5.0, the use of the \sphinxcode{\sphinxupquote{until}} keyword together with the \sphinxcode{\sphinxupquote{count}} keyword is deprecated per RFC-5545 Sec. 3.3.10. \end{sphinxadmonition} \item {} \sphinxstyleliteralstrong{\sphinxupquote{until}} \textendash{} If given, this must be a datetime instance, that will specify the limit of the recurrence. The last recurrence in the rule is the greatest datetime that is less than or equal to the value specified in the \sphinxcode{\sphinxupquote{until}} parameter. \begin{sphinxadmonition}{note}{Note:} As of version 2.5.0, the use of the \sphinxcode{\sphinxupquote{until}} keyword together with the \sphinxcode{\sphinxupquote{count}} keyword is deprecated per RFC-5545 Sec. 3.3.10. \end{sphinxadmonition} \item {} \sphinxstyleliteralstrong{\sphinxupquote{bysetpos}} \textendash{} If given, it must be either an integer, or a sequence of integers, positive or negative. Each given integer will specify an occurrence number, corresponding to the nth occurrence of the rule inside the frequency period. For example, a bysetpos of -1 if combined with a MONTHLY frequency, and a byweekday of (MO, TU, WE, TH, FR), will result in the last work day of every month. \item {} \sphinxstyleliteralstrong{\sphinxupquote{bymonth}} \textendash{} If given, it must be either an integer, or a sequence of integers, meaning the months to apply the recurrence to. \item {} \sphinxstyleliteralstrong{\sphinxupquote{bymonthday}} \textendash{} If given, it must be either an integer, or a sequence of integers, meaning the month days to apply the recurrence to. \item {} \sphinxstyleliteralstrong{\sphinxupquote{byyearday}} \textendash{} If given, it must be either an integer, or a sequence of integers, meaning the year days to apply the recurrence to. \item {} \sphinxstyleliteralstrong{\sphinxupquote{byeaster}} \textendash{} If given, it must be either an integer, or a sequence of integers, positive or negative. Each integer will define an offset from the Easter Sunday. Passing the offset 0 to byeaster will yield the Easter Sunday itself. This is an extension to the RFC specification. \item {} \sphinxstyleliteralstrong{\sphinxupquote{byweekno}} \textendash{} If given, it must be either an integer, or a sequence of integers, meaning the week numbers to apply the recurrence to. Week numbers have the meaning described in ISO8601, that is, the first week of the year is that containing at least four days of the new year. \item {} \sphinxstyleliteralstrong{\sphinxupquote{byweekday}} \textendash{} If given, it must be either an integer (0 == MO), a sequence of integers, one of the weekday constants (MO, TU, etc), or a sequence of these constants. When given, these variables will define the weekdays where the recurrence will be applied. It’s also possible to use an argument n for the weekday instances, which will mean the nth occurrence of this weekday in the period. For example, with MONTHLY, or with YEARLY and BYMONTH, using FR(+1) in byweekday will specify the first friday of the month where the recurrence happens. Notice that in the RFC documentation, this is specified as BYDAY, but was renamed to avoid the ambiguity of that keyword. \item {} \sphinxstyleliteralstrong{\sphinxupquote{byhour}} \textendash{} If given, it must be either an integer, or a sequence of integers, meaning the hours to apply the recurrence to. \item {} \sphinxstyleliteralstrong{\sphinxupquote{byminute}} \textendash{} If given, it must be either an integer, or a sequence of integers, meaning the minutes to apply the recurrence to. \item {} \sphinxstyleliteralstrong{\sphinxupquote{bysecond}} \textendash{} If given, it must be either an integer, or a sequence of integers, meaning the seconds to apply the recurrence to. \item {} \sphinxstyleliteralstrong{\sphinxupquote{cache}} \textendash{} If given, it must be a boolean value specifying to enable or disable caching of results. If you will use the same rrule instance multiple times, enabling caching will improve the performance considerably. \end{itemize} \end{description}\end{quote} \index{replace() (matplotlib.dates.rrule method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.rrule.replace}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{replace}}}{\emph{**kwargs}}{} Return new rrule with same attributes except for those attributes given new values by whichever keyword arguments are specified. \end{fulllineitems} \end{fulllineitems} \index{relativedelta (class in matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.relativedelta}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{relativedelta}}}{\emph{dt1=None}, \emph{dt2=None}, \emph{years=0}, \emph{months=0}, \emph{days=0}, \emph{leapdays=0}, \emph{weeks=0}, \emph{hours=0}, \emph{minutes=0}, \emph{seconds=0}, \emph{microseconds=0}, \emph{year=None}, \emph{month=None}, \emph{day=None}, \emph{weekday=None}, \emph{yearday=None}, \emph{nlyearday=None}, \emph{hour=None}, \emph{minute=None}, \emph{second=None}, \emph{microsecond=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} The relativedelta type is based on the specification of the excellent work done by M.-A. Lemburg in his \sphinxhref{https://www.egenix.com/products/python/mxBase/mxDateTime/}{mx.DateTime} extension. However, notice that this type does \sphinxstyleemphasis{NOT} implement the same algorithm as his work. Do \sphinxstyleemphasis{NOT} expect it to behave like mx.DateTime’s counterpart. There are two different ways to build a relativedelta instance. The first one is passing it two date/datetime classes: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{relativedelta}\PYG{p}{(}\PYG{n}{datetime1}\PYG{p}{,} \PYG{n}{datetime2}\PYG{p}{)} \end{sphinxVerbatim} The second one is passing it any number of the following keyword arguments: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{relativedelta}\PYG{p}{(}\PYG{n}{arg1}\PYG{o}{=}\PYG{n}{x}\PYG{p}{,}\PYG{n}{arg2}\PYG{o}{=}\PYG{n}{y}\PYG{p}{,}\PYG{n}{arg3}\PYG{o}{=}\PYG{n}{z}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{year}\PYG{p}{,} \PYG{n}{month}\PYG{p}{,} \PYG{n}{day}\PYG{p}{,} \PYG{n}{hour}\PYG{p}{,} \PYG{n}{minute}\PYG{p}{,} \PYG{n}{second}\PYG{p}{,} \PYG{n}{microsecond}\PYG{p}{:} \PYG{n}{Absolute} \PYG{n}{information} \PYG{p}{(}\PYG{n}{argument} \PYG{o+ow}{is} \PYG{n}{singular}\PYG{p}{)}\PYG{p}{;} \PYG{n}{adding} \PYG{o+ow}{or} \PYG{n}{subtracting} \PYG{n}{a} \PYG{n}{relativedelta} \PYG{k}{with} \PYG{n}{absolute} \PYG{n}{information} \PYG{n}{does} \PYG{o+ow}{not} \PYG{n}{perform} \PYG{n}{an} \PYG{n}{arithmetic} \PYG{n}{operation}\PYG{p}{,} \PYG{n}{but} \PYG{n}{rather} \PYG{n}{REPLACES} \PYG{n}{the} \PYG{n}{corresponding} \PYG{n}{value} \PYG{o+ow}{in} \PYG{n}{the} \PYG{n}{original} \PYG{n}{datetime} \PYG{k}{with} \PYG{n}{the} \PYG{n}{value}\PYG{p}{(}\PYG{n}{s}\PYG{p}{)} \PYG{o+ow}{in} \PYG{n}{relativedelta}\PYG{o}{.} \PYG{n}{years}\PYG{p}{,} \PYG{n}{months}\PYG{p}{,} \PYG{n}{weeks}\PYG{p}{,} \PYG{n}{days}\PYG{p}{,} \PYG{n}{hours}\PYG{p}{,} \PYG{n}{minutes}\PYG{p}{,} \PYG{n}{seconds}\PYG{p}{,} \PYG{n}{microseconds}\PYG{p}{:} \PYG{n}{Relative} \PYG{n}{information}\PYG{p}{,} \PYG{n}{may} \PYG{n}{be} \PYG{n}{negative} \PYG{p}{(}\PYG{n}{argument} \PYG{o+ow}{is} \PYG{n}{plural}\PYG{p}{)}\PYG{p}{;} \PYG{n}{adding} \PYG{o+ow}{or} \PYG{n}{subtracting} \PYG{n}{a} \PYG{n}{relativedelta} \PYG{k}{with} \PYG{n}{relative} \PYG{n}{information} \PYG{n}{performs} \PYG{n}{the} \PYG{n}{corresponding} \PYG{n}{aritmetic} \PYG{n}{operation} \PYG{n}{on} \PYG{n}{the} \PYG{n}{original} \PYG{n}{datetime} \PYG{n}{value} \PYG{k}{with} \PYG{n}{the} \PYG{n}{information} \PYG{o+ow}{in} \PYG{n}{the} \PYG{n}{relativedelta}\PYG{o}{.} \PYG{n}{weekday}\PYG{p}{:} \PYG{n}{One} \PYG{n}{of} \PYG{n}{the} \PYG{n}{weekday} \PYG{n}{instances} \PYG{p}{(}\PYG{n}{MO}\PYG{p}{,} \PYG{n}{TU}\PYG{p}{,} \PYG{n}{etc}\PYG{p}{)}\PYG{o}{.} \PYG{n}{These} \PYG{n}{instances} \PYG{n}{may} \PYG{n}{receive} \PYG{n}{a} \PYG{n}{parameter} \PYG{n}{N}\PYG{p}{,} \PYG{n}{specifying} \PYG{n}{the} \PYG{n}{Nth} \PYG{n}{weekday}\PYG{p}{,} \PYG{n}{which} \PYG{n}{could} \PYG{n}{be} \PYG{n}{positive} \PYG{o+ow}{or} \PYG{n}{negative} \PYG{p}{(}\PYG{n}{like} \PYG{n}{MO}\PYG{p}{(}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{o+ow}{or} \PYG{n}{MO}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{2}\PYG{p}{)}\PYG{o}{.} \PYG{n}{Not} \PYG{n}{specifying} \PYG{n}{it} \PYG{o+ow}{is} \PYG{n}{the} \PYG{n}{same} \PYG{k}{as} \PYG{n}{specifying} \PYG{o}{+}\PYG{l+m+mf}{1.} \PYG{n}{You} \PYG{n}{can} \PYG{n}{also} \PYG{n}{use} \PYG{n}{an} \PYG{n}{integer}\PYG{p}{,} \PYG{n}{where} \PYG{l+m+mi}{0}\PYG{o}{=}\PYG{n}{MO}\PYG{o}{.} \PYG{n}{Notice} \PYG{n}{that} \PYG{k}{if} \PYG{n}{the} \PYG{n}{calculated} \PYG{n}{date} \PYG{o+ow}{is} \PYG{n}{already} \PYG{n}{Monday}\PYG{p}{,} \PYG{k}{for} \PYG{n}{example}\PYG{p}{,} \PYG{n}{using} \PYG{n}{MO}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{o+ow}{or} \PYG{n}{MO}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{won}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{t change the day.} \PYG{n}{leapdays}\PYG{p}{:} \PYG{n}{Will} \PYG{n}{add} \PYG{n}{given} \PYG{n}{days} \PYG{n}{to} \PYG{n}{the} \PYG{n}{date} \PYG{n}{found}\PYG{p}{,} \PYG{k}{if} \PYG{n}{year} \PYG{o+ow}{is} \PYG{n}{a} \PYG{n}{leap} \PYG{n}{year}\PYG{p}{,} \PYG{o+ow}{and} \PYG{n}{the} \PYG{n}{date} \PYG{n}{found} \PYG{o+ow}{is} \PYG{n}{post} \PYG{l+m+mi}{28} \PYG{n}{of} \PYG{n}{february}\PYG{o}{.} \PYG{n}{yearday}\PYG{p}{,} \PYG{n}{nlyearday}\PYG{p}{:} \PYG{n}{Set} \PYG{n}{the} \PYG{n}{yearday} \PYG{o+ow}{or} \PYG{n}{the} \PYG{n}{non}\PYG{o}{\PYGZhy{}}\PYG{n}{leap} \PYG{n}{year} \PYG{n}{day} \PYG{p}{(}\PYG{n}{jump} \PYG{n}{leap} \PYG{n}{days}\PYG{p}{)}\PYG{o}{.} \PYG{n}{These} \PYG{n}{are} \PYG{n}{converted} \PYG{n}{to} \PYG{n}{day}\PYG{o}{/}\PYG{n}{month}\PYG{o}{/}\PYG{n}{leapdays} \PYG{n}{information}\PYG{o}{.} \end{sphinxVerbatim} There are relative and absolute forms of the keyword arguments. The plural is relative, and the singular is absolute. For each argument in the order below, the absolute form is applied first (by setting each attribute to that value) and then the relative form (by adding the value to the attribute). The order of attributes considered when this relativedelta is added to a datetime is: \begin{enumerate} \item {} Year \item {} Month \item {} Day \item {} Hours \item {} Minutes \item {} Seconds \item {} Microseconds \end{enumerate} Finally, weekday is applied, using the rule described above. For example \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{dt} \PYG{o}{=} \PYG{n}{datetime}\PYG{p}{(}\PYG{l+m+mi}{2018}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{9}\PYG{p}{,} \PYG{l+m+mi}{13}\PYG{p}{,} \PYG{l+m+mi}{37}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{delta} \PYG{o}{=} \PYG{n}{relativedelta}\PYG{p}{(}\PYG{n}{hours}\PYG{o}{=}\PYG{l+m+mi}{25}\PYG{p}{,} \PYG{n}{day}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{weekday}\PYG{o}{=}\PYG{n}{MO}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{datetime(2018, 4, 2, 14, 37, 0)} \end{sphinxVerbatim} First, the day is set to 1 (the first of the month), then 25 hours are added, to get to the 2nd day and 14th hour, finally the weekday is applied, but since the 2nd is already a Monday there is no effect. \index{normalized() (matplotlib.dates.relativedelta method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.relativedelta.normalized}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{normalized}}}{}{} Return a version of this object represented entirely using integer values for the relative attributes. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{relativedelta}\PYG{p}{(}\PYG{n}{days}\PYG{o}{=}\PYG{l+m+mf}{1.5}\PYG{p}{,} \PYG{n}{hours}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)}\PYG{o}{.}\PYG{n}{normalized}\PYG{p}{(}\PYG{p}{)} \PYG{g+go}{relativedelta(days=1, hours=14)} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Returns}] \leavevmode Returns a \sphinxcode{\sphinxupquote{dateutil.relativedelta.relativedelta}} object. \end{description}\end{quote} \end{fulllineitems} \index{weeks (matplotlib.dates.relativedelta attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.relativedelta.weeks}}\pysigline{\sphinxbfcode{\sphinxupquote{weeks}}}~ \end{fulllineitems} \end{fulllineitems} \index{seconds() (in module matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.seconds}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{seconds}}}{\emph{s}}{} Return seconds as days. \end{fulllineitems} \index{minutes() (in module matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.minutes}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{minutes}}}{\emph{m}}{} Return minutes as days. \end{fulllineitems} \index{hours() (in module matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.hours}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{hours}}}{\emph{h}}{} Return hours as days. \end{fulllineitems} \index{weeks() (in module matplotlib.dates)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dates_api:matplotlib.dates.weeks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.dates.}}\sphinxbfcode{\sphinxupquote{weeks}}}{\emph{w}}{} Return weeks as days. \end{fulllineitems} \chapter{dviread} \label{\detokenize{api/dviread:dviread}}\label{\detokenize{api/dviread::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.dviread}}} \label{\detokenize{api/dviread:module-matplotlib.dviread}}\label{\detokenize{api/dviread:matplotlib-dviread}}\index{matplotlib.dviread (module)} A module for reading dvi files output by TeX. Several limitations make this not (currently) useful as a general-purpose dvi preprocessor, but it is currently used by the pdf backend for processing usetex text. Interface: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{with} \PYG{n}{Dvi}\PYG{p}{(}\PYG{n}{filename}\PYG{p}{,} \PYG{l+m+mi}{72}\PYG{p}{)} \PYG{k}{as} \PYG{n}{dvi}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} iterate over pages:} \PYG{k}{for} \PYG{n}{page} \PYG{o+ow}{in} \PYG{n}{dvi}\PYG{p}{:} \PYG{n}{w}\PYG{p}{,} \PYG{n}{h}\PYG{p}{,} \PYG{n}{d} \PYG{o}{=} \PYG{n}{page}\PYG{o}{.}\PYG{n}{width}\PYG{p}{,} \PYG{n}{page}\PYG{o}{.}\PYG{n}{height}\PYG{p}{,} \PYG{n}{page}\PYG{o}{.}\PYG{n}{descent} \PYG{k}{for} \PYG{n}{x}\PYG{p}{,}\PYG{n}{y}\PYG{p}{,}\PYG{n}{font}\PYG{p}{,}\PYG{n}{glyph}\PYG{p}{,}\PYG{n}{width} \PYG{o+ow}{in} \PYG{n}{page}\PYG{o}{.}\PYG{n}{text}\PYG{p}{:} \PYG{n}{fontname} \PYG{o}{=} \PYG{n}{font}\PYG{o}{.}\PYG{n}{texname} \PYG{n}{pointsize} \PYG{o}{=} \PYG{n}{font}\PYG{o}{.}\PYG{n}{size} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.} \PYG{k}{for} \PYG{n}{x}\PYG{p}{,}\PYG{n}{y}\PYG{p}{,}\PYG{n}{height}\PYG{p}{,}\PYG{n}{width} \PYG{o+ow}{in} \PYG{n}{page}\PYG{o}{.}\PYG{n}{boxes}\PYG{p}{:} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.} \end{sphinxVerbatim} \index{Dvi (class in matplotlib.dviread)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.Dvi}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dviread.}}\sphinxbfcode{\sphinxupquote{Dvi}}}{\emph{filename}, \emph{dpi}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} A reader for a dvi (“device-independent”) file, as produced by TeX. The current implementation can only iterate through pages in order, and does not even attempt to verify the postamble. This class can be used as a context manager to close the underlying file upon exit. Pages can be read via iteration. Here is an overly simple way to extract text without trying to detect whitespace: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k}{with} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{dviread}\PYG{o}{.}\PYG{n}{Dvi}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{input.dvi}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+m+mi}{72}\PYG{p}{)} \PYG{k}{as} \PYG{n}{dvi}\PYG{p}{:} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} } \PYG{k}{for} \PYG{n}{page} \PYG{o+ow}{in} \PYG{n}{dvi}\PYG{p}{:} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} } \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{.}\PYG{n}{join}\PYG{p}{(}\PYG{n}{unichr}\PYG{p}{(}\PYG{n}{t}\PYG{o}{.}\PYG{n}{glyph}\PYG{p}{)} \PYG{k}{for} \PYG{n}{t} \PYG{o+ow}{in} \PYG{n}{page}\PYG{o}{.}\PYG{n}{text}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} Read the data from the file named \sphinxstyleemphasis{filename} and convert TeX’s internal units to units of \sphinxstyleemphasis{dpi} per inch. \sphinxstyleemphasis{dpi} only sets the units and does not limit the resolution. Use None to return TeX’s internal units. \index{close() (matplotlib.dviread.Dvi method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.Dvi.close}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{close}}}{}{} Close the underlying file if it is open. \end{fulllineitems} \end{fulllineitems} \index{DviFont (class in matplotlib.dviread)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.DviFont}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dviread.}}\sphinxbfcode{\sphinxupquote{DviFont}}}{\emph{scale}, \emph{tfm}, \emph{texname}, \emph{vf}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Encapsulation of a font that a DVI file can refer to. This class holds a font’s texname and size, supports comparison, and knows the widths of glyphs in the same units as the AFM file. There are also internal attributes (for use by dviread.py) that are \sphinxstyleemphasis{not} used for comparison. The size is in Adobe points (converted from TeX points). \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float{]} Factor by which the font is scaled from its natural size. \item[{\sphinxstylestrong{tfm}}] \leavevmode{[}Tfm{]} TeX font metrics for this font \item[{\sphinxstylestrong{texname}}] \leavevmode{[}bytes{]} Name of the font as used internally by TeX and friends, as an ASCII bytestring. This is usually very different from any external font names, and \sphinxcode{\sphinxupquote{dviread.PsfontsMap}} can be used to find the external name of the font. \item[{\sphinxstylestrong{vf}}] \leavevmode{[}Vf{]} A TeX “virtual font” file, or None if this font is not virtual. \end{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{texname}}] \leavevmode{[}bytes{]} \item[{\sphinxstylestrong{size}}] \leavevmode{[}float{]} Size of the font in Adobe points, converted from the slightly smaller TeX points. \item[{\sphinxstylestrong{widths}}] \leavevmode{[}list{]} Widths of glyphs in glyph-space units, typically 1/1000ths of the point size. \end{description} \end{description}\end{quote} \index{size (matplotlib.dviread.DviFont attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.DviFont.size}}\pysigline{\sphinxbfcode{\sphinxupquote{size}}}~ \end{fulllineitems} \index{texname (matplotlib.dviread.DviFont attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.DviFont.texname}}\pysigline{\sphinxbfcode{\sphinxupquote{texname}}}~ \end{fulllineitems} \index{widths (matplotlib.dviread.DviFont attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.DviFont.widths}}\pysigline{\sphinxbfcode{\sphinxupquote{widths}}}~ \end{fulllineitems} \end{fulllineitems} \index{Encoding (class in matplotlib.dviread)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.Encoding}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dviread.}}\sphinxbfcode{\sphinxupquote{Encoding}}}{\emph{filename}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Parses a *.enc file referenced from a psfonts.map style file. The format this class understands is a very limited subset of PostScript. Usage (subject to change): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{for} \PYG{n}{name} \PYG{o+ow}{in} \PYG{n}{Encoding}\PYG{p}{(}\PYG{n}{filename}\PYG{p}{)}\PYG{p}{:} \PYG{n}{whatever}\PYG{p}{(}\PYG{n}{name}\PYG{p}{)} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filename}}] \leavevmode{[}string or bytestring{]} \end{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{encoding}}] \leavevmode{[}list{]} List of character names \end{description} \end{description}\end{quote} \index{encoding (matplotlib.dviread.Encoding attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.Encoding.encoding}}\pysigline{\sphinxbfcode{\sphinxupquote{encoding}}}~ \end{fulllineitems} \end{fulllineitems} \index{PsFont (in module matplotlib.dviread)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.PsFont}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.dviread.}}\sphinxbfcode{\sphinxupquote{PsFont}}} alias of \sphinxcode{\sphinxupquote{matplotlib.dviread.Font}} \end{fulllineitems} \index{PsfontsMap (class in matplotlib.dviread)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.PsfontsMap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dviread.}}\sphinxbfcode{\sphinxupquote{PsfontsMap}}}{\emph{filename}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} A psfonts.map formatted file, mapping TeX fonts to PS fonts. Usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{map} \PYG{o}{=} \PYG{n}{PsfontsMap}\PYG{p}{(}\PYG{n}{find\PYGZus{}tex\PYGZus{}file}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{pdftex.map}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{entry} \PYG{o}{=} \PYG{n+nb}{map}\PYG{p}{[}\PYG{l+s+sa}{b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ptmbo8r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{entry}\PYG{o}{.}\PYG{n}{texname} \PYG{g+go}{b\PYGZsq{}ptmbo8r\PYGZsq{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{entry}\PYG{o}{.}\PYG{n}{psname} \PYG{g+go}{b\PYGZsq{}Times\PYGZhy{}Bold\PYGZsq{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{entry}\PYG{o}{.}\PYG{n}{encoding} \PYG{g+go}{\PYGZsq{}/usr/local/texlive/2008/texmf\PYGZhy{}dist/fonts/enc/dvips/base/8r.enc\PYGZsq{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{entry}\PYG{o}{.}\PYG{n}{effects} \PYG{g+go}{\PYGZob{}\PYGZsq{}slant\PYGZsq{}: 0.16700000000000001\PYGZcb{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{entry}\PYG{o}{.}\PYG{n}{filename} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filename}}] \leavevmode{[}string or bytestring{]} \end{description} \end{description}\end{quote} \paragraph{Notes} For historical reasons, TeX knows many Type-1 fonts by different names than the outside world. (For one thing, the names have to fit in eight characters.) Also, TeX’s native fonts are not Type-1 but Metafont, which is nontrivial to convert to PostScript except as a bitmap. While high-quality conversions to Type-1 format exist and are shipped with modern TeX distributions, we need to know which Type-1 fonts are the counterparts of which native fonts. For these reasons a mapping is needed from internal font names to font file names. A texmf tree typically includes mapping files called e.g. \sphinxcode{\sphinxupquote{psfonts.map}}, \sphinxcode{\sphinxupquote{pdftex.map}}, or \sphinxcode{\sphinxupquote{dvipdfm.map}}. The file \sphinxcode{\sphinxupquote{psfonts.map}} is used by \sphinxstyleliteralstrong{\sphinxupquote{dvips}}, \sphinxcode{\sphinxupquote{pdftex.map}} by \sphinxstyleliteralstrong{\sphinxupquote{pdfTeX}}, and \sphinxcode{\sphinxupquote{dvipdfm.map}} by \sphinxstyleliteralstrong{\sphinxupquote{dvipdfm}}. \sphinxcode{\sphinxupquote{psfonts.map}} might avoid embedding the 35 PostScript fonts (i.e., have no filename for them, as in the Times-Bold example above), while the pdf-related files perhaps only avoid the “Base 14” pdf fonts. But the user may have configured these files differently. \end{fulllineitems} \index{Tfm (class in matplotlib.dviread)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.Tfm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dviread.}}\sphinxbfcode{\sphinxupquote{Tfm}}}{\emph{filename}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} A TeX Font Metric file. This implementation covers only the bare minimum needed by the Dvi class. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filename}}] \leavevmode{[}string or bytestring{]} \end{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{checksum}}] \leavevmode{[}int{]} Used for verifying against the dvi file. \item[{\sphinxstylestrong{design\_size}}] \leavevmode{[}int{]} Design size of the font (unknown units) \item[{\sphinxstylestrong{width, height, depth}}] \leavevmode{[}dict{]} Dimensions of each character, need to be scaled by the factor specified in the dvi file. These are dicts because indexing may not start from 0. \end{description} \end{description}\end{quote} \index{checksum (matplotlib.dviread.Tfm attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.Tfm.checksum}}\pysigline{\sphinxbfcode{\sphinxupquote{checksum}}}~ \end{fulllineitems} \index{depth (matplotlib.dviread.Tfm attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.Tfm.depth}}\pysigline{\sphinxbfcode{\sphinxupquote{depth}}}~ \end{fulllineitems} \index{design\_size (matplotlib.dviread.Tfm attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.Tfm.design_size}}\pysigline{\sphinxbfcode{\sphinxupquote{design\_size}}}~ \end{fulllineitems} \index{height (matplotlib.dviread.Tfm attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.Tfm.height}}\pysigline{\sphinxbfcode{\sphinxupquote{height}}}~ \end{fulllineitems} \index{width (matplotlib.dviread.Tfm attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.Tfm.width}}\pysigline{\sphinxbfcode{\sphinxupquote{width}}}~ \end{fulllineitems} \end{fulllineitems} \index{Vf (class in matplotlib.dviread)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.Vf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.dviread.}}\sphinxbfcode{\sphinxupquote{Vf}}}{\emph{filename}}{} Bases: {\hyperref[\detokenize{api/dviread:matplotlib.dviread.Dvi}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dviread.Dvi}}}}} A virtual font (*.vf file) containing subroutines for dvi files. Usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{vf} \PYG{o}{=} \PYG{n}{Vf}\PYG{p}{(}\PYG{n}{filename}\PYG{p}{)} \PYG{n}{glyph} \PYG{o}{=} \PYG{n}{vf}\PYG{p}{[}\PYG{n}{code}\PYG{p}{]} \PYG{n}{glyph}\PYG{o}{.}\PYG{n}{text}\PYG{p}{,} \PYG{n}{glyph}\PYG{o}{.}\PYG{n}{boxes}\PYG{p}{,} \PYG{n}{glyph}\PYG{o}{.}\PYG{n}{width} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filename}}] \leavevmode{[}string or bytestring{]} \end{description} \end{description}\end{quote} \paragraph{Notes} The virtual font format is a derivative of dvi: \sphinxurl{http://mirrors.ctan.org/info/knuth/virtual-fonts} This class reuses some of the machinery of {\hyperref[\detokenize{api/dviread:matplotlib.dviread.Dvi}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Dvi}}}}} but replaces the \sphinxcode{\sphinxupquote{\_read}} loop and dispatch mechanism. \end{fulllineitems} \index{find\_tex\_file() (in module matplotlib.dviread)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.find_tex_file}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.dviread.}}\sphinxbfcode{\sphinxupquote{find\_tex\_file}}}{\emph{filename}, \emph{format=None}}{} Find a file in the texmf tree. Calls \sphinxstyleliteralstrong{\sphinxupquote{kpsewhich}} which is an interface to the kpathsea library \phantomsection\label{\detokenize{api/dviread:id1}}{\hyperref[\detokenize{api/dviread:ra043a4f19cd5-1}]{\sphinxcrossref{{[}1{]}}}}. Most existing TeX distributions on Unix-like systems use kpathsea. It is also available as part of MikTeX, a popular distribution on Windows. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filename}}] \leavevmode{[}string or bytestring{]} \item[{\sphinxstylestrong{format}}] \leavevmode{[}string or bytestring{]} Used as the value of the \sphinxcode{\sphinxupquote{-{-}format}} option to \sphinxstyleliteralstrong{\sphinxupquote{kpsewhich}}. Could be e.g. ‘tfm’ or ‘vf’ to limit the search to that type of files. \end{description} \end{description}\end{quote} \paragraph{References} \phantomsection\label{\detokenize{api/dviread:id2}}{\hyperref[\detokenize{api/dviread:ra043a4f19cd5-1}]{\sphinxcrossref{{[}1{]}}}} \end{fulllineitems} \index{ord() (in module matplotlib.dviread)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/dviread:matplotlib.dviread.ord}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.dviread.}}\sphinxbfcode{\sphinxupquote{ord}}}{\emph{x}}{}~ \end{fulllineitems} \chapter{figure} \label{\detokenize{api/figure_api:figure}}\label{\detokenize{api/figure_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.figure}}} \label{\detokenize{api/figure_api:module-matplotlib.figure}}\label{\detokenize{api/figure_api:matplotlib-figure}}\index{matplotlib.figure (module)} The figure module provides the top-level {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}}, the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}, which contains all the plot elements. The following classes are defined \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.SubplotParams:matplotlib.figure.SubplotParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SubplotParams}}}}}}] \leavevmode control the default spacing of the subplots \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}}] \leavevmode top level container for all plot elements \end{description} \subsection{Classes} \label{\detokenize{api/figure_api:classes}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.AxesStack:matplotlib.figure.AxesStack}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AxesStack}}}}}() & Specialization of the Stack to handle all tracking of Axes in a Figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}({[}figsize, dpi, facecolor, edgecolor, …{]}) & The Figure instance supports callbacks through a \sphinxstyleemphasis{callbacks} attribute which is a {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.CallbackRegistry}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CallbackRegistry}}}}} instance. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.SubplotParams:matplotlib.figure.SubplotParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SubplotParams}}}}}({[}left, bottom, right, top, …{]}) & A class to hold the parameters for a subplot \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.figure.AxesStack} \label{\detokenize{api/_as_gen/matplotlib.figure.AxesStack:matplotlib-figure-axesstack}}\label{\detokenize{api/_as_gen/matplotlib.figure.AxesStack::doc}}\index{AxesStack (class in matplotlib.figure)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.AxesStack:matplotlib.figure.AxesStack}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.figure.}}\sphinxbfcode{\sphinxupquote{AxesStack}}} Specialization of the Stack to handle all tracking of Axes in a Figure. This stack stores \sphinxcode{\sphinxupquote{key, (ind, axes)}} pairs, where: \begin{itemize} \item {} \sphinxstylestrong{key} should be a hash of the args and kwargs used in generating the Axes. \item {} \sphinxstylestrong{ind} is a serial number for tracking the order in which axes were added. \end{itemize} The AxesStack is a callable, where \sphinxcode{\sphinxupquote{ax\_stack()}} returns the current axes. Alternatively the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.AxesStack:matplotlib.figure.AxesStack.current_key_axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{current\_key\_axes()}}}}} will return the current key and associated axes. \index{add() (matplotlib.figure.AxesStack method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.AxesStack:matplotlib.figure.AxesStack.add}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add}}}{\emph{key}, \emph{a}}{} Add Axes \sphinxstyleemphasis{a}, with key \sphinxstyleemphasis{key}, to the stack, and return the stack. If \sphinxstyleemphasis{key} is unhashable, replace it by a unique, arbitrary object. If \sphinxstyleemphasis{a} is already on the stack, don’t add it again, but return \sphinxstyleemphasis{None}. \end{fulllineitems} \index{as\_list() (matplotlib.figure.AxesStack method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.AxesStack:matplotlib.figure.AxesStack.as_list}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{as\_list}}}{}{} Return a list of the Axes instances that have been added to the figure \end{fulllineitems} \index{bubble() (matplotlib.figure.AxesStack method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.AxesStack:matplotlib.figure.AxesStack.bubble}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{bubble}}}{\emph{a}}{} Move the given axes, which must already exist in the stack, to the top. \end{fulllineitems} \index{current\_key\_axes() (matplotlib.figure.AxesStack method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.AxesStack:matplotlib.figure.AxesStack.current_key_axes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{current\_key\_axes}}}{}{} Return a tuple of \sphinxcode{\sphinxupquote{(key, axes)}} for the active axes. If no axes exists on the stack, then returns \sphinxcode{\sphinxupquote{(None, None)}}. \end{fulllineitems} \index{get() (matplotlib.figure.AxesStack method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.AxesStack:matplotlib.figure.AxesStack.get}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get}}}{\emph{key}}{} Return the Axes instance that was added with \sphinxstyleemphasis{key}. If it is not present, return None. \end{fulllineitems} \index{remove() (matplotlib.figure.AxesStack method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.AxesStack:matplotlib.figure.AxesStack.remove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{remove}}}{\emph{a}}{} Remove the axes from the stack. \end{fulllineitems} \end{fulllineitems} \subsubsection{matplotlib.figure.Figure} \label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib-figure-figure}}\label{\detokenize{api/_as_gen/matplotlib.figure.Figure::doc}}\index{Figure (class in matplotlib.figure)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.figure.}}\sphinxbfcode{\sphinxupquote{Figure}}}{\emph{figsize=None}, \emph{dpi=None}, \emph{facecolor=None}, \emph{edgecolor=None}, \emph{linewidth=0.0}, \emph{frameon=None}, \emph{subplotpars=None}, \emph{tight\_layout=None}, \emph{constrained\_layout=None}}{} The Figure instance supports callbacks through a \sphinxstyleemphasis{callbacks} attribute which is a {\hyperref[\detokenize{api/cbook_api:matplotlib.cbook.CallbackRegistry}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CallbackRegistry}}}}} instance. The events you can connect to are ‘dpi\_changed’, and the callback will be called with \sphinxcode{\sphinxupquote{func(fig)}} where fig is the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance. \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{patch}}] \leavevmode The {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}} instance representing the figure patch. \item[{\sphinxstylestrong{suppressComposite}}] \leavevmode For multiple figure images, the figure will make composite images depending on the renderer option\_image\_nocomposite function. If \sphinxstyleemphasis{suppressComposite} is a boolean, this will override the renderer. \end{description} \end{description}\end{quote} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{figsize}}] \leavevmode{[}2-tuple of floats{]} \sphinxcode{\sphinxupquote{(width, height)}} tuple in inches \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}float{]} Dots per inch \item[{\sphinxstylestrong{facecolor}}] \leavevmode The figure patch facecolor; defaults to rc \sphinxcode{\sphinxupquote{figure.facecolor}} \item[{\sphinxstylestrong{edgecolor}}] \leavevmode The figure patch edge color; defaults to rc \sphinxcode{\sphinxupquote{figure.edgecolor}} \item[{\sphinxstylestrong{linewidth}}] \leavevmode{[}float{]} The figure patch edge linewidth; the default linewidth of the frame \item[{\sphinxstylestrong{frameon}}] \leavevmode{[}bool{]} If \sphinxcode{\sphinxupquote{False}}, suppress drawing the figure frame \item[{\sphinxstylestrong{subplotpars}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.SubplotParams:matplotlib.figure.SubplotParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SubplotParams}}}}}{]} Subplot parameters, defaults to rc \item[{\sphinxstylestrong{tight\_layout}}] \leavevmode{[}bool{]} If \sphinxcode{\sphinxupquote{False}} use \sphinxstyleemphasis{subplotpars}; if \sphinxcode{\sphinxupquote{True}} adjust subplot parameters using {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout}}}}} with default padding. When providing a dict containing the keys \sphinxcode{\sphinxupquote{pad}}, \sphinxcode{\sphinxupquote{w\_pad}}, \sphinxcode{\sphinxupquote{h\_pad}}, and \sphinxcode{\sphinxupquote{rect}}, the default {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout}}}}} paddings will be overridden. Defaults to rc \sphinxcode{\sphinxupquote{figure.autolayout}}. \item[{\sphinxstylestrong{constrained\_layout}}] \leavevmode{[}bool{]} If \sphinxcode{\sphinxupquote{True}} use constrained layout to adjust positioning of plot elements. Like \sphinxcode{\sphinxupquote{tight\_layout}}, but designed to be more flexible. See {\hyperref[\detokenize{tutorials/intermediate/constrainedlayout_guide::doc}]{\sphinxcrossref{\DUrole{doc}{Constrained Layout Guide}}}} for examples. (Note: does not work with \sphinxcode{\sphinxupquote{subplot()}} or \sphinxcode{\sphinxupquote{subplot2grid()}}.) Defaults to rc \sphinxcode{\sphinxupquote{figure.constrained\_layout.use}}. \end{description} \end{description}\end{quote} \index{add\_axes() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_axes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_axes}}}{\emph{*args}, \emph{**kwargs}}{} Add an axes at position \sphinxstyleemphasis{rect} {[}\sphinxstyleemphasis{left}, \sphinxstyleemphasis{bottom}, \sphinxstyleemphasis{width}, \sphinxstyleemphasis{height}{]} where all quantities are in fractions of figure width and height. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rect}}] \leavevmode{[}sequence of float{]} A 4-length sequence of {[}left, bottom, width, height{]} quantities. \item[{\sphinxstylestrong{projection :}}] \leavevmode {[}‘aitoff’ \textbar{} ‘hammer’ \textbar{} ‘lambert’ \textbar{} ‘mollweide’ \textbar{} ‘polar’ \textbar{} ‘rectilinear’{]}, optional The projection type of the axes. \item[{\sphinxstylestrong{polar}}] \leavevmode{[}boolean, optional{]} If True, equivalent to projection=’polar’. \item[{\sphinxstylestrong{**kwargs}}] \leavevmode This method also takes the keyword arguments for {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{axes}}] \leavevmode{[}Axes{]} The added axes. \end{description} \end{description}\end{quote} \paragraph{Examples} A simple example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{rect} \PYG{o}{=} \PYG{n}{l}\PYG{p}{,}\PYG{n}{b}\PYG{p}{,}\PYG{n}{w}\PYG{p}{,}\PYG{n}{h} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{n}{rect}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{n}{rect}\PYG{p}{,} \PYG{n}{frameon}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{n}{rect}\PYG{p}{,} \PYG{n}{polar}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{n}{rect}\PYG{p}{,} \PYG{n}{projection}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{polar}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \end{sphinxVerbatim} If the figure already has an axes with the same parameters, then it will simply make that axes current and return it. This behavior has been deprecated as of Matplotlib 2.1. Meanwhile, if you do not want this behavior (i.e., you want to force the creation of a new Axes), you must use a unique set of args and kwargs. The axes \sphinxcode{\sphinxupquote{label}} attribute has been exposed for this purpose: if you want two axes that are otherwise identical to be added to the figure, make sure you give them unique labels: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{n}{rect}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{n}{rect}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} In rare circumstances, add\_axes may be called with a single argument, an Axes instance already created in the present figure but not in the figure’s list of axes. For example, if an axes has been removed with {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.delaxes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{delaxes()}}}}}, it can be restored with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{)} \end{sphinxVerbatim} In all cases, the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance will be returned. \end{fulllineitems} \index{add\_axobserver() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_axobserver}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_axobserver}}}{\emph{func}}{} Whenever the axes state change, \sphinxcode{\sphinxupquote{func(self)}} will be called. \end{fulllineitems} \index{add\_subplot() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_subplot}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_subplot}}}{\emph{*args}, \emph{**kwargs}}{} Add a subplot. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{*args}}] \leavevmode Either a 3-digit integer or three separate integers describing the position of the subplot. If the three integers are R, C, and P in order, the subplot will take the Pth position on a grid with R rows and C columns. \item[{\sphinxstylestrong{projection}}] \leavevmode{[}{[}‘aitoff’ \textbar{} ‘hammer’ \textbar{} ‘lambert’ \textbar{} ‘mollweide’ \textbar{} ‘polar’ \textbar{} ‘rectilinear’{]}, optional{]} The projection type of the axes. \item[{\sphinxstylestrong{polar}}] \leavevmode{[}boolean, optional{]} If True, equivalent to projection=’polar’. \item[{\sphinxstylestrong{**kwargs}}] \leavevmode This method also takes the keyword arguments for {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{axes}}] \leavevmode{[}Axes{]} The axes of the subplot. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot:matplotlib.pyplot.subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.subplot}}}}}}] \leavevmode for an explanation of the args. \end{description} \paragraph{Notes} If the figure already has a subplot with key (\sphinxstyleemphasis{args}, \sphinxstyleemphasis{kwargs}) then it will simply make that subplot current and return it. This behavior is deprecated. \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} equivalent but more general} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} add subplot with red background} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{212}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} add a polar subplot} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{,} \PYG{n}{projection}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{polar}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} add Subplot instance sub} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{n}{sub}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{align\_labels() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.align_labels}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{align\_labels}}}{\emph{axs=None}}{} Align the xlabels and ylabels of subplots with the same subplots row or column (respectively) if label alignment is being done automatically (i.e. the label position is not manually set). Alignment persists for draw events after this is called. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{axs}}] \leavevmode{[}list of {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} (None){]} Optional list (or ndarray) of {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} to align the labels. Default is to align all axes on the figure. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.align_xlabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure.align\_xlabels}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.align_ylabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure.align\_ylabels}}}}} \end{fulllineitems} \index{align\_xlabels() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.align_xlabels}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{align\_xlabels}}}{\emph{axs=None}}{} Align the ylabels of subplots in the same subplot column if label alignment is being done automatically (i.e. the label position is not manually set). Alignment persists for draw events after this is called. If a label is on the bottom, it is aligned with labels on axes that also have their label on the bottom and that have the same bottom-most subplot row. If the label is on the top, it is aligned with labels on axes with the same top-most row. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{axs}}] \leavevmode{[}list of {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} (None){]} Optional list of (or ndarray) {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} to align the xlabels. Default is to align all axes on the figure. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.align_ylabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure.align\_ylabels}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.align_labels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure.align\_labels}}}}} \paragraph{Notes} This assumes that \sphinxcode{\sphinxupquote{axs}} are from the same {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpec}}}}}, so that their {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.SubplotSpec:matplotlib.gridspec.SubplotSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SubplotSpec}}}}} positions correspond to figure positions. \paragraph{Examples} Example with rotated xtick labels: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)} \PYG{k}{for} \PYG{n}{tick} \PYG{o+ow}{in} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{get\PYGZus{}xticklabels}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{tick}\PYG{o}{.}\PYG{n}{set\PYGZus{}rotation}\PYG{p}{(}\PYG{l+m+mi}{55}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{XLabel 0}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{XLabel 1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{align\PYGZus{}xlabels}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{align\_ylabels() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.align_ylabels}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{align\_ylabels}}}{\emph{axs=None}}{} Align the ylabels of subplots in the same subplot column if label alignment is being done automatically (i.e. the label position is not manually set). Alignment persists for draw events after this is called. If a label is on the left, it is aligned with labels on axes that also have their label on the left and that have the same left-most subplot column. If the label is on the right, it is aligned with labels on axes with the same right-most column. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{axs}}] \leavevmode{[}list of {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} (None){]} Optional list (or ndarray) of {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} to align the ylabels. Default is to align all axes on the figure. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.align_xlabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure.align\_xlabels}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.align_labels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure.align\_labels}}}}} \paragraph{Notes} This assumes that \sphinxcode{\sphinxupquote{axs}} are from the same {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpec}}}}}, so that their {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.SubplotSpec:matplotlib.gridspec.SubplotSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SubplotSpec}}}}} positions correspond to figure positions. \paragraph{Examples} Example with large yticks labels: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{axs} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1000}\PYG{p}{,} \PYG{l+m+mi}{50}\PYG{p}{)}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{YLabel 0}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{axs}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}ylabel}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{YLabel 1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{align\PYGZus{}ylabels}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{autofmt\_xdate() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.autofmt_xdate}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autofmt\_xdate}}}{\emph{bottom=0.2}, \emph{rotation=30}, \emph{ha='right'}, \emph{which=None}}{} Date ticklabels often overlap, so it is useful to rotate them and right align them. Also, a common use case is a number of subplots with shared xaxes where the x-axis is date data. The ticklabels are often long, and it helps to rotate them on the bottom subplot and turn them off on other subplots, as well as turn off xlabels. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{bottom}}] \leavevmode{[}scalar{]} The bottom of the subplots for {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.subplots_adjust}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots\_adjust()}}}}} \item[{\sphinxstylestrong{rotation}}] \leavevmode{[}angle in degrees{]} The rotation of the xtick labels \item[{\sphinxstylestrong{ha}}] \leavevmode{[}string{]} The horizontal alignment of the xticklabels \item[{\sphinxstylestrong{which}}] \leavevmode{[}\{None, ‘major’, ‘minor’, ‘both’\}{]} Selects which ticklabels to rotate (default is None which works same as major) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{axes (matplotlib.figure.Figure attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.axes}}\pysigline{\sphinxbfcode{\sphinxupquote{axes}}} Read-only: list of axes in Figure \end{fulllineitems} \index{clear() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.clear}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{clear}}}{\emph{keep\_observers=False}}{} Clear the figure \textendash{} synonym for {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.clf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clf()}}}}}. \end{fulllineitems} \index{clf() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.clf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{clf}}}{\emph{keep\_observers=False}}{} Clear the figure. Set \sphinxstyleemphasis{keep\_observers} to True if, for example, a gui widget is tracking the axes in the figure. \end{fulllineitems} \index{colorbar() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.colorbar}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{colorbar}}}{\emph{mappable}, \emph{cax=None}, \emph{ax=None}, \emph{use\_gridspec=True}, \emph{**kw}}{} Create a colorbar for a ScalarMappable instance, \sphinxstyleemphasis{mappable}. Documentation for the pylab thin wrapper: Add a colorbar to a plot. Function signatures for the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pyplot}}}}} interface; all but the first are also method signatures for the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} method: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{colorbar}\PYG{p}{(}\PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{mappable}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{mappable}\PYG{p}{,} \PYG{n}{cax}\PYG{o}{=}\PYG{n}{cax}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{mappable}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{mappable :}}] \leavevmode The \sphinxcode{\sphinxupquote{Image}}, {\hyperref[\detokenize{api/contour_api:matplotlib.contour.ContourSet}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ContourSet}}}}}, etc. to which the colorbar applies; this argument is mandatory for the Figure {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} method but optional for the pyplot {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.colorbar:matplotlib.pyplot.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} function, which sets the default to the current image. \item[{\sphinxstylestrong{cax}}] \leavevmode{[}{\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} object, optional{]} Axis into which the colorbar will be drawn \item[{\sphinxstylestrong{ax}}] \leavevmode{[}{\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}, list of Axes, optional{]} Parent axes from which space for a new colorbar axes will be stolen. If a list of axes is given they will all be resized to make room for the colorbar axes. \item[{\sphinxstylestrong{use\_gridspec}}] \leavevmode{[}bool, optional{]} If \sphinxstyleemphasis{cax} is \sphinxcode{\sphinxupquote{None}}, a new \sphinxstyleemphasis{cax} is created as an instance of Axes. If \sphinxstyleemphasis{ax} is an instance of Subplot and \sphinxstyleemphasis{use\_gridspec} is \sphinxcode{\sphinxupquote{True}}, \sphinxstyleemphasis{cax} is created as an instance of Subplot using the grid\_spec module. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{:class:{}`\textasciitilde{}matplotlib.colorbar.Colorbar{}` instance}}] \leavevmode See also its base class, {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ColorbarBase}}}}}. Call the {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_label()}}}}} method to label the colorbar. \end{description} \end{description}\end{quote} \paragraph{Notes} Additional keyword arguments are of two kinds: \begin{quote} axes properties: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{orientation} & vertical or horizontal \\ \hline \sphinxstyleemphasis{fraction} & 0.15; fraction of original axes to use for colorbar \\ \hline \sphinxstyleemphasis{pad} & 0.05 if vertical, 0.15 if horizontal; fraction of original axes between colorbar and new image axes \\ \hline \sphinxstyleemphasis{shrink} & 1.0; fraction by which to multiply the size of the colorbar \\ \hline \sphinxstyleemphasis{aspect} & 20; ratio of long to short dimensions \\ \hline \sphinxstyleemphasis{anchor} & (0.0, 0.5) if vertical; (0.5, 1.0) if horizontal; the anchor point of the colorbar axes \\ \hline \sphinxstyleemphasis{panchor} & (1.0, 0.5) if vertical; (0.5, 0.0) if horizontal; the anchor point of the colorbar parent axes. If False, the parent axes’ anchor will be unchanged \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} colorbar properties: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{extend} & {[} ‘neither’ \textbar{} ‘both’ \textbar{} ‘min’ \textbar{} ‘max’ {]} If not ‘neither’, make pointed end(s) for out-of- range values. These are set for a given colormap using the colormap set\_under and set\_over methods. \\ \hline \sphinxstyleemphasis{extendfrac} & {[} \sphinxstyleemphasis{None} \textbar{} ‘auto’ \textbar{} length \textbar{} lengths {]} If set to \sphinxstyleemphasis{None}, both the minimum and maximum triangular colorbar extensions with have a length of 5\% of the interior colorbar length (this is the default setting). If set to ‘auto’, makes the triangular colorbar extensions the same lengths as the interior boxes (when \sphinxstyleemphasis{spacing} is set to ‘uniform’) or the same lengths as the respective adjacent interior boxes (when \sphinxstyleemphasis{spacing} is set to ‘proportional’). If a scalar, indicates the length of both the minimum and maximum triangular colorbar extensions as a fraction of the interior colorbar length. A two-element sequence of fractions may also be given, indicating the lengths of the minimum and maximum colorbar extensions respectively as a fraction of the interior colorbar length. \\ \hline \sphinxstyleemphasis{extendrect} & bool If \sphinxstyleemphasis{False} the minimum and maximum colorbar extensions will be triangular (the default). If \sphinxstyleemphasis{True} the extensions will be rectangular. \\ \hline \sphinxstyleemphasis{spacing} & {[} ‘uniform’ \textbar{} ‘proportional’ {]} Uniform spacing gives each discrete color the same space; proportional makes the space proportional to the data interval. \\ \hline \sphinxstyleemphasis{ticks} & {[} None \textbar{} list of ticks \textbar{} Locator object {]} If None, ticks are determined automatically from the input. \\ \hline \sphinxstyleemphasis{format} & {[} None \textbar{} format string \textbar{} Formatter object {]} If None, the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarFormatter}}}}} is used. If a format string is given, e.g., ‘\%.3f’, that is used. An alternative {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Formatter}}}}} object may be given instead. \\ \hline \sphinxstyleemphasis{drawedges} & bool Whether to draw lines at color boundaries. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} The following will probably be useful only in the context of indexed colors (that is, when the mappable has norm=NoNorm()), or other unusual circumstances. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{boundaries} & None or a sequence \\ \hline \sphinxstyleemphasis{values} & None or a sequence which must be of length 1 less than the sequence of \sphinxstyleemphasis{boundaries}. For each region delimited by adjacent entries in \sphinxstyleemphasis{boundaries}, the color mapped to the corresponding value in values will be used. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \end{quote} If \sphinxstyleemphasis{mappable} is a \sphinxcode{\sphinxupquote{ContourSet}}, its \sphinxstyleemphasis{extend} kwarg is included automatically. The \sphinxstyleemphasis{shrink} kwarg provides a simple way to scale the colorbar with respect to the axes. Note that if \sphinxstyleemphasis{cax} is specified it determines the size of the colorbar and \sphinxstyleemphasis{shrink} and \sphinxstyleemphasis{aspect} kwargs are ignored. For more precise control, you can manually specify the positions of the axes objects in which the mappable and the colorbar are drawn. In this case, do not use any of the axes properties kwargs. It is known that some vector graphics viewer (svg and pdf) renders white gaps between segments of the colorbar. This is due to bugs in the viewers not matplotlib. As a workaround the colorbar can be rendered with overlapping segments: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{cbar} \PYG{o}{=} \PYG{n}{colorbar}\PYG{p}{(}\PYG{p}{)} \PYG{n}{cbar}\PYG{o}{.}\PYG{n}{solids}\PYG{o}{.}\PYG{n}{set\PYGZus{}edgecolor}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{face}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} However this has negative consequences in other circumstances. Particularly with semi transparent images (alpha \textless{} 1) and colorbar extensions and is not enabled by default see (issue \#1188). \end{fulllineitems} \index{contains() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred on the figure. Returns True, \{\}. \end{fulllineitems} \index{delaxes() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.delaxes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{delaxes}}}{\emph{ax}}{} Remove the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} \sphinxstyleemphasis{ax} from the figure and update the current axes. \end{fulllineitems} \index{dpi (matplotlib.figure.Figure attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.dpi}}\pysigline{\sphinxbfcode{\sphinxupquote{dpi}}}~ \end{fulllineitems} \index{draw() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Render the figure using {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.RendererBase}}}}} instance \sphinxstyleemphasis{renderer}. \end{fulllineitems} \index{draw\_artist() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.draw_artist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_artist}}}{\emph{a}}{} Draw {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.Artist}}}}} instance \sphinxstyleemphasis{a} only. This is available only after the figure is drawn. \end{fulllineitems} \index{execute\_constrained\_layout() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.execute_constrained_layout}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{execute\_constrained\_layout}}}{\emph{renderer=None}}{} Use \sphinxcode{\sphinxupquote{layoutbox}} to determine pos positions within axes. See also set\_constrained\_layout\_pads \end{fulllineitems} \index{figimage() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.figimage}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{figimage}}}{\emph{X}, \emph{xo=0}, \emph{yo=0}, \emph{alpha=None}, \emph{norm=None}, \emph{cmap=None}, \emph{vmin=None}, \emph{vmax=None}, \emph{origin=None}, \emph{resize=False}, \emph{**kwargs}}{} Adds a non-resampled image to the figure. call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{figimage}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} adds a non-resampled array \sphinxstyleemphasis{X} to the figure. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{figimage}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{xo}\PYG{p}{,} \PYG{n}{yo}\PYG{p}{)} \end{sphinxVerbatim} with pixel offsets \sphinxstyleemphasis{xo}, \sphinxstyleemphasis{yo}, \sphinxstyleemphasis{X} must be a float array: \begin{itemize} \item {} If \sphinxstyleemphasis{X} is MxN, assume luminance (grayscale) \item {} If \sphinxstyleemphasis{X} is MxNx3, assume RGB \item {} If \sphinxstyleemphasis{X} is MxNx4, assume RGBA \end{itemize} Optional keyword arguments: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Keyword &\sphinxstyletheadfamily Description \\ \hline resize & a boolean, True or False. If “True”, then re-size the Figure to match the given image size. \\ \hline xo or yo & An integer, the \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} image offset in pixels \\ \hline cmap & a {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap}}}}} instance, e.g., cm.jet. If \sphinxstyleemphasis{None}, default to the rc \sphinxcode{\sphinxupquote{image.cmap}} value \\ \hline norm & a {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance. The default is normalization(). This scales luminance -\textgreater{} 0-1 \\ \hline vmin\textbar{}vmax & are used to scale a luminance image to 0-1. If either is \sphinxstyleemphasis{None}, the min and max of the luminance values will be used. Note if you pass a norm instance, the settings for \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} will be ignored. \\ \hline alpha & the alpha blending value, default is \sphinxstyleemphasis{None} \\ \hline origin & {[} ‘upper’ \textbar{} ‘lower’ {]} Indicates where the {[}0,0{]} index of the array is in the upper left or lower left corner of the axes. Defaults to the rc image.origin value \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} figimage complements the axes image ({\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.imshow:matplotlib.axes.Axes.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow()}}}}}) which will be resampled to fit the current axes. If you want a resampled image to fill the entire figure, you can define an {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} with extent {[}0,0,1,1{]}. An {\hyperref[\detokenize{api/image_api:matplotlib.image.FigureImage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.image.FigureImage}}}}} instance is returned. Additional kwargs are Artist kwargs passed on to {\hyperref[\detokenize{api/image_api:matplotlib.image.FigureImage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FigureImage}}}}} \end{fulllineitems} \index{figurePatch (matplotlib.figure.Figure attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.figurePatch}}\pysigline{\sphinxbfcode{\sphinxupquote{figurePatch}}}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The figurePatch function was deprecated in version 2.1. Use Figure.patch instead. \end{fulllineitems} \index{gca() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.gca}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{gca}}}{\emph{**kwargs}}{} Get the current axes, creating one if necessary The following kwargs are supported for ensuring the returned axes adheres to the given projection etc., and for axes creation if the active axes does not exist: \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot \sphinxcode{\sphinxupquote{adjustable}} & {[} ‘box’ \textbar{} ‘datalim’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline \sphinxcode{\sphinxupquote{anchor}} & {[} ‘C’ \textbar{} ‘SW’ \textbar{} ‘S’ \textbar{} ‘SE’ \textbar{} ‘E’ \textbar{} ‘NE’ \textbar{} ‘N’ \textbar{} ‘NW’ \textbar{} ‘W’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline \sphinxcode{\sphinxupquote{aspect}} & unknown \\ \hline \sphinxcode{\sphinxupquote{autoscale\_on}} & bool \\ \hline \sphinxcode{\sphinxupquote{autoscalex\_on}} & bool \\ \hline \sphinxcode{\sphinxupquote{autoscaley\_on}} & bool \\ \hline \sphinxcode{\sphinxupquote{axes\_locator}} & a callable object which takes an axes instance and renderer and returns a bbox. \\ \hline \sphinxcode{\sphinxupquote{axisbelow}} & {[} bool \textbar{} ‘line’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline \sphinxcode{\sphinxupquote{facecolor}} & color \\ \hline \sphinxcode{\sphinxupquote{fc}} & color \\ \hline \sphinxcode{\sphinxupquote{figure}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} \\ \hline \sphinxcode{\sphinxupquote{frame\_on}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline \sphinxcode{\sphinxupquote{navigate}} & bool \\ \hline \sphinxcode{\sphinxupquote{navigate\_mode}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline \sphinxcode{\sphinxupquote{position}} & unknown \\ \hline \sphinxcode{\sphinxupquote{rasterization\_zorder}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline \sphinxcode{\sphinxupquote{title}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline \sphinxcode{\sphinxupquote{xbound}} & (lower: float, upper: float) \\ \hline \sphinxcode{\sphinxupquote{xlabel}} & unknown \\ \hline \sphinxcode{\sphinxupquote{xlim}} & (left: float, right: float) \\ \hline \sphinxcode{\sphinxupquote{xmargin}} & float greater than -0.5 \\ \hline \sphinxcode{\sphinxupquote{xscale}} & {[} ‘linear’ \textbar{} ‘log’ \textbar{} ‘symlog’ \textbar{} ‘logit’ \textbar{} … {]} \\ \hline \sphinxcode{\sphinxupquote{xticklabels}} & list of string labels \\ \hline \sphinxcode{\sphinxupquote{xticks}} & list of tick locations. \\ \hline \sphinxcode{\sphinxupquote{ybound}} & (lower: float, upper: float) \\ \hline \sphinxcode{\sphinxupquote{ylabel}} & unknown \\ \hline \sphinxcode{\sphinxupquote{ylim}} & (bottom: float, top: float) \\ \hline \sphinxcode{\sphinxupquote{ymargin}} & float greater than -0.5 \\ \hline \sphinxcode{\sphinxupquote{yscale}} & {[} ‘linear’ \textbar{} ‘log’ \textbar{} ‘symlog’ \textbar{} ‘logit’ \textbar{} … {]} \\ \hline \sphinxcode{\sphinxupquote{yticklabels}} & list of string labels \\ \hline \sphinxcode{\sphinxupquote{yticks}} & list of tick locations. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} \end{fulllineitems} \index{get\_axes() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.get_axes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_axes}}}{}{}~ \end{fulllineitems} \index{get\_children() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Get a list of artists contained in the figure. \end{fulllineitems} \index{get\_constrained\_layout() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.get_constrained_layout}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_constrained\_layout}}}{}{} Return a boolean: True means constrained layout is being used. See {\hyperref[\detokenize{tutorials/intermediate/constrainedlayout_guide::doc}]{\sphinxcrossref{\DUrole{doc}{Constrained Layout Guide}}}} \end{fulllineitems} \index{get\_constrained\_layout\_pads() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.get_constrained_layout_pads}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_constrained\_layout\_pads}}}{\emph{relative=False}}{} Get padding for \sphinxcode{\sphinxupquote{constrained\_layout}}. Returns a list of \sphinxcode{\sphinxupquote{w\_pad, h\_pad}} in inches and \sphinxcode{\sphinxupquote{wspace}} and \sphinxcode{\sphinxupquote{hspace}} as fractions of the subplot. See {\hyperref[\detokenize{tutorials/intermediate/constrainedlayout_guide::doc}]{\sphinxcrossref{\DUrole{doc}{Constrained Layout Guide}}}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{relative}}] \leavevmode{[}boolean{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, then convert from inches to figure relative. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_default\_bbox\_extra\_artists() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.get_default_bbox_extra_artists}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_default\_bbox\_extra\_artists}}}{}{}~ \end{fulllineitems} \index{get\_dpi() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.get_dpi}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dpi}}}{}{} Return the dpi as a float. \end{fulllineitems} \index{get\_edgecolor() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.get_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolor}}}{}{} Get the edge color of the Figure rectangle. \end{fulllineitems} \index{get\_facecolor() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{} Get the face color of the Figure rectangle. \end{fulllineitems} \index{get\_figheight() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.get_figheight}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_figheight}}}{}{} Return the figheight as a float. \end{fulllineitems} \index{get\_figwidth() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.get_figwidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_figwidth}}}{}{} Return the figwidth as a float. \end{fulllineitems} \index{get\_frameon() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.get_frameon}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_frameon}}}{}{} Get the boolean indicating frameon. \end{fulllineitems} \index{get\_size\_inches() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.get_size_inches}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_size\_inches}}}{}{} Returns the current size of the figure in inches (1in == 2.54cm) as an numpy array. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{size}}] \leavevmode{[}ndarray{]} The size of the figure in inches \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \sphinxcode{\sphinxupquote{matplotlib.Figure.set\_size\_inches}} \end{fulllineitems} \index{get\_tight\_layout() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.get_tight_layout}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_tight\_layout}}}{}{} Return whether and how {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout}}}}} is called when drawing. \end{fulllineitems} \index{get\_tightbbox() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.get_tightbbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_tightbbox}}}{\emph{renderer}}{} Return a (tight) bounding box of the figure in inches. It only accounts axes title, axis labels, and axis ticklabels. Needs improvement. \end{fulllineitems} \index{get\_window\_extent() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{*args}, \emph{**kwargs}}{} Return figure bounding box in display space; arguments are ignored. \end{fulllineitems} \index{ginput() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.ginput}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{ginput}}}{\emph{n=1}, \emph{timeout=30}, \emph{show\_clicks=True}, \emph{mouse\_add=1}, \emph{mouse\_pop=3}, \emph{mouse\_stop=2}}{} Blocking call to interact with a figure. Wait until the user clicks \sphinxstyleemphasis{n} times on the figure, and return the coordinates of each click in a list. The buttons used for the various actions (adding points, removing points, terminating the inputs) can be overridden via the arguments \sphinxstyleemphasis{mouse\_add}, \sphinxstyleemphasis{mouse\_pop} and \sphinxstyleemphasis{mouse\_stop}, that give the associated mouse button: 1 for left, 2 for middle, 3 for right. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{n}}] \leavevmode{[}int, optional, default: 1{]} Number of mouse clicks to accumulate. If negative, accumulate clicks until the input is terminated manually. \item[{\sphinxstylestrong{timeout}}] \leavevmode{[}scalar, optional, default: 30{]} Number of seconds to wait before timing out. If zero or negative will never timeout. \item[{\sphinxstylestrong{show\_clicks}}] \leavevmode{[}bool, optional, default: False{]} If True, show a red cross at the location of each click. \item[{\sphinxstylestrong{mouse\_add}}] \leavevmode{[}int, one of (1, 2, 3), optional, default: 1 (left click){]} Mouse button used to add points. \item[{\sphinxstylestrong{mouse\_pop}}] \leavevmode{[}int, one of (1, 2, 3), optional, default: 3 (right click){]} Mouse button used to remove the most recently added point. \item[{\sphinxstylestrong{mouse\_stop}}] \leavevmode{[}int, one of (1, 2, 3), optional, default: 2 (middle click){]} Mouse button used to stop input. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{points}}] \leavevmode{[}list of tuples{]} A list of the clicked (x, y) coordinates. \end{description} \end{description}\end{quote} \paragraph{Notes} The keyboard can also be used to select points in case your mouse does not have one or more of the buttons. The delete and backspace keys act like right clicking (i.e., remove last point), the enter key terminates input and any other key (not already used by the window manager) selects a point. \end{fulllineitems} \index{hold() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.hold}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hold}}}{\emph{b=None}}{}~ \DUrole{versionmodified}{Deprecated since version 2.0: }The hold function was deprecated in version 2.0. Set the hold state. If hold is None (default), toggle the hold state. Else set the hold state to boolean value b. e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hold}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} toggle hold} \PYG{n}{hold}\PYG{p}{(}\PYG{k+kc}{True}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} hold is on} \PYG{n}{hold}\PYG{p}{(}\PYG{k+kc}{False}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} hold is off} \end{sphinxVerbatim} All “hold” machinery is deprecated. \end{fulllineitems} \index{init\_layoutbox() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.init_layoutbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{init\_layoutbox}}}{}{} initilaize the layoutbox for use in constrained\_layout. \end{fulllineitems} \index{legend() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.legend}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{legend}}}{\emph{*args}, \emph{**kwargs}}{} Place a legend on the figure. To make a legend from existing artists on every axes: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{legend}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} To make a legend for a list of lines and labels: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{legend}\PYG{p}{(} \PYG{p}{(}\PYG{n}{line1}\PYG{p}{,} \PYG{n}{line2}\PYG{p}{,} \PYG{n}{line3}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label3}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{,} \PYG{n}{loc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{upper right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} These can also be specified by keyword: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{legend}\PYG{p}{(}\PYG{n}{handles}\PYG{o}{=}\PYG{p}{(}\PYG{n}{line1}\PYG{p}{,} \PYG{n}{line2}\PYG{p}{,} \PYG{n}{line3}\PYG{p}{)}\PYG{p}{,} \PYG{n}{labels}\PYG{o}{=}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label3}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{,} \PYG{n}{loc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{upper right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{handles}}] \leavevmode{[}sequence of {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}}, optional{]} A list of Artists (lines, patches) to be added to the legend. Use this together with \sphinxstyleemphasis{labels}, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient. The length of handles and labels should be the same in this case. If they are not, they are truncated to the smaller length. \item[{\sphinxstylestrong{labels}}] \leavevmode{[}sequence of strings, optional{]} A list of labels to show next to the artists. Use this together with \sphinxstyleemphasis{handles}, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{:class:{}`matplotlib.legend.Legend{}` instance}}] \leavevmode \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{loc}}] \leavevmode{[}int or string or pair of floats, default: ‘upper right’{]} The location of the legend. Possible codes are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Location String &\sphinxstyletheadfamily Location Code \\ \hline ‘best’ & 0 \\ \hline ‘upper right’ & 1 \\ \hline ‘upper left’ & 2 \\ \hline ‘lower left’ & 3 \\ \hline ‘lower right’ & 4 \\ \hline ‘right’ & 5 \\ \hline ‘center left’ & 6 \\ \hline ‘center right’ & 7 \\ \hline ‘lower center’ & 8 \\ \hline ‘upper center’ & 9 \\ \hline ‘center’ & 10 \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} Alternatively can be a 2-tuple giving \sphinxcode{\sphinxupquote{x, y}} of the lower-left corner of the legend in axes coordinates (in which case \sphinxcode{\sphinxupquote{bbox\_to\_anchor}} will be ignored). \item[{\sphinxstylestrong{bbox\_to\_anchor}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BboxBase}}}}} or pair of floats{]} Specify any arbitrary location for the legend in \sphinxcode{\sphinxupquote{bbox\_transform}} coordinates (default Axes coordinates). For example, to put the legend’s upper right hand corner in the center of the axes the following keywords can be used: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{loc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{upper right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{bbox\PYGZus{}to\PYGZus{}anchor}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)} \end{sphinxVerbatim} \item[{\sphinxstylestrong{ncol}}] \leavevmode{[}integer{]} The number of columns that the legend has. Default is 1. \item[{\sphinxstylestrong{prop}}] \leavevmode{[}None or {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}} or dict{]} The font properties of the legend. If None (default), the current {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcParams}}}}} will be used. \item[{\sphinxstylestrong{fontsize}}] \leavevmode{[}int or float or \{‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’\}{]} Controls the font size of the legend. If the value is numeric the size will be the absolute font size in points. String values are relative to the current default font size. This argument is only used if \sphinxcode{\sphinxupquote{prop}} is not specified. \item[{\sphinxstylestrong{numpoints}}] \leavevmode{[}None or int{]} The number of marker points in the legend when creating a legend entry for a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} (line). Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.numpoints"{]}}}. \item[{\sphinxstylestrong{scatterpoints}}] \leavevmode{[}None or int{]} The number of marker points in the legend when creating a legend entry for a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PathCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathCollection}}}}} (scatter plot). Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.scatterpoints"{]}}}. \item[{\sphinxstylestrong{scatteryoffsets}}] \leavevmode{[}iterable of floats{]} The vertical offset (relative to the font size) for the markers created for a scatter plot legend entry. 0.0 is at the base the legend text, and 1.0 is at the top. To draw all markers at the same height, set to \sphinxcode{\sphinxupquote{{[}0.5{]}}}. Default is \sphinxcode{\sphinxupquote{{[}0.375, 0.5, 0.3125{]}}}. \item[{\sphinxstylestrong{markerscale}}] \leavevmode{[}None or int or float{]} The relative size of legend markers compared with the originally drawn ones. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.markerscale"{]}}}. \item[{\sphinxstylestrong{markerfirst}}] \leavevmode{[}bool{]} If \sphinxstyleemphasis{True}, legend marker is placed to the left of the legend label. If \sphinxstyleemphasis{False}, legend marker is placed to the right of the legend label. Default is \sphinxstyleemphasis{True}. \item[{\sphinxstylestrong{frameon}}] \leavevmode{[}None or bool{]} Control whether the legend should be drawn on a patch (frame). Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.frameon"{]}}}. \item[{\sphinxstylestrong{fancybox}}] \leavevmode{[}None or bool{]} Control whether round edges should be enabled around the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyBboxPatch}}}}} which makes up the legend’s background. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.fancybox"{]}}}. \item[{\sphinxstylestrong{shadow}}] \leavevmode{[}None or bool{]} Control whether to draw a shadow behind the legend. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.shadow"{]}}}. \item[{\sphinxstylestrong{framealpha}}] \leavevmode{[}None or float{]} Control the alpha transparency of the legend’s background. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.framealpha"{]}}}. If shadow is activated and \sphinxstyleemphasis{framealpha} is \sphinxcode{\sphinxupquote{None}}, the default value is ignored. \item[{\sphinxstylestrong{facecolor}}] \leavevmode{[}None or “inherit” or a color spec{]} Control the legend’s background color. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.facecolor"{]}}}. If \sphinxcode{\sphinxupquote{"inherit"}}, it will take \sphinxcode{\sphinxupquote{rcParams{[}"axes.facecolor"{]}}}. \item[{\sphinxstylestrong{edgecolor}}] \leavevmode{[}None or “inherit” or a color spec{]} Control the legend’s background patch edge color. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.edgecolor"{]}}} If \sphinxcode{\sphinxupquote{"inherit"}}, it will take \sphinxcode{\sphinxupquote{rcParams{[}"axes.edgecolor"{]}}}. \item[{\sphinxstylestrong{mode}}] \leavevmode{[}\{“expand”, None\}{]} If \sphinxcode{\sphinxupquote{mode}} is set to \sphinxcode{\sphinxupquote{"expand"}} the legend will be horizontally expanded to fill the axes area (or \sphinxcode{\sphinxupquote{bbox\_to\_anchor}} if defines the legend’s size). \item[{\sphinxstylestrong{bbox\_transform}}] \leavevmode{[}None or {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} The transform for the bounding box (\sphinxcode{\sphinxupquote{bbox\_to\_anchor}}). For a value of \sphinxcode{\sphinxupquote{None}} (default) the Axes’ \sphinxcode{\sphinxupquote{transAxes}} transform will be used. \item[{\sphinxstylestrong{title}}] \leavevmode{[}str or None{]} The legend’s title. Default is no title (\sphinxcode{\sphinxupquote{None}}). \item[{\sphinxstylestrong{borderpad}}] \leavevmode{[}float or None{]} The fractional whitespace inside the legend border. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.borderpad"{]}}}. \item[{\sphinxstylestrong{labelspacing}}] \leavevmode{[}float or None{]} The vertical space between the legend entries. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.labelspacing"{]}}}. \item[{\sphinxstylestrong{handlelength}}] \leavevmode{[}float or None{]} The length of the legend handles. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.handlelength"{]}}}. \item[{\sphinxstylestrong{handletextpad}}] \leavevmode{[}float or None{]} The pad between the legend handle and text. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.handletextpad"{]}}}. \item[{\sphinxstylestrong{borderaxespad}}] \leavevmode{[}float or None{]} The pad between the axes and legend border. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.borderaxespad"{]}}}. \item[{\sphinxstylestrong{columnspacing}}] \leavevmode{[}float or None{]} The spacing between columns. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.columnspacing"{]}}}. \item[{\sphinxstylestrong{handler\_map}}] \leavevmode{[}dict or None{]} The custom dictionary mapping instances or types to a legend handler. This \sphinxcode{\sphinxupquote{handler\_map}} updates the default handler map found at {\hyperref[\detokenize{api/legend_api:matplotlib.legend.Legend.get_legend_handler_map}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.legend.Legend.get\_legend\_handler\_map()}}}}}. \end{description} \end{description}\end{quote} \paragraph{Notes} Not all kinds of artist are supported by the legend command. See {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Legend guide}}}} for details. \end{fulllineitems} \index{savefig() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.savefig}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{savefig}}}{\emph{fname}, \emph{**kwargs}}{} Save the current figure. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{savefig}\PYG{p}{(}\PYG{n}{fname}\PYG{p}{,} \PYG{n}{dpi}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{w}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{edgecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{w}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{orientation}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{portrait}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{papertype}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n+nb}{format}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{transparent}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{,} \PYG{n}{bbox\PYGZus{}inches}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{pad\PYGZus{}inches}\PYG{o}{=}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{n}{frameon}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)} \end{sphinxVerbatim} The output formats available depend on the backend being used. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fname}}] \leavevmode{[}str or file-like object{]} A string containing a path to a filename, or a Python file-like object, or possibly some backend-dependent object such as {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfPages}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PdfPages}}}}}. If \sphinxstyleemphasis{format} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{fname} is a string, the output format is deduced from the extension of the filename. If the filename has no extension, the value of the rc parameter \sphinxcode{\sphinxupquote{savefig.format}} is used. If \sphinxstyleemphasis{fname} is not a string, remember to specify \sphinxstyleemphasis{format} to ensure that the correct backend is used. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}{[} \sphinxstyleemphasis{None} \textbar{} scalar \textgreater{} 0 \textbar{} ‘figure’{]}{]} The resolution in dots per inch. If \sphinxstyleemphasis{None} it will default to the value \sphinxcode{\sphinxupquote{savefig.dpi}} in the matplotlibrc file. If ‘figure’ it will set the dpi to be the value of the figure. \item[{\sphinxstylestrong{facecolor}}] \leavevmode{[}color spec or None, optional{]} the facecolor of the figure; if None, defaults to savefig.facecolor \item[{\sphinxstylestrong{edgecolor}}] \leavevmode{[}color spec or None, optional{]} the edgecolor of the figure; if None, defaults to savefig.edgecolor \item[{\sphinxstylestrong{orientation}}] \leavevmode{[}\{‘landscape’, ‘portrait’\}{]} not supported on all backends; currently only on postscript output \item[{\sphinxstylestrong{papertype}}] \leavevmode{[}str{]} One of ‘letter’, ‘legal’, ‘executive’, ‘ledger’, ‘a0’ through ‘a10’, ‘b0’ through ‘b10’. Only supported for postscript output. \item[{\sphinxstylestrong{format}}] \leavevmode{[}str{]} One of the file extensions supported by the active backend. Most backends support png, pdf, ps, eps and svg. \item[{\sphinxstylestrong{transparent}}] \leavevmode{[}bool{]} If \sphinxstyleemphasis{True}, the axes patches will all be transparent; the figure patch will also be transparent unless facecolor and/or edgecolor are specified via kwargs. This is useful, for example, for displaying a plot on top of a colored background on a web page. The transparency of these patches will be restored to their original values upon exit of this function. \item[{\sphinxstylestrong{frameon}}] \leavevmode{[}bool{]} If \sphinxstyleemphasis{True}, the figure patch will be colored, if \sphinxstyleemphasis{False}, the figure background will be transparent. If not provided, the rcParam ‘savefig.frameon’ will be used. \item[{\sphinxstylestrong{bbox\_inches}}] \leavevmode{[}str or {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}, optional{]} Bbox in inches. Only the given portion of the figure is saved. If ‘tight’, try to figure out the tight bbox of the figure. If None, use savefig.bbox \item[{\sphinxstylestrong{pad\_inches}}] \leavevmode{[}scalar, optional{]} Amount of padding around the figure when bbox\_inches is ‘tight’. If None, use savefig.pad\_inches \item[{\sphinxstylestrong{bbox\_extra\_artists}}] \leavevmode{[}list of {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}}, optional{]} A list of extra artists that will be considered when the tight bbox is calculated. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{sca() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.sca}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{sca}}}{\emph{a}}{} Set the current axes to be a and return a. \end{fulllineitems} \index{set\_canvas() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.set_canvas}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_canvas}}}{\emph{canvas}}{} Set the canvas that contains the figure ACCEPTS: a FigureCanvas instance \end{fulllineitems} \index{set\_constrained\_layout() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.set_constrained_layout}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_constrained\_layout}}}{\emph{constrained}}{} Set whether \sphinxcode{\sphinxupquote{constrained\_layout}} is used upon drawing. If None, the rcParams{[}‘figure.constrained\_layout.use’{]} value will be used. When providing a dict containing the keys \sphinxcode{\sphinxupquote{w\_pad}}, \sphinxcode{\sphinxupquote{h\_pad}} the default \sphinxcode{\sphinxupquote{constrained\_layout}} paddings will be overridden. These pads are in inches and default to 3.0/72.0. \sphinxcode{\sphinxupquote{w\_pad}} is the width padding and \sphinxcode{\sphinxupquote{h\_pad}} is the height padding. ACCEPTS: {[}True \textbar{} False \textbar{} dict \textbar{} None {]} See {\hyperref[\detokenize{tutorials/intermediate/constrainedlayout_guide::doc}]{\sphinxcrossref{\DUrole{doc}{Constrained Layout Guide}}}} \end{fulllineitems} \index{set\_constrained\_layout\_pads() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.set_constrained_layout_pads}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_constrained\_layout\_pads}}}{\emph{**kwargs}}{} Set padding for \sphinxcode{\sphinxupquote{constrained\_layout}}. Note the kwargs can be passed as a dictionary \sphinxcode{\sphinxupquote{fig.set\_constrained\_layout(**paddict)}}. See {\hyperref[\detokenize{tutorials/intermediate/constrainedlayout_guide::doc}]{\sphinxcrossref{\DUrole{doc}{Constrained Layout Guide}}}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{w\_pad}}] \leavevmode{[}scalar{]} Width padding in inches. This is the pad around axes and is meant to make sure there is enough room for fonts to look good. Defaults to 3 pts = 0.04167 inches \item[{\sphinxstylestrong{h\_pad}}] \leavevmode{[}scalar{]} Height padding in inches. Defaults to 3 pts. \item[{\sphinxstylestrong{wspace: scalar}}] \leavevmode Width padding between subplots, expressed as a fraction of the subplot width. The total padding ends up being w\_pad + wspace. \item[{\sphinxstylestrong{hspace: scalar}}] \leavevmode Height padding between subplots, expressed as a fraction of the subplot width. The total padding ends up being h\_pad + hspace. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_dpi() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.set_dpi}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dpi}}}{\emph{val}}{} Set the dots-per-inch of the figure ACCEPTS: float \end{fulllineitems} \index{set\_edgecolor() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.set_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolor}}}{\emph{color}}{} Set the edge color of the Figure rectangle ACCEPTS: any matplotlib color - see help(colors) \end{fulllineitems} \index{set\_facecolor() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.set_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{color}}{} Set the face color of the Figure rectangle ACCEPTS: any matplotlib color - see help(colors) \end{fulllineitems} \index{set\_figheight() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.set_figheight}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figheight}}}{\emph{val}, \emph{forward=True}}{} Set the height of the figure in inches ACCEPTS: float \end{fulllineitems} \index{set\_figwidth() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.set_figwidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figwidth}}}{\emph{val}, \emph{forward=True}}{} Set the width of the figure in inches ACCEPTS: float \end{fulllineitems} \index{set\_frameon() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.set_frameon}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_frameon}}}{\emph{b}}{} Set whether the figure frame (background) is displayed or invisible ACCEPTS: boolean \end{fulllineitems} \index{set\_size\_inches() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.set_size_inches}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_size\_inches}}}{\emph{w}, \emph{h=None}, \emph{forward=True}}{} Set the figure size in inches (1in == 2.54cm) Usage \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{o}{.}\PYG{n}{set\PYGZus{}size\PYGZus{}inches}\PYG{p}{(}\PYG{n}{w}\PYG{p}{,} \PYG{n}{h}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} OR} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{set\PYGZus{}size\PYGZus{}inches}\PYG{p}{(}\PYG{p}{(}\PYG{n}{w}\PYG{p}{,} \PYG{n}{h}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} optional kwarg \sphinxstyleemphasis{forward=True} will cause the canvas size to be automatically updated; e.g., you can resize the figure window from the shell ACCEPTS: a w, h tuple with w, h in inches \sphinxstrong{See also:} \sphinxcode{\sphinxupquote{matplotlib.Figure.get\_size\_inches}} \end{fulllineitems} \index{set\_tight\_layout() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.set_tight_layout}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_tight\_layout}}}{\emph{tight}}{} Set whether and how {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout}}}}} is called when drawing. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{tight}}] \leavevmode{[}bool or dict with keys “pad”, “w\_pad”, “h\_pad”, “rect” or None{]} If a bool, sets whether to call {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout}}}}} upon drawing. If \sphinxcode{\sphinxupquote{None}}, use the \sphinxcode{\sphinxupquote{figure.autolayout}} rcparam instead. If a dict, pass it as kwargs to {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout}}}}}, overriding the default paddings. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{show() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.show}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{show}}}{\emph{warn=True}}{} If using a GUI backend with pyplot, display the figure window. If the figure was not created using {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figure:matplotlib.pyplot.figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure()}}}}}, it will lack a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureManagerBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FigureManagerBase}}}}}, and will raise an AttributeError. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{warm}}] \leavevmode{[}bool{]} If \sphinxcode{\sphinxupquote{True}}, issue warning when called on a non-GUI backend \end{description} \end{description}\end{quote} \paragraph{Notes} For non-GUI backends, this does nothing, in which case a warning will be issued if \sphinxstyleemphasis{warn} is \sphinxcode{\sphinxupquote{True}} (default). \end{fulllineitems} \index{subplots() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.subplots}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subplots}}}{\emph{nrows=1}, \emph{ncols=1}, \emph{sharex=False}, \emph{sharey=False}, \emph{squeeze=True}, \emph{subplot\_kw=None}, \emph{gridspec\_kw=None}}{} Add a set of subplots to this figure. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{nrows, ncols}}] \leavevmode{[}int, default: 1{]} Number of rows/cols of the subplot grid. \item[{\sphinxstylestrong{sharex, sharey}}] \leavevmode{[}bool or \{‘none’, ‘all’, ‘row’, ‘col’\}, default: False{]} Controls sharing of properties among x (\sphinxcode{\sphinxupquote{sharex}}) or y (\sphinxcode{\sphinxupquote{sharey}}) axes: \begin{itemize} \item {} True or ‘all’: x- or y-axis will be shared among all subplots. \item {} False or ‘none’: each subplot x- or y-axis will be independent. \item {} ‘row’: each subplot row will share an x- or y-axis. \item {} ‘col’: each subplot column will share an x- or y-axis. \end{itemize} When subplots have a shared x-axis along a column, only the x tick labels of the bottom subplot are visible. Similarly, when subplots have a shared y-axis along a row, only the y tick labels of the first column subplot are visible. \item[{\sphinxstylestrong{squeeze}}] \leavevmode{[}bool, default: True{]}\begin{itemize} \item {} If True, extra dimensions are squeezed out from the returned axis object: \begin{itemize} \item {} if only one subplot is constructed (nrows=ncols=1), the resulting single Axes object is returned as a scalar. \item {} for Nx1 or 1xN subplots, the returned object is a 1D numpy object array of Axes objects are returned as numpy 1D arrays. \item {} for NxM, subplots with N\textgreater{}1 and M\textgreater{}1 are returned as a 2D arrays. \end{itemize} \item {} If False, no squeezing at all is done: the returned Axes object is always a 2D array containing Axes instances, even if it ends up being 1x1. \end{itemize} \item[{\sphinxstylestrong{subplot\_kw}}] \leavevmode{[}dict, default: \{\}{]} Dict with keywords passed to the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_subplot()}}}}} call used to create each subplots. \item[{\sphinxstylestrong{gridspec\_kw}}] \leavevmode{[}dict, default: \{\}{]} Dict with keywords passed to the {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpec}}}}} constructor used to create the grid the subplots are placed on. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ax}}] \leavevmode{[}single Axes object or array of Axes objects{]} The added axes. The dimensions of the resulting array can be controlled with the squeeze keyword, see above. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{\sphinxcode{\sphinxupquote{pyplot.subplots}}}] \leavevmode pyplot API; docstring includes examples. \end{description} \end{fulllineitems} \index{subplots\_adjust() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.subplots_adjust}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subplots\_adjust}}}{\emph{*args}, \emph{**kwargs}}{} Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{subplots\PYGZus{}adjust}\PYG{p}{(}\PYG{n}{left}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{bottom}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{right}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{top}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{wspace}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{hspace}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)} \end{sphinxVerbatim} Update the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.SubplotParams:matplotlib.figure.SubplotParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SubplotParams}}}}} with \sphinxstyleemphasis{kwargs} (defaulting to rc when \sphinxstyleemphasis{None}) and update the subplot locations. \end{fulllineitems} \index{suptitle() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.suptitle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{suptitle}}}{\emph{t}, \emph{**kwargs}}{} Add a centered title to the figure. kwargs are {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}} properties. Using figure coordinates, the defaults are: \begin{quote} \begin{description} \item[{x}] \leavevmode{[}0.5{]} The x location of the text in figure coords \item[{y}] \leavevmode{[}0.98{]} The y location of the text in figure coords \item[{horizontalalignment}] \leavevmode{[}‘center’{]} The horizontal alignment of the text \item[{verticalalignment}] \leavevmode{[}‘top’{]} The vertical alignment of the text \end{description} \end{quote} If the \sphinxcode{\sphinxupquote{fontproperties}} keyword argument is given then the rcParams defaults for \sphinxcode{\sphinxupquote{fontsize}} (\sphinxcode{\sphinxupquote{figure.titlesize}}) and \sphinxcode{\sphinxupquote{fontweight}} (\sphinxcode{\sphinxupquote{figure.titleweight}}) will be ignored in favour of the \sphinxcode{\sphinxupquote{FontProperties}} defaults. A {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}} instance is returned. Example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{o}{.}\PYG{n}{suptitle}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{this is the figure title}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{12}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{text() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.text}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{text}}}{\emph{x}, \emph{y}, \emph{s}, \emph{*args}, \emph{**kwargs}}{} Add text to figure. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{text}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{s}\PYG{p}{,} \PYG{n}{fontdict}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Add text to figure at location \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} (relative 0-1 coords). See {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.text:matplotlib.pyplot.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text()}}}}} for the meaning of the other arguments. kwargs control the {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} properties: \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_backgroundcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{backgroundcolor}}}}} & any matplotlib color \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bbox}}}}} & FancyBboxPatch prop dict \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[} ({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_family}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{family}}}}} or fontfamily or fontname or name & {[}FONTNAME \textbar{} ‘serif’ \textbar{} ‘sans-serif’ \textbar{} ‘cursive’ \textbar{} ‘fantasy’ \textbar{} ‘monospace’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_fontproperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fontproperties}}}}} or font\_properties & a {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_horizontalalignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{horizontalalignment}}}}} or ha & {[} ‘center’ \textbar{} ‘right’ \textbar{} ‘left’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_linespacing}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linespacing}}}}} & float (multiple of font size) \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_multialignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{multialignment}}}}} or ma & {[}‘left’ \textbar{} ‘right’ \textbar{} ‘center’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{position}}}}} & (x,y) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_rotation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotation}}}}} & {[} angle in degrees \textbar{} ‘vertical’ \textbar{} ‘horizontal’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_rotation_mode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotation\_mode}}}}} & {[} None \textbar{} “default” \textbar{} “anchor” {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_size}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{size}}}}} or fontsize & {[}size in points \textbar{} ‘xx-small’ \textbar{} ‘x-small’ \textbar{} ‘small’ \textbar{} ‘medium’ \textbar{} ‘large’ \textbar{} ‘x-large’ \textbar{} ‘xx-large’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_stretch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stretch}}}}} or fontstretch & {[}a numeric value in range 0-1000 \textbar{} ‘ultra-condensed’ \textbar{} ‘extra-condensed’ \textbar{} ‘condensed’ \textbar{} ‘semi-condensed’ \textbar{} ‘normal’ \textbar{} ‘semi-expanded’ \textbar{} ‘expanded’ \textbar{} ‘extra-expanded’ \textbar{} ‘ultra-expanded’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_style}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{style}}}}} or fontstyle & {[} ‘normal’ \textbar{} ‘italic’ \textbar{} ‘oblique’{]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text}}}}} & string or anything printable with ‘\%s’ conversion. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_usetex}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{usetex}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_variant}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{variant}}}}} or fontvariant & {[} ‘normal’ \textbar{} ‘small-caps’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_verticalalignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{verticalalignment}}}}} or va & {[} ‘center’ \textbar{} ‘top’ \textbar{} ‘bottom’ \textbar{} ‘baseline’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_weight}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{weight}}}}} or fontweight & {[}a numeric value in range 0-1000 \textbar{} ‘ultralight’ \textbar{} ‘light’ \textbar{} ‘normal’ \textbar{} ‘regular’ \textbar{} ‘book’ \textbar{} ‘medium’ \textbar{} ‘roman’ \textbar{} ‘semibold’ \textbar{} ‘demibold’ \textbar{} ‘demi’ \textbar{} ‘bold’ \textbar{} ‘heavy’ \textbar{} ‘extra bold’ \textbar{} ‘black’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_wrap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{wrap}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_x}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x}}}}} & float \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_y}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y}}}}} & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} \end{fulllineitems} \index{tight\_layout() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.tight_layout}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tight\_layout}}}{\emph{renderer=None}, \emph{pad=1.08}, \emph{h\_pad=None}, \emph{w\_pad=None}, \emph{rect=None}}{} Adjust subplot parameters to give specified padding. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{pad}}] \leavevmode{[}float{]} padding between the figure edge and the edges of subplots, as a fraction of the font-size. \item[{\sphinxstylestrong{h\_pad, w\_pad}}] \leavevmode{[}float, optional{]} padding (height/width) between edges of adjacent subplots. Defaults to \sphinxcode{\sphinxupquote{pad\_inches}}. \item[{\sphinxstylestrong{rect}}] \leavevmode{[}tuple (left, bottom, right, top), optional{]} a rectangle (left, bottom, right, top) in the normalized figure coordinate that the whole subplots area (including labels) will fit into. Default is (0, 0, 1, 1). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{waitforbuttonpress() (matplotlib.figure.Figure method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.waitforbuttonpress}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{waitforbuttonpress}}}{\emph{timeout=-1}}{} Blocking call to interact with the figure. This will return True is a key was pressed, False if a mouse button was pressed and None if \sphinxstyleemphasis{timeout} was reached without either being pressed. If \sphinxstyleemphasis{timeout} is negative, does not timeout. \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.figure.Figure}}} \label{\detokenize{api/_as_gen/matplotlib.figure.Figure:examples-using-matplotlib-figure-figure}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_agg\_oo\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_custom\_figure\_class.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_webapp\_demo\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_embedding\_in\_gtk3\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_embedding\_in\_gtk\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_embedding\_in\_gtk3\_panzoom\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_mpl\_with\_glade\_316\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_histogram\_demo\_canvasagg\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_embedding\_in\_gtk2\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_embedding\_in\_tk\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_embedding\_in\_wx2\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_embedding\_in\_wx5\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_embedding\_in\_qt\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_embedding\_in\_tk\_canvas\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_wxcursor\_demo\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_gtk\_spreadsheet\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_embedding\_in\_wx4\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_mpl\_with\_glade\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_mathtext\_wx\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_embedding\_in\_wx3\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_embedding\_webagg\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_fourier\_demo\_wx\_sgskip.py} \end{itemize} \subsubsection{matplotlib.figure.SubplotParams} \label{\detokenize{api/_as_gen/matplotlib.figure.SubplotParams:matplotlib-figure-subplotparams}}\label{\detokenize{api/_as_gen/matplotlib.figure.SubplotParams::doc}}\index{SubplotParams (class in matplotlib.figure)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.SubplotParams:matplotlib.figure.SubplotParams}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.figure.}}\sphinxbfcode{\sphinxupquote{SubplotParams}}}{\emph{left=None}, \emph{bottom=None}, \emph{right=None}, \emph{top=None}, \emph{wspace=None}, \emph{hspace=None}}{} A class to hold the parameters for a subplot All dimensions are fraction of the figure width or height. All values default to their rc params The following attributes are available \begin{description} \item[{left}] \leavevmode{[}0.125{]} The left side of the subplots of the figure \item[{right}] \leavevmode{[}0.9{]} The right side of the subplots of the figure \item[{bottom}] \leavevmode{[}0.1{]} The bottom of the subplots of the figure \item[{top}] \leavevmode{[}0.9{]} The top of the subplots of the figure \item[{wspace}] \leavevmode{[}0.2{]} The amount of width reserved for space between subplots, expressed as a fraction of the average axis width \item[{hspace}] \leavevmode{[}0.2{]} The amount of height reserved for space between subplots, expressed as a fraction of the average axis height \end{description} \index{update() (matplotlib.figure.SubplotParams method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.SubplotParams:matplotlib.figure.SubplotParams.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{\emph{left=None}, \emph{bottom=None}, \emph{right=None}, \emph{top=None}, \emph{wspace=None}, \emph{hspace=None}}{} Update the current values. If any kwarg is None, default to the current value, if set, otherwise to rc \end{fulllineitems} \end{fulllineitems} \subsection{Functions} \label{\detokenize{api/figure_api:functions}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.figaspect:matplotlib.figure.figaspect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figaspect}}}}}(arg) & Create a figure with specified aspect ratio. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.figure.figaspect} \label{\detokenize{api/_as_gen/matplotlib.figure.figaspect:matplotlib-figure-figaspect}}\label{\detokenize{api/_as_gen/matplotlib.figure.figaspect::doc}}\index{figaspect() (in module matplotlib.figure)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.figure.figaspect:matplotlib.figure.figaspect}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.figure.}}\sphinxbfcode{\sphinxupquote{figaspect}}}{\emph{arg}}{} Create a figure with specified aspect ratio. If \sphinxstyleemphasis{arg} is a number, use that aspect ratio. If \sphinxstyleemphasis{arg} is an array, figaspect will determine the width and height for a figure that would fit array preserving aspect ratio. The figure width, height in inches are returned. Be sure to create an axes with equal with and height, e.g., Example usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} make a figure twice as tall as it is wide} \PYG{n}{w}\PYG{p}{,} \PYG{n}{h} \PYG{o}{=} \PYG{n}{figaspect}\PYG{p}{(}\PYG{l+m+mf}{2.}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{Figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{n}{w}\PYG{p}{,}\PYG{n}{h}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.8}\PYG{p}{,} \PYG{l+m+mf}{0.8}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{A}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} make a figure with the proper aspect for an array} \PYG{n}{A} \PYG{o}{=} \PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{)} \PYG{n}{w}\PYG{p}{,} \PYG{n}{h} \PYG{o}{=} \PYG{n}{figaspect}\PYG{p}{(}\PYG{n}{A}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{Figure}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{n}{w}\PYG{p}{,}\PYG{n}{h}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}axes}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.8}\PYG{p}{,} \PYG{l+m+mf}{0.8}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{A}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Thanks to Fernando Perez for this function \end{fulllineitems} \chapter{font\_manager} \label{\detokenize{api/font_manager_api:font-manager}}\label{\detokenize{api/font_manager_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.font\_manager}}} \label{\detokenize{api/font_manager_api:module-matplotlib.font_manager}}\label{\detokenize{api/font_manager_api:matplotlib-font-manager}}\index{matplotlib.font\_manager (module)} A module for finding, managing, and using fonts across platforms. This module provides a single {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontManager}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FontManager}}}}} instance that can be shared across backends and platforms. The {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.findfont}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{findfont()}}}}} function returns the best TrueType (TTF) font file in the local or system font path that matches the specified {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FontProperties}}}}} instance. The {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontManager}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FontManager}}}}} also handles Adobe Font Metrics (AFM) font files for use by the PostScript backend. The design is based on the \sphinxhref{http://www.w3.org/TR/1998/REC-CSS2-19980512/}{W3C Cascading Style Sheet, Level 1 (CSS1) font specification}. Future versions may implement the Level 2 or 2.1 specifications. Experimental support is included for using \sphinxcode{\sphinxupquote{fontconfig}} on Unix variant platforms (Linux, OS X, Solaris). To enable it, set the constant \sphinxcode{\sphinxupquote{USE\_FONTCONFIG}} in this file to \sphinxcode{\sphinxupquote{True}}. Fontconfig has the advantage that it is the standard way to look up fonts on X11 platforms, so if a font is installed, it is much more likely to be found. \index{FontEntry (class in matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontEntry}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{FontEntry}}}{\emph{fname=''}, \emph{name=''}, \emph{style='normal'}, \emph{variant='normal'}, \emph{weight='normal'}, \emph{stretch='normal'}, \emph{size='medium'}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} A class for storing Font properties. It is used when populating the font lookup dictionary. \end{fulllineitems} \index{FontManager (class in matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontManager}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{FontManager}}}{\emph{size=None}, \emph{weight='normal'}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} On import, the {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontManager}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FontManager}}}}} singleton instance creates a list of TrueType fonts based on the font properties: name, style, variant, weight, stretch, and size. The {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.findfont}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{findfont()}}}}} method does a nearest neighbor search to find the font that most closely matches the specification. If no good enough match is found, a default font is returned. \index{findfont() (matplotlib.font\_manager.FontManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontManager.findfont}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{findfont}}}{\emph{prop}, \emph{fontext='ttf'}, \emph{directory=None}, \emph{fallback\_to\_default=True}, \emph{rebuild\_if\_missing=True}}{} Search the font list for the font that most closely matches the {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FontProperties}}}}} \sphinxstyleemphasis{prop}. {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.findfont}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{findfont()}}}}} performs a nearest neighbor search. Each font is given a similarity score to the target font properties. The first font with the highest score is returned. If no matches below a certain threshold are found, the default font (usually DejaVu Sans) is returned. \sphinxcode{\sphinxupquote{directory}}, is specified, will only return fonts from the given directory (or subdirectory of that directory). The result is cached, so subsequent lookups don’t have to perform the O(n) nearest neighbor search. If \sphinxcode{\sphinxupquote{fallback\_to\_default}} is True, will fallback to the default font family (usually “DejaVu Sans” or “Helvetica”) if the first lookup hard-fails. See the \sphinxhref{http://www.w3.org/TR/1998/REC-CSS2-19980512/}{W3C Cascading Style Sheet, Level 1} documentation for a description of the font finding algorithm. \end{fulllineitems} \index{get\_default\_size() (matplotlib.font\_manager.FontManager static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontManager.get_default_size}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{get\_default\_size}}}{}{} Return the default font size. \end{fulllineitems} \index{get\_default\_weight() (matplotlib.font\_manager.FontManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontManager.get_default_weight}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_default\_weight}}}{}{} Return the default font weight. \end{fulllineitems} \index{score\_family() (matplotlib.font\_manager.FontManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontManager.score_family}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{score\_family}}}{\emph{families}, \emph{family2}}{} Returns a match score between the list of font families in \sphinxstyleemphasis{families} and the font family name \sphinxstyleemphasis{family2}. An exact match at the head of the list returns 0.0. A match further down the list will return between 0 and 1. No match will return 1.0. \end{fulllineitems} \index{score\_size() (matplotlib.font\_manager.FontManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontManager.score_size}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{score\_size}}}{\emph{size1}, \emph{size2}}{} Returns a match score between \sphinxstyleemphasis{size1} and \sphinxstyleemphasis{size2}. If \sphinxstyleemphasis{size2} (the size specified in the font file) is ‘scalable’, this function always returns 0.0, since any font size can be generated. Otherwise, the result is the absolute distance between \sphinxstyleemphasis{size1} and \sphinxstyleemphasis{size2}, normalized so that the usual range of font sizes (6pt - 72pt) will lie between 0.0 and 1.0. \end{fulllineitems} \index{score\_stretch() (matplotlib.font\_manager.FontManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontManager.score_stretch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{score\_stretch}}}{\emph{stretch1}, \emph{stretch2}}{} Returns a match score between \sphinxstyleemphasis{stretch1} and \sphinxstyleemphasis{stretch2}. The result is the absolute value of the difference between the CSS numeric values of \sphinxstyleemphasis{stretch1} and \sphinxstyleemphasis{stretch2}, normalized between 0.0 and 1.0. \end{fulllineitems} \index{score\_style() (matplotlib.font\_manager.FontManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontManager.score_style}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{score\_style}}}{\emph{style1}, \emph{style2}}{} Returns a match score between \sphinxstyleemphasis{style1} and \sphinxstyleemphasis{style2}. An exact match returns 0.0. A match between ‘italic’ and ‘oblique’ returns 0.1. No match returns 1.0. \end{fulllineitems} \index{score\_variant() (matplotlib.font\_manager.FontManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontManager.score_variant}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{score\_variant}}}{\emph{variant1}, \emph{variant2}}{} Returns a match score between \sphinxstyleemphasis{variant1} and \sphinxstyleemphasis{variant2}. An exact match returns 0.0, otherwise 1.0. \end{fulllineitems} \index{score\_weight() (matplotlib.font\_manager.FontManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontManager.score_weight}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{score\_weight}}}{\emph{weight1}, \emph{weight2}}{} Returns a match score between \sphinxstyleemphasis{weight1} and \sphinxstyleemphasis{weight2}. The result is 0.0 if both weight1 and weight 2 are given as strings and have the same value. Otherwise, the result is the absolute value of the difference between the CSS numeric values of \sphinxstyleemphasis{weight1} and \sphinxstyleemphasis{weight2}, normalized between 0.05 and 1.0. \end{fulllineitems} \index{set\_default\_weight() (matplotlib.font\_manager.FontManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontManager.set_default_weight}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_default\_weight}}}{\emph{weight}}{} Set the default font weight. The initial value is ‘normal’. \end{fulllineitems} \index{update\_fonts() (matplotlib.font\_manager.FontManager method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontManager.update_fonts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_fonts}}}{\emph{filenames}}{} Update the font dictionary with new font files. Currently not implemented. \end{fulllineitems} \end{fulllineitems} \index{FontProperties (class in matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{FontProperties}}}{\emph{family=None}, \emph{style=None}, \emph{variant=None}, \emph{weight=None}, \emph{stretch=None}, \emph{size=None}, \emph{fname=None}, \emph{\_init=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} A class for storing and manipulating font properties. The font properties are those described in the \sphinxhref{http://www.w3.org/TR/1998/REC-CSS2-19980512/}{W3C Cascading Style Sheet, Level 1} font specification. The six properties are: \begin{itemize} \item {} family: A list of font names in decreasing order of priority. The items may include a generic font family name, either ‘serif’, ‘sans-serif’, ‘cursive’, ‘fantasy’, or ‘monospace’. In that case, the actual font to be used will be looked up from the associated rcParam in \sphinxcode{\sphinxupquote{matplotlibrc}}. \item {} style: Either ‘normal’, ‘italic’ or ‘oblique’. \item {} variant: Either ‘normal’ or ‘small-caps’. \item {} stretch: A numeric value in the range 0-1000 or one of ‘ultra-condensed’, ‘extra-condensed’, ‘condensed’, ‘semi-condensed’, ‘normal’, ‘semi-expanded’, ‘expanded’, ‘extra-expanded’ or ‘ultra-expanded’ \item {} weight: A numeric value in the range 0-1000 or one of ‘ultralight’, ‘light’, ‘normal’, ‘regular’, ‘book’, ‘medium’, ‘roman’, ‘semibold’, ‘demibold’, ‘demi’, ‘bold’, ‘heavy’, ‘extra bold’, ‘black’ \item {} size: Either an relative value of ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’ or an absolute font size, e.g., 12 \end{itemize} The default font property for TrueType fonts (as specified in the default \sphinxcode{\sphinxupquote{matplotlibrc}} file) is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{sans}\PYG{o}{\PYGZhy{}}\PYG{n}{serif}\PYG{p}{,} \PYG{n}{normal}\PYG{p}{,} \PYG{n}{normal}\PYG{p}{,} \PYG{n}{normal}\PYG{p}{,} \PYG{n}{normal}\PYG{p}{,} \PYG{n}{scalable}\PYG{o}{.} \end{sphinxVerbatim} Alternatively, a font may be specified using an absolute path to a .ttf file, by using the \sphinxstyleemphasis{fname} kwarg. The preferred usage of font sizes is to use the relative values, e.g., ‘large’, instead of absolute font sizes, e.g., 12. This approach allows all text sizes to be made larger or smaller based on the font manager’s default font size. This class will also accept a \sphinxhref{https://www.freedesktop.org/wiki/Software/fontconfig/}{fontconfig} pattern, if it is the only argument provided. See the documentation on \sphinxhref{https://www.freedesktop.org/software/fontconfig/fontconfig-user.html}{fontconfig patterns}. This support does not require fontconfig to be installed. We are merely borrowing its pattern syntax for use here. Note that matplotlib’s internal font manager and fontconfig use a different algorithm to lookup fonts, so the results of the same pattern may be different in matplotlib than in other applications that use fontconfig. \index{copy() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.copy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{copy}}}{}{} Return a deep copy of self \end{fulllineitems} \index{get\_family() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.get_family}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_family}}}{}{} Return a list of font names that comprise the font family. \end{fulllineitems} \index{get\_file() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.get_file}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_file}}}{}{} Return the filename of the associated font. \end{fulllineitems} \index{get\_fontconfig\_pattern() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.get_fontconfig_pattern}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fontconfig\_pattern}}}{}{} Get a fontconfig pattern suitable for looking up the font as specified with fontconfig’s \sphinxcode{\sphinxupquote{fc-match}} utility. See the documentation on \sphinxhref{https://www.freedesktop.org/software/fontconfig/fontconfig-user.html}{fontconfig patterns}. This support does not require fontconfig to be installed or support for it to be enabled. We are merely borrowing its pattern syntax for use here. \end{fulllineitems} \index{get\_name() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.get_name}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_name}}}{}{} Return the name of the font that best matches the font properties. \end{fulllineitems} \index{get\_size() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.get_size}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_size}}}{}{} Return the font size. \end{fulllineitems} \index{get\_size\_in\_points() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.get_size_in_points}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_size\_in\_points}}}{}{}~ \end{fulllineitems} \index{get\_slant() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.get_slant}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_slant}}}{}{} Return the font style. Values are: ‘normal’, ‘italic’ or ‘oblique’. \end{fulllineitems} \index{get\_stretch() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.get_stretch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_stretch}}}{}{} Return the font stretch or width. Options are: ‘ultra-condensed’, ‘extra-condensed’, ‘condensed’, ‘semi-condensed’, ‘normal’, ‘semi-expanded’, ‘expanded’, ‘extra-expanded’, ‘ultra-expanded’. \end{fulllineitems} \index{get\_style() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.get_style}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_style}}}{}{} Return the font style. Values are: ‘normal’, ‘italic’ or ‘oblique’. \end{fulllineitems} \index{get\_variant() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.get_variant}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_variant}}}{}{} Return the font variant. Values are: ‘normal’ or ‘small-caps’. \end{fulllineitems} \index{get\_weight() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.get_weight}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_weight}}}{}{} Set the font weight. Options are: A numeric value in the range 0-1000 or one of ‘light’, ‘normal’, ‘regular’, ‘book’, ‘medium’, ‘roman’, ‘semibold’, ‘demibold’, ‘demi’, ‘bold’, ‘heavy’, ‘extra bold’, ‘black’ \end{fulllineitems} \index{set\_family() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.set_family}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_family}}}{\emph{family}}{} Change the font family. May be either an alias (generic name is CSS parlance), such as: ‘serif’, ‘sans-serif’, ‘cursive’, ‘fantasy’, or ‘monospace’, a real font name or a list of real font names. Real font names are not supported when \sphinxcode{\sphinxupquote{text.usetex}} is \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}. \end{fulllineitems} \index{set\_file() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.set_file}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_file}}}{\emph{file}}{} Set the filename of the fontfile to use. In this case, all other properties will be ignored. \end{fulllineitems} \index{set\_fontconfig\_pattern() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.set_fontconfig_pattern}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_fontconfig\_pattern}}}{\emph{pattern}}{} Set the properties by parsing a fontconfig \sphinxstyleemphasis{pattern}. See the documentation on \sphinxhref{https://www.freedesktop.org/software/fontconfig/fontconfig-user.html}{fontconfig patterns}. This support does not require fontconfig to be installed or support for it to be enabled. We are merely borrowing its pattern syntax for use here. \end{fulllineitems} \index{set\_name() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.set_name}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_name}}}{\emph{family}}{} Change the font family. May be either an alias (generic name is CSS parlance), such as: ‘serif’, ‘sans-serif’, ‘cursive’, ‘fantasy’, or ‘monospace’, a real font name or a list of real font names. Real font names are not supported when \sphinxcode{\sphinxupquote{text.usetex}} is \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}. \end{fulllineitems} \index{set\_size() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.set_size}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_size}}}{\emph{size}}{} Set the font size. Either an relative value of ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’ or an absolute font size, e.g., 12. \end{fulllineitems} \index{set\_slant() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.set_slant}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_slant}}}{\emph{style}}{} Set the font style. Values are: ‘normal’, ‘italic’ or ‘oblique’. \end{fulllineitems} \index{set\_stretch() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.set_stretch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_stretch}}}{\emph{stretch}}{} Set the font stretch or width. Options are: ‘ultra-condensed’, ‘extra-condensed’, ‘condensed’, ‘semi-condensed’, ‘normal’, ‘semi-expanded’, ‘expanded’, ‘extra-expanded’ or ‘ultra-expanded’, or a numeric value in the range 0-1000. \end{fulllineitems} \index{set\_style() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.set_style}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_style}}}{\emph{style}}{} Set the font style. Values are: ‘normal’, ‘italic’ or ‘oblique’. \end{fulllineitems} \index{set\_variant() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.set_variant}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_variant}}}{\emph{variant}}{} Set the font variant. Values are: ‘normal’ or ‘small-caps’. \end{fulllineitems} \index{set\_weight() (matplotlib.font\_manager.FontProperties method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties.set_weight}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_weight}}}{\emph{weight}}{} Set the font weight. May be either a numeric value in the range 0-1000 or one of ‘ultralight’, ‘light’, ‘normal’, ‘regular’, ‘book’, ‘medium’, ‘roman’, ‘semibold’, ‘demibold’, ‘demi’, ‘bold’, ‘heavy’, ‘extra bold’, ‘black’ \end{fulllineitems} \end{fulllineitems} \index{JSONEncoder (class in matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.JSONEncoder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{JSONEncoder}}}{\emph{*}, \emph{skipkeys=False}, \emph{ensure\_ascii=True}, \emph{check\_circular=True}, \emph{allow\_nan=True}, \emph{sort\_keys=False}, \emph{indent=None}, \emph{separators=None}, \emph{default=None}}{} Bases: \sphinxcode{\sphinxupquote{json.encoder.JSONEncoder}} Constructor for JSONEncoder, with sensible defaults. If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, float or None. If skipkeys is True, such items are simply skipped. If ensure\_ascii is true, the output is guaranteed to be str objects with all incoming non-ASCII characters escaped. If ensure\_ascii is false, the output can contain non-ASCII characters. If check\_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause an OverflowError). Otherwise, no such check takes place. If allow\_nan is true, then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders. Otherwise, it will be a ValueError to encode such floats. If sort\_keys is true, then the output of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis. If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation. If specified, separators should be an (item\_separator, key\_separator) tuple. The default is (‘, ‘, ‘: ‘) if \sphinxstyleemphasis{indent} is \sphinxcode{\sphinxupquote{None}} and (‘,’, ‘: ‘) otherwise. To get the most compact JSON representation, you should specify (‘,’, ‘:’) to eliminate whitespace. If specified, default is a function that gets called for objects that can’t otherwise be serialized. It should return a JSON encodable version of the object or raise a \sphinxcode{\sphinxupquote{TypeError}}. \index{default() (matplotlib.font\_manager.JSONEncoder method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.JSONEncoder.default}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{default}}}{\emph{o}}{} Implement this method in a subclass such that it returns a serializable object for \sphinxcode{\sphinxupquote{o}}, or calls the base implementation (to raise a \sphinxcode{\sphinxupquote{TypeError}}). For example, to support arbitrary iterators, you could implement default like this: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{default}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{o}\PYG{p}{)}\PYG{p}{:} \PYG{k}{try}\PYG{p}{:} \PYG{n}{iterable} \PYG{o}{=} \PYG{n+nb}{iter}\PYG{p}{(}\PYG{n}{o}\PYG{p}{)} \PYG{k}{except} \PYG{n+ne}{TypeError}\PYG{p}{:} \PYG{k}{pass} \PYG{k}{else}\PYG{p}{:} \PYG{k}{return} \PYG{n+nb}{list}\PYG{p}{(}\PYG{n}{iterable}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Let the base class default method raise the TypeError} \PYG{k}{return} \PYG{n}{JSONEncoder}\PYG{o}{.}\PYG{n}{default}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{o}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \end{fulllineitems} \index{OSXInstalledFonts() (in module matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.OSXInstalledFonts}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{OSXInstalledFonts}}}{\emph{directories=None}, \emph{fontext='ttf'}}{} Get list of font files on OS X - ignores font suffix by default. \end{fulllineitems} \index{TempCache (class in matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.TempCache}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{TempCache}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} A class to store temporary caches that are (a) not saved to disk and (b) invalidated whenever certain font-related rcParams—namely the family lookup lists—are changed or the font cache is reloaded. This avoids the expensive linear search through all fonts every time a font is looked up. \index{get() (matplotlib.font\_manager.TempCache method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.TempCache.get}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get}}}{\emph{prop}}{}~ \end{fulllineitems} \index{invalidating\_rcparams (matplotlib.font\_manager.TempCache attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.TempCache.invalidating_rcparams}}\pysigline{\sphinxbfcode{\sphinxupquote{invalidating\_rcparams}}\sphinxbfcode{\sphinxupquote{ = ('font.serif', 'font.sans-serif', 'font.cursive', 'font.fantasy', 'font.monospace')}}} \end{fulllineitems} \index{make\_rcparams\_key() (matplotlib.font\_manager.TempCache method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.TempCache.make_rcparams_key}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{make\_rcparams\_key}}}{}{}~ \end{fulllineitems} \index{set() (matplotlib.font\_manager.TempCache method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.TempCache.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{prop}, \emph{value}}{}~ \end{fulllineitems} \end{fulllineitems} \index{afmFontProperty() (in module matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.afmFontProperty}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{afmFontProperty}}}{\emph{fontpath}, \emph{font}}{} Extract information from an AFM font file. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{font}}] \leavevmode{[}{\hyperref[\detokenize{api/afm_api:matplotlib.afm.AFM}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AFM}}}}}{]} The AFM font file from which information will be extracted. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{{}`FontEntry{}`}}] \leavevmode The extracted font properties. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{createFontList() (in module matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.createFontList}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{createFontList}}}{\emph{fontfiles}, \emph{fontext='ttf'}}{} A function to create a font lookup list. The default is to create a list of TrueType fonts. An AFM font list can optionally be created. \end{fulllineitems} \index{findSystemFonts() (in module matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.findSystemFonts}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{findSystemFonts}}}{\emph{fontpaths=None}, \emph{fontext='ttf'}}{} Search for fonts in the specified font paths. If no paths are given, will use a standard set of system paths, as well as the list of fonts tracked by fontconfig if fontconfig is installed and available. A list of TrueType fonts are returned by default with AFM fonts as an option. \end{fulllineitems} \index{findfont() (in module matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.findfont}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{findfont}}}{\emph{prop}, \emph{**kw}}{}~ \end{fulllineitems} \index{get\_font() (in module matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.get_font}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{get\_font}}}{\emph{filename}, \emph{hinting\_factor=None}}{}~ \end{fulllineitems} \index{get\_fontconfig\_fonts() (in module matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.get_fontconfig_fonts}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{get\_fontconfig\_fonts}}}{\emph{fontext='ttf'}}{} List the font filenames known to \sphinxcode{\sphinxupquote{fc-list}} having the given extension. \end{fulllineitems} \index{get\_fontext\_synonyms() (in module matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.get_fontext_synonyms}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{get\_fontext\_synonyms}}}{\emph{fontext}}{} Return a list of file extensions extensions that are synonyms for the given file extension \sphinxstyleemphasis{fileext}. \end{fulllineitems} \index{is\_opentype\_cff\_font() (in module matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.is_opentype_cff_font}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{is\_opentype\_cff\_font}}}{\emph{filename}}{} Returns True if the given font is a Postscript Compact Font Format Font embedded in an OpenType wrapper. Used by the PostScript and PDF backends that can not subset these fonts. \end{fulllineitems} \index{json\_dump() (in module matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.json_dump}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{json\_dump}}}{\emph{data}, \emph{filename}}{} Dumps a data structure as JSON in the named file. Handles FontManager and its fields. \end{fulllineitems} \index{json\_load() (in module matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.json_load}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{json\_load}}}{\emph{filename}}{} Loads a data structure as JSON from the named file. Handles FontManager and its fields. \end{fulllineitems} \index{list\_fonts() (in module matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.list_fonts}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{list\_fonts}}}{\emph{directory}, \emph{extensions}}{} Return a list of all fonts matching any of the extensions, possibly upper-cased, found recursively under the directory. \end{fulllineitems} \index{ttfFontProperty() (in module matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.ttfFontProperty}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{ttfFontProperty}}}{\emph{font}}{} Extract information from a TrueType font file. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{font}}] \leavevmode{[}\sphinxcode{\sphinxupquote{FT2Font}}{]} The TrueType font file from which information will be extracted. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{{}`FontEntry{}`}}] \leavevmode The extracted font properties. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{ttfdict\_to\_fnames() (in module matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.ttfdict_to_fnames}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{ttfdict\_to\_fnames}}}{\emph{d}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The ttfdict\_to\_fnames function was deprecated in version 2.1. flatten a ttfdict to all the filenames it contains \end{fulllineitems} \index{weight\_as\_number() (in module matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.weight_as_number}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{weight\_as\_number}}}{\emph{weight}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The weight\_as\_number function was deprecated in version 2.1. Return the weight property as a numeric value. String values are converted to their corresponding numeric value. \end{fulllineitems} \index{win32FontDirectory() (in module matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.win32FontDirectory}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{win32FontDirectory}}}{}{} Return the user-specified font directory for Win32. This is looked up from the registry key: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYGZbs{}\PYGZbs{}\PYG{n}{HKEY\PYGZus{}CURRENT\PYGZus{}USER}\PYGZbs{}\PYG{n}{Software}\PYGZbs{}\PYG{n}{Microsoft}\PYGZbs{}\PYG{n}{Windows}\PYGZbs{}\PYG{n}{CurrentVersion}\PYGZbs{}\PYG{n}{Explorer}\PYGZbs{}\PYG{n}{Shell} \PYG{n}{Folders}\PYGZbs{}\PYG{n}{Fonts} \end{sphinxVerbatim} If the key is not found, \$WINDIR/Fonts will be returned. \end{fulllineitems} \index{win32InstalledFonts() (in module matplotlib.font\_manager)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.font_manager.win32InstalledFonts}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.}}\sphinxbfcode{\sphinxupquote{win32InstalledFonts}}}{\emph{directory=None}, \emph{fontext='ttf'}}{} Search for fonts in the specified font directory, or use the system directories if none given. A list of TrueType font filenames are returned by default, or AFM fonts if \sphinxstyleemphasis{fontext} == ‘afm’. \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.fontconfig\_pattern}}} \label{\detokenize{api/font_manager_api:module-matplotlib.fontconfig_pattern}}\label{\detokenize{api/font_manager_api:matplotlib-fontconfig-pattern}}\index{matplotlib.fontconfig\_pattern (module)} A module for parsing and generating fontconfig patterns. See the \sphinxhref{https://www.freedesktop.org/software/fontconfig/fontconfig-user.html}{fontconfig pattern specification} for more information. \index{FontconfigPatternParser (class in matplotlib.fontconfig\_pattern)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.fontconfig_pattern.FontconfigPatternParser}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.fontconfig\_pattern.}}\sphinxbfcode{\sphinxupquote{FontconfigPatternParser}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} A simple pyparsing-based parser for fontconfig-style patterns. See the \sphinxhref{https://www.freedesktop.org/software/fontconfig/fontconfig-user.html}{fontconfig pattern specification} for more information. \index{parse() (matplotlib.fontconfig\_pattern.FontconfigPatternParser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.fontconfig_pattern.FontconfigPatternParser.parse}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{parse}}}{\emph{pattern}}{} Parse the given fontconfig \sphinxstyleemphasis{pattern} and return a dictionary of key/value pairs useful for initializing a \sphinxcode{\sphinxupquote{font\_manager.FontProperties}} object. \end{fulllineitems} \end{fulllineitems} \index{family\_escape() (in module matplotlib.fontconfig\_pattern)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.fontconfig_pattern.family_escape}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.fontconfig\_pattern.}}\sphinxbfcode{\sphinxupquote{family\_escape}}}{\emph{\$self}, \emph{/}, \emph{repl}, \emph{string}, \emph{count=0}}{} Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl. \end{fulllineitems} \index{family\_unescape() (in module matplotlib.fontconfig\_pattern)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.fontconfig_pattern.family_unescape}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.fontconfig\_pattern.}}\sphinxbfcode{\sphinxupquote{family\_unescape}}}{\emph{\$self}, \emph{/}, \emph{repl}, \emph{string}, \emph{count=0}}{} Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl. \end{fulllineitems} \index{generate\_fontconfig\_pattern() (in module matplotlib.fontconfig\_pattern)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.fontconfig_pattern.generate_fontconfig_pattern}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.fontconfig\_pattern.}}\sphinxbfcode{\sphinxupquote{generate\_fontconfig\_pattern}}}{\emph{d}}{} Given a dictionary of key/value pairs, generates a fontconfig pattern string. \end{fulllineitems} \index{parse\_fontconfig\_pattern (in module matplotlib.fontconfig\_pattern)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.fontconfig_pattern.parse_fontconfig_pattern}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.fontconfig\_pattern.}}\sphinxbfcode{\sphinxupquote{parse\_fontconfig\_pattern}}} Parse the given fontconfig \sphinxstyleemphasis{pattern} and return a dictionary of key/value pairs useful for initializing a \sphinxcode{\sphinxupquote{font\_manager.FontProperties}} object. \end{fulllineitems} \index{value\_escape() (in module matplotlib.fontconfig\_pattern)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.fontconfig_pattern.value_escape}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.fontconfig\_pattern.}}\sphinxbfcode{\sphinxupquote{value\_escape}}}{\emph{\$self}, \emph{/}, \emph{repl}, \emph{string}, \emph{count=0}}{} Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl. \end{fulllineitems} \index{value\_unescape() (in module matplotlib.fontconfig\_pattern)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/font_manager_api:matplotlib.fontconfig_pattern.value_unescape}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.fontconfig\_pattern.}}\sphinxbfcode{\sphinxupquote{value\_unescape}}}{\emph{\$self}, \emph{/}, \emph{repl}, \emph{string}, \emph{count=0}}{} Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl. \end{fulllineitems} \chapter{gridspec} \label{\detokenize{api/gridspec_api:gridspec}}\label{\detokenize{api/gridspec_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.gridspec}}} \label{\detokenize{api/gridspec_api:module-matplotlib.gridspec}}\label{\detokenize{api/gridspec_api:matplotlib-gridspec}}\index{matplotlib.gridspec (module)} {\hyperref[\detokenize{api/gridspec_api:module-matplotlib.gridspec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gridspec}}}}} is a module which specifies the location of the subplot in the figure. \begin{quote} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpec}}}}}}] \leavevmode specifies the geometry of the grid that a subplot will be placed. The number of rows and number of columns of the grid need to be set. Optionally, the subplot layout parameters (e.g., left, right, etc.) can be tuned. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.SubplotSpec:matplotlib.gridspec.SubplotSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SubplotSpec}}}}}}] \leavevmode specifies the location of the subplot in the given {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpec}}}}}. \end{description} \end{quote} \subsection{Classes} \label{\detokenize{api/gridspec_api:classes}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpec}}}}}(nrows, ncols{[}, figure, left, …{]}) & A class that specifies the geometry of the grid that a subplot will be placed. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.SubplotSpec:matplotlib.gridspec.SubplotSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SubplotSpec}}}}}(gridspec, num1{[}, num2{]}) & Specifies the location of the subplot in the given {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpec}}}}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecBase:matplotlib.gridspec.GridSpecBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpecBase}}}}}(nrows, ncols{[}, height\_ratios, …{]}) & A base class of GridSpec that specifies the geometry of the grid that a subplot will be placed. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecFromSubplotSpec:matplotlib.gridspec.GridSpecFromSubplotSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpecFromSubplotSpec}}}}}(nrows, ncols, …{[}, …{]}) & GridSpec whose subplot layout parameters are inherited from the location specified by a given SubplotSpec. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.gridspec.GridSpec} \label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib-gridspec-gridspec}}\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec::doc}}\index{GridSpec (class in matplotlib.gridspec)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.gridspec.}}\sphinxbfcode{\sphinxupquote{GridSpec}}}{\emph{nrows}, \emph{ncols}, \emph{figure=None}, \emph{left=None}, \emph{bottom=None}, \emph{right=None}, \emph{top=None}, \emph{wspace=None}, \emph{hspace=None}, \emph{width\_ratios=None}, \emph{height\_ratios=None}}{} A class that specifies the geometry of the grid that a subplot will be placed. The location of grid is determined by similar way as the SubplotParams. The number of rows and number of columns of the grid need to be set. Optionally, the subplot layout parameters (e.g., left, right, etc.) can be tuned. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{nrows}}] \leavevmode{[}int{]} Number of rows in grid. \item[{\sphinxstylestrong{ncols}}] \leavevmode{[}int{]} Number or columns in grid. \end{description} \end{description}\end{quote} \paragraph{Notes} See {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.SubplotParams:matplotlib.figure.SubplotParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SubplotParams}}}}} for descriptions of the layout parameters. \index{get\_subplot\_params() (matplotlib.gridspec.GridSpec method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec.get_subplot_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_subplot\_params}}}{\emph{figure=None}, \emph{fig=None}}{} Return a dictionary of subplot layout parameters. The default parameters are from rcParams unless a figure attribute is set. \end{fulllineitems} \index{locally\_modified\_subplot\_params() (matplotlib.gridspec.GridSpec method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec.locally_modified_subplot_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{locally\_modified\_subplot\_params}}}{}{}~ \end{fulllineitems} \index{tight\_layout() (matplotlib.gridspec.GridSpec method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec.tight_layout}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tight\_layout}}}{\emph{figure}, \emph{renderer=None}, \emph{pad=1.08}, \emph{h\_pad=None}, \emph{w\_pad=None}, \emph{rect=None}}{} Adjust subplot parameters to give specified padding. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{pad}}] \leavevmode{[}float{]} Padding between the figure edge and the edges of subplots, as a fraction of the font-size. \item[{\sphinxstylestrong{h\_pad, w\_pad}}] \leavevmode{[}float, optional{]} Padding (height/width) between edges of adjacent subplots. Defaults to \sphinxcode{\sphinxupquote{pad\_inches}}. \item[{\sphinxstylestrong{rect}}] \leavevmode{[}tuple of 4 floats, optional{]} (left, bottom, right, top) rectangle in normalized figure coordinates that the whole subplots area (including labels) will fit into. Default is (0, 0, 1, 1). \end{description} \end{description}\end{quote} \end{fulllineitems} \index{update() (matplotlib.gridspec.GridSpec method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{\emph{**kwargs}}{} Update the current values. If any kwarg is None, default to the current value, if set, otherwise to rc. \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.gridspec.GridSpec}}} \label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:examples-using-matplotlib-gridspec-gridspec}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_align\_labels\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_demo\_tight\_layout.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_markevery\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_plot\_streamplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_pie\_demo2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec05.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec02.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec03.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec04.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec06.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/gridspec:sphx-glr-tutorials-intermediate-gridspec-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Figure Layouts Using GridSpec and Other Functions}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-tutorials-intermediate-tight-layout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Tight Layout guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/imshow_extent:sphx-glr-tutorials-intermediate-imshow-extent-py}]{\sphinxcrossref{\DUrole{std,std-ref}{origin and extent in imshow}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/constrainedlayout_guide:sphx-glr-tutorials-intermediate-constrainedlayout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Constrained Layout Guide}}}} \end{itemize} \subsubsection{matplotlib.gridspec.SubplotSpec} \label{\detokenize{api/_as_gen/matplotlib.gridspec.SubplotSpec:matplotlib-gridspec-subplotspec}}\label{\detokenize{api/_as_gen/matplotlib.gridspec.SubplotSpec::doc}}\index{SubplotSpec (class in matplotlib.gridspec)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.SubplotSpec:matplotlib.gridspec.SubplotSpec}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.gridspec.}}\sphinxbfcode{\sphinxupquote{SubplotSpec}}}{\emph{gridspec}, \emph{num1}, \emph{num2=None}}{} Specifies the location of the subplot in the given {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpec}}}}}. The subplot will occupy the num1-th cell of the given gridspec. If num2 is provided, the subplot will span between num1-th cell and num2-th cell. The index starts from 0. \index{get\_geometry() (matplotlib.gridspec.SubplotSpec method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.SubplotSpec:matplotlib.gridspec.SubplotSpec.get_geometry}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_geometry}}}{}{} Get the subplot geometry (\sphinxcode{\sphinxupquote{n\_rows, n\_cols, start, stop}}). start and stop are the index of the start and stop of the subplot. \end{fulllineitems} \index{get\_gridspec() (matplotlib.gridspec.SubplotSpec method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.SubplotSpec:matplotlib.gridspec.SubplotSpec.get_gridspec}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_gridspec}}}{}{}~ \end{fulllineitems} \index{get\_position() (matplotlib.gridspec.SubplotSpec method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.SubplotSpec:matplotlib.gridspec.SubplotSpec.get_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_position}}}{\emph{figure}, \emph{return\_all=False}}{} Update the subplot position from \sphinxcode{\sphinxupquote{figure.subplotpars}}. \end{fulllineitems} \index{get\_rows\_columns() (matplotlib.gridspec.SubplotSpec method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.SubplotSpec:matplotlib.gridspec.SubplotSpec.get_rows_columns}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rows\_columns}}}{}{} Get the subplot row and column numbers: (\sphinxcode{\sphinxupquote{n\_rows, n\_cols, row\_start, row\_stop, col\_start, col\_stop}}) \end{fulllineitems} \index{get\_topmost\_subplotspec() (matplotlib.gridspec.SubplotSpec method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.SubplotSpec:matplotlib.gridspec.SubplotSpec.get_topmost_subplotspec}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_topmost\_subplotspec}}}{}{} get the topmost SubplotSpec instance associated with the subplot \end{fulllineitems} \end{fulllineitems} \subsubsection{matplotlib.gridspec.GridSpecBase} \label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecBase:matplotlib-gridspec-gridspecbase}}\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecBase::doc}}\index{GridSpecBase (class in matplotlib.gridspec)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecBase:matplotlib.gridspec.GridSpecBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.gridspec.}}\sphinxbfcode{\sphinxupquote{GridSpecBase}}}{\emph{nrows}, \emph{ncols}, \emph{height\_ratios=None}, \emph{width\_ratios=None}}{} A base class of GridSpec that specifies the geometry of the grid that a subplot will be placed. The number of rows and number of columns of the grid need to be set. Optionally, the ratio of heights and widths of rows and columns can be specified. \index{get\_geometry() (matplotlib.gridspec.GridSpecBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecBase:matplotlib.gridspec.GridSpecBase.get_geometry}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_geometry}}}{}{} get the geometry of the grid, e.g., 2,3 \end{fulllineitems} \index{get\_grid\_positions() (matplotlib.gridspec.GridSpecBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecBase:matplotlib.gridspec.GridSpecBase.get_grid_positions}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_grid\_positions}}}{\emph{fig}, \emph{raw=False}}{} return lists of bottom and top position of rows, left and right positions of columns. If raw=True, then these are all in units relative to the container with no margins. (used for constrained\_layout). \end{fulllineitems} \index{get\_height\_ratios() (matplotlib.gridspec.GridSpecBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecBase:matplotlib.gridspec.GridSpecBase.get_height_ratios}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_height\_ratios}}}{}{}~ \end{fulllineitems} \index{get\_subplot\_params() (matplotlib.gridspec.GridSpecBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecBase:matplotlib.gridspec.GridSpecBase.get_subplot_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_subplot\_params}}}{\emph{figure=None}, \emph{fig=None}}{}~ \end{fulllineitems} \index{get\_width\_ratios() (matplotlib.gridspec.GridSpecBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecBase:matplotlib.gridspec.GridSpecBase.get_width_ratios}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_width\_ratios}}}{}{}~ \end{fulllineitems} \index{new\_subplotspec() (matplotlib.gridspec.GridSpecBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecBase:matplotlib.gridspec.GridSpecBase.new_subplotspec}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{new\_subplotspec}}}{\emph{loc}, \emph{rowspan=1}, \emph{colspan=1}}{} create and return a SuplotSpec instance. \end{fulllineitems} \index{set\_height\_ratios() (matplotlib.gridspec.GridSpecBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecBase:matplotlib.gridspec.GridSpecBase.set_height_ratios}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_height\_ratios}}}{\emph{height\_ratios}}{}~ \end{fulllineitems} \index{set\_width\_ratios() (matplotlib.gridspec.GridSpecBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecBase:matplotlib.gridspec.GridSpecBase.set_width_ratios}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_width\_ratios}}}{\emph{width\_ratios}}{}~ \end{fulllineitems} \end{fulllineitems} \subsubsection{matplotlib.gridspec.GridSpecFromSubplotSpec} \label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecFromSubplotSpec:matplotlib-gridspec-gridspecfromsubplotspec}}\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecFromSubplotSpec::doc}}\index{GridSpecFromSubplotSpec (class in matplotlib.gridspec)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecFromSubplotSpec:matplotlib.gridspec.GridSpecFromSubplotSpec}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.gridspec.}}\sphinxbfcode{\sphinxupquote{GridSpecFromSubplotSpec}}}{\emph{nrows}, \emph{ncols}, \emph{subplot\_spec}, \emph{wspace=None}, \emph{hspace=None}, \emph{height\_ratios=None}, \emph{width\_ratios=None}}{} GridSpec whose subplot layout parameters are inherited from the location specified by a given SubplotSpec. The number of rows and number of columns of the grid need to be set. An instance of SubplotSpec is also needed to be set from which the layout parameters will be inherited. The wspace and hspace of the layout can be optionally specified or the default values (from the figure or rcParams) will be used. \index{get\_subplot\_params() (matplotlib.gridspec.GridSpecFromSubplotSpec method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecFromSubplotSpec:matplotlib.gridspec.GridSpecFromSubplotSpec.get_subplot_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_subplot\_params}}}{\emph{figure=None}, \emph{fig=None}}{} Return a dictionary of subplot layout parameters. \end{fulllineitems} \index{get\_topmost\_subplotspec() (matplotlib.gridspec.GridSpecFromSubplotSpec method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecFromSubplotSpec:matplotlib.gridspec.GridSpecFromSubplotSpec.get_topmost_subplotspec}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_topmost\_subplotspec}}}{}{} Get the topmost SubplotSpec instance associated with the subplot. \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.gridspec.GridSpecFromSubplotSpec}}} \label{\detokenize{api/_as_gen/matplotlib.gridspec.GridSpecFromSubplotSpec:examples-using-matplotlib-gridspec-gridspecfromsubplotspec}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec04.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec06.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/gridspec:sphx-glr-tutorials-intermediate-gridspec-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Figure Layouts Using GridSpec and Other Functions}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/constrainedlayout_guide:sphx-glr-tutorials-intermediate-constrainedlayout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Constrained Layout Guide}}}} \end{itemize} \chapter{image} \label{\detokenize{api/image_api:image}}\label{\detokenize{api/image_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.image}}} \label{\detokenize{api/image_api:module-matplotlib.image}}\label{\detokenize{api/image_api:matplotlib-image}}\index{matplotlib.image (module)} The image module supports basic image loading, rescaling and display operations. \index{AxesImage (class in matplotlib.image)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.AxesImage}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.image.}}\sphinxbfcode{\sphinxupquote{AxesImage}}}{\emph{ax}, \emph{cmap=None}, \emph{norm=None}, \emph{interpolation=None}, \emph{origin=None}, \emph{extent=None}, \emph{filternorm=1}, \emph{filterrad=4.0}, \emph{resample=False}, \emph{**kwargs}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.image.\_ImageBase}} interpolation and cmap default to their rc settings cmap is a colors.Colormap instance norm is a colors.Normalize instance to map luminance to 0-1 extent is data axes (left, right, bottom, top) for making image plots registered with data plots. Default is to label the pixel centers with the zero-based row and column indices. Additional kwargs are matplotlib.artist properties \index{get\_cursor\_data() (matplotlib.image.AxesImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.AxesImage.get_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event \end{fulllineitems} \index{get\_extent() (matplotlib.image.AxesImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.AxesImage.get_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_extent}}}{}{} Get the image extent: left, right, bottom, top \end{fulllineitems} \index{get\_window\_extent() (matplotlib.image.AxesImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.AxesImage.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer=None}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{make\_image() (matplotlib.image.AxesImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.AxesImage.make_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{make\_image}}}{\emph{renderer}, \emph{magnification=1.0}, \emph{unsampled=False}}{}~ \end{fulllineitems} \index{set\_extent() (matplotlib.image.AxesImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.AxesImage.set_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_extent}}}{\emph{extent}}{} extent is data axes (left, right, bottom, top) for making image plots This updates ax.dataLim, and, if autoscaling, sets viewLim to tightly fit the image, regardless of dataLim. Autoscaling state is not changed, so following this with ax.autoscale\_view will redo the autoscaling in accord with dataLim. \end{fulllineitems} \end{fulllineitems} \index{BboxImage (class in matplotlib.image)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.BboxImage}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.image.}}\sphinxbfcode{\sphinxupquote{BboxImage}}}{\emph{bbox}, \emph{cmap=None}, \emph{norm=None}, \emph{interpolation=None}, \emph{origin=None}, \emph{filternorm=1}, \emph{filterrad=4.0}, \emph{resample=False}, \emph{interp\_at\_native=True}, \emph{**kwargs}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.image.\_ImageBase}} The Image class whose size is determined by the given bbox. cmap is a colors.Colormap instance norm is a colors.Normalize instance to map luminance to 0-1 interp\_at\_native is a flag that determines whether or not interpolation should still be applied when the image is displayed at its native resolution. A common use case for this is when displaying an image for annotational purposes; it is treated similarly to Photoshop (interpolation is only used when displaying the image at non-native resolutions). kwargs are an optional list of Artist keyword args \index{contains() (matplotlib.image.BboxImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.BboxImage.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred within the image. \end{fulllineitems} \index{get\_transform() (matplotlib.image.BboxImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.BboxImage.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance used by this artist. \end{fulllineitems} \index{get\_window\_extent() (matplotlib.image.BboxImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.BboxImage.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer=None}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{make\_image() (matplotlib.image.BboxImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.BboxImage.make_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{make\_image}}}{\emph{renderer}, \emph{magnification=1.0}, \emph{unsampled=False}}{}~ \end{fulllineitems} \end{fulllineitems} \index{FigureImage (class in matplotlib.image)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.FigureImage}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.image.}}\sphinxbfcode{\sphinxupquote{FigureImage}}}{\emph{fig}, \emph{cmap=None}, \emph{norm=None}, \emph{offsetx=0}, \emph{offsety=0}, \emph{origin=None}, \emph{**kwargs}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.image.\_ImageBase}} cmap is a colors.Colormap instance norm is a colors.Normalize instance to map luminance to 0-1 kwargs are an optional list of Artist keyword args \index{get\_extent() (matplotlib.image.FigureImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.FigureImage.get_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_extent}}}{}{} Get the image extent: left, right, bottom, top \end{fulllineitems} \index{make\_image() (matplotlib.image.FigureImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.FigureImage.make_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{make\_image}}}{\emph{renderer}, \emph{magnification=1.0}, \emph{unsampled=False}}{}~ \end{fulllineitems} \index{set\_data() (matplotlib.image.FigureImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.FigureImage.set_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_data}}}{\emph{A}}{} Set the image array. \end{fulllineitems} \index{zorder (matplotlib.image.FigureImage attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.FigureImage.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \end{fulllineitems} \index{NonUniformImage (class in matplotlib.image)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.NonUniformImage}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.image.}}\sphinxbfcode{\sphinxupquote{NonUniformImage}}}{\emph{ax}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/image_api:matplotlib.image.AxesImage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.image.AxesImage}}}}} kwargs are identical to those for AxesImage, except that ‘nearest’ and ‘bilinear’ are the only supported ‘interpolation’ options. \index{get\_extent() (matplotlib.image.NonUniformImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.NonUniformImage.get_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_extent}}}{}{} Get the image extent: left, right, bottom, top \end{fulllineitems} \index{make\_image() (matplotlib.image.NonUniformImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.NonUniformImage.make_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{make\_image}}}{\emph{renderer}, \emph{magnification=1.0}, \emph{unsampled=False}}{}~ \end{fulllineitems} \index{set\_array() (matplotlib.image.NonUniformImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.NonUniformImage.set_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_array}}}{\emph{*args}}{} Retained for backwards compatibility - use set\_data instead ACCEPTS: numpy array A or PIL Image \end{fulllineitems} \index{set\_cmap() (matplotlib.image.NonUniformImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.NonUniformImage.set_cmap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_cmap}}}{\emph{cmap}}{} set the colormap for luminance data ACCEPTS: a colormap or registered colormap name \end{fulllineitems} \index{set\_data() (matplotlib.image.NonUniformImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.NonUniformImage.set_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_data}}}{\emph{x}, \emph{y}, \emph{A}}{} Set the grid for the pixel centers, and the pixel values. \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} are monotonic 1-D ndarrays of lengths N and M,}] \leavevmode respectively, specifying pixel centers \item[{\sphinxstyleemphasis{A} is an (M,N) ndarray or masked array of values to be}] \leavevmode colormapped, or a (M,N,3) RGB array, or a (M,N,4) RGBA array. \end{description} \end{quote} \end{fulllineitems} \index{set\_filternorm() (matplotlib.image.NonUniformImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.NonUniformImage.set_filternorm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_filternorm}}}{\emph{s}}{} Set whether the resize filter norms the weights \textendash{} see help for imshow ACCEPTS: 0 or 1 \end{fulllineitems} \index{set\_filterrad() (matplotlib.image.NonUniformImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.NonUniformImage.set_filterrad}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_filterrad}}}{\emph{s}}{} Set the resize filter radius only applicable to some interpolation schemes \textendash{} see help for imshow ACCEPTS: positive float \end{fulllineitems} \index{set\_interpolation() (matplotlib.image.NonUniformImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.NonUniformImage.set_interpolation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_interpolation}}}{\emph{s}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}str, None{]} Either ‘nearest’, ‘bilinear’, or \sphinxcode{\sphinxupquote{None}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_norm() (matplotlib.image.NonUniformImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.NonUniformImage.set_norm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_norm}}}{\emph{norm}}{} Set the normalization instance. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{PcolorImage (class in matplotlib.image)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.PcolorImage}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.image.}}\sphinxbfcode{\sphinxupquote{PcolorImage}}}{\emph{ax}, \emph{x=None}, \emph{y=None}, \emph{A=None}, \emph{cmap=None}, \emph{norm=None}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/image_api:matplotlib.image.AxesImage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.image.AxesImage}}}}} Make a pcolor-style plot with an irregular rectangular grid. This uses a variation of the original irregular image code, and it is used by pcolorfast for the corresponding grid type. cmap defaults to its rc setting cmap is a colors.Colormap instance norm is a colors.Normalize instance to map luminance to 0-1 Additional kwargs are matplotlib.artist properties \index{get\_cursor\_data() (matplotlib.image.PcolorImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.PcolorImage.get_cursor_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cursor\_data}}}{\emph{event}}{} Get the cursor data for a given event \end{fulllineitems} \index{make\_image() (matplotlib.image.PcolorImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.PcolorImage.make_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{make\_image}}}{\emph{renderer}, \emph{magnification=1.0}, \emph{unsampled=False}}{}~ \end{fulllineitems} \index{set\_array() (matplotlib.image.PcolorImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.PcolorImage.set_array}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_array}}}{\emph{*args}}{} Retained for backwards compatibility - use set\_data instead ACCEPTS: numpy array A or PIL Image \end{fulllineitems} \index{set\_data() (matplotlib.image.PcolorImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.PcolorImage.set_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_data}}}{\emph{x}, \emph{y}, \emph{A}}{} Set the grid for the rectangle boundaries, and the data values. \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} are monotonic 1-D ndarrays of lengths N+1 and M+1,}] \leavevmode respectively, specifying rectangle boundaries. If None, they will be created as uniform arrays from 0 through N and 0 through M, respectively. \item[{\sphinxstyleemphasis{A} is an (M,N) ndarray or masked array of values to be}] \leavevmode colormapped, or a (M,N,3) RGB array, or a (M,N,4) RGBA array. \end{description} \end{quote} \end{fulllineitems} \end{fulllineitems} \index{composite\_images() (in module matplotlib.image)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.composite_images}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.image.}}\sphinxbfcode{\sphinxupquote{composite\_images}}}{\emph{images}, \emph{renderer}, \emph{magnification=1.0}}{} Composite a number of RGBA images into one. The images are composited in the order in which they appear in the \sphinxcode{\sphinxupquote{images}} list. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{images}}] \leavevmode{[}list of Images{]} Each must have a \sphinxcode{\sphinxupquote{make\_image}} method. For each image, \sphinxcode{\sphinxupquote{can\_composite}} should return \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, though this is not enforced by this function. Each image must have a purely affine transformation with no shear. \item[{\sphinxstylestrong{renderer}}] \leavevmode{[}RendererBase instance{]} \item[{\sphinxstylestrong{magnification}}] \leavevmode{[}float{]} The additional magnification to apply for the renderer in use. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{tuple}}] \leavevmode{[}image, offset\_x, offset\_y{]} Returns the tuple: \begin{itemize} \item {} image: A numpy array of the same type as the input images. \item {} offset\_x, offset\_y: The offset of the image (left, bottom) in the output figure. \end{itemize} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{imread() (in module matplotlib.image)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.imread}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.image.}}\sphinxbfcode{\sphinxupquote{imread}}}{\emph{fname}, \emph{format=None}}{} Read an image from a file into an array. \sphinxstyleemphasis{fname} may be a string path, a valid URL, or a Python file-like object. If using a file object, it must be opened in binary mode. If \sphinxstyleemphasis{format} is provided, will try to read file of that type, otherwise the format is deduced from the filename. If nothing can be deduced, PNG is tried. Return value is a \sphinxcode{\sphinxupquote{numpy.array}}. For grayscale images, the return array is MxN. For RGB images, the return value is MxNx3. For RGBA images the return value is MxNx4. matplotlib can only read PNGs natively, but if \sphinxhref{http://www.pythonware.com/products/pil/}{PIL} is installed, it will use it to load the image and return an array (if possible) which can be used with {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow()}}}}}. Note, URL strings may not be compatible with PIL. Check the PIL documentation for more information. \end{fulllineitems} \index{imsave() (in module matplotlib.image)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.imsave}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.image.}}\sphinxbfcode{\sphinxupquote{imsave}}}{\emph{fname}, \emph{arr}, \emph{vmin=None}, \emph{vmax=None}, \emph{cmap=None}, \emph{format=None}, \emph{origin=None}, \emph{dpi=100}}{} Save an array as in image file. The output formats available depend on the backend being used. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fname}}] \leavevmode{[}str or file-like{]} Path string to a filename, or a Python file-like object. If \sphinxstyleemphasis{format} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{fname} is a string, the output format is deduced from the extension of the filename. \item[{\sphinxstylestrong{arr}}] \leavevmode{[}array-like{]} An MxN (luminance), MxNx3 (RGB) or MxNx4 (RGBA) array. \item[{\sphinxstylestrong{vmin, vmax: {[} None \textbar{} scalar {]}}}] \leavevmode \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} set the color scaling for the image by fixing the values that map to the colormap color limits. If either \sphinxstyleemphasis{vmin} or \sphinxstyleemphasis{vmax} is None, that limit is determined from the \sphinxstyleemphasis{arr} min/max value. \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}matplotlib.colors.Colormap, optional{]} For example, \sphinxcode{\sphinxupquote{cm.viridis}}. If \sphinxcode{\sphinxupquote{None}}, defaults to the \sphinxcode{\sphinxupquote{image.cmap}} rcParam. \item[{\sphinxstylestrong{format}}] \leavevmode{[}str{]} One of the file extensions supported by the active backend. Most backends support png, pdf, ps, eps and svg. \item[{\sphinxstylestrong{origin}}] \leavevmode{[}{[} ‘upper’ \textbar{} ‘lower’ {]}{]} Indicates whether the \sphinxcode{\sphinxupquote{(0, 0)}} index of the array is in the upper left or lower left corner of the axes. Defaults to the \sphinxcode{\sphinxupquote{image.origin}} rcParam. \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}int{]} The DPI to store in the metadata of the file. This does not affect the resolution of the output image. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{pil\_to\_array() (in module matplotlib.image)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.pil_to_array}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.image.}}\sphinxbfcode{\sphinxupquote{pil\_to\_array}}}{\emph{pilImage}}{} Load a PIL image and return it as a numpy array. Grayscale images are returned as \sphinxcode{\sphinxupquote{(M, N)}} arrays. RGB images are returned as \sphinxcode{\sphinxupquote{(M, N, 3)}} arrays. RGBA images are returned as \sphinxcode{\sphinxupquote{(M, N, 4)}} arrays. \end{fulllineitems} \index{thumbnail() (in module matplotlib.image)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/image_api:matplotlib.image.thumbnail}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.image.}}\sphinxbfcode{\sphinxupquote{thumbnail}}}{\emph{infile}, \emph{thumbfile}, \emph{scale=0.1}, \emph{interpolation='bilinear'}, \emph{preview=False}}{} make a thumbnail of image in \sphinxstyleemphasis{infile} with output filename \sphinxstyleemphasis{thumbfile}. \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{infile} the image file \textendash{} must be PNG or Pillow-readable if you}] \leavevmode have \sphinxhref{http://python-pillow.org/}{Pillow} installed \item[{\sphinxstyleemphasis{thumbfile}}] \leavevmode the thumbnail filename \item[{\sphinxstyleemphasis{scale}}] \leavevmode the scale factor for the thumbnail \item[{\sphinxstyleemphasis{interpolation}}] \leavevmode the interpolation scheme used in the resampling \item[{\sphinxstyleemphasis{preview}}] \leavevmode if True, the default backend (presumably a user interface backend) will be used which will cause a figure to be raised if {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.show:matplotlib.pyplot.show}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{show()}}}}} is called. If it is False, a pure image backend will be used depending on the extension, ‘png’-\textgreater{}FigureCanvasAgg, ‘pdf’-\textgreater{}FigureCanvasPdf, ‘svg’-\textgreater{}FigureCanvasSVG \end{description} \end{quote} See examples/misc/image\_thumbnail.py. Return value is the figure instance containing the thumbnail \end{fulllineitems} \chapter{legend and legend\_handler} \label{\detokenize{api/legend_api:legend-and-legend-handler}}\label{\detokenize{api/legend_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.legend}}} \label{\detokenize{api/legend_api:module-matplotlib.legend}}\label{\detokenize{api/legend_api:matplotlib-legend}}\index{matplotlib.legend (module)} The legend module defines the Legend class, which is responsible for drawing legends associated with axes and/or figures. \begin{sphinxadmonition}{important}{Important:} It is unlikely that you would ever create a Legend instance manually. Most users would normally create a legend via the {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.legend:matplotlib.axes.Axes.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend()}}}}} function. For more details on legends there is also a {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{legend guide}}}}. \end{sphinxadmonition} The Legend class can be considered as a container of legend handles and legend texts. Creation of corresponding legend handles from the plot elements in the axes or figures (e.g., lines, patches, etc.) are specified by the handler map, which defines the mapping between the plot elements and the legend handlers to be used (the default legend handlers are defined in the {\hyperref[\detokenize{api/legend_api:module-matplotlib.legend_handler}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend\_handler}}}}} module). Note that not all kinds of artist are supported by the legend yet by default but it is possible to extend the legend handler’s capabilities to support arbitrary objects. See the {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{legend guide}}}} for more information. \index{DraggableLegend (class in matplotlib.legend)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.DraggableLegend}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.legend.}}\sphinxbfcode{\sphinxupquote{DraggableLegend}}}{\emph{legend}, \emph{use\_blit=False}, \emph{update='loc'}}{} Bases: {\hyperref[\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableOffsetBox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.offsetbox.DraggableOffsetBox}}}}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{update}}] \leavevmode{[}string{]} If “loc”, update \sphinxstyleemphasis{loc} parameter of legend upon finalizing. If “bbox”, update \sphinxstyleemphasis{bbox\_to\_anchor} parameter. \end{description} \end{description}\end{quote} \index{artist\_picker() (matplotlib.legend.DraggableLegend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.DraggableLegend.artist_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{artist\_picker}}}{\emph{legend}, \emph{evt}}{}~ \end{fulllineitems} \index{finalize\_offset() (matplotlib.legend.DraggableLegend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.DraggableLegend.finalize_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{finalize\_offset}}}{}{}~ \end{fulllineitems} \end{fulllineitems} \index{Legend (class in matplotlib.legend)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.legend.}}\sphinxbfcode{\sphinxupquote{Legend}}}{\emph{parent}, \emph{handles}, \emph{labels}, \emph{loc=None}, \emph{numpoints=None}, \emph{markerscale=None}, \emph{markerfirst=True}, \emph{scatterpoints=None}, \emph{scatteryoffsets=None}, \emph{prop=None}, \emph{fontsize=None}, \emph{borderpad=None}, \emph{labelspacing=None}, \emph{handlelength=None}, \emph{handleheight=None}, \emph{handletextpad=None}, \emph{borderaxespad=None}, \emph{columnspacing=None}, \emph{ncol=1}, \emph{mode=None}, \emph{fancybox=None}, \emph{shadow=None}, \emph{title=None}, \emph{framealpha=None}, \emph{edgecolor=None}, \emph{facecolor=None}, \emph{bbox\_to\_anchor=None}, \emph{bbox\_transform=None}, \emph{frameon=None}, \emph{handler\_map=None}}{} Bases: {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.Artist}}}}} Place a legend on the axes at location loc. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{parent}}] \leavevmode{[}{\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} The artist that contains the legend. \item[{\sphinxstylestrong{handles}}] \leavevmode{[}sequence of {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}}{]} A list of Artists (lines, patches) to be added to the legend. \item[{\sphinxstylestrong{labels}}] \leavevmode{[}sequence of strings{]} A list of labels to show next to the artists. The length of handles and labels should be the same. If they are not, they are truncated to the smaller of both lengths. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{loc}}] \leavevmode{[}int or string or pair of floats, default: ‘upper right’{]} The location of the legend. Possible codes are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Location String &\sphinxstyletheadfamily Location Code \\ \hline ‘best’ & 0 \\ \hline ‘upper right’ & 1 \\ \hline ‘upper left’ & 2 \\ \hline ‘lower left’ & 3 \\ \hline ‘lower right’ & 4 \\ \hline ‘right’ & 5 \\ \hline ‘center left’ & 6 \\ \hline ‘center right’ & 7 \\ \hline ‘lower center’ & 8 \\ \hline ‘upper center’ & 9 \\ \hline ‘center’ & 10 \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} Alternatively can be a 2-tuple giving \sphinxcode{\sphinxupquote{x, y}} of the lower-left corner of the legend in axes coordinates (in which case \sphinxcode{\sphinxupquote{bbox\_to\_anchor}} will be ignored). \item[{\sphinxstylestrong{bbox\_to\_anchor}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BboxBase}}}}} or pair of floats{]} Specify any arbitrary location for the legend in \sphinxcode{\sphinxupquote{bbox\_transform}} coordinates (default Axes coordinates). For example, to put the legend’s upper right hand corner in the center of the axes the following keywords can be used: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{loc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{upper right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{bbox\PYGZus{}to\PYGZus{}anchor}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)} \end{sphinxVerbatim} \item[{\sphinxstylestrong{ncol}}] \leavevmode{[}integer{]} The number of columns that the legend has. Default is 1. \item[{\sphinxstylestrong{prop}}] \leavevmode{[}None or {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}} or dict{]} The font properties of the legend. If None (default), the current {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcParams}}}}} will be used. \item[{\sphinxstylestrong{fontsize}}] \leavevmode{[}int or float or \{‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’\}{]} Controls the font size of the legend. If the value is numeric the size will be the absolute font size in points. String values are relative to the current default font size. This argument is only used if \sphinxcode{\sphinxupquote{prop}} is not specified. \item[{\sphinxstylestrong{numpoints}}] \leavevmode{[}None or int{]} The number of marker points in the legend when creating a legend entry for a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} (line). Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.numpoints"{]}}}. \item[{\sphinxstylestrong{scatterpoints}}] \leavevmode{[}None or int{]} The number of marker points in the legend when creating a legend entry for a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PathCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathCollection}}}}} (scatter plot). Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.scatterpoints"{]}}}. \item[{\sphinxstylestrong{scatteryoffsets}}] \leavevmode{[}iterable of floats{]} The vertical offset (relative to the font size) for the markers created for a scatter plot legend entry. 0.0 is at the base the legend text, and 1.0 is at the top. To draw all markers at the same height, set to \sphinxcode{\sphinxupquote{{[}0.5{]}}}. Default is \sphinxcode{\sphinxupquote{{[}0.375, 0.5, 0.3125{]}}}. \item[{\sphinxstylestrong{markerscale}}] \leavevmode{[}None or int or float{]} The relative size of legend markers compared with the originally drawn ones. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.markerscale"{]}}}. \item[{\sphinxstylestrong{markerfirst}}] \leavevmode{[}bool{]} If \sphinxstyleemphasis{True}, legend marker is placed to the left of the legend label. If \sphinxstyleemphasis{False}, legend marker is placed to the right of the legend label. Default is \sphinxstyleemphasis{True}. \item[{\sphinxstylestrong{frameon}}] \leavevmode{[}None or bool{]} Control whether the legend should be drawn on a patch (frame). Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.frameon"{]}}}. \item[{\sphinxstylestrong{fancybox}}] \leavevmode{[}None or bool{]} Control whether round edges should be enabled around the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyBboxPatch}}}}} which makes up the legend’s background. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.fancybox"{]}}}. \item[{\sphinxstylestrong{shadow}}] \leavevmode{[}None or bool{]} Control whether to draw a shadow behind the legend. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.shadow"{]}}}. \item[{\sphinxstylestrong{framealpha}}] \leavevmode{[}None or float{]} Control the alpha transparency of the legend’s background. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.framealpha"{]}}}. If shadow is activated and \sphinxstyleemphasis{framealpha} is \sphinxcode{\sphinxupquote{None}}, the default value is ignored. \item[{\sphinxstylestrong{facecolor}}] \leavevmode{[}None or “inherit” or a color spec{]} Control the legend’s background color. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.facecolor"{]}}}. If \sphinxcode{\sphinxupquote{"inherit"}}, it will take \sphinxcode{\sphinxupquote{rcParams{[}"axes.facecolor"{]}}}. \item[{\sphinxstylestrong{edgecolor}}] \leavevmode{[}None or “inherit” or a color spec{]} Control the legend’s background patch edge color. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.edgecolor"{]}}} If \sphinxcode{\sphinxupquote{"inherit"}}, it will take \sphinxcode{\sphinxupquote{rcParams{[}"axes.edgecolor"{]}}}. \item[{\sphinxstylestrong{mode}}] \leavevmode{[}\{“expand”, None\}{]} If \sphinxcode{\sphinxupquote{mode}} is set to \sphinxcode{\sphinxupquote{"expand"}} the legend will be horizontally expanded to fill the axes area (or \sphinxcode{\sphinxupquote{bbox\_to\_anchor}} if defines the legend’s size). \item[{\sphinxstylestrong{bbox\_transform}}] \leavevmode{[}None or {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} The transform for the bounding box (\sphinxcode{\sphinxupquote{bbox\_to\_anchor}}). For a value of \sphinxcode{\sphinxupquote{None}} (default) the Axes’ \sphinxcode{\sphinxupquote{transAxes}} transform will be used. \item[{\sphinxstylestrong{title}}] \leavevmode{[}str or None{]} The legend’s title. Default is no title (\sphinxcode{\sphinxupquote{None}}). \item[{\sphinxstylestrong{borderpad}}] \leavevmode{[}float or None{]} The fractional whitespace inside the legend border. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.borderpad"{]}}}. \item[{\sphinxstylestrong{labelspacing}}] \leavevmode{[}float or None{]} The vertical space between the legend entries. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.labelspacing"{]}}}. \item[{\sphinxstylestrong{handlelength}}] \leavevmode{[}float or None{]} The length of the legend handles. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.handlelength"{]}}}. \item[{\sphinxstylestrong{handletextpad}}] \leavevmode{[}float or None{]} The pad between the legend handle and text. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.handletextpad"{]}}}. \item[{\sphinxstylestrong{borderaxespad}}] \leavevmode{[}float or None{]} The pad between the axes and legend border. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.borderaxespad"{]}}}. \item[{\sphinxstylestrong{columnspacing}}] \leavevmode{[}float or None{]} The spacing between columns. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.columnspacing"{]}}}. \item[{\sphinxstylestrong{handler\_map}}] \leavevmode{[}dict or None{]} The custom dictionary mapping instances or types to a legend handler. This \sphinxcode{\sphinxupquote{handler\_map}} updates the default handler map found at {\hyperref[\detokenize{api/legend_api:matplotlib.legend.Legend.get_legend_handler_map}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.legend.Legend.get\_legend\_handler\_map()}}}}}. \end{description} \end{description}\end{quote} \paragraph{Notes} Users can specify any arbitrary location for the legend using the \sphinxstyleemphasis{bbox\_to\_anchor} keyword argument. bbox\_to\_anchor can be an instance of BboxBase(or its derivatives) or a tuple of 2 or 4 floats. See {\hyperref[\detokenize{api/legend_api:matplotlib.legend.Legend.set_bbox_to_anchor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_bbox\_to\_anchor()}}}}} for more detail. The legend location can be specified by setting \sphinxstyleemphasis{loc} with a tuple of 2 floats, which is interpreted as the lower-left corner of the legend in the normalized axes coordinate. \index{codes (matplotlib.legend.Legend attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.codes}}\pysigline{\sphinxbfcode{\sphinxupquote{codes}}\sphinxbfcode{\sphinxupquote{ = \{'best': 0, 'center': 10, 'center left': 6, 'center right': 7, 'lower center': 8, 'lower left': 3, 'lower right': 4, 'right': 5, 'upper center': 9, 'upper left': 2, 'upper right': 1\}}}} \end{fulllineitems} \index{contains() (matplotlib.legend.Legend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{event}}{} Test whether the artist contains the mouse event. Returns the truth value and a dictionary of artist specific details of selection, such as which points are contained in the pick radius. See individual artists for details. \end{fulllineitems} \index{draggable() (matplotlib.legend.Legend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.draggable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draggable}}}{\emph{state=None}, \emph{use\_blit=False}, \emph{update='loc'}}{} Set the draggable state \textendash{} if state is \begin{itemize} \item {} None : toggle the current state \item {} True : turn draggable on \item {} False : turn draggable off \end{itemize} If draggable is on, you can drag the legend on the canvas with the mouse. The {\hyperref[\detokenize{api/legend_api:matplotlib.legend.DraggableLegend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{DraggableLegend}}}}} helper instance is returned if draggable is on. The update parameter control which parameter of the legend changes when dragged. If update is “loc”, the \sphinxstyleemphasis{loc} parameter of the legend is changed. If “bbox”, the \sphinxstyleemphasis{bbox\_to\_anchor} parameter is changed. \end{fulllineitems} \index{draw() (matplotlib.legend.Legend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draw everything that belongs to the legend. \end{fulllineitems} \index{draw\_frame() (matplotlib.legend.Legend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.draw_frame}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_frame}}}{\emph{b}}{} Set draw frame to b. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_bbox\_to\_anchor() (matplotlib.legend.Legend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.get_bbox_to_anchor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_bbox\_to\_anchor}}}{}{} Return the bbox that the legend will be anchored to. \end{fulllineitems} \index{get\_children() (matplotlib.legend.Legend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of child artists. \end{fulllineitems} \index{get\_default\_handler\_map() (matplotlib.legend.Legend class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.get_default_handler_map}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{get\_default\_handler\_map}}}{}{} A class method that returns the default handler map. \end{fulllineitems} \index{get\_frame() (matplotlib.legend.Legend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.get_frame}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_frame}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}} instances used to frame the legend. \end{fulllineitems} \index{get\_frame\_on() (matplotlib.legend.Legend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.get_frame_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_frame\_on}}}{}{} Get whether the legend box patch is drawn. \end{fulllineitems} \index{get\_legend\_handler() (matplotlib.legend.Legend static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.get_legend_handler}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{get\_legend\_handler}}}{\emph{legend\_handler\_map}, \emph{orig\_handle}}{} Return a legend handler from \sphinxstyleemphasis{legend\_handler\_map} that corresponds to \sphinxstyleemphasis{orig\_handler}. \sphinxstyleemphasis{legend\_handler\_map} should be a dictionary object (that is returned by the get\_legend\_handler\_map method). It first checks if the \sphinxstyleemphasis{orig\_handle} itself is a key in the \sphinxstyleemphasis{legend\_hanler\_map} and return the associated value. Otherwise, it checks for each of the classes in its method-resolution-order. If no matching key is found, it returns \sphinxcode{\sphinxupquote{None}}. \end{fulllineitems} \index{get\_legend\_handler\_map() (matplotlib.legend.Legend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.get_legend_handler_map}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_legend\_handler\_map}}}{}{} Return the handler map. \end{fulllineitems} \index{get\_lines() (matplotlib.legend.Legend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.get_lines}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_lines}}}{}{} Return a list of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instances in the legend. \end{fulllineitems} \index{get\_patches() (matplotlib.legend.Legend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.get_patches}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_patches}}}{}{} Return a list of {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} instances in the legend. \end{fulllineitems} \index{get\_texts() (matplotlib.legend.Legend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.get_texts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_texts}}}{}{} Return a list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances in the legend. \end{fulllineitems} \index{get\_title() (matplotlib.legend.Legend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.get_title}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_title}}}{}{} Return the {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instance for the legend title. \end{fulllineitems} \index{get\_window\_extent() (matplotlib.legend.Legend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{*args}, \emph{**kwargs}}{} Return extent of the legend. \end{fulllineitems} \index{set\_bbox\_to\_anchor() (matplotlib.legend.Legend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.set_bbox_to_anchor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_bbox\_to\_anchor}}}{\emph{bbox}, \emph{transform=None}}{} Set the bbox that the legend will be anchored to. \sphinxstyleemphasis{bbox} can be \begin{itemize} \item {} A {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BboxBase}}}}} instance \item {} A tuple of \sphinxcode{\sphinxupquote{(left, bottom, width, height)}} in the given transform (normalized axes coordinate if None) \item {} A tuple of \sphinxcode{\sphinxupquote{(left, bottom)}} where the width and height will be assumed to be zero. \end{itemize} \end{fulllineitems} \index{set\_default\_handler\_map() (matplotlib.legend.Legend class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.set_default_handler_map}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{set\_default\_handler\_map}}}{\emph{handler\_map}}{} A class method to set the default handler map. \end{fulllineitems} \index{set\_frame\_on() (matplotlib.legend.Legend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.set_frame_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_frame\_on}}}{\emph{b}}{} Set whether the legend box patch is drawn. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_title() (matplotlib.legend.Legend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.set_title}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_title}}}{\emph{title}, \emph{prop=None}}{} Set the legend title. Fontproperties can be optionally set with \sphinxstyleemphasis{prop} parameter. \end{fulllineitems} \index{update\_default\_handler\_map() (matplotlib.legend.Legend class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.update_default_handler_map}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{update\_default\_handler\_map}}}{\emph{handler\_map}}{} A class method to update the default handler map. \end{fulllineitems} \index{zorder (matplotlib.legend.Legend attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend.Legend.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 5}}} \end{fulllineitems} \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.legend\_handler}}} \label{\detokenize{api/legend_api:module-matplotlib.legend_handler}}\label{\detokenize{api/legend_api:matplotlib-legend-handler}}\index{matplotlib.legend\_handler (module)} This module defines default legend handlers. It is strongly encouraged to have read the {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{legend guide}}}} before this documentation. Legend handlers are expected to be a callable object with a following signature. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{legend\PYGZus{}handler}\PYG{p}{(}\PYG{n}{legend}\PYG{p}{,} \PYG{n}{orig\PYGZus{}handle}\PYG{p}{,} \PYG{n}{fontsize}\PYG{p}{,} \PYG{n}{handlebox}\PYG{p}{)} \end{sphinxVerbatim} Where \sphinxstyleemphasis{legend} is the legend itself, \sphinxstyleemphasis{orig\_handle} is the original plot, \sphinxstyleemphasis{fontsize} is the fontsize in pixels, and \sphinxstyleemphasis{handlebox} is a OffsetBox instance. Within the call, you should create relevant artists (using relevant properties from the \sphinxstyleemphasis{legend} and/or \sphinxstyleemphasis{orig\_handle}) and add them into the handlebox. The artists needs to be scaled according to the fontsize (note that the size is in pixel, i.e., this is dpi-scaled value). This module includes definition of several legend handler classes derived from the base class (HandlerBase) with the following method: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{legend\PYGZus{}artist}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{legend}\PYG{p}{,} \PYG{n}{orig\PYGZus{}handle}\PYG{p}{,} \PYG{n}{fontsize}\PYG{p}{,} \PYG{n}{handlebox}\PYG{p}{)}\PYG{p}{:} \end{sphinxVerbatim} \index{HandlerBase (class in matplotlib.legend\_handler)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.legend\_handler.}}\sphinxbfcode{\sphinxupquote{HandlerBase}}}{\emph{xpad=0.0}, \emph{ypad=0.0}, \emph{update\_func=None}}{} A Base class for default legend handlers. The derived classes are meant to override \sphinxstyleemphasis{create\_artists} method, which has a following signature.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{create\PYGZus{}artists}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{legend}\PYG{p}{,} \PYG{n}{orig\PYGZus{}handle}\PYG{p}{,} \PYG{n}{xdescent}\PYG{p}{,} \PYG{n}{ydescent}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{n}{fontsize}\PYG{p}{,} \PYG{n}{trans}\PYG{p}{)}\PYG{p}{:} \end{sphinxVerbatim} The overridden method needs to create artists of the given transform that fits in the given dimension (xdescent, ydescent, width, height) that are scaled by fontsize if necessary. \index{adjust\_drawing\_area() (matplotlib.legend\_handler.HandlerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerBase.adjust_drawing_area}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{adjust\_drawing\_area}}}{\emph{legend}, \emph{orig\_handle}, \emph{xdescent}, \emph{ydescent}, \emph{width}, \emph{height}, \emph{fontsize}}{}~ \end{fulllineitems} \index{create\_artists() (matplotlib.legend\_handler.HandlerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerBase.create_artists}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{create\_artists}}}{\emph{legend}, \emph{orig\_handle}, \emph{xdescent}, \emph{ydescent}, \emph{width}, \emph{height}, \emph{fontsize}, \emph{trans}}{}~ \end{fulllineitems} \index{legend\_artist() (matplotlib.legend\_handler.HandlerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerBase.legend_artist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{legend\_artist}}}{\emph{legend}, \emph{orig\_handle}, \emph{fontsize}, \emph{handlebox}}{} Return the artist that this HandlerBase generates for the given original artist/handle. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{legend}}] \leavevmode{[}{\hyperref[\detokenize{api/legend_api:matplotlib.legend.Legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.legend.Legend}}}}} instance{]} The legend for which these legend artists are being created. \item[{\sphinxstylestrong{orig\_handle}}] \leavevmode{[}{\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.Artist}}}}} or similar{]} The object for which these legend artists are being created. \item[{\sphinxstylestrong{fontsize}}] \leavevmode{[}float or int{]} The fontsize in pixels. The artists being created should be scaled according to the given fontsize. \item[{\sphinxstylestrong{handlebox}}] \leavevmode{[}{\hyperref[\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.offsetbox.OffsetBox}}}}} instance{]} The box which has been created to hold this legend entry’s artists. Artists created in the {\hyperref[\detokenize{api/legend_api:matplotlib.legend_handler.HandlerBase.legend_artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend\_artist}}}}} method must be added to this handlebox inside this method. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{update\_prop() (matplotlib.legend\_handler.HandlerBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerBase.update_prop}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_prop}}}{\emph{legend\_handle}, \emph{orig\_handle}, \emph{legend}}{}~ \end{fulllineitems} \end{fulllineitems} \index{HandlerCircleCollection (class in matplotlib.legend\_handler)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerCircleCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.legend\_handler.}}\sphinxbfcode{\sphinxupquote{HandlerCircleCollection}}}{\emph{yoffsets=None}, \emph{sizes=None}, \emph{**kw}}{} Handler for \sphinxcode{\sphinxupquote{CircleCollections}}. \index{create\_collection() (matplotlib.legend\_handler.HandlerCircleCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerCircleCollection.create_collection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{create\_collection}}}{\emph{orig\_handle}, \emph{sizes}, \emph{offsets}, \emph{transOffset}}{}~ \end{fulllineitems} \end{fulllineitems} \index{HandlerErrorbar (class in matplotlib.legend\_handler)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerErrorbar}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.legend\_handler.}}\sphinxbfcode{\sphinxupquote{HandlerErrorbar}}}{\emph{xerr\_size=0.5}, \emph{yerr\_size=None}, \emph{marker\_pad=0.3}, \emph{numpoints=None}, \emph{**kw}}{} Handler for Errorbars. \index{create\_artists() (matplotlib.legend\_handler.HandlerErrorbar method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerErrorbar.create_artists}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{create\_artists}}}{\emph{legend}, \emph{orig\_handle}, \emph{xdescent}, \emph{ydescent}, \emph{width}, \emph{height}, \emph{fontsize}, \emph{trans}}{}~ \end{fulllineitems} \index{get\_err\_size() (matplotlib.legend\_handler.HandlerErrorbar method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerErrorbar.get_err_size}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_err\_size}}}{\emph{legend}, \emph{xdescent}, \emph{ydescent}, \emph{width}, \emph{height}, \emph{fontsize}}{}~ \end{fulllineitems} \end{fulllineitems} \index{HandlerLine2D (class in matplotlib.legend\_handler)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerLine2D}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.legend\_handler.}}\sphinxbfcode{\sphinxupquote{HandlerLine2D}}}{\emph{marker\_pad=0.3}, \emph{numpoints=None}, \emph{**kw}}{} Handler for {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instances. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{marker\_pad}}] \leavevmode{[}float{]} Padding between points in legend entry. \item[{\sphinxstylestrong{numpoints}}] \leavevmode{[}int{]} Number of points to show in legend entry. \end{description} \end{description}\end{quote} \paragraph{Notes} Any other keyword arguments are given to {\hyperref[\detokenize{api/legend_api:matplotlib.legend_handler.HandlerNpoints}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{HandlerNpoints}}}}}. \index{create\_artists() (matplotlib.legend\_handler.HandlerLine2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerLine2D.create_artists}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{create\_artists}}}{\emph{legend}, \emph{orig\_handle}, \emph{xdescent}, \emph{ydescent}, \emph{width}, \emph{height}, \emph{fontsize}, \emph{trans}}{}~ \end{fulllineitems} \end{fulllineitems} \index{HandlerLineCollection (class in matplotlib.legend\_handler)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerLineCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.legend\_handler.}}\sphinxbfcode{\sphinxupquote{HandlerLineCollection}}}{\emph{marker\_pad=0.3}, \emph{numpoints=None}, \emph{**kw}}{} Handler for {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} instances. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{marker\_pad}}] \leavevmode{[}float{]} Padding between points in legend entry. \item[{\sphinxstylestrong{numpoints}}] \leavevmode{[}int{]} Number of points to show in legend entry. \end{description} \end{description}\end{quote} \paragraph{Notes} Any other keyword arguments are given to {\hyperref[\detokenize{api/legend_api:matplotlib.legend_handler.HandlerNpoints}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{HandlerNpoints}}}}}. \index{create\_artists() (matplotlib.legend\_handler.HandlerLineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerLineCollection.create_artists}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{create\_artists}}}{\emph{legend}, \emph{orig\_handle}, \emph{xdescent}, \emph{ydescent}, \emph{width}, \emph{height}, \emph{fontsize}, \emph{trans}}{}~ \end{fulllineitems} \index{get\_numpoints() (matplotlib.legend\_handler.HandlerLineCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerLineCollection.get_numpoints}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_numpoints}}}{\emph{legend}}{}~ \end{fulllineitems} \end{fulllineitems} \index{HandlerNpoints (class in matplotlib.legend\_handler)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerNpoints}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.legend\_handler.}}\sphinxbfcode{\sphinxupquote{HandlerNpoints}}}{\emph{marker\_pad=0.3}, \emph{numpoints=None}, \emph{**kw}}{} A legend handler that shows \sphinxstyleemphasis{numpoints} points in the legend entry. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{marker\_pad}}] \leavevmode{[}float{]} Padding between points in legend entry. \item[{\sphinxstylestrong{numpoints}}] \leavevmode{[}int{]} Number of points to show in legend entry. \end{description} \end{description}\end{quote} \paragraph{Notes} Any other keyword arguments are given to {\hyperref[\detokenize{api/legend_api:matplotlib.legend_handler.HandlerBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{HandlerBase}}}}}. \index{get\_numpoints() (matplotlib.legend\_handler.HandlerNpoints method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerNpoints.get_numpoints}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_numpoints}}}{\emph{legend}}{}~ \end{fulllineitems} \index{get\_xdata() (matplotlib.legend\_handler.HandlerNpoints method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerNpoints.get_xdata}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_xdata}}}{\emph{legend}, \emph{xdescent}, \emph{ydescent}, \emph{width}, \emph{height}, \emph{fontsize}}{}~ \end{fulllineitems} \end{fulllineitems} \index{HandlerNpointsYoffsets (class in matplotlib.legend\_handler)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerNpointsYoffsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.legend\_handler.}}\sphinxbfcode{\sphinxupquote{HandlerNpointsYoffsets}}}{\emph{numpoints=None}, \emph{yoffsets=None}, \emph{**kw}}{} A legend handler that shows \sphinxstyleemphasis{numpoints} in the legend, and allows them to be individually offest in the y-direction. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{numpoints}}] \leavevmode{[}int{]} Number of points to show in legend entry. \item[{\sphinxstylestrong{yoffsets}}] \leavevmode{[}array of floats{]} Length \sphinxstyleemphasis{numpoints} list of y offsets for each point in legend entry. \end{description} \end{description}\end{quote} \paragraph{Notes} Any other keyword arguments are given to {\hyperref[\detokenize{api/legend_api:matplotlib.legend_handler.HandlerNpoints}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{HandlerNpoints}}}}}. \index{get\_ydata() (matplotlib.legend\_handler.HandlerNpointsYoffsets method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerNpointsYoffsets.get_ydata}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_ydata}}}{\emph{legend}, \emph{xdescent}, \emph{ydescent}, \emph{width}, \emph{height}, \emph{fontsize}}{}~ \end{fulllineitems} \end{fulllineitems} \index{HandlerPatch (class in matplotlib.legend\_handler)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerPatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.legend\_handler.}}\sphinxbfcode{\sphinxupquote{HandlerPatch}}}{\emph{patch\_func=None}, \emph{**kw}}{} Handler for {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} instances. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{patch\_func}}] \leavevmode{[}callable, optional{]} The function that creates the legend key artist. \sphinxstyleemphasis{patch\_func} should have the signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{patch\PYGZus{}func}\PYG{p}{(}\PYG{n}{legend}\PYG{o}{=}\PYG{n}{legend}\PYG{p}{,} \PYG{n}{orig\PYGZus{}handle}\PYG{o}{=}\PYG{n}{orig\PYGZus{}handle}\PYG{p}{,} \PYG{n}{xdescent}\PYG{o}{=}\PYG{n}{xdescent}\PYG{p}{,} \PYG{n}{ydescent}\PYG{o}{=}\PYG{n}{ydescent}\PYG{p}{,} \PYG{n}{width}\PYG{o}{=}\PYG{n}{width}\PYG{p}{,} \PYG{n}{height}\PYG{o}{=}\PYG{n}{height}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{n}{fontsize}\PYG{p}{)} \end{sphinxVerbatim} Subsequently the created artist will have its \sphinxcode{\sphinxupquote{update\_prop}} method called and the appropriate transform will be applied. \end{description} \end{description}\end{quote} \paragraph{Notes} Any other keyword arguments are given to {\hyperref[\detokenize{api/legend_api:matplotlib.legend_handler.HandlerBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{HandlerBase}}}}}. \index{create\_artists() (matplotlib.legend\_handler.HandlerPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerPatch.create_artists}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{create\_artists}}}{\emph{legend}, \emph{orig\_handle}, \emph{xdescent}, \emph{ydescent}, \emph{width}, \emph{height}, \emph{fontsize}, \emph{trans}}{}~ \end{fulllineitems} \end{fulllineitems} \index{HandlerPathCollection (class in matplotlib.legend\_handler)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerPathCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.legend\_handler.}}\sphinxbfcode{\sphinxupquote{HandlerPathCollection}}}{\emph{yoffsets=None}, \emph{sizes=None}, \emph{**kw}}{} Handler for \sphinxcode{\sphinxupquote{PathCollections}}, which are used by {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.scatter:matplotlib.axes.Axes.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter}}}}}. \index{create\_collection() (matplotlib.legend\_handler.HandlerPathCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerPathCollection.create_collection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{create\_collection}}}{\emph{orig\_handle}, \emph{sizes}, \emph{offsets}, \emph{transOffset}}{}~ \end{fulllineitems} \end{fulllineitems} \index{HandlerPolyCollection (class in matplotlib.legend\_handler)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerPolyCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.legend\_handler.}}\sphinxbfcode{\sphinxupquote{HandlerPolyCollection}}}{\emph{xpad=0.0}, \emph{ypad=0.0}, \emph{update\_func=None}}{} Handler for {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} used in {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.fill_between:matplotlib.axes.Axes.fill_between}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill\_between}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.stackplot:matplotlib.axes.Axes.stackplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stackplot}}}}}. \index{create\_artists() (matplotlib.legend\_handler.HandlerPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerPolyCollection.create_artists}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{create\_artists}}}{\emph{legend}, \emph{orig\_handle}, \emph{xdescent}, \emph{ydescent}, \emph{width}, \emph{height}, \emph{fontsize}, \emph{trans}}{}~ \end{fulllineitems} \end{fulllineitems} \index{HandlerRegularPolyCollection (class in matplotlib.legend\_handler)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerRegularPolyCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.legend\_handler.}}\sphinxbfcode{\sphinxupquote{HandlerRegularPolyCollection}}}{\emph{yoffsets=None}, \emph{sizes=None}, \emph{**kw}}{} Handler for \sphinxcode{\sphinxupquote{RegularPolyCollections}}. \index{create\_artists() (matplotlib.legend\_handler.HandlerRegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerRegularPolyCollection.create_artists}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{create\_artists}}}{\emph{legend}, \emph{orig\_handle}, \emph{xdescent}, \emph{ydescent}, \emph{width}, \emph{height}, \emph{fontsize}, \emph{trans}}{}~ \end{fulllineitems} \index{create\_collection() (matplotlib.legend\_handler.HandlerRegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerRegularPolyCollection.create_collection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{create\_collection}}}{\emph{orig\_handle}, \emph{sizes}, \emph{offsets}, \emph{transOffset}}{}~ \end{fulllineitems} \index{get\_numpoints() (matplotlib.legend\_handler.HandlerRegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerRegularPolyCollection.get_numpoints}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_numpoints}}}{\emph{legend}}{}~ \end{fulllineitems} \index{get\_sizes() (matplotlib.legend\_handler.HandlerRegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerRegularPolyCollection.get_sizes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sizes}}}{\emph{legend}, \emph{orig\_handle}, \emph{xdescent}, \emph{ydescent}, \emph{width}, \emph{height}, \emph{fontsize}}{}~ \end{fulllineitems} \index{update\_prop() (matplotlib.legend\_handler.HandlerRegularPolyCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerRegularPolyCollection.update_prop}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_prop}}}{\emph{legend\_handle}, \emph{orig\_handle}, \emph{legend}}{}~ \end{fulllineitems} \end{fulllineitems} \index{HandlerStem (class in matplotlib.legend\_handler)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerStem}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.legend\_handler.}}\sphinxbfcode{\sphinxupquote{HandlerStem}}}{\emph{marker\_pad=0.3}, \emph{numpoints=None}, \emph{bottom=None}, \emph{yoffsets=None}, \emph{**kw}}{} Handler for plots produced by {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.stem:matplotlib.axes.Axes.stem}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stem}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{marker\_pad}}] \leavevmode{[}float{]} Padding between points in legend entry. Default is 0.3. \item[{\sphinxstylestrong{numpoints}}] \leavevmode{[}int, optional{]} Number of points to show in legend entry. \item[{\sphinxstylestrong{bottom}}] \leavevmode{[}float, optional{]} \item[{\sphinxstylestrong{yoffsets}}] \leavevmode{[}array of floats, optional{]} Length \sphinxstyleemphasis{numpoints} list of y offsets for each point in legend entry. \end{description} \end{description}\end{quote} \paragraph{Notes} Any other keyword arguments are given to {\hyperref[\detokenize{api/legend_api:matplotlib.legend_handler.HandlerNpointsYoffsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{HandlerNpointsYoffsets}}}}}. \index{create\_artists() (matplotlib.legend\_handler.HandlerStem method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerStem.create_artists}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{create\_artists}}}{\emph{legend}, \emph{orig\_handle}, \emph{xdescent}, \emph{ydescent}, \emph{width}, \emph{height}, \emph{fontsize}, \emph{trans}}{}~ \end{fulllineitems} \index{get\_ydata() (matplotlib.legend\_handler.HandlerStem method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerStem.get_ydata}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_ydata}}}{\emph{legend}, \emph{xdescent}, \emph{ydescent}, \emph{width}, \emph{height}, \emph{fontsize}}{}~ \end{fulllineitems} \end{fulllineitems} \index{HandlerTuple (class in matplotlib.legend\_handler)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerTuple}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.legend\_handler.}}\sphinxbfcode{\sphinxupquote{HandlerTuple}}}{\emph{ndivide=1}, \emph{pad=None}, \emph{**kwargs}}{} Handler for Tuple. Additional kwargs are passed through to {\hyperref[\detokenize{api/legend_api:matplotlib.legend_handler.HandlerBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{HandlerBase}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ndivide}}] \leavevmode{[}int, optional{]} The number of sections to divide the legend area into. If None, use the length of the input tuple. Default is 1. \item[{\sphinxstylestrong{pad}}] \leavevmode{[}float, optional{]} If None, fall back to \sphinxcode{\sphinxupquote{legend.borderpad}} as the default. In units of fraction of font size. Default is None. \end{description} \end{description}\end{quote} \index{create\_artists() (matplotlib.legend\_handler.HandlerTuple method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.HandlerTuple.create_artists}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{create\_artists}}}{\emph{legend}, \emph{orig\_handle}, \emph{xdescent}, \emph{ydescent}, \emph{width}, \emph{height}, \emph{fontsize}, \emph{trans}}{}~ \end{fulllineitems} \end{fulllineitems} \index{update\_from\_first\_child() (in module matplotlib.legend\_handler)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/legend_api:matplotlib.legend_handler.update_from_first_child}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.legend\_handler.}}\sphinxbfcode{\sphinxupquote{update\_from\_first\_child}}}{\emph{tgt}, \emph{src}}{}~ \end{fulllineitems} \chapter{lines} \label{\detokenize{api/lines_api:lines}}\label{\detokenize{api/lines_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.lines}}} \label{\detokenize{api/lines_api:module-matplotlib.lines}}\label{\detokenize{api/lines_api:matplotlib-lines}}\index{matplotlib.lines (module)} This module contains all the 2D line class which can draw with a variety of line styles, markers and colors. \subsection{Classes} \label{\detokenize{api/lines_api:classes}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}}(xdata, ydata{[}, linewidth, linestyle, …{]}) & A line - the line can have both a solid linestyle connecting all the vertices, and a marker at each vertex. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.VertexSelector:matplotlib.lines.VertexSelector}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{VertexSelector}}}}}(line) & Manage the callbacks to maintain a list of selected vertices for {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.lines.Line2D}}}}}. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.lines.Line2D} \label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib-lines-line2d}}\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D::doc}}\index{Line2D (class in matplotlib.lines)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.lines.}}\sphinxbfcode{\sphinxupquote{Line2D}}}{\emph{xdata}, \emph{ydata}, \emph{linewidth=None}, \emph{linestyle=None}, \emph{color=None}, \emph{marker=None}, \emph{markersize=None}, \emph{markeredgewidth=None}, \emph{markeredgecolor=None}, \emph{markerfacecolor=None}, \emph{markerfacecoloralt='none'}, \emph{fillstyle=None}, \emph{antialiased=None}, \emph{dash\_capstyle=None}, \emph{solid\_capstyle=None}, \emph{dash\_joinstyle=None}, \emph{solid\_joinstyle=None}, \emph{pickradius=5}, \emph{drawstyle=None}, \emph{markevery=None}, \emph{**kwargs}}{} A line - the line can have both a solid linestyle connecting all the vertices, and a marker at each vertex. Additionally, the drawing of the solid line is influenced by the drawstyle, e.g., one can create “stepped” lines in various styles. Create a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instance with \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} data in sequences \sphinxstyleemphasis{xdata}, \sphinxstyleemphasis{ydata}. The kwargs are {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties: \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} See {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_linestyle()}}}}} for a decription of the line styles, {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_marker()}}}}} for a description of the markers, and {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_drawstyle()}}}}} for a description of the draw styles. \index{axes (matplotlib.lines.Line2D attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.axes}}\pysigline{\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \index{contains() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred on the line. The pick radius determines the precision of the location test (usually within five points of the value). Use {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_pickradius()}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_pickradius()}}}}} to view or modify it. Returns \sphinxstyleemphasis{True} if any values are within the radius along with \sphinxcode{\sphinxupquote{\{'ind': pointlist\}}}, where \sphinxstyleemphasis{pointlist} is the set of points within the radius. TODO: sort returned indices by distance \end{fulllineitems} \index{draw() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} draw the Line with \sphinxcode{\sphinxupquote{renderer}} unless visibility is False \end{fulllineitems} \index{drawStyleKeys (matplotlib.lines.Line2D attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.drawStyleKeys}}\pysigline{\sphinxbfcode{\sphinxupquote{drawStyleKeys}}\sphinxbfcode{\sphinxupquote{ = {[}'default', 'steps-mid', 'steps-pre', 'steps-post', 'steps'{]}}}} \end{fulllineitems} \index{drawStyles (matplotlib.lines.Line2D attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.drawStyles}}\pysigline{\sphinxbfcode{\sphinxupquote{drawStyles}}\sphinxbfcode{\sphinxupquote{ = \{'default': '\_draw\_lines', 'steps': '\_draw\_steps\_pre', 'steps-mid': '\_draw\_steps\_mid', 'steps-post': '\_draw\_steps\_post', 'steps-pre': '\_draw\_steps\_pre'\}}}} \end{fulllineitems} \index{fillStyles (matplotlib.lines.Line2D attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.fillStyles}}\pysigline{\sphinxbfcode{\sphinxupquote{fillStyles}}\sphinxbfcode{\sphinxupquote{ = ('full', 'left', 'right', 'bottom', 'top', 'none')}}} \end{fulllineitems} \index{filled\_markers (matplotlib.lines.Line2D attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.filled_markers}}\pysigline{\sphinxbfcode{\sphinxupquote{filled\_markers}}\sphinxbfcode{\sphinxupquote{ = ('o', 'v', '\textasciicircum{}', '\textless{}', '\textgreater{}', '8', 's', 'p', '*', 'h', 'H', 'D', 'd', 'P', 'X')}}} \end{fulllineitems} \index{get\_aa() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_aa}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_aa}}}{}{} alias for get\_antialiased \end{fulllineitems} \index{get\_antialiased() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_antialiased}}}{}{}~ \end{fulllineitems} \index{get\_c() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_c}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_c}}}{}{} alias for get\_color \end{fulllineitems} \index{get\_color() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_color}}}{}{}~ \end{fulllineitems} \index{get\_dash\_capstyle() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_dash_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dash\_capstyle}}}{}{} Get the cap style for dashed linestyles \end{fulllineitems} \index{get\_dash\_joinstyle() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_dash_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dash\_joinstyle}}}{}{} Get the join style for dashed linestyles \end{fulllineitems} \index{get\_data() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_data}}}{\emph{orig=True}}{} Return the xdata, ydata. If \sphinxstyleemphasis{orig} is \sphinxstyleemphasis{True}, return the original data. \end{fulllineitems} \index{get\_drawstyle() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_drawstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_drawstyle}}}{}{}~ \end{fulllineitems} \index{get\_fillstyle() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_fillstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fillstyle}}}{}{} return the marker fillstyle \end{fulllineitems} \index{get\_linestyle() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyle}}}{}{}~ \end{fulllineitems} \index{get\_linewidth() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidth}}}{}{}~ \end{fulllineitems} \index{get\_ls() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_ls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_ls}}}{}{} alias for get\_linestyle \end{fulllineitems} \index{get\_lw() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_lw}}}{}{} alias for get\_linewidth \end{fulllineitems} \index{get\_marker() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_marker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_marker}}}{}{}~ \end{fulllineitems} \index{get\_markeredgecolor() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_markeredgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_markeredgecolor}}}{}{}~ \end{fulllineitems} \index{get\_markeredgewidth() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_markeredgewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_markeredgewidth}}}{}{}~ \end{fulllineitems} \index{get\_markerfacecolor() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_markerfacecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_markerfacecolor}}}{}{}~ \end{fulllineitems} \index{get\_markerfacecoloralt() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_markerfacecoloralt}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_markerfacecoloralt}}}{}{}~ \end{fulllineitems} \index{get\_markersize() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_markersize}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_markersize}}}{}{}~ \end{fulllineitems} \index{get\_markevery() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_markevery}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_markevery}}}{}{} return the markevery setting \end{fulllineitems} \index{get\_mec() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_mec}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_mec}}}{}{} alias for get\_markeredgecolor \end{fulllineitems} \index{get\_mew() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_mew}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_mew}}}{}{} alias for get\_markeredgewidth \end{fulllineitems} \index{get\_mfc() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_mfc}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_mfc}}}{}{} alias for get\_markerfacecolor \end{fulllineitems} \index{get\_mfcalt() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_mfcalt}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_mfcalt}}}{\emph{alt=False}}{} alias for get\_markerfacecoloralt \end{fulllineitems} \index{get\_ms() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_ms}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_ms}}}{}{} alias for get\_markersize \end{fulllineitems} \index{get\_path() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path}}}{}{} Return the {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} object associated with this line. \end{fulllineitems} \index{get\_pickradius() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_pickradius}}}{}{} return the pick radius used for containment tests \end{fulllineitems} \index{get\_solid\_capstyle() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_solid_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_solid\_capstyle}}}{}{} Get the cap style for solid linestyles \end{fulllineitems} \index{get\_solid\_joinstyle() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_solid_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_solid\_joinstyle}}}{}{} Get the join style for solid linestyles \end{fulllineitems} \index{get\_window\_extent() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{get\_xdata() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_xdata}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_xdata}}}{\emph{orig=True}}{} Return the xdata. If \sphinxstyleemphasis{orig} is \sphinxstyleemphasis{True}, return the original data, else the processed data. \end{fulllineitems} \index{get\_xydata() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_xydata}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_xydata}}}{}{} Return the \sphinxstyleemphasis{xy} data as a Nx2 numpy array. \end{fulllineitems} \index{get\_ydata() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.get_ydata}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_ydata}}}{\emph{orig=True}}{} Return the ydata. If \sphinxstyleemphasis{orig} is \sphinxstyleemphasis{True}, return the original data, else the processed data. \end{fulllineitems} \index{is\_dashed() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.is_dashed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_dashed}}}{}{} return True if line is dashstyle \end{fulllineitems} \index{lineStyles (matplotlib.lines.Line2D attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.lineStyles}}\pysigline{\sphinxbfcode{\sphinxupquote{lineStyles}}\sphinxbfcode{\sphinxupquote{ = \{'': '\_draw\_nothing', ' ': '\_draw\_nothing', '-': '\_draw\_solid', '--': '\_draw\_dashed', '-.': '\_draw\_dash\_dot', ':': '\_draw\_dotted', 'None': '\_draw\_nothing'\}}}} \end{fulllineitems} \index{markers (matplotlib.lines.Line2D attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.markers}}\pysigline{\sphinxbfcode{\sphinxupquote{markers}}\sphinxbfcode{\sphinxupquote{ = \{'.': 'point', ',': 'pixel', 'o': 'circle', 'v': 'triangle\_down', '\textasciicircum{}': 'triangle\_up', '\textless{}': 'triangle\_left', '\textgreater{}': 'triangle\_right', '1': 'tri\_down', '2': 'tri\_up', '3': 'tri\_left', '4': 'tri\_right', '8': 'octagon', 's': 'square', 'p': 'pentagon', '*': 'star', 'h': 'hexagon1', 'H': 'hexagon2', '+': 'plus', 'x': 'x', 'D': 'diamond', 'd': 'thin\_diamond', '\textbar{}': 'vline', '\_': 'hline', 'P': 'plus\_filled', 'X': 'x\_filled', 0: 'tickleft', 1: 'tickright', 2: 'tickup', 3: 'tickdown', 4: 'caretleft', 5: 'caretright', 6: 'caretup', 7: 'caretdown', 8: 'caretleftbase', 9: 'caretrightbase', 10: 'caretupbase', 11: 'caretdownbase', 'None': 'nothing', None: 'nothing', ' ': 'nothing', '': 'nothing'\}}}} \end{fulllineitems} \index{recache() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.recache}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{recache}}}{\emph{always=False}}{}~ \end{fulllineitems} \index{recache\_always() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.recache_always}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{recache\_always}}}{}{}~ \end{fulllineitems} \index{set\_aa() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_aa}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_aa}}}{\emph{val}}{} alias for set\_antialiased \end{fulllineitems} \index{set\_antialiased() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiased}}}{\emph{b}}{} Set whether to use antialiased rendering. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_c() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_c}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_c}}}{\emph{val}}{} alias for set\_color \end{fulllineitems} \index{set\_color() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{color}}{} Set the color of the line ACCEPTS: any matplotlib color \end{fulllineitems} \index{set\_dash\_capstyle() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dash\_capstyle}}}{\emph{s}}{} Set the cap style for dashed linestyles ACCEPTS: {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \end{fulllineitems} \index{set\_dash\_joinstyle() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dash\_joinstyle}}}{\emph{s}}{} Set the join style for dashed linestyles ACCEPTS: {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \end{fulllineitems} \index{set\_dashes() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashes}}}{\emph{seq}}{} Set the dash sequence, sequence of dashes with on off ink in points. If seq is empty or if seq = (None, None), the linestyle will be set to solid. ACCEPTS: sequence of on/off ink in points \end{fulllineitems} \index{set\_data() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_data}}}{\emph{*args}}{} Set the x and y data ACCEPTS: 2D array (rows are x, y) or two 1D arrays \end{fulllineitems} \index{set\_drawstyle() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_drawstyle}}}{\emph{drawstyle}}{} Set the drawstyle of the plot ‘default’ connects the points with lines. The steps variants produce step-plots. ‘steps’ is equivalent to ‘steps-pre’ and is maintained for backward-compatibility. \begin{description} \item[{ACCEPTS: {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{}}] \leavevmode ‘steps-post’{]} \end{description} \end{fulllineitems} \index{set\_fillstyle() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_fillstyle}}}{\emph{fs}}{} Set the marker fill style; ‘full’ means fill the whole marker. ‘none’ means no filling; other options are for half-filled markers. ACCEPTS: {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \end{fulllineitems} \index{set\_linestyle() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyle}}}{\emph{ls}}{} Set the linestyle of the line (also accepts drawstyles, e.g., \sphinxcode{\sphinxupquote{'steps-{-}'}}) \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily linestyle &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} or \sphinxcode{\sphinxupquote{'solid'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} or \sphinxcode{\sphinxupquote{'dashed'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} or \sphinxcode{\sphinxupquote{'dashdot'}} & dash-dotted line \\ \hline \sphinxcode{\sphinxupquote{':'}} or \sphinxcode{\sphinxupquote{'dotted'}} & dotted line \\ \hline \sphinxcode{\sphinxupquote{'None'}} & draw nothing \\ \hline \sphinxcode{\sphinxupquote{' '}} & draw nothing \\ \hline \sphinxcode{\sphinxupquote{'{'}}} & draw nothing \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} ‘steps’ is equivalent to ‘steps-pre’ and is maintained for backward-compatibility. Alternatively a dash tuple of the following form can be provided: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{onoffseq}} is an even length tuple of on and off ink in points. \begin{description} \item[{ACCEPTS: {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{}}] \leavevmode (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \end{description} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_drawstyle()}}}}}}] \leavevmode To set the drawing style (stepping) of the plot. \end{description} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ls}}] \leavevmode{[}\{ \sphinxcode{\sphinxupquote{'-'}}, \sphinxcode{\sphinxupquote{'-{-}'}}, \sphinxcode{\sphinxupquote{'-.'}}, \sphinxcode{\sphinxupquote{':'}}\} and more see description{]} The line style. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linewidth() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{w}}{} Set the line width in points ACCEPTS: float value in points \end{fulllineitems} \index{set\_ls() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_ls}}}{\emph{val}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_lw() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_lw}}}{\emph{val}}{} alias for set\_linewidth \end{fulllineitems} \index{set\_marker() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_marker}}}{\emph{marker}}{} Set the line marker ACCEPTS: {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{marker: marker style}}] \leavevmode See {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markers}}}}} for full description of possible argument \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_markeredgecolor() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_markeredgecolor}}}{\emph{ec}}{} Set the marker edge color ACCEPTS: any matplotlib color \end{fulllineitems} \index{set\_markeredgewidth() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_markeredgewidth}}}{\emph{ew}}{} Set the marker edge width in points ACCEPTS: float value in points \end{fulllineitems} \index{set\_markerfacecolor() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_markerfacecolor}}}{\emph{fc}}{} Set the marker face color. ACCEPTS: any matplotlib color \end{fulllineitems} \index{set\_markerfacecoloralt() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_markerfacecoloralt}}}{\emph{fc}}{} Set the alternate marker face color. ACCEPTS: any matplotlib color \end{fulllineitems} \index{set\_markersize() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_markersize}}}{\emph{sz}}{} Set the marker size in points ACCEPTS: float \end{fulllineitems} \index{set\_markevery() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_markevery}}}{\emph{every}}{} Set the markevery property to subsample the plot when using markers. e.g., if \sphinxcode{\sphinxupquote{every=5}}, every 5-th marker will be plotted. ACCEPTS: {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{every: None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float}}] \leavevmode Which markers to plot. \begin{itemize} \item {} every=None, every point will be plotted. \item {} every=N, every N-th marker will be plotted starting with marker 0. \item {} every=(start, N), every N-th marker, starting at point start, will be plotted. \item {} every=slice(start, end, N), every N-th marker, starting at point start, upto but not including point end, will be plotted. \item {} every={[}i, j, m, n{]}, only markers at points i, j, m, and n will be plotted. \item {} every=0.1, (i.e. a float) then markers will be spaced at approximately equal distances along the line; the distance along the line between markers is determined by multiplying the display-coordinate distance of the axes bounding-box diagonal by the value of every. \item {} every=(0.5, 0.1) (i.e. a length-2 tuple of float), the same functionality as every=0.1 is exhibited but the first marker will be 0.5 multiplied by the display-cordinate-diagonal-distance along the line. \end{itemize} \end{description} \end{description}\end{quote} \paragraph{Notes} Setting the markevery property will only show markers at actual data points. When using float arguments to set the markevery property on irregularly spaced data, the markers will likely not appear evenly spaced because the actual data points do not coincide with the theoretical spacing between markers. When using a start offset to specify the first marker, the offset will be from the first data point which may be different from the first the visible data point if the plot is zoomed in. If zooming in on a plot when using float arguments then the actual data points that have markers will change because the distance between markers is always determined from the display-coordinates axes-bounding-box-diagonal regardless of the actual axes data limits. \end{fulllineitems} \index{set\_mec() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_mec}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_mec}}}{\emph{val}}{} alias for set\_markeredgecolor \end{fulllineitems} \index{set\_mew() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_mew}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_mew}}}{\emph{val}}{} alias for set\_markeredgewidth \end{fulllineitems} \index{set\_mfc() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_mfc}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_mfc}}}{\emph{val}}{} alias for set\_markerfacecolor \end{fulllineitems} \index{set\_mfcalt() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_mfcalt}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_mfcalt}}}{\emph{val}}{} alias for set\_markerfacecoloralt \end{fulllineitems} \index{set\_ms() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ms}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_ms}}}{\emph{val}}{} alias for set\_markersize \end{fulllineitems} \index{set\_picker() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_picker}}}{\emph{p}}{} Sets the event picker details for the line. ACCEPTS: float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \end{fulllineitems} \index{set\_pickradius() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_pickradius}}}{\emph{d}}{} Set the pick radius used for containment tests. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{d}}] \leavevmode{[}float{]} Pick radius, in points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_solid\_capstyle() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_solid\_capstyle}}}{\emph{s}}{} Set the cap style for solid linestyles ACCEPTS: {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \end{fulllineitems} \index{set\_solid\_joinstyle() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_solid\_joinstyle}}}{\emph{s}}{} Set the join style for solid linestyles ACCEPTS: {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \end{fulllineitems} \index{set\_transform() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} set the Transformation instance used by this artist ACCEPTS: a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \end{fulllineitems} \index{set\_xdata() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_xdata}}}{\emph{x}}{} Set the data np.array for x ACCEPTS: 1D array \end{fulllineitems} \index{set\_ydata() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_ydata}}}{\emph{y}}{} Set the data np.array for y ACCEPTS: 1D array \end{fulllineitems} \index{update\_from() (matplotlib.lines.Line2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.update_from}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} copy properties from other to self \end{fulllineitems} \index{validCap (matplotlib.lines.Line2D attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.validCap}}\pysigline{\sphinxbfcode{\sphinxupquote{validCap}}\sphinxbfcode{\sphinxupquote{ = ('butt', 'round', 'projecting')}}} \end{fulllineitems} \index{validJoin (matplotlib.lines.Line2D attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.validJoin}}\pysigline{\sphinxbfcode{\sphinxupquote{validJoin}}\sphinxbfcode{\sphinxupquote{ = ('miter', 'round', 'bevel')}}} \end{fulllineitems} \index{zorder (matplotlib.lines.Line2D attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 2}}} \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.lines.Line2D}}} \label{\detokenize{api/_as_gen/matplotlib.lines.Line2D:examples-using-matplotlib-lines-line2d}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_line\_with\_text.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_fig\_x.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_artist\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_custom\_legends.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_legend\_demo.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/strip_chart:sphx-glr-gallery-animation-strip-chart-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Oscilloscope}}}} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_pick\_event\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_poly\_editor.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_artist\_tests.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Legend guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/artists:sphx-glr-tutorials-intermediate-artists-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Artist tutorial}}}} \end{itemize} \subsubsection{matplotlib.lines.VertexSelector} \label{\detokenize{api/_as_gen/matplotlib.lines.VertexSelector:matplotlib-lines-vertexselector}}\label{\detokenize{api/_as_gen/matplotlib.lines.VertexSelector::doc}}\index{VertexSelector (class in matplotlib.lines)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.VertexSelector:matplotlib.lines.VertexSelector}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.lines.}}\sphinxbfcode{\sphinxupquote{VertexSelector}}}{\emph{line}}{} Manage the callbacks to maintain a list of selected vertices for {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.lines.Line2D}}}}}. Derived classes should override {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.VertexSelector:matplotlib.lines.VertexSelector.process_selected}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{process\_selected()}}}}} to do something with the picks. Here is an example which highlights the selected verts with red circles: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{lines} \PYG{k}{as} \PYG{n+nn}{lines} \PYG{k}{class} \PYG{n+nc}{HighlightSelected}\PYG{p}{(}\PYG{n}{lines}\PYG{o}{.}\PYG{n}{VertexSelector}\PYG{p}{)}\PYG{p}{:} \PYG{k}{def} \PYG{n+nf}{\PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{line}\PYG{p}{,} \PYG{n}{fmt}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ro}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)}\PYG{p}{:} \PYG{n}{lines}\PYG{o}{.}\PYG{n}{VertexSelector}\PYG{o}{.}\PYG{n+nf+fm}{\PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{line}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{markers}\PYG{p}{,} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{axes}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{p}{]}\PYG{p}{,} \PYG{n}{fmt}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{process\PYGZus{}selected}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{ind}\PYG{p}{,} \PYG{n}{xs}\PYG{p}{,} \PYG{n}{ys}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{markers}\PYG{o}{.}\PYG{n}{set\PYGZus{}data}\PYG{p}{(}\PYG{n}{xs}\PYG{p}{,} \PYG{n}{ys}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{30}\PYG{p}{)} \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bs\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{picker}\PYG{o}{=}\PYG{l+m+mi}{5}\PYG{p}{)} \PYG{n}{selector} \PYG{o}{=} \PYG{n}{HighlightSelected}\PYG{p}{(}\PYG{n}{line}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} Initialize the class with a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.lines.Line2D}}}}} instance. The line should already be added to some {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} instance and should have the picker property set. \index{onpick() (matplotlib.lines.VertexSelector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.VertexSelector:matplotlib.lines.VertexSelector.onpick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{onpick}}}{\emph{event}}{} When the line is picked, update the set of selected indices. \end{fulllineitems} \index{process\_selected() (matplotlib.lines.VertexSelector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.VertexSelector:matplotlib.lines.VertexSelector.process_selected}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{process\_selected}}}{\emph{ind}, \emph{xs}, \emph{ys}}{} Default “do nothing” implementation of the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.VertexSelector:matplotlib.lines.VertexSelector.process_selected}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{process\_selected()}}}}} method. \sphinxstyleemphasis{ind} are the indices of the selected vertices. \sphinxstyleemphasis{xs} and \sphinxstyleemphasis{ys} are the coordinates of the selected vertices. \end{fulllineitems} \end{fulllineitems} \subsection{Functions} \label{\detokenize{api/lines_api:functions}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.segment_hits:matplotlib.lines.segment_hits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{segment\_hits}}}}}(cx, cy, x, y, radius) & Determine if any line segments are within radius of a point. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.lines.segment\_hits} \label{\detokenize{api/_as_gen/matplotlib.lines.segment_hits:matplotlib-lines-segment-hits}}\label{\detokenize{api/_as_gen/matplotlib.lines.segment_hits::doc}}\index{segment\_hits() (in module matplotlib.lines)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.lines.segment_hits:matplotlib.lines.segment_hits}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.lines.}}\sphinxbfcode{\sphinxupquote{segment\_hits}}}{\emph{cx}, \emph{cy}, \emph{x}, \emph{y}, \emph{radius}}{} Determine if any line segments are within radius of a point. Returns the list of line segments that are within that radius. \end{fulllineitems} \chapter{markers} \label{\detokenize{api/markers_api:markers}}\label{\detokenize{api/markers_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.markers}}} \label{\detokenize{api/markers_api:module-matplotlib.markers}}\label{\detokenize{api/markers_api:matplotlib-markers}}\index{matplotlib.markers (module)} This module contains functions to handle markers. Used by both the marker functionality of {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.scatter:matplotlib.axes.Axes.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter}}}}}. All possible markers are defined here: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|*{2}{\X{1}{2}|}} \hline \sphinxstyletheadfamily marker &\sphinxstyletheadfamily description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily marker &\sphinxstyletheadfamily description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot \sphinxcode{\sphinxupquote{"."}} & point \\ \hline \sphinxcode{\sphinxupquote{","}} & pixel \\ \hline \sphinxcode{\sphinxupquote{"o"}} & circle \\ \hline \sphinxcode{\sphinxupquote{"v"}} & triangle\_down \\ \hline \sphinxcode{\sphinxupquote{"\textasciicircum{}"}} & triangle\_up \\ \hline \sphinxcode{\sphinxupquote{"\textless{}"}} & triangle\_left \\ \hline \sphinxcode{\sphinxupquote{"\textgreater{}"}} & triangle\_right \\ \hline \sphinxcode{\sphinxupquote{"1"}} & tri\_down \\ \hline \sphinxcode{\sphinxupquote{"2"}} & tri\_up \\ \hline \sphinxcode{\sphinxupquote{"3"}} & tri\_left \\ \hline \sphinxcode{\sphinxupquote{"4"}} & tri\_right \\ \hline \sphinxcode{\sphinxupquote{"8"}} & octagon \\ \hline \sphinxcode{\sphinxupquote{"s"}} & square \\ \hline \sphinxcode{\sphinxupquote{"p"}} & pentagon \\ \hline \sphinxcode{\sphinxupquote{"P"}} & plus (filled) \\ \hline \sphinxcode{\sphinxupquote{"*"}} & star \\ \hline \sphinxcode{\sphinxupquote{"h"}} & hexagon1 \\ \hline \sphinxcode{\sphinxupquote{"H"}} & hexagon2 \\ \hline \sphinxcode{\sphinxupquote{"+"}} & plus \\ \hline \sphinxcode{\sphinxupquote{"x"}} & x \\ \hline \sphinxcode{\sphinxupquote{"X"}} & x (filled) \\ \hline \sphinxcode{\sphinxupquote{"D"}} & diamond \\ \hline \sphinxcode{\sphinxupquote{"d"}} & thin\_diamond \\ \hline \sphinxcode{\sphinxupquote{"\textbar{}"}} & vline \\ \hline \sphinxcode{\sphinxupquote{"\_"}} & hline \\ \hline TICKLEFT & tickleft \\ \hline TICKRIGHT & tickright \\ \hline TICKUP & tickup \\ \hline TICKDOWN & tickdown \\ \hline CARETLEFT & caretleft (centered at tip) \\ \hline CARETRIGHT & caretright (centered at tip) \\ \hline CARETUP & caretup (centered at tip) \\ \hline CARETDOWN & caretdown (centered at tip) \\ \hline CARETLEFTBASE & caretleft (centered at base) \\ \hline CARETRIGHTBASE & caretright (centered at base) \\ \hline CARETUPBASE & caretup (centered at base) \\ \hline \sphinxcode{\sphinxupquote{"None"}}, \sphinxcode{\sphinxupquote{" "}} or \sphinxcode{\sphinxupquote{""}} & nothing \\ \hline \sphinxcode{\sphinxupquote{'\$...\$'}} & render the string using mathtext. \\ \hline \sphinxcode{\sphinxupquote{verts}} & a list of (x, y) pairs used for Path vertices. The center of the marker is located at (0,0) and the size is normalized. \\ \hline path & a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \\ \hline (\sphinxcode{\sphinxupquote{numsides}}, \sphinxcode{\sphinxupquote{style}}, \sphinxcode{\sphinxupquote{angle}}) & The marker can also be a tuple (\sphinxcode{\sphinxupquote{numsides}}, \sphinxcode{\sphinxupquote{style}}, \sphinxcode{\sphinxupquote{angle}}), which will create a custom, regular symbol. \begin{description} \item[{\sphinxcode{\sphinxupquote{numsides}}:}] \leavevmode the number of sides \item[{\sphinxcode{\sphinxupquote{style}}:}] \leavevmode the style of the regular symbol: \begin{description} \item[{0}] \leavevmode a regular polygon \item[{1}] \leavevmode a star-like symbol \item[{2}] \leavevmode an asterisk \item[{3}] \leavevmode a circle (\sphinxcode{\sphinxupquote{numsides}} and \sphinxcode{\sphinxupquote{angle}} is ignored) \end{description} \item[{\sphinxcode{\sphinxupquote{angle}}:}] \leavevmode the angle of rotation of the symbol \end{description} \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} For backward compatibility, the form (\sphinxcode{\sphinxupquote{verts}}, 0) is also accepted, but it is equivalent to just \sphinxcode{\sphinxupquote{verts}} for giving a raw set of vertices that define the shape. \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}} is the default which means ‘nothing’, however this table is referred to from other docs for the valid inputs from marker inputs and in those cases \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}} still means ‘default’. \subsection{Classes} \label{\detokenize{api/markers_api:classes}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MarkerStyle}}}}}({[}marker, fillstyle{]}) & \begin{quote}\begin{description} \item[{Parameters}] \leavevmode \end{description}\end{quote} \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.markers.MarkerStyle} \label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib-markers-markerstyle}}\label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle::doc}}\index{MarkerStyle (class in matplotlib.markers)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.markers.}}\sphinxbfcode{\sphinxupquote{MarkerStyle}}}{\emph{marker=None}, \emph{fillstyle=None}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{marker}}] \leavevmode{[}string or array\_like, optional, default: None{]} See the descriptions of possible markers in the module docstring. \item[{\sphinxstylestrong{fillstyle}}] \leavevmode{[}string, optional, default: ‘full’{]} ‘full’, ‘left”, ‘right’, ‘bottom’, ‘top’, ‘none’ \end{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{markers}}] \leavevmode{[}list of known marks{]} \item[{\sphinxstylestrong{fillstyles}}] \leavevmode{[}list of known fillstyles{]} \item[{\sphinxstylestrong{filled\_markers}}] \leavevmode{[}list of known filled markers.{]} \end{description} \end{description}\end{quote} \index{filled\_markers (matplotlib.markers.MarkerStyle attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle.filled_markers}}\pysigline{\sphinxbfcode{\sphinxupquote{filled\_markers}}\sphinxbfcode{\sphinxupquote{ = ('o', 'v', '\textasciicircum{}', '\textless{}', '\textgreater{}', '8', 's', 'p', '*', 'h', 'H', 'D', 'd', 'P', 'X')}}} \end{fulllineitems} \index{fillstyles (matplotlib.markers.MarkerStyle attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle.fillstyles}}\pysigline{\sphinxbfcode{\sphinxupquote{fillstyles}}\sphinxbfcode{\sphinxupquote{ = ('full', 'left', 'right', 'bottom', 'top', 'none')}}} \end{fulllineitems} \index{get\_alt\_path() (matplotlib.markers.MarkerStyle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle.get_alt_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alt\_path}}}{}{}~ \end{fulllineitems} \index{get\_alt\_transform() (matplotlib.markers.MarkerStyle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle.get_alt_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_alt\_transform}}}{}{}~ \end{fulllineitems} \index{get\_capstyle() (matplotlib.markers.MarkerStyle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{}~ \end{fulllineitems} \index{get\_fillstyle() (matplotlib.markers.MarkerStyle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle.get_fillstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fillstyle}}}{}{}~ \end{fulllineitems} \index{get\_joinstyle() (matplotlib.markers.MarkerStyle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{}~ \end{fulllineitems} \index{get\_marker() (matplotlib.markers.MarkerStyle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle.get_marker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_marker}}}{}{}~ \end{fulllineitems} \index{get\_path() (matplotlib.markers.MarkerStyle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle.get_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path}}}{}{}~ \end{fulllineitems} \index{get\_snap\_threshold() (matplotlib.markers.MarkerStyle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle.get_snap_threshold}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_snap\_threshold}}}{}{}~ \end{fulllineitems} \index{get\_transform() (matplotlib.markers.MarkerStyle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{}~ \end{fulllineitems} \index{is\_filled() (matplotlib.markers.MarkerStyle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle.is_filled}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_filled}}}{}{}~ \end{fulllineitems} \index{markers (matplotlib.markers.MarkerStyle attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle.markers}}\pysigline{\sphinxbfcode{\sphinxupquote{markers}}\sphinxbfcode{\sphinxupquote{ = \{'.': 'point', ',': 'pixel', 'o': 'circle', 'v': 'triangle\_down', '\textasciicircum{}': 'triangle\_up', '\textless{}': 'triangle\_left', '\textgreater{}': 'triangle\_right', '1': 'tri\_down', '2': 'tri\_up', '3': 'tri\_left', '4': 'tri\_right', '8': 'octagon', 's': 'square', 'p': 'pentagon', '*': 'star', 'h': 'hexagon1', 'H': 'hexagon2', '+': 'plus', 'x': 'x', 'D': 'diamond', 'd': 'thin\_diamond', '\textbar{}': 'vline', '\_': 'hline', 'P': 'plus\_filled', 'X': 'x\_filled', 0: 'tickleft', 1: 'tickright', 2: 'tickup', 3: 'tickdown', 4: 'caretleft', 5: 'caretright', 6: 'caretup', 7: 'caretdown', 8: 'caretleftbase', 9: 'caretrightbase', 10: 'caretupbase', 11: 'caretdownbase', 'None': 'nothing', None: 'nothing', ' ': 'nothing', '': 'nothing'\}}}} \end{fulllineitems} \index{set\_fillstyle() (matplotlib.markers.MarkerStyle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle.set_fillstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_fillstyle}}}{\emph{fillstyle}}{} Sets fillstyle \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fillstyle}}] \leavevmode{[}string amongst known fillstyles{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_marker() (matplotlib.markers.MarkerStyle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle.set_marker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_marker}}}{\emph{marker}}{}~ \end{fulllineitems} \end{fulllineitems} \chapter{mathtext} \label{\detokenize{api/mathtext_api:mathtext}}\label{\detokenize{api/mathtext_api::doc}} \sphinxincludegraphics[]{inheritance-9ecc2058d1f5a63dd7fbe9eb843746f1aa41aba7.pdf} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.mathtext}}} \label{\detokenize{api/mathtext_api:module-matplotlib.mathtext}}\label{\detokenize{api/mathtext_api:matplotlib-mathtext}}\index{matplotlib.mathtext (module)} {\hyperref[\detokenize{api/mathtext_api:module-matplotlib.mathtext}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mathtext}}}}} is a module for parsing a subset of the TeX math syntax and drawing them to a matplotlib backend. For a tutorial of its usage see {\hyperref[\detokenize{tutorials/text/mathtext:sphx-glr-tutorials-text-mathtext-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Writing mathematical expressions}}}}. This document is primarily concerned with implementation details. The module uses \sphinxhref{http://pyparsing.wikispaces.com/}{pyparsing} to parse the TeX expression. The Bakoma distribution of the TeX Computer Modern fonts, and STIX fonts are supported. There is experimental support for using arbitrary fonts, but results may vary without proper tweaking and metrics for those fonts. \index{Accent (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Accent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Accent}}}{\emph{c}, \emph{state}, \emph{math=True}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Char}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Char}}}}} The font metrics need to be dealt with differently for accents, since they are already offset correctly from the baseline in TrueType fonts. \index{grow() (matplotlib.mathtext.Accent method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Accent.grow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{grow}}}{}{} Grows one level larger. There is no limit to how big something can get. \end{fulllineitems} \index{render() (matplotlib.mathtext.Accent method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Accent.render}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render}}}{\emph{x}, \emph{y}}{} Render the character to the canvas. \end{fulllineitems} \index{shrink() (matplotlib.mathtext.Accent method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Accent.shrink}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{shrink}}}{}{} Shrinks one level smaller. There are only three levels of sizes, after which things will no longer get smaller. \end{fulllineitems} \end{fulllineitems} \index{AutoHeightChar (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.AutoHeightChar}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{AutoHeightChar}}}{\emph{c}, \emph{height}, \emph{depth}, \emph{state}, \emph{always=False}, \emph{factor=None}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Hlist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Hlist}}}}} {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.AutoHeightChar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AutoHeightChar}}}}} will create a character as close to the given height and depth as possible. When using a font with multiple height versions of some characters (such as the BaKoMa fonts), the correct glyph will be selected, otherwise this will always just return a scaled version of the glyph. \end{fulllineitems} \index{AutoWidthChar (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.AutoWidthChar}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{AutoWidthChar}}}{\emph{c}, \emph{width}, \emph{state}, \emph{always=False}, \emph{char\_class=\textless{}class 'matplotlib.mathtext.Char'\textgreater{}}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Hlist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Hlist}}}}} {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.AutoWidthChar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AutoWidthChar}}}}} will create a character as close to the given width as possible. When using a font with multiple width versions of some characters (such as the BaKoMa fonts), the correct glyph will be selected, otherwise this will always just return a scaled version of the glyph. \end{fulllineitems} \index{BakomaFonts (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.BakomaFonts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{BakomaFonts}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.TruetypeFonts}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.TruetypeFonts}}}}} Use the Bakoma TrueType fonts for rendering. Symbols are strewn about a number of font files, each of which has its own proprietary 8-bit encoding. \index{alias (matplotlib.mathtext.BakomaFonts attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.BakomaFonts.alias}}\pysigline{\sphinxbfcode{\sphinxupquote{alias}}\sphinxbfcode{\sphinxupquote{ = '\textbackslash{}\textbackslash{}{]}'}}} \end{fulllineitems} \index{get\_sized\_alternatives\_for\_symbol() (matplotlib.mathtext.BakomaFonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.BakomaFonts.get_sized_alternatives_for_symbol}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sized\_alternatives\_for\_symbol}}}{\emph{fontname}, \emph{sym}}{} Override if your font provides multiple sizes of the same symbol. Should return a list of symbols matching \sphinxstyleemphasis{sym} in various sizes. The expression renderer will select the most appropriate size for a given situation from this list. \end{fulllineitems} \index{target (matplotlib.mathtext.BakomaFonts attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.BakomaFonts.target}}\pysigline{\sphinxbfcode{\sphinxupquote{target}}\sphinxbfcode{\sphinxupquote{ = '{]}'}}} \end{fulllineitems} \end{fulllineitems} \index{Box (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Box}}}{\emph{width}, \emph{height}, \emph{depth}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Node}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Node}}}}} Represents any node with a physical location. \index{grow() (matplotlib.mathtext.Box method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Box.grow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{grow}}}{}{} Grows one level larger. There is no limit to how big something can get. \end{fulllineitems} \index{render() (matplotlib.mathtext.Box method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Box.render}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render}}}{\emph{x1}, \emph{y1}, \emph{x2}, \emph{y2}}{}~ \end{fulllineitems} \index{shrink() (matplotlib.mathtext.Box method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Box.shrink}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{shrink}}}{}{} Shrinks one level smaller. There are only three levels of sizes, after which things will no longer get smaller. \end{fulllineitems} \end{fulllineitems} \index{Char (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Char}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Char}}}{\emph{c}, \emph{state}, \emph{math=True}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Node}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Node}}}}} Represents a single character. Unlike TeX, the font information and metrics are stored with each {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Char}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Char}}}}} to make it easier to lookup the font metrics when needed. Note that TeX boxes have a width, height, and depth, unlike Type1 and Truetype which use a full bounding box and an advance in the x-direction. The metrics must be converted to the TeX way, and the advance (if different from width) must be converted into a {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Kern}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Kern}}}}} node when the {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Char}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Char}}}}} is added to its parent {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Hlist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Hlist}}}}}. \index{get\_kerning() (matplotlib.mathtext.Char method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Char.get_kerning}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_kerning}}}{\emph{next}}{} Return the amount of kerning between this and the given character. Called when characters are strung together into {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Hlist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Hlist}}}}} to create {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Kern}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Kern}}}}} nodes. \end{fulllineitems} \index{grow() (matplotlib.mathtext.Char method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Char.grow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{grow}}}{}{} Grows one level larger. There is no limit to how big something can get. \end{fulllineitems} \index{is\_slanted() (matplotlib.mathtext.Char method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Char.is_slanted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_slanted}}}{}{}~ \end{fulllineitems} \index{render() (matplotlib.mathtext.Char method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Char.render}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render}}}{\emph{x}, \emph{y}}{} Render the character to the canvas \end{fulllineitems} \index{shrink() (matplotlib.mathtext.Char method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Char.shrink}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{shrink}}}{}{} Shrinks one level smaller. There are only three levels of sizes, after which things will no longer get smaller. \end{fulllineitems} \end{fulllineitems} \index{ComputerModernFontConstants (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.ComputerModernFontConstants}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{ComputerModernFontConstants}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.FontConstantsBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.FontConstantsBase}}}}} \index{delta (matplotlib.mathtext.ComputerModernFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.ComputerModernFontConstants.delta}}\pysigline{\sphinxbfcode{\sphinxupquote{delta}}\sphinxbfcode{\sphinxupquote{ = 0.075}}} \end{fulllineitems} \index{delta\_integral (matplotlib.mathtext.ComputerModernFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.ComputerModernFontConstants.delta_integral}}\pysigline{\sphinxbfcode{\sphinxupquote{delta\_integral}}\sphinxbfcode{\sphinxupquote{ = 0.3}}} \end{fulllineitems} \index{delta\_slanted (matplotlib.mathtext.ComputerModernFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.ComputerModernFontConstants.delta_slanted}}\pysigline{\sphinxbfcode{\sphinxupquote{delta\_slanted}}\sphinxbfcode{\sphinxupquote{ = 0.3}}} \end{fulllineitems} \index{script\_space (matplotlib.mathtext.ComputerModernFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.ComputerModernFontConstants.script_space}}\pysigline{\sphinxbfcode{\sphinxupquote{script\_space}}\sphinxbfcode{\sphinxupquote{ = 0.075}}} \end{fulllineitems} \index{sub1 (matplotlib.mathtext.ComputerModernFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.ComputerModernFontConstants.sub1}}\pysigline{\sphinxbfcode{\sphinxupquote{sub1}}\sphinxbfcode{\sphinxupquote{ = 0.2}}} \end{fulllineitems} \index{sub2 (matplotlib.mathtext.ComputerModernFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.ComputerModernFontConstants.sub2}}\pysigline{\sphinxbfcode{\sphinxupquote{sub2}}\sphinxbfcode{\sphinxupquote{ = 0.3}}} \end{fulllineitems} \index{subdrop (matplotlib.mathtext.ComputerModernFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.ComputerModernFontConstants.subdrop}}\pysigline{\sphinxbfcode{\sphinxupquote{subdrop}}\sphinxbfcode{\sphinxupquote{ = 0.2}}} \end{fulllineitems} \index{sup1 (matplotlib.mathtext.ComputerModernFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.ComputerModernFontConstants.sup1}}\pysigline{\sphinxbfcode{\sphinxupquote{sup1}}\sphinxbfcode{\sphinxupquote{ = 0.45}}} \end{fulllineitems} \end{fulllineitems} \index{DejaVuFonts (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.DejaVuFonts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{DejaVuFonts}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.UnicodeFonts}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.UnicodeFonts}}}}} \index{use\_cmex (matplotlib.mathtext.DejaVuFonts attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.DejaVuFonts.use_cmex}}\pysigline{\sphinxbfcode{\sphinxupquote{use\_cmex}}\sphinxbfcode{\sphinxupquote{ = False}}} \end{fulllineitems} \end{fulllineitems} \index{DejaVuSansFontConstants (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.DejaVuSansFontConstants}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{DejaVuSansFontConstants}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.FontConstantsBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.FontConstantsBase}}}}} \end{fulllineitems} \index{DejaVuSansFonts (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.DejaVuSansFonts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{DejaVuSansFonts}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.DejaVuFonts}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.DejaVuFonts}}}}} A font handling class for the DejaVu Sans fonts If a glyph is not found it will fallback to Stix Sans \end{fulllineitems} \index{DejaVuSerifFontConstants (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.DejaVuSerifFontConstants}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{DejaVuSerifFontConstants}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.FontConstantsBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.FontConstantsBase}}}}} \end{fulllineitems} \index{DejaVuSerifFonts (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.DejaVuSerifFonts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{DejaVuSerifFonts}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.DejaVuFonts}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.DejaVuFonts}}}}} A font handling class for the DejaVu Serif fonts If a glyph is not found it will fallback to Stix Serif \end{fulllineitems} \index{Error() (in module matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Error}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Error}}}{\emph{msg}}{} Helper class to raise parser errors. \end{fulllineitems} \index{Fil (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Fil}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Fil}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Glue}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Glue}}}}} \end{fulllineitems} \index{Fill (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Fill}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Fill}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Glue}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Glue}}}}} \end{fulllineitems} \index{Filll (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Filll}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Filll}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Glue}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Glue}}}}} \end{fulllineitems} \index{FontConstantsBase (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.FontConstantsBase}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{FontConstantsBase}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} A set of constants that controls how certain things, such as sub- and superscripts are laid out. These are all metrics that can’t be reliably retrieved from the font metrics in the font itself. \index{delta (matplotlib.mathtext.FontConstantsBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.FontConstantsBase.delta}}\pysigline{\sphinxbfcode{\sphinxupquote{delta}}\sphinxbfcode{\sphinxupquote{ = 0.025}}} \end{fulllineitems} \index{delta\_integral (matplotlib.mathtext.FontConstantsBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.FontConstantsBase.delta_integral}}\pysigline{\sphinxbfcode{\sphinxupquote{delta\_integral}}\sphinxbfcode{\sphinxupquote{ = 0.1}}} \end{fulllineitems} \index{delta\_slanted (matplotlib.mathtext.FontConstantsBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.FontConstantsBase.delta_slanted}}\pysigline{\sphinxbfcode{\sphinxupquote{delta\_slanted}}\sphinxbfcode{\sphinxupquote{ = 0.2}}} \end{fulllineitems} \index{script\_space (matplotlib.mathtext.FontConstantsBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.FontConstantsBase.script_space}}\pysigline{\sphinxbfcode{\sphinxupquote{script\_space}}\sphinxbfcode{\sphinxupquote{ = 0.05}}} \end{fulllineitems} \index{sub1 (matplotlib.mathtext.FontConstantsBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.FontConstantsBase.sub1}}\pysigline{\sphinxbfcode{\sphinxupquote{sub1}}\sphinxbfcode{\sphinxupquote{ = 0.3}}} \end{fulllineitems} \index{sub2 (matplotlib.mathtext.FontConstantsBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.FontConstantsBase.sub2}}\pysigline{\sphinxbfcode{\sphinxupquote{sub2}}\sphinxbfcode{\sphinxupquote{ = 0.5}}} \end{fulllineitems} \index{subdrop (matplotlib.mathtext.FontConstantsBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.FontConstantsBase.subdrop}}\pysigline{\sphinxbfcode{\sphinxupquote{subdrop}}\sphinxbfcode{\sphinxupquote{ = 0.4}}} \end{fulllineitems} \index{sup1 (matplotlib.mathtext.FontConstantsBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.FontConstantsBase.sup1}}\pysigline{\sphinxbfcode{\sphinxupquote{sup1}}\sphinxbfcode{\sphinxupquote{ = 0.7}}} \end{fulllineitems} \end{fulllineitems} \index{Fonts (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Fonts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Fonts}}}{\emph{default\_font\_prop}, \emph{mathtext\_backend}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} An abstract base class for a system of fonts to use for mathtext. The class must be able to take symbol keys and font file names and return the character metrics. It also delegates to a backend class to do the actual drawing. \sphinxstyleemphasis{default\_font\_prop}: A {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FontProperties}}}}} object to use for the default non-math font, or the base font for Unicode (generic) font rendering. \sphinxstyleemphasis{mathtext\_backend}: A subclass of \sphinxcode{\sphinxupquote{MathTextBackend}} used to delegate the actual rendering. \index{destroy() (matplotlib.mathtext.Fonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Fonts.destroy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{destroy}}}{}{} Fix any cyclical references before the object is about to be destroyed. \end{fulllineitems} \index{get\_kern() (matplotlib.mathtext.Fonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Fonts.get_kern}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_kern}}}{\emph{font1}, \emph{fontclass1}, \emph{sym1}, \emph{fontsize1}, \emph{font2}, \emph{fontclass2}, \emph{sym2}, \emph{fontsize2}, \emph{dpi}}{} Get the kerning distance for font between \sphinxstyleemphasis{sym1} and \sphinxstyleemphasis{sym2}. \sphinxstyleemphasis{fontX}: one of the TeX font names: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tt}\PYG{p}{,} \PYG{n}{it}\PYG{p}{,} \PYG{n}{rm}\PYG{p}{,} \PYG{n}{cal}\PYG{p}{,} \PYG{n}{sf}\PYG{p}{,} \PYG{n}{bf} \PYG{o+ow}{or} \PYG{n}{default}\PYG{o}{/}\PYG{n}{regular} \PYG{p}{(}\PYG{n}{non}\PYG{o}{\PYGZhy{}}\PYG{n}{math}\PYG{p}{)} \end{sphinxVerbatim} \sphinxstyleemphasis{fontclassX}: TODO \sphinxstyleemphasis{symX}: a symbol in raw TeX form. e.g., ‘1’, ‘x’ or ‘sigma’ \sphinxstyleemphasis{fontsizeX}: the fontsize in points \sphinxstyleemphasis{dpi}: the current dots-per-inch \end{fulllineitems} \index{get\_metrics() (matplotlib.mathtext.Fonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Fonts.get_metrics}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_metrics}}}{\emph{font}, \emph{font\_class}, \emph{sym}, \emph{fontsize}, \emph{dpi}, \emph{math=True}}{} \sphinxstyleemphasis{font}: one of the TeX font names: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tt}\PYG{p}{,} \PYG{n}{it}\PYG{p}{,} \PYG{n}{rm}\PYG{p}{,} \PYG{n}{cal}\PYG{p}{,} \PYG{n}{sf}\PYG{p}{,} \PYG{n}{bf} \PYG{o+ow}{or} \PYG{n}{default}\PYG{o}{/}\PYG{n}{regular} \PYG{p}{(}\PYG{n}{non}\PYG{o}{\PYGZhy{}}\PYG{n}{math}\PYG{p}{)} \end{sphinxVerbatim} \sphinxstyleemphasis{font\_class}: TODO \sphinxstyleemphasis{sym}: a symbol in raw TeX form. e.g., ‘1’, ‘x’ or ‘sigma’ \sphinxstyleemphasis{fontsize}: font size in points \sphinxstyleemphasis{dpi}: current dots-per-inch \sphinxstyleemphasis{math}: whether sym is a math character Returns an object with the following attributes: \begin{itemize} \item {} \sphinxstyleemphasis{advance}: The advance distance (in points) of the glyph. \item {} \sphinxstyleemphasis{height}: The height of the glyph in points. \item {} \sphinxstyleemphasis{width}: The width of the glyph in points. \item {} \sphinxstyleemphasis{xmin}, \sphinxstyleemphasis{xmax}, \sphinxstyleemphasis{ymin}, \sphinxstyleemphasis{ymax} - the ink rectangle of the glyph \item {} \sphinxstyleemphasis{iceberg} - the distance from the baseline to the top of the glyph. This corresponds to TeX’s definition of “height”. \end{itemize} \end{fulllineitems} \index{get\_results() (matplotlib.mathtext.Fonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Fonts.get_results}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_results}}}{\emph{box}}{} Get the data needed by the backend to render the math expression. The return value is backend-specific. \end{fulllineitems} \index{get\_sized\_alternatives\_for\_symbol() (matplotlib.mathtext.Fonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Fonts.get_sized_alternatives_for_symbol}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sized\_alternatives\_for\_symbol}}}{\emph{fontname}, \emph{sym}}{} Override if your font provides multiple sizes of the same symbol. Should return a list of symbols matching \sphinxstyleemphasis{sym} in various sizes. The expression renderer will select the most appropriate size for a given situation from this list. \end{fulllineitems} \index{get\_underline\_thickness() (matplotlib.mathtext.Fonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Fonts.get_underline_thickness}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_underline\_thickness}}}{\emph{font}, \emph{fontsize}, \emph{dpi}}{} Get the line thickness that matches the given font. Used as a base unit for drawing lines such as in a fraction or radical. \end{fulllineitems} \index{get\_used\_characters() (matplotlib.mathtext.Fonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Fonts.get_used_characters}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_used\_characters}}}{}{} Get the set of characters that were used in the math expression. Used by backends that need to subset fonts so they know which glyphs to include. \end{fulllineitems} \index{get\_xheight() (matplotlib.mathtext.Fonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Fonts.get_xheight}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_xheight}}}{\emph{font}, \emph{fontsize}, \emph{dpi}}{} Get the xheight for the given \sphinxstyleemphasis{font} and \sphinxstyleemphasis{fontsize}. \end{fulllineitems} \index{render\_glyph() (matplotlib.mathtext.Fonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Fonts.render_glyph}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render\_glyph}}}{\emph{ox}, \emph{oy}, \emph{facename}, \emph{font\_class}, \emph{sym}, \emph{fontsize}, \emph{dpi}}{} Draw a glyph at \begin{itemize} \item {} \sphinxstyleemphasis{ox}, \sphinxstyleemphasis{oy}: position \item {} \sphinxstyleemphasis{facename}: One of the TeX face names \item {} \sphinxstyleemphasis{font\_class}: \item {} \sphinxstyleemphasis{sym}: TeX symbol name or single character \item {} \sphinxstyleemphasis{fontsize}: fontsize in points \item {} \sphinxstyleemphasis{dpi}: The dpi to draw at. \end{itemize} \end{fulllineitems} \index{render\_rect\_filled() (matplotlib.mathtext.Fonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Fonts.render_rect_filled}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render\_rect\_filled}}}{\emph{x1}, \emph{y1}, \emph{x2}, \emph{y2}}{} Draw a filled rectangle from (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) to (\sphinxstyleemphasis{x2}, \sphinxstyleemphasis{y2}). \end{fulllineitems} \index{set\_canvas\_size() (matplotlib.mathtext.Fonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Fonts.set_canvas_size}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_canvas\_size}}}{\emph{w}, \emph{h}, \emph{d}}{} Set the size of the buffer used to render the math expression. Only really necessary for the bitmap backends. \end{fulllineitems} \end{fulllineitems} \index{Glue (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Glue}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Glue}}}{\emph{glue\_type}, \emph{copy=False}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Node}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Node}}}}} Most of the information in this object is stored in the underlying {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.GlueSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GlueSpec}}}}} class, which is shared between multiple glue objects. (This is a memory optimization which probably doesn’t matter anymore, but it’s easier to stick to what TeX does.) \index{grow() (matplotlib.mathtext.Glue method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Glue.grow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{grow}}}{}{} Grows one level larger. There is no limit to how big something can get. \end{fulllineitems} \index{shrink() (matplotlib.mathtext.Glue method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Glue.shrink}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{shrink}}}{}{} Shrinks one level smaller. There are only three levels of sizes, after which things will no longer get smaller. \end{fulllineitems} \end{fulllineitems} \index{GlueSpec (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.GlueSpec}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{GlueSpec}}}{\emph{width=0.0}, \emph{stretch=0.0}, \emph{stretch\_order=0}, \emph{shrink=0.0}, \emph{shrink\_order=0}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} See {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Glue}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Glue}}}}}. \index{copy() (matplotlib.mathtext.GlueSpec method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.GlueSpec.copy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{copy}}}{}{}~ \end{fulllineitems} \index{factory() (matplotlib.mathtext.GlueSpec class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.GlueSpec.factory}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{factory}}}{\emph{glue\_type}}{}~ \end{fulllineitems} \end{fulllineitems} \index{HCentered (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.HCentered}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{HCentered}}}{\emph{elements}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Hlist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Hlist}}}}} A convenience class to create an {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Hlist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Hlist}}}}} whose contents are centered within its enclosing box. \end{fulllineitems} \index{Hbox (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Hbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Hbox}}}{\emph{width}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Box}}}}} A box with only width (zero height and depth). \end{fulllineitems} \index{Hlist (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Hlist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Hlist}}}{\emph{elements}, \emph{w=0.0}, \emph{m='additional'}, \emph{do\_kern=True}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.List}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.List}}}}} A horizontal list of boxes. \index{hpack() (matplotlib.mathtext.Hlist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Hlist.hpack}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hpack}}}{\emph{w=0.0}, \emph{m='additional'}}{} The main duty of {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Hlist.hpack}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hpack()}}}}} is to compute the dimensions of the resulting boxes, and to adjust the glue if one of those dimensions is pre-specified. The computed sizes normally enclose all of the material inside the new box; but some items may stick out if negative glue is used, if the box is overfull, or if a \sphinxcode{\sphinxupquote{\textbackslash{}vbox}} includes other boxes that have been shifted left. \begin{itemize} \item {} \sphinxstyleemphasis{w}: specifies a width \item {} \sphinxstyleemphasis{m}: is either ‘exactly’ or ‘additional’. \end{itemize} Thus, \sphinxcode{\sphinxupquote{hpack(w, 'exactly')}} produces a box whose width is exactly \sphinxstyleemphasis{w}, while \sphinxcode{\sphinxupquote{hpack(w, 'additional')}} yields a box whose width is the natural width plus \sphinxstyleemphasis{w}. The default values produce a box with the natural width. \end{fulllineitems} \index{kern() (matplotlib.mathtext.Hlist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Hlist.kern}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{kern}}}{}{} Insert {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Kern}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Kern}}}}} nodes between {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Char}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Char}}}}} nodes to set kerning. The {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Char}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Char}}}}} nodes themselves determine the amount of kerning they need (in {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Char.get_kerning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_kerning()}}}}}), and this function just creates the linked list in the correct way. \end{fulllineitems} \end{fulllineitems} \index{Hrule (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Hrule}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Hrule}}}{\emph{state}, \emph{thickness=None}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Rule}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Rule}}}}} Convenience class to create a horizontal rule. \end{fulllineitems} \index{Kern (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Kern}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Kern}}}{\emph{width}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Node}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Node}}}}} A {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Kern}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Kern}}}}} node has a width field to specify a (normally negative) amount of spacing. This spacing correction appears in horizontal lists between letters like A and V when the font designer said that it looks better to move them closer together or further apart. A kern node can also appear in a vertical list, when its \sphinxstyleemphasis{width} denotes additional spacing in the vertical direction. \index{depth (matplotlib.mathtext.Kern attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Kern.depth}}\pysigline{\sphinxbfcode{\sphinxupquote{depth}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \index{grow() (matplotlib.mathtext.Kern method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Kern.grow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{grow}}}{}{} Grows one level larger. There is no limit to how big something can get. \end{fulllineitems} \index{height (matplotlib.mathtext.Kern attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Kern.height}}\pysigline{\sphinxbfcode{\sphinxupquote{height}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \index{shrink() (matplotlib.mathtext.Kern method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Kern.shrink}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{shrink}}}{}{} Shrinks one level smaller. There are only three levels of sizes, after which things will no longer get smaller. \end{fulllineitems} \end{fulllineitems} \index{List (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.List}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{List}}}{\emph{elements}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Box}}}}} A list of nodes (either horizontal or vertical). \index{grow() (matplotlib.mathtext.List method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.List.grow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{grow}}}{}{} Grows one level larger. There is no limit to how big something can get. \end{fulllineitems} \index{shrink() (matplotlib.mathtext.List method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.List.shrink}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{shrink}}}{}{} Shrinks one level smaller. There are only three levels of sizes, after which things will no longer get smaller. \end{fulllineitems} \end{fulllineitems} \index{MathTextParser (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathTextParser}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{MathTextParser}}}{\emph{output}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Create a MathTextParser for the given backend \sphinxstyleemphasis{output}. \index{get\_depth() (matplotlib.mathtext.MathTextParser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathTextParser.get_depth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_depth}}}{\emph{texstr}, \emph{dpi=120}, \emph{fontsize=14}}{} Returns the offset of the baseline from the bottom of the image in pixels. \begin{description} \item[{\sphinxstyleemphasis{texstr}}] \leavevmode A valid mathtext string, e.g., r’IQ: \$sigma\_i=15\$’ \item[{\sphinxstyleemphasis{dpi}}] \leavevmode The dots-per-inch to render the text \item[{\sphinxstyleemphasis{fontsize}}] \leavevmode The font size in points \end{description} \end{fulllineitems} \index{parse() (matplotlib.mathtext.MathTextParser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathTextParser.parse}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{parse}}}{\emph{s}, \emph{dpi=72}, \emph{prop=None}}{} Parse the given math expression \sphinxstyleemphasis{s} at the given \sphinxstyleemphasis{dpi}. If \sphinxstyleemphasis{prop} is provided, it is a {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FontProperties}}}}} object specifying the “default” font to use in the math expression, used for all non-math text. The results are cached, so multiple calls to {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.MathTextParser.parse}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{parse()}}}}} with the same expression should be fast. \end{fulllineitems} \index{to\_mask() (matplotlib.mathtext.MathTextParser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathTextParser.to_mask}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_mask}}}{\emph{texstr}, \emph{dpi=120}, \emph{fontsize=14}}{}~\begin{description} \item[{\sphinxstyleemphasis{texstr}}] \leavevmode A valid mathtext string, e.g., r’IQ: \$sigma\_i=15\$’ \item[{\sphinxstyleemphasis{dpi}}] \leavevmode The dots-per-inch to render the text \item[{\sphinxstyleemphasis{fontsize}}] \leavevmode The font size in points \end{description} Returns a tuple (\sphinxstyleemphasis{array}, \sphinxstyleemphasis{depth}) \begin{itemize} \item {} \sphinxstyleemphasis{array} is an NxM uint8 alpha ubyte mask array of rasterized tex. \item {} depth is the offset of the baseline from the bottom of the image in pixels. \end{itemize} \end{fulllineitems} \index{to\_png() (matplotlib.mathtext.MathTextParser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathTextParser.to_png}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_png}}}{\emph{filename}, \emph{texstr}, \emph{color='black'}, \emph{dpi=120}, \emph{fontsize=14}}{} Writes a tex expression to a PNG file. Returns the offset of the baseline from the bottom of the image in pixels. \begin{description} \item[{\sphinxstyleemphasis{filename}}] \leavevmode A writable filename or fileobject \item[{\sphinxstyleemphasis{texstr}}] \leavevmode A valid mathtext string, e.g., r’IQ: \$sigma\_i=15\$’ \item[{\sphinxstyleemphasis{color}}] \leavevmode A valid matplotlib color argument \item[{\sphinxstyleemphasis{dpi}}] \leavevmode The dots-per-inch to render the text \item[{\sphinxstyleemphasis{fontsize}}] \leavevmode The font size in points \end{description} Returns the offset of the baseline from the bottom of the image in pixels. \end{fulllineitems} \index{to\_rgba() (matplotlib.mathtext.MathTextParser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathTextParser.to_rgba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_rgba}}}{\emph{texstr}, \emph{color='black'}, \emph{dpi=120}, \emph{fontsize=14}}{}~\begin{description} \item[{\sphinxstyleemphasis{texstr}}] \leavevmode A valid mathtext string, e.g., r’IQ: \$sigma\_i=15\$’ \item[{\sphinxstyleemphasis{color}}] \leavevmode Any matplotlib color argument \item[{\sphinxstyleemphasis{dpi}}] \leavevmode The dots-per-inch to render the text \item[{\sphinxstyleemphasis{fontsize}}] \leavevmode The font size in points \end{description} Returns a tuple (\sphinxstyleemphasis{array}, \sphinxstyleemphasis{depth}) \begin{itemize} \item {} \sphinxstyleemphasis{array} is an NxM uint8 alpha ubyte mask array of rasterized tex. \item {} depth is the offset of the baseline from the bottom of the image in pixels. \end{itemize} \end{fulllineitems} \end{fulllineitems} \index{MathTextWarning} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathTextWarning}}\pysigline{\sphinxbfcode{\sphinxupquote{exception }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{MathTextWarning}}} Bases: \sphinxhref{https://docs.python.org/3/library/exceptions.html\#Warning}{\sphinxcode{\sphinxupquote{Warning}}} \end{fulllineitems} \index{MathtextBackend (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackend}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{MathtextBackend}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} The base class for the mathtext backend-specific code. The purpose of {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MathtextBackend}}}}} subclasses is to interface between mathtext and a specific matplotlib graphics backend. Subclasses need to override the following: \begin{itemize} \item {} {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackend.render_glyph}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{render\_glyph()}}}}} \item {} {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackend.render_rect_filled}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{render\_rect\_filled()}}}}} \item {} {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackend.get_results}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_results()}}}}} \end{itemize} And optionally, if you need to use a FreeType hinting style: \begin{itemize} \item {} {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackend.get_hinting_type}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_hinting\_type()}}}}} \end{itemize} \index{get\_hinting\_type() (matplotlib.mathtext.MathtextBackend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackend.get_hinting_type}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hinting\_type}}}{}{} Get the FreeType hinting type to use with this particular backend. \end{fulllineitems} \index{get\_results() (matplotlib.mathtext.MathtextBackend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackend.get_results}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_results}}}{\emph{box}}{} Return a backend-specific tuple to return to the backend after all processing is done. \end{fulllineitems} \index{render\_glyph() (matplotlib.mathtext.MathtextBackend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackend.render_glyph}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render\_glyph}}}{\emph{ox}, \emph{oy}, \emph{info}}{} Draw a glyph described by \sphinxstyleemphasis{info} to the reference point (\sphinxstyleemphasis{ox}, \sphinxstyleemphasis{oy}). \end{fulllineitems} \index{render\_rect\_filled() (matplotlib.mathtext.MathtextBackend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackend.render_rect_filled}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render\_rect\_filled}}}{\emph{x1}, \emph{y1}, \emph{x2}, \emph{y2}}{} Draw a filled black rectangle from (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) to (\sphinxstyleemphasis{x2}, \sphinxstyleemphasis{y2}). \end{fulllineitems} \index{set\_canvas\_size() (matplotlib.mathtext.MathtextBackend method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackend.set_canvas_size}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_canvas\_size}}}{\emph{w}, \emph{h}, \emph{d}}{} Dimension the drawing canvas \end{fulllineitems} \end{fulllineitems} \index{MathtextBackendAgg (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendAgg}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{MathtextBackendAgg}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.MathtextBackend}}}}} Render glyphs and rectangles to an FTImage buffer, which is later transferred to the Agg image by the Agg backend. \index{get\_hinting\_type() (matplotlib.mathtext.MathtextBackendAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendAgg.get_hinting_type}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hinting\_type}}}{}{} Get the FreeType hinting type to use with this particular backend. \end{fulllineitems} \index{get\_results() (matplotlib.mathtext.MathtextBackendAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendAgg.get_results}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_results}}}{\emph{box}, \emph{used\_characters}}{} Return a backend-specific tuple to return to the backend after all processing is done. \end{fulllineitems} \index{render\_glyph() (matplotlib.mathtext.MathtextBackendAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendAgg.render_glyph}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render\_glyph}}}{\emph{ox}, \emph{oy}, \emph{info}}{} Draw a glyph described by \sphinxstyleemphasis{info} to the reference point (\sphinxstyleemphasis{ox}, \sphinxstyleemphasis{oy}). \end{fulllineitems} \index{render\_rect\_filled() (matplotlib.mathtext.MathtextBackendAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendAgg.render_rect_filled}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render\_rect\_filled}}}{\emph{x1}, \emph{y1}, \emph{x2}, \emph{y2}}{} Draw a filled black rectangle from (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) to (\sphinxstyleemphasis{x2}, \sphinxstyleemphasis{y2}). \end{fulllineitems} \index{set\_canvas\_size() (matplotlib.mathtext.MathtextBackendAgg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendAgg.set_canvas_size}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_canvas\_size}}}{\emph{w}, \emph{h}, \emph{d}}{} Dimension the drawing canvas \end{fulllineitems} \end{fulllineitems} \index{MathtextBackendBitmap (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendBitmap}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{MathtextBackendBitmap}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendAgg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.MathtextBackendAgg}}}}} \index{get\_results() (matplotlib.mathtext.MathtextBackendBitmap method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendBitmap.get_results}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_results}}}{\emph{box}, \emph{used\_characters}}{} Return a backend-specific tuple to return to the backend after all processing is done. \end{fulllineitems} \end{fulllineitems} \index{MathtextBackendCairo (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendCairo}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{MathtextBackendCairo}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.MathtextBackend}}}}} Store information to write a mathtext rendering to the Cairo backend. \index{get\_results() (matplotlib.mathtext.MathtextBackendCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendCairo.get_results}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_results}}}{\emph{box}, \emph{used\_characters}}{} Return a backend-specific tuple to return to the backend after all processing is done. \end{fulllineitems} \index{render\_glyph() (matplotlib.mathtext.MathtextBackendCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendCairo.render_glyph}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render\_glyph}}}{\emph{ox}, \emph{oy}, \emph{info}}{} Draw a glyph described by \sphinxstyleemphasis{info} to the reference point (\sphinxstyleemphasis{ox}, \sphinxstyleemphasis{oy}). \end{fulllineitems} \index{render\_rect\_filled() (matplotlib.mathtext.MathtextBackendCairo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendCairo.render_rect_filled}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render\_rect\_filled}}}{\emph{x1}, \emph{y1}, \emph{x2}, \emph{y2}}{} Draw a filled black rectangle from (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) to (\sphinxstyleemphasis{x2}, \sphinxstyleemphasis{y2}). \end{fulllineitems} \end{fulllineitems} \index{MathtextBackendPath (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendPath}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{MathtextBackendPath}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.MathtextBackend}}}}} Store information to write a mathtext rendering to the text path machinery. \index{get\_results() (matplotlib.mathtext.MathtextBackendPath method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendPath.get_results}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_results}}}{\emph{box}, \emph{used\_characters}}{} Return a backend-specific tuple to return to the backend after all processing is done. \end{fulllineitems} \index{render\_glyph() (matplotlib.mathtext.MathtextBackendPath method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendPath.render_glyph}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render\_glyph}}}{\emph{ox}, \emph{oy}, \emph{info}}{} Draw a glyph described by \sphinxstyleemphasis{info} to the reference point (\sphinxstyleemphasis{ox}, \sphinxstyleemphasis{oy}). \end{fulllineitems} \index{render\_rect\_filled() (matplotlib.mathtext.MathtextBackendPath method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendPath.render_rect_filled}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render\_rect\_filled}}}{\emph{x1}, \emph{y1}, \emph{x2}, \emph{y2}}{} Draw a filled black rectangle from (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) to (\sphinxstyleemphasis{x2}, \sphinxstyleemphasis{y2}). \end{fulllineitems} \end{fulllineitems} \index{MathtextBackendPdf (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendPdf}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{MathtextBackendPdf}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.MathtextBackend}}}}} Store information to write a mathtext rendering to the PDF backend. \index{get\_results() (matplotlib.mathtext.MathtextBackendPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendPdf.get_results}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_results}}}{\emph{box}, \emph{used\_characters}}{} Return a backend-specific tuple to return to the backend after all processing is done. \end{fulllineitems} \index{render\_glyph() (matplotlib.mathtext.MathtextBackendPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendPdf.render_glyph}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render\_glyph}}}{\emph{ox}, \emph{oy}, \emph{info}}{} Draw a glyph described by \sphinxstyleemphasis{info} to the reference point (\sphinxstyleemphasis{ox}, \sphinxstyleemphasis{oy}). \end{fulllineitems} \index{render\_rect\_filled() (matplotlib.mathtext.MathtextBackendPdf method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendPdf.render_rect_filled}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render\_rect\_filled}}}{\emph{x1}, \emph{y1}, \emph{x2}, \emph{y2}}{} Draw a filled black rectangle from (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) to (\sphinxstyleemphasis{x2}, \sphinxstyleemphasis{y2}). \end{fulllineitems} \end{fulllineitems} \index{MathtextBackendPs (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendPs}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{MathtextBackendPs}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.MathtextBackend}}}}} Store information to write a mathtext rendering to the PostScript backend. \index{get\_results() (matplotlib.mathtext.MathtextBackendPs method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendPs.get_results}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_results}}}{\emph{box}, \emph{used\_characters}}{} Return a backend-specific tuple to return to the backend after all processing is done. \end{fulllineitems} \index{render\_glyph() (matplotlib.mathtext.MathtextBackendPs method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendPs.render_glyph}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render\_glyph}}}{\emph{ox}, \emph{oy}, \emph{info}}{} Draw a glyph described by \sphinxstyleemphasis{info} to the reference point (\sphinxstyleemphasis{ox}, \sphinxstyleemphasis{oy}). \end{fulllineitems} \index{render\_rect\_filled() (matplotlib.mathtext.MathtextBackendPs method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendPs.render_rect_filled}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render\_rect\_filled}}}{\emph{x1}, \emph{y1}, \emph{x2}, \emph{y2}}{} Draw a filled black rectangle from (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) to (\sphinxstyleemphasis{x2}, \sphinxstyleemphasis{y2}). \end{fulllineitems} \end{fulllineitems} \index{MathtextBackendSvg (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendSvg}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{MathtextBackendSvg}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.MathtextBackend}}}}} Store information to write a mathtext rendering to the SVG backend. \index{get\_results() (matplotlib.mathtext.MathtextBackendSvg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendSvg.get_results}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_results}}}{\emph{box}, \emph{used\_characters}}{} Return a backend-specific tuple to return to the backend after all processing is done. \end{fulllineitems} \index{render\_glyph() (matplotlib.mathtext.MathtextBackendSvg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendSvg.render_glyph}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render\_glyph}}}{\emph{ox}, \emph{oy}, \emph{info}}{} Draw a glyph described by \sphinxstyleemphasis{info} to the reference point (\sphinxstyleemphasis{ox}, \sphinxstyleemphasis{oy}). \end{fulllineitems} \index{render\_rect\_filled() (matplotlib.mathtext.MathtextBackendSvg method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.MathtextBackendSvg.render_rect_filled}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render\_rect\_filled}}}{\emph{x1}, \emph{y1}, \emph{x2}, \emph{y2}}{} Draw a filled black rectangle from (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) to (\sphinxstyleemphasis{x2}, \sphinxstyleemphasis{y2}). \end{fulllineitems} \end{fulllineitems} \index{NegFil (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.NegFil}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{NegFil}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Glue}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Glue}}}}} \end{fulllineitems} \index{NegFill (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.NegFill}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{NegFill}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Glue}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Glue}}}}} \end{fulllineitems} \index{NegFilll (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.NegFilll}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{NegFilll}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Glue}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Glue}}}}} \end{fulllineitems} \index{Node (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Node}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Node}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} A node in the TeX box model \index{get\_kerning() (matplotlib.mathtext.Node method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Node.get_kerning}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_kerning}}}{\emph{next}}{}~ \end{fulllineitems} \index{grow() (matplotlib.mathtext.Node method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Node.grow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{grow}}}{}{} Grows one level larger. There is no limit to how big something can get. \end{fulllineitems} \index{render() (matplotlib.mathtext.Node method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Node.render}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render}}}{\emph{x}, \emph{y}}{}~ \end{fulllineitems} \index{shrink() (matplotlib.mathtext.Node method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Node.shrink}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{shrink}}}{}{} Shrinks one level smaller. There are only three levels of sizes, after which things will no longer get smaller. \end{fulllineitems} \end{fulllineitems} \index{Parser (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Parser}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} This is the pyparsing-based parser for math expressions. It actually parses full strings \sphinxstyleemphasis{containing} math expressions, in that raw text may also appear outside of pairs of \sphinxcode{\sphinxupquote{\$}}. The grammar is based directly on that in TeX, though it cuts a few corners. \index{Parser.State (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.State}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{State}}}{\emph{font\_output}, \emph{font}, \emph{font\_class}, \emph{fontsize}, \emph{dpi}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Stores the state of the parser. States are pushed and popped from a stack as necessary, and the “current” state is always at the top of the stack. \index{copy() (matplotlib.mathtext.Parser.State method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.State.copy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{copy}}}{}{}~ \end{fulllineitems} \index{font (matplotlib.mathtext.Parser.State attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.State.font}}\pysigline{\sphinxbfcode{\sphinxupquote{font}}}~ \end{fulllineitems} \end{fulllineitems} \index{accent() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.accent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{accent}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{auto\_delim() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.auto_delim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{auto\_delim}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{binom() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.binom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{binom}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{c\_over\_c() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.c_over_c}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{c\_over\_c}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{customspace() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.customspace}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{customspace}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{dfrac() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.dfrac}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{dfrac}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{end\_group() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.end_group}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{end\_group}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{font() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.font}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{font}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{frac() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.frac}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{frac}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{function() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.function}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{function}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{genfrac() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.genfrac}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{genfrac}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{get\_state() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.get_state}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_state}}}{}{} Get the current {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.State}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{State}}}}} of the parser. \end{fulllineitems} \index{group() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.group}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{group}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{is\_between\_brackets() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.is_between_brackets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_between\_brackets}}}{\emph{s}, \emph{loc}}{}~ \end{fulllineitems} \index{is\_dropsub() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.is_dropsub}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_dropsub}}}{\emph{nucleus}}{}~ \end{fulllineitems} \index{is\_overunder() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.is_overunder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_overunder}}}{\emph{nucleus}}{}~ \end{fulllineitems} \index{is\_slanted() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.is_slanted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_slanted}}}{\emph{nucleus}}{}~ \end{fulllineitems} \index{main() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.main}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{main}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{math() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.math}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{math}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{math\_string() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.math_string}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{math\_string}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{non\_math() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.non_math}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{non\_math}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{operatorname() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.operatorname}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{operatorname}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{overline() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.overline}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{overline}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{parse() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.parse}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{parse}}}{\emph{s}, \emph{fonts\_object}, \emph{fontsize}, \emph{dpi}}{} Parse expression \sphinxstyleemphasis{s} using the given \sphinxstyleemphasis{fonts\_object} for output, at the given \sphinxstyleemphasis{fontsize} and \sphinxstyleemphasis{dpi}. Returns the parse tree of {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Node}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Node}}}}} instances. \end{fulllineitems} \index{pop\_state() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.pop_state}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pop\_state}}}{}{} Pop a {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.State}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{State}}}}} off of the stack. \end{fulllineitems} \index{push\_state() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.push_state}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{push\_state}}}{}{} Push a new {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.State}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{State}}}}} onto the stack which is just a copy of the current state. \end{fulllineitems} \index{required\_group() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.required_group}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{required\_group}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{simple\_group() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.simple_group}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{simple\_group}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{snowflake() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.snowflake}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{snowflake}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{space() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.space}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{space}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{sqrt() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.sqrt}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{sqrt}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{stackrel() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.stackrel}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{stackrel}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{start\_group() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.start_group}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{start\_group}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{subsuper() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.subsuper}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subsuper}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{symbol() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.symbol}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{symbol}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \index{unknown\_symbol() (matplotlib.mathtext.Parser method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Parser.unknown_symbol}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{unknown\_symbol}}}{\emph{s}, \emph{loc}, \emph{toks}}{}~ \end{fulllineitems} \end{fulllineitems} \index{Rule (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Rule}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Rule}}}{\emph{width}, \emph{height}, \emph{depth}, \emph{state}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Box}}}}} A {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Rule}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rule}}}}} node stands for a solid black rectangle; it has \sphinxstyleemphasis{width}, \sphinxstyleemphasis{depth}, and \sphinxstyleemphasis{height} fields just as in an {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Hlist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Hlist}}}}}. However, if any of these dimensions is inf, the actual value will be determined by running the rule up to the boundary of the innermost enclosing box. This is called a “running dimension.” The width is never running in an {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Hlist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Hlist}}}}}; the height and depth are never running in a {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Vlist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Vlist}}}}}. \index{render() (matplotlib.mathtext.Rule method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Rule.render}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{render}}}{\emph{x}, \emph{y}, \emph{w}, \emph{h}}{}~ \end{fulllineitems} \end{fulllineitems} \index{STIXFontConstants (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.STIXFontConstants}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{STIXFontConstants}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.FontConstantsBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.FontConstantsBase}}}}} \index{delta (matplotlib.mathtext.STIXFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.STIXFontConstants.delta}}\pysigline{\sphinxbfcode{\sphinxupquote{delta}}\sphinxbfcode{\sphinxupquote{ = 0.05}}} \end{fulllineitems} \index{delta\_integral (matplotlib.mathtext.STIXFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.STIXFontConstants.delta_integral}}\pysigline{\sphinxbfcode{\sphinxupquote{delta\_integral}}\sphinxbfcode{\sphinxupquote{ = 0.3}}} \end{fulllineitems} \index{delta\_slanted (matplotlib.mathtext.STIXFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.STIXFontConstants.delta_slanted}}\pysigline{\sphinxbfcode{\sphinxupquote{delta\_slanted}}\sphinxbfcode{\sphinxupquote{ = 0.3}}} \end{fulllineitems} \index{script\_space (matplotlib.mathtext.STIXFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.STIXFontConstants.script_space}}\pysigline{\sphinxbfcode{\sphinxupquote{script\_space}}\sphinxbfcode{\sphinxupquote{ = 0.1}}} \end{fulllineitems} \index{sub2 (matplotlib.mathtext.STIXFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.STIXFontConstants.sub2}}\pysigline{\sphinxbfcode{\sphinxupquote{sub2}}\sphinxbfcode{\sphinxupquote{ = 0.6}}} \end{fulllineitems} \index{sup1 (matplotlib.mathtext.STIXFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.STIXFontConstants.sup1}}\pysigline{\sphinxbfcode{\sphinxupquote{sup1}}\sphinxbfcode{\sphinxupquote{ = 0.8}}} \end{fulllineitems} \end{fulllineitems} \index{STIXSansFontConstants (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.STIXSansFontConstants}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{STIXSansFontConstants}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.FontConstantsBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.FontConstantsBase}}}}} \index{delta\_integral (matplotlib.mathtext.STIXSansFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.STIXSansFontConstants.delta_integral}}\pysigline{\sphinxbfcode{\sphinxupquote{delta\_integral}}\sphinxbfcode{\sphinxupquote{ = 0.3}}} \end{fulllineitems} \index{delta\_slanted (matplotlib.mathtext.STIXSansFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.STIXSansFontConstants.delta_slanted}}\pysigline{\sphinxbfcode{\sphinxupquote{delta\_slanted}}\sphinxbfcode{\sphinxupquote{ = 0.6}}} \end{fulllineitems} \index{script\_space (matplotlib.mathtext.STIXSansFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.STIXSansFontConstants.script_space}}\pysigline{\sphinxbfcode{\sphinxupquote{script\_space}}\sphinxbfcode{\sphinxupquote{ = 0.05}}} \end{fulllineitems} \index{sup1 (matplotlib.mathtext.STIXSansFontConstants attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.STIXSansFontConstants.sup1}}\pysigline{\sphinxbfcode{\sphinxupquote{sup1}}\sphinxbfcode{\sphinxupquote{ = 0.8}}} \end{fulllineitems} \end{fulllineitems} \index{Ship (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Ship}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Ship}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Once the boxes have been set up, this sends them to output. Since boxes can be inside of boxes inside of boxes, the main work of {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Ship}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Ship}}}}} is done by two mutually recursive routines, {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Ship.hlist_out}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hlist\_out()}}}}} and {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Ship.vlist_out}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{vlist\_out()}}}}}, which traverse the {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Hlist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Hlist}}}}} nodes and {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Vlist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Vlist}}}}} nodes inside of horizontal and vertical boxes. The global variables used in TeX to store state as it processes have become member variables here. \index{clamp() (matplotlib.mathtext.Ship static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Ship.clamp}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{clamp}}}{\emph{value}}{}~ \end{fulllineitems} \index{hlist\_out() (matplotlib.mathtext.Ship method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Ship.hlist_out}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{hlist\_out}}}{\emph{box}}{}~ \end{fulllineitems} \index{vlist\_out() (matplotlib.mathtext.Ship method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Ship.vlist_out}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{vlist\_out}}}{\emph{box}}{}~ \end{fulllineitems} \end{fulllineitems} \index{SsGlue (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.SsGlue}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{SsGlue}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Glue}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Glue}}}}} \end{fulllineitems} \index{StandardPsFonts (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.StandardPsFonts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{StandardPsFonts}}}{\emph{default\_font\_prop}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Fonts}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Fonts}}}}} Use the standard postscript fonts for rendering to backend\_ps Unlike the other font classes, BakomaFont and UnicodeFont, this one requires the Ps backend. \index{basepath (matplotlib.mathtext.StandardPsFonts attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.StandardPsFonts.basepath}}\pysigline{\sphinxbfcode{\sphinxupquote{basepath}}\sphinxbfcode{\sphinxupquote{ = '/tmp/build\_mpl/lib/python3.6/site-packages/matplotlib/mpl-data/fonts/afm'}}} \end{fulllineitems} \index{fontmap (matplotlib.mathtext.StandardPsFonts attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.StandardPsFonts.fontmap}}\pysigline{\sphinxbfcode{\sphinxupquote{fontmap}}\sphinxbfcode{\sphinxupquote{ = \{'cal': 'pzcmi8a', 'rm': 'pncr8a', 'tt': 'pcrr8a', 'it': 'pncri8a', 'sf': 'phvr8a', 'bf': 'pncb8a', None: 'psyr'\}}}} \end{fulllineitems} \index{get\_kern() (matplotlib.mathtext.StandardPsFonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.StandardPsFonts.get_kern}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_kern}}}{\emph{font1}, \emph{fontclass1}, \emph{sym1}, \emph{fontsize1}, \emph{font2}, \emph{fontclass2}, \emph{sym2}, \emph{fontsize2}, \emph{dpi}}{} Get the kerning distance for font between \sphinxstyleemphasis{sym1} and \sphinxstyleemphasis{sym2}. \sphinxstyleemphasis{fontX}: one of the TeX font names: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tt}\PYG{p}{,} \PYG{n}{it}\PYG{p}{,} \PYG{n}{rm}\PYG{p}{,} \PYG{n}{cal}\PYG{p}{,} \PYG{n}{sf}\PYG{p}{,} \PYG{n}{bf} \PYG{o+ow}{or} \PYG{n}{default}\PYG{o}{/}\PYG{n}{regular} \PYG{p}{(}\PYG{n}{non}\PYG{o}{\PYGZhy{}}\PYG{n}{math}\PYG{p}{)} \end{sphinxVerbatim} \sphinxstyleemphasis{fontclassX}: TODO \sphinxstyleemphasis{symX}: a symbol in raw TeX form. e.g., ‘1’, ‘x’ or ‘sigma’ \sphinxstyleemphasis{fontsizeX}: the fontsize in points \sphinxstyleemphasis{dpi}: the current dots-per-inch \end{fulllineitems} \index{get\_underline\_thickness() (matplotlib.mathtext.StandardPsFonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.StandardPsFonts.get_underline_thickness}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_underline\_thickness}}}{\emph{font}, \emph{fontsize}, \emph{dpi}}{} Get the line thickness that matches the given font. Used as a base unit for drawing lines such as in a fraction or radical. \end{fulllineitems} \index{get\_xheight() (matplotlib.mathtext.StandardPsFonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.StandardPsFonts.get_xheight}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_xheight}}}{\emph{font}, \emph{fontsize}, \emph{dpi}}{} Get the xheight for the given \sphinxstyleemphasis{font} and \sphinxstyleemphasis{fontsize}. \end{fulllineitems} \end{fulllineitems} \index{StixFonts (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.StixFonts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{StixFonts}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.UnicodeFonts}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.UnicodeFonts}}}}} A font handling class for the STIX fonts. In addition to what UnicodeFonts provides, this class: \begin{itemize} \item {} supports “virtual fonts” which are complete alpha numeric character sets with different font styles at special Unicode code points, such as “Blackboard”. \item {} handles sized alternative characters for the STIXSizeX fonts. \end{itemize} \index{cm\_fallback (matplotlib.mathtext.StixFonts attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.StixFonts.cm_fallback}}\pysigline{\sphinxbfcode{\sphinxupquote{cm\_fallback}}\sphinxbfcode{\sphinxupquote{ = False}}} \end{fulllineitems} \index{get\_sized\_alternatives\_for\_symbol() (matplotlib.mathtext.StixFonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.StixFonts.get_sized_alternatives_for_symbol}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sized\_alternatives\_for\_symbol}}}{\emph{fontname}, \emph{sym}}{} Override if your font provides multiple sizes of the same symbol. Should return a list of symbols matching \sphinxstyleemphasis{sym} in various sizes. The expression renderer will select the most appropriate size for a given situation from this list. \end{fulllineitems} \index{use\_cmex (matplotlib.mathtext.StixFonts attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.StixFonts.use_cmex}}\pysigline{\sphinxbfcode{\sphinxupquote{use\_cmex}}\sphinxbfcode{\sphinxupquote{ = False}}} \end{fulllineitems} \end{fulllineitems} \index{StixSansFonts (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.StixSansFonts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{StixSansFonts}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.StixFonts}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.StixFonts}}}}} A font handling class for the STIX fonts (that uses sans-serif characters by default). \end{fulllineitems} \index{SubSuperCluster (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.SubSuperCluster}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{SubSuperCluster}}} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Hlist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Hlist}}}}} {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.SubSuperCluster}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SubSuperCluster}}}}} is a sort of hack to get around that fact that this code do a two-pass parse like TeX. This lets us store enough information in the hlist itself, namely the nucleus, sub- and super-script, such that if another script follows that needs to be attached, it can be reconfigured on the fly. \end{fulllineitems} \index{TruetypeFonts (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.TruetypeFonts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{TruetypeFonts}}}{\emph{default\_font\_prop}, \emph{mathtext\_backend}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Fonts}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Fonts}}}}} A generic base class for all font setups that use Truetype fonts (through FT2Font). \index{destroy() (matplotlib.mathtext.TruetypeFonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.TruetypeFonts.destroy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{destroy}}}{}{} Fix any cyclical references before the object is about to be destroyed. \end{fulllineitems} \index{get\_kern() (matplotlib.mathtext.TruetypeFonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.TruetypeFonts.get_kern}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_kern}}}{\emph{font1}, \emph{fontclass1}, \emph{sym1}, \emph{fontsize1}, \emph{font2}, \emph{fontclass2}, \emph{sym2}, \emph{fontsize2}, \emph{dpi}}{} Get the kerning distance for font between \sphinxstyleemphasis{sym1} and \sphinxstyleemphasis{sym2}. \sphinxstyleemphasis{fontX}: one of the TeX font names: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tt}\PYG{p}{,} \PYG{n}{it}\PYG{p}{,} \PYG{n}{rm}\PYG{p}{,} \PYG{n}{cal}\PYG{p}{,} \PYG{n}{sf}\PYG{p}{,} \PYG{n}{bf} \PYG{o+ow}{or} \PYG{n}{default}\PYG{o}{/}\PYG{n}{regular} \PYG{p}{(}\PYG{n}{non}\PYG{o}{\PYGZhy{}}\PYG{n}{math}\PYG{p}{)} \end{sphinxVerbatim} \sphinxstyleemphasis{fontclassX}: TODO \sphinxstyleemphasis{symX}: a symbol in raw TeX form. e.g., ‘1’, ‘x’ or ‘sigma’ \sphinxstyleemphasis{fontsizeX}: the fontsize in points \sphinxstyleemphasis{dpi}: the current dots-per-inch \end{fulllineitems} \index{get\_underline\_thickness() (matplotlib.mathtext.TruetypeFonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.TruetypeFonts.get_underline_thickness}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_underline\_thickness}}}{\emph{font}, \emph{fontsize}, \emph{dpi}}{} Get the line thickness that matches the given font. Used as a base unit for drawing lines such as in a fraction or radical. \end{fulllineitems} \index{get\_xheight() (matplotlib.mathtext.TruetypeFonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.TruetypeFonts.get_xheight}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_xheight}}}{\emph{fontname}, \emph{fontsize}, \emph{dpi}}{} Get the xheight for the given \sphinxstyleemphasis{font} and \sphinxstyleemphasis{fontsize}. \end{fulllineitems} \end{fulllineitems} \index{UnicodeFonts (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.UnicodeFonts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{UnicodeFonts}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.TruetypeFonts}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.TruetypeFonts}}}}} An abstract base class for handling Unicode fonts. While some reasonably complete Unicode fonts (such as DejaVu) may work in some situations, the only Unicode font I’m aware of with a complete set of math symbols is STIX. This class will “fallback” on the Bakoma fonts when a required symbol can not be found in the font. \index{get\_sized\_alternatives\_for\_symbol() (matplotlib.mathtext.UnicodeFonts method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.UnicodeFonts.get_sized_alternatives_for_symbol}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_sized\_alternatives\_for\_symbol}}}{\emph{fontname}, \emph{sym}}{} Override if your font provides multiple sizes of the same symbol. Should return a list of symbols matching \sphinxstyleemphasis{sym} in various sizes. The expression renderer will select the most appropriate size for a given situation from this list. \end{fulllineitems} \index{use\_cmex (matplotlib.mathtext.UnicodeFonts attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.UnicodeFonts.use_cmex}}\pysigline{\sphinxbfcode{\sphinxupquote{use\_cmex}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \end{fulllineitems} \index{VCentered (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.VCentered}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{VCentered}}}{\emph{elements}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Hlist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Hlist}}}}} A convenience class to create a {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Vlist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Vlist}}}}} whose contents are centered within its enclosing box. \end{fulllineitems} \index{Vbox (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Vbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Vbox}}}{\emph{height}, \emph{depth}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Box}}}}} A box with only height (zero width). \end{fulllineitems} \index{Vlist (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Vlist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Vlist}}}{\emph{elements}, \emph{h=0.0}, \emph{m='additional'}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.List}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.List}}}}} A vertical list of boxes. \index{vpack() (matplotlib.mathtext.Vlist method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Vlist.vpack}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{vpack}}}{\emph{h=0.0}, \emph{m='additional'}, \emph{l=inf}}{} The main duty of {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Vlist.vpack}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{vpack()}}}}} is to compute the dimensions of the resulting boxes, and to adjust the glue if one of those dimensions is pre-specified. \begin{itemize} \item {} \sphinxstyleemphasis{h}: specifies a height \item {} \sphinxstyleemphasis{m}: is either ‘exactly’ or ‘additional’. \item {} \sphinxstyleemphasis{l}: a maximum height \end{itemize} Thus, \sphinxcode{\sphinxupquote{vpack(h, 'exactly')}} produces a box whose height is exactly \sphinxstyleemphasis{h}, while \sphinxcode{\sphinxupquote{vpack(h, 'additional')}} yields a box whose height is the natural height plus \sphinxstyleemphasis{h}. The default values produce a box with the natural width. \end{fulllineitems} \end{fulllineitems} \index{Vrule (class in matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.Vrule}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{Vrule}}}{\emph{state}}{} Bases: {\hyperref[\detokenize{api/mathtext_api:matplotlib.mathtext.Rule}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mathtext.Rule}}}}} Convenience class to create a vertical rule. \end{fulllineitems} \index{get\_unicode\_index() (in module matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.get_unicode_index}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{get\_unicode\_index}}}{\emph{symbol}\sphinxoptional{, \emph{bool}}}{{ $\rightarrow$ integer}} Return the integer index (from the Unicode table) of symbol. \sphinxstyleemphasis{symbol} can be a single unicode character, a TeX command (i.e. r’pi’), or a Type1 symbol name (i.e. ‘phi’). If math is False, the current symbol should be treated as a non-math symbol. \end{fulllineitems} \index{math\_to\_image() (in module matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.math_to_image}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{math\_to\_image}}}{\emph{s}, \emph{filename\_or\_obj}, \emph{prop=None}, \emph{dpi=None}, \emph{format=None}}{} Given a math expression, renders it in a closely-clipped bounding box to an image file. \begin{description} \item[{\sphinxstyleemphasis{s}}] \leavevmode A math expression. The math portion should be enclosed in dollar signs. \item[{\sphinxstyleemphasis{filename\_or\_obj}}] \leavevmode A filepath or writable file-like object to write the image data to. \item[{\sphinxstyleemphasis{prop}}] \leavevmode If provided, a FontProperties() object describing the size and style of the text. \item[{\sphinxstyleemphasis{dpi}}] \leavevmode Override the output dpi, otherwise use the default associated with the output format. \item[{\sphinxstyleemphasis{format}}] \leavevmode The output format, e.g., ‘svg’, ‘pdf’, ‘ps’ or ‘png’. If not provided, will be deduced from the filename. \end{description} \end{fulllineitems} \index{unichr\_safe() (in module matplotlib.mathtext)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mathtext_api:matplotlib.mathtext.unichr_safe}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mathtext.}}\sphinxbfcode{\sphinxupquote{unichr\_safe}}}{\emph{index}}{} Return the Unicode character corresponding to the index, or the replacement character if this is a narrow build of Python and the requested character is outside the BMP. \end{fulllineitems} \chapter{mlab} \label{\detokenize{api/mlab_api:mlab}}\label{\detokenize{api/mlab_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.mlab}}} \label{\detokenize{api/mlab_api:module-matplotlib.mlab}}\label{\detokenize{api/mlab_api:matplotlib-mlab}}\index{matplotlib.mlab (module)} Numerical python functions written for compatibility with MATLAB commands with the same names. \subsection{MATLAB compatible functions} \label{\detokenize{api/mlab_api:matlab-compatible-functions}}\begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.cohere}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cohere()}}}}}}] \leavevmode Coherence (normalized cross spectral density) \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.csd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{csd()}}}}}}] \leavevmode Cross spectral density using Welch’s average periodogram \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend()}}}}}}] \leavevmode Remove the mean or best fit line from an array \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.find}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{find()}}}}}}] \leavevmode Return the indices where some condition is true; numpy.nonzero is similar but more general. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.griddata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{griddata()}}}}}}] \leavevmode Interpolate irregularly distributed data to a regular grid. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.prctile}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{prctile()}}}}}}] \leavevmode Find the percentiles of a sequence \item[{\sphinxcode{\sphinxupquote{prepca()}}}] \leavevmode Principal Component Analysis \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}}}] \leavevmode Power spectral density using Welch’s average periodogram \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.rk4}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rk4()}}}}}}] \leavevmode A 4th order runge kutta integrator for 1D or ND systems \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}}}] \leavevmode Spectrogram (spectrum over segments of time) \end{description} \subsection{Miscellaneous functions} \label{\detokenize{api/mlab_api:miscellaneous-functions}} Functions that don’t exist in MATLAB, but are useful anyway: \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.cohere_pairs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cohere\_pairs()}}}}}}] \leavevmode Coherence over all pairs. This is not a MATLAB function, but we compute coherence a lot in my lab, and we compute it for a lot of pairs. This function is optimized to do this efficiently by caching the direct FFTs. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.rk4}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rk4()}}}}}}] \leavevmode A 4th order Runge-Kutta ODE integrator in case you ever find yourself stranded without scipy (and the far superior scipy.integrate tools) \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.contiguous_regions}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contiguous\_regions()}}}}}}] \leavevmode Return the indices of the regions spanned by some logical mask \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.cross_from_below}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cross\_from\_below()}}}}}}] \leavevmode Return the indices where a 1D array crosses a threshold from below \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.cross_from_above}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cross\_from\_above()}}}}}}] \leavevmode Return the indices where a 1D array crosses a threshold from above \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.complex_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{complex\_spectrum()}}}}}}] \leavevmode Return the complex-valued frequency spectrum of a signal \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}}}] \leavevmode Return the magnitude of the frequency spectrum of a signal \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}}}] \leavevmode Return the angle (wrapped phase) of the frequency spectrum of a signal \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}}}] \leavevmode Return the phase (unwrapped angle) of the frequency spectrum of a signal \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_mean}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_mean()}}}}}}] \leavevmode Remove the mean from a line. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.demean}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{demean()}}}}}}] \leavevmode Remove the mean from a line. This function is the same as {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_mean}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_mean()}}}}} except for the default \sphinxstyleemphasis{axis}. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_linear}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_linear()}}}}}}] \leavevmode Remove the best fit line from a line. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_none()}}}}}}] \leavevmode Return the original line. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.stride_windows}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stride\_windows()}}}}}}] \leavevmode Get all windows in an array in a memory-efficient manner \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.stride_repeat}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stride\_repeat()}}}}}}] \leavevmode Repeat an array in a memory-efficient manner \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.apply_window}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{apply\_window()}}}}}}] \leavevmode Apply a window along a given axis \end{description} \subsection{record array helper functions} \label{\detokenize{api/mlab_api:record-array-helper-functions}} A collection of helper methods for numpyrecord arrays \phantomsection\label{\detokenize{api/mlab_api:htmlonly}}\begin{quote} See \DUrole{xref,std,std-ref}{misc-examples-index} \end{quote} \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.rec2txt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rec2txt()}}}}}}] \leavevmode Pretty print a record array \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.rec2csv}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rec2csv()}}}}}}] \leavevmode Store record array in CSV file \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.csv2rec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{csv2rec()}}}}}}] \leavevmode Import record array from CSV file with type inspection \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.rec_append_fields}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rec\_append\_fields()}}}}}}] \leavevmode Adds field(s)/array(s) to record array \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.rec_drop_fields}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rec\_drop\_fields()}}}}}}] \leavevmode Drop fields from record array \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.rec_join}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rec\_join()}}}}}}] \leavevmode Join two record arrays on sequence of fields \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.recs_join}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{recs\_join()}}}}}}] \leavevmode A simple join of multiple recarrays using a single column as a key \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.rec_groupby}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rec\_groupby()}}}}}}] \leavevmode Summarize data by groups (similar to SQL GROUP BY) \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.rec_summarize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rec\_summarize()}}}}}}] \leavevmode Helper code to filter rec array fields into new fields \end{description} For the rec viewer functions(e rec2csv), there are a bunch of Format objects you can pass into the functions that will do things like color negative values red, set percent formatting and scaling, etc. Example usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{r} \PYG{o}{=} \PYG{n}{csv2rec}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{somefile.csv}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{checkrows}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{)} \PYG{n}{formatd} \PYG{o}{=} \PYG{n+nb}{dict}\PYG{p}{(} \PYG{n}{weight} \PYG{o}{=} \PYG{n}{FormatFloat}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{,} \PYG{n}{change} \PYG{o}{=} \PYG{n}{FormatPercent}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{,} \PYG{n}{cost} \PYG{o}{=} \PYG{n}{FormatThousands}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{,} \PYG{p}{)} \PYG{n}{rec2excel}\PYG{p}{(}\PYG{n}{r}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{test.xls}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{formatd}\PYG{o}{=}\PYG{n}{formatd}\PYG{p}{)} \PYG{n}{rec2csv}\PYG{p}{(}\PYG{n}{r}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{test.csv}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{formatd}\PYG{o}{=}\PYG{n}{formatd}\PYG{p}{)} \PYG{n}{scroll} \PYG{o}{=} \PYG{n}{rec2gtk}\PYG{p}{(}\PYG{n}{r}\PYG{p}{,} \PYG{n}{formatd}\PYG{o}{=}\PYG{n}{formatd}\PYG{p}{)} \PYG{n}{win} \PYG{o}{=} \PYG{n}{gtk}\PYG{o}{.}\PYG{n}{Window}\PYG{p}{(}\PYG{p}{)} \PYG{n}{win}\PYG{o}{.}\PYG{n}{set\PYGZus{}size\PYGZus{}request}\PYG{p}{(}\PYG{l+m+mi}{600}\PYG{p}{,}\PYG{l+m+mi}{800}\PYG{p}{)} \PYG{n}{win}\PYG{o}{.}\PYG{n}{add}\PYG{p}{(}\PYG{n}{scroll}\PYG{p}{)} \PYG{n}{win}\PYG{o}{.}\PYG{n}{show\PYGZus{}all}\PYG{p}{(}\PYG{p}{)} \PYG{n}{gtk}\PYG{o}{.}\PYG{n}{main}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \index{FormatBool (class in matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatBool}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{FormatBool}}}{\emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.FormatObj}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.FormatObj}}}}} \DUrole{versionmodified}{Deprecated since version 2.2: }The FormatBool class was deprecated in version 2.2. \index{fromstr() (matplotlib.mlab.FormatBool method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatBool.fromstr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{fromstr}}}{\emph{s}}{}~ \end{fulllineitems} \index{toval() (matplotlib.mlab.FormatBool method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatBool.toval}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{toval}}}{\emph{x}}{}~ \end{fulllineitems} \end{fulllineitems} \index{FormatDate (class in matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatDate}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{FormatDate}}}{\emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.FormatObj}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.FormatObj}}}}} \DUrole{versionmodified}{Deprecated since version 2.2: }The FormatDate class was deprecated in version 2.2. Use date.strftime instead. \index{fromstr() (matplotlib.mlab.FormatDate method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatDate.fromstr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{fromstr}}}{\emph{x}}{}~ \end{fulllineitems} \index{toval() (matplotlib.mlab.FormatDate method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatDate.toval}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{toval}}}{\emph{x}}{}~ \end{fulllineitems} \end{fulllineitems} \index{FormatDatetime (class in matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatDatetime}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{FormatDatetime}}}{\emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.FormatDate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.FormatDate}}}}} \DUrole{versionmodified}{Deprecated since version 2.2: }The FormatDatetime class was deprecated in version 2.2. Use datetime.strftime instead. \index{fromstr() (matplotlib.mlab.FormatDatetime method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatDatetime.fromstr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{fromstr}}}{\emph{x}}{}~ \end{fulllineitems} \end{fulllineitems} \index{FormatFloat (class in matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatFloat}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{FormatFloat}}}{\emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.FormatFormatStr}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.FormatFormatStr}}}}} \DUrole{versionmodified}{Deprecated since version 2.2: }The FormatFloat class was deprecated in version 2.2. \index{fromstr() (matplotlib.mlab.FormatFloat method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatFloat.fromstr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{fromstr}}}{\emph{s}}{}~ \end{fulllineitems} \index{toval() (matplotlib.mlab.FormatFloat method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatFloat.toval}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{toval}}}{\emph{x}}{}~ \end{fulllineitems} \end{fulllineitems} \index{FormatFormatStr (class in matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatFormatStr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{FormatFormatStr}}}{\emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.FormatObj}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.FormatObj}}}}} \DUrole{versionmodified}{Deprecated since version 2.2: }The FormatFormatStr class was deprecated in version 2.2. \index{tostr() (matplotlib.mlab.FormatFormatStr method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatFormatStr.tostr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tostr}}}{\emph{x}}{}~ \end{fulllineitems} \end{fulllineitems} \index{FormatInt (class in matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatInt}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{FormatInt}}}{\emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.FormatObj}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.FormatObj}}}}} \DUrole{versionmodified}{Deprecated since version 2.2: }The FormatInt class was deprecated in version 2.2. \index{fromstr() (matplotlib.mlab.FormatInt method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatInt.fromstr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{fromstr}}}{\emph{s}}{}~ \end{fulllineitems} \index{tostr() (matplotlib.mlab.FormatInt method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatInt.tostr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tostr}}}{\emph{x}}{}~ \end{fulllineitems} \index{toval() (matplotlib.mlab.FormatInt method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatInt.toval}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{toval}}}{\emph{x}}{}~ \end{fulllineitems} \end{fulllineitems} \index{FormatMillions (class in matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatMillions}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{FormatMillions}}}{\emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.FormatFloat}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.FormatFloat}}}}} \DUrole{versionmodified}{Deprecated since version 2.2: }The FormatMillions class was deprecated in version 2.2. \end{fulllineitems} \index{FormatObj (class in matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatObj}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{FormatObj}}}{\emph{**kwargs}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} \DUrole{versionmodified}{Deprecated since version 2.2: }The FormatObj class was deprecated in version 2.2. \index{fromstr() (matplotlib.mlab.FormatObj method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatObj.fromstr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{fromstr}}}{\emph{s}}{}~ \end{fulllineitems} \index{tostr() (matplotlib.mlab.FormatObj method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatObj.tostr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tostr}}}{\emph{x}}{}~ \end{fulllineitems} \index{toval() (matplotlib.mlab.FormatObj method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatObj.toval}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{toval}}}{\emph{x}}{}~ \end{fulllineitems} \end{fulllineitems} \index{FormatPercent (class in matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatPercent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{FormatPercent}}}{\emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.FormatFloat}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.FormatFloat}}}}} \DUrole{versionmodified}{Deprecated since version 2.2: }The FormatPercent class was deprecated in version 2.2. \end{fulllineitems} \index{FormatString (class in matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatString}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{FormatString}}}{\emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.FormatObj}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.FormatObj}}}}} \DUrole{versionmodified}{Deprecated since version 2.2: }The FormatString class was deprecated in version 2.2. \index{tostr() (matplotlib.mlab.FormatString method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatString.tostr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tostr}}}{\emph{x}}{}~ \end{fulllineitems} \end{fulllineitems} \index{FormatThousands (class in matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.FormatThousands}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{FormatThousands}}}{\emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.FormatFloat}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.mlab.FormatFloat}}}}} \DUrole{versionmodified}{Deprecated since version 2.2: }The FormatThousands class was deprecated in version 2.2. \end{fulllineitems} \index{GaussianKDE (class in matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.GaussianKDE}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{GaussianKDE}}}{\emph{dataset}, \emph{bw\_method=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Representation of a kernel-density estimate using Gaussian kernels. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{dataset}}] \leavevmode{[}array\_like{]} Datapoints to estimate from. In case of univariate data this is a 1-D array, otherwise a 2-D array with shape (\# of dims, \# of data). \item[{\sphinxstylestrong{bw\_method}}] \leavevmode{[}str, scalar or callable, optional{]} The method used to calculate the estimator bandwidth. This can be ‘scott’, ‘silverman’, a scalar constant or a callable. If a scalar, this will be used directly as \sphinxcode{\sphinxupquote{kde.factor}}. If a callable, it should take a {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.GaussianKDE}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GaussianKDE}}}}} instance as only parameter and return a scalar. If None (default), ‘scott’ is used. \end{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{dataset}}] \leavevmode{[}ndarray{]} The dataset with which \sphinxcode{\sphinxupquote{gaussian\_kde}} was initialized. \item[{\sphinxstylestrong{dim}}] \leavevmode{[}int{]} Number of dimensions. \item[{\sphinxstylestrong{num\_dp}}] \leavevmode{[}int{]} Number of datapoints. \item[{\sphinxstylestrong{factor}}] \leavevmode{[}float{]} The bandwidth factor, obtained from \sphinxcode{\sphinxupquote{kde.covariance\_factor}}, with which the covariance matrix is multiplied. \item[{\sphinxstylestrong{covariance}}] \leavevmode{[}ndarray{]} The covariance matrix of \sphinxcode{\sphinxupquote{dataset}}, scaled by the calculated bandwidth (\sphinxcode{\sphinxupquote{kde.factor}}). \item[{\sphinxstylestrong{inv\_cov}}] \leavevmode{[}ndarray{]} The inverse of \sphinxcode{\sphinxupquote{covariance}}. \end{description} \end{description}\end{quote} \paragraph{Methods} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstylestrong{kde.evaluate(points)} & (ndarray) Evaluate the estimated pdf on a provided set of points. \\ \hline \sphinxstylestrong{kde(points)} & (ndarray) Same as kde.evaluate(points) \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \index{covariance\_factor() (matplotlib.mlab.GaussianKDE method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.GaussianKDE.covariance_factor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{covariance\_factor}}}{}{}~ \end{fulllineitems} \index{evaluate() (matplotlib.mlab.GaussianKDE method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.GaussianKDE.evaluate}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{evaluate}}}{\emph{points}}{} Evaluate the estimated pdf on a set of points. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{points}}] \leavevmode{[}(\# of dimensions, \# of points)-array{]} Alternatively, a (\# of dimensions,) vector can be passed in and treated as a single point. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{values}}] \leavevmode{[}(\# of points,)-array{]} The values at each point. \end{description} \item[{Raises}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ValueError}}] \leavevmode{[}if the dimensionality of the input points is different{]} than the dimensionality of the KDE. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{scotts\_factor() (matplotlib.mlab.GaussianKDE method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.GaussianKDE.scotts_factor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{scotts\_factor}}}{}{}~ \end{fulllineitems} \index{silverman\_factor() (matplotlib.mlab.GaussianKDE method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.GaussianKDE.silverman_factor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{silverman\_factor}}}{}{}~ \end{fulllineitems} \end{fulllineitems} \index{PCA (class in matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.PCA}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{PCA}}}{\emph{**kwargs}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} \DUrole{versionmodified}{Deprecated since version 2.2: }The PCA class was deprecated in version 2.2. \index{center() (matplotlib.mlab.PCA method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.PCA.center}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{center}}}{\emph{x}}{} center and optionally standardize the data using the mean and sigma from training set a \end{fulllineitems} \index{project() (matplotlib.mlab.PCA method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.PCA.project}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{project}}}{\emph{x}, \emph{minfrac=0.0}}{} project x onto the principle axes, dropping any axes where fraction of variance\textless{}minfrac \end{fulllineitems} \end{fulllineitems} \index{amap() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.amap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{amap}}}{\emph{fn}, \emph{*args}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The amap function was deprecated in version 2.2. Use numpy.array(list(map(…))) instead. amap(function, sequence{[}, sequence, …{]}) -\textgreater{} array. Works like \sphinxhref{https://docs.python.org/3/library/functions.html\#map}{\sphinxcode{\sphinxupquote{map()}}}, but it returns an array. This is just a convenient shorthand for \sphinxcode{\sphinxupquote{numpy.array(map(...))}}. \end{fulllineitems} \index{angle\_spectrum() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.angle_spectrum}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{angle\_spectrum}}}{\emph{x}, \emph{Fs=None}, \emph{window=None}, \emph{pad\_to=None}, \emph{sides=None}}{} Compute the angle of the frequency spectrum (wrapped phase spectrum) of \sphinxstyleemphasis{x}. Data is padded to a length of \sphinxstyleemphasis{pad\_to} and the windowing function \sphinxstyleemphasis{window} is applied to the signal. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1-D array or sequence{]} Array or sequence containing the data \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_none()}}}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to the length of the input signal (i.e. no padding). \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{spectrum}}] \leavevmode{[}1-D array{]} The values for the angle spectrum in radians (real valued) \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the elements in \sphinxstyleemphasis{spectrum} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.complex_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{complex\_spectrum()}}}}}}] \leavevmode This function returns the angle value of {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.complex_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{complex\_spectrum()}}}}}. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}} returns the magnitudes of the corresponding frequencies. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}} returns the unwrapped version of this function. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}} can return the angle spectrum of segments within the signal. \end{description} \end{fulllineitems} \index{apply\_window() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.apply_window}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{apply\_window}}}{\emph{x}, \emph{window}, \emph{axis=0}, \emph{return\_window=None}}{} Apply the given window to the given 1D or 2D array along the given axis. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1D or 2D array or sequence{]} Array or sequence containing the data. \item[{\sphinxstylestrong{window}}] \leavevmode{[}function or array.{]} Either a function to generate a window or an array with length \sphinxstyleemphasis{x}.shape{[}\sphinxstyleemphasis{axis}{]} \item[{\sphinxstylestrong{axis}}] \leavevmode{[}integer{]} The axis over which to do the repetition. Must be 0 or 1. The default is 0 \item[{\sphinxstylestrong{return\_window}}] \leavevmode{[}bool{]} If true, also return the 1D values of the window that was applied \end{description} \end{description}\end{quote} \end{fulllineitems} \index{base\_repr() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.base_repr}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{base\_repr}}}{\emph{number}, \emph{base=2}, \emph{padding=0}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The base\_repr function was deprecated in version 2.2. Return the representation of a \sphinxstyleemphasis{number} in any given \sphinxstyleemphasis{base}. \end{fulllineitems} \index{binary\_repr() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.binary_repr}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{binary\_repr}}}{\emph{number}, \emph{max\_length=1025}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The binary\_repr function was deprecated in version 2.2. Return the binary representation of the input \sphinxstyleemphasis{number} as a string. This is more efficient than using {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.base_repr}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{base\_repr()}}}}} with base 2. Increase the value of max\_length for very large numbers. Note that on 32-bit machines, 2**1023 is the largest integer power of 2 which can be converted to a Python float. \end{fulllineitems} \index{bivariate\_normal() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.bivariate_normal}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{bivariate\_normal}}}{\emph{X}, \emph{Y}, \emph{sigmax=1.0}, \emph{sigmay=1.0}, \emph{mux=0.0}, \emph{muy=0.0}, \emph{sigmaxy=0.0}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The bivariate\_normal function was deprecated in version 2.2. Bivariate Gaussian distribution for equal shape \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}. See \sphinxhref{http://mathworld.wolfram.com/BivariateNormalDistribution.html}{bivariate normal} at mathworld. \end{fulllineitems} \index{center\_matrix() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.center_matrix}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{center\_matrix}}}{\emph{M}, \emph{dim=0}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The center\_matrix function was deprecated in version 2.2. Return the matrix \sphinxstyleemphasis{M} with each row having zero mean and unit std. If \sphinxstyleemphasis{dim} = 1 operate on columns instead of rows. (\sphinxstyleemphasis{dim} is opposite to the numpy axis kwarg.) \end{fulllineitems} \index{cohere() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.cohere}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{cohere}}}{\emph{x}, \emph{y}, \emph{NFFT=256}, \emph{Fs=2}, \emph{detrend=\textless{}function detrend\_none\textgreater{}}, \emph{window=\textless{}function window\_hanning\textgreater{}}, \emph{noverlap=0}, \emph{pad\_to=None}, \emph{sides='default'}, \emph{scale\_by\_freq=None}}{} The coherence between \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. Coherence is the normalized cross spectral density: \begin{equation}C_{xy} = \frac{|P_{xy}|^2}{P_{xx}P_{yy}}\end{equation}\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode Array or sequence containing the data \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_none()}}}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. This can be different from \sphinxstyleemphasis{NFFT}, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to \sphinxstyleemphasis{NFFT} \item[{\sphinxstylestrong{NFFT}}] \leavevmode{[}integer{]} The number of data points used in each block for the FFT. A power 2 is most efficient. The default value is 256. This should \sphinxstyleemphasis{NOT} be used to get zero padding, or the scaling of the result will be incorrect. Use \sphinxstyleemphasis{pad\_to} for this instead. \item[{\sphinxstylestrong{detrend}}] \leavevmode{[}\{‘default’, ‘constant’, ‘mean’, ‘linear’, ‘none’\} or callable{]} The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the \sphinxstyleemphasis{detrend} parameter is a vector, in matplotlib is it a function. The \sphinxcode{\sphinxupquote{pylab}} module defines \sphinxcode{\sphinxupquote{detrend\_none()}}, \sphinxcode{\sphinxupquote{detrend\_mean()}}, and \sphinxcode{\sphinxupquote{detrend\_linear()}}, but you can use a custom function as well. You can also use a string to choose one of the functions. ‘default’, ‘constant’, and ‘mean’ call \sphinxcode{\sphinxupquote{detrend\_mean()}}. ‘linear’ calls \sphinxcode{\sphinxupquote{detrend\_linear()}}. ‘none’ calls \sphinxcode{\sphinxupquote{detrend\_none()}}. \item[{\sphinxstylestrong{scale\_by\_freq}}] \leavevmode{[}boolean, optional{]} Specifies whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz\textasciicircum{}-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. \item[{\sphinxstylestrong{noverlap}}] \leavevmode{[}integer{]} The number of points of overlap between blocks. The default value is 0 (no overlap). \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{The return value is the tuple (*Cxy*, *f*), where *f* are the}}] \leavevmode \item[{\sphinxstylestrong{frequencies of the coherence vector. For cohere, scaling the}}] \leavevmode \item[{\sphinxstylestrong{individual densities by the sampling frequency has no effect,}}] \leavevmode \item[{\sphinxstylestrong{since the factors cancel out.}}] \leavevmode \end{description} \end{description}\end{quote} \sphinxstrong{See also:} {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.csd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{csd()}}}}} \end{fulllineitems} \index{cohere\_pairs() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.cohere_pairs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{cohere\_pairs}}}{\emph{X}, \emph{ij}, \emph{NFFT=256}, \emph{Fs=2}, \emph{detrend=\textless{}function detrend\_none\textgreater{}}, \emph{window=\textless{}function window\_hanning\textgreater{}}, \emph{noverlap=0}, \emph{preferSpeedOverMemory=True}, \emph{progressCallback=\textless{}function donothing\_callback\textgreater{}}, \emph{returnPxx=False}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }scipy.signal.coherence Compute the coherence and phase for all pairs \sphinxstyleemphasis{ij}, in \sphinxstyleemphasis{X}. \sphinxstyleemphasis{X} is a \sphinxstyleemphasis{numSamples} * \sphinxstyleemphasis{numCols} array \sphinxstyleemphasis{ij} is a list of tuples. Each tuple is a pair of indexes into the columns of X for which you want to compute coherence. For example, if \sphinxstyleemphasis{X} has 64 columns, and you want to compute all nonredundant pairs, define \sphinxstyleemphasis{ij} as: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ij} \PYG{o}{=} \PYG{p}{[}\PYG{p}{]} \PYG{k}{for} \PYG{n}{i} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{64}\PYG{p}{)}\PYG{p}{:} \PYG{k}{for} \PYG{n}{j} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{n}{i}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{64}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ij}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(} \PYG{p}{(}\PYG{n}{i}\PYG{p}{,}\PYG{n}{j}\PYG{p}{)} \PYG{p}{)} \end{sphinxVerbatim} \sphinxstyleemphasis{preferSpeedOverMemory} is an optional bool. Defaults to true. If False, limits the caching by only making one, rather than two, complex cache arrays. This is useful if memory becomes critical. Even when \sphinxstyleemphasis{preferSpeedOverMemory} is False, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.cohere_pairs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cohere\_pairs()}}}}} will still give significant performance gains over calling {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.cohere}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cohere()}}}}} for each pair, and will use subtantially less memory than if \sphinxstyleemphasis{preferSpeedOverMemory} is True. In my tests with a 43000,64 array over all nonredundant pairs, \sphinxstyleemphasis{preferSpeedOverMemory} = True delivered a 33\% performance boost on a 1.7GHZ Athlon with 512MB RAM compared with \sphinxstyleemphasis{preferSpeedOverMemory} = False. But both solutions were more than 10x faster than naively crunching all possible pairs through {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.cohere}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cohere()}}}}}. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Cxy}}] \leavevmode{[}dictionary of (\sphinxstyleemphasis{i}, \sphinxstyleemphasis{j}) tuples -\textgreater{} coherence vector for{]} that pair. i.e., \sphinxcode{\sphinxupquote{Cxy{[}(i,j) = cohere(X{[}:,i{]}, X{[}:,j{]})}}. Number of dictionary keys is \sphinxcode{\sphinxupquote{len(ij)}}. \item[{\sphinxstylestrong{Phase}}] \leavevmode{[}dictionary of phases of the cross spectral density at{]} each frequency for each pair. Keys are (\sphinxstyleemphasis{i}, \sphinxstyleemphasis{j}). \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}vector of frequencies, equal in length to either the{]} coherence or phase vectors for any (\sphinxstyleemphasis{i}, \sphinxstyleemphasis{j}) key. \item[{\sphinxstylestrong{e.g., to make a coherence Bode plot::}}] \leavevmode subplot(211) plot( freqs, Cxy{[}(12,19){]}) subplot(212) plot( freqs, Phase{[}(12,19){]}) \item[{\sphinxstylestrong{For a large number of pairs, :func:{}`cohere\_pairs{}` can be much more}}] \leavevmode \item[{\sphinxstylestrong{efficient than just calling :func:{}`cohere{}` for each pair, because}}] \leavevmode \item[{\sphinxstylestrong{it caches most of the intensive computations. If :math:{}`N{}` is the}}] \leavevmode \item[{\sphinxstylestrong{number of pairs, this function is :math:{}`O(N){}` for most of the}}] \leavevmode \item[{\sphinxstylestrong{heavy lifting, whereas calling cohere for each pair is}}] \leavevmode \item[{\sphinxstylestrong{:math:{}`O(N\textasciicircum{}2){}`. However, because of the caching, it is also more}}] \leavevmode \item[{\sphinxstylestrong{memory intensive, making 2 additional complex arrays with}}] \leavevmode \item[{\sphinxstylestrong{approximately the same number of elements as *X*.}}] \leavevmode \item[{\sphinxstylestrong{See :file:{}`test/cohere\_pairs\_test.py{}` in the src tree for an}}] \leavevmode \item[{\sphinxstylestrong{example script that shows that this :func:{}`cohere\_pairs{}` and}}] \leavevmode \item[{\sphinxstylestrong{:func:{}`cohere{}` give the same results for a given pair.}}] \leavevmode \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}}}] \leavevmode For information about the methods used to compute $P_{xy}$, $P_{xx}$ and $P_{yy}$. \end{description} \end{fulllineitems} \index{complex\_spectrum() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.complex_spectrum}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{complex\_spectrum}}}{\emph{x}, \emph{Fs=None}, \emph{window=None}, \emph{pad\_to=None}, \emph{sides=None}}{} Compute the complex-valued frequency spectrum of \sphinxstyleemphasis{x}. Data is padded to a length of \sphinxstyleemphasis{pad\_to} and the windowing function \sphinxstyleemphasis{window} is applied to the signal. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1-D array or sequence{]} Array or sequence containing the data \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_none()}}}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to the length of the input signal (i.e. no padding). \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{spectrum}}] \leavevmode{[}1-D array{]} The values for the complex spectrum (complex valued) \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the elements in \sphinxstyleemphasis{spectrum} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}} returns the absolute value of this function. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}} returns the angle of this function. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}} returns the phase (unwrapped angle) of this function. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}} can return the complex spectrum of segments within the signal. \end{description} \end{fulllineitems} \index{contiguous\_regions() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.contiguous_regions}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{contiguous\_regions}}}{\emph{mask}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }Moved to matplotlib.cbook return a list of (ind0, ind1) such that mask{[}ind0:ind1{]}.all() is True and we cover all such regions \end{fulllineitems} \index{cross\_from\_above() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.cross_from_above}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{cross\_from\_above}}}{\emph{x}, \emph{threshold}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The cross\_from\_above function was deprecated in version 2.2. return the indices into \sphinxstyleemphasis{x} where \sphinxstyleemphasis{x} crosses some threshold from below, e.g., the i’s where: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{x}\PYG{p}{[}\PYG{n}{i}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{\PYGZgt{}}\PYG{n}{threshold} \PYG{o+ow}{and} \PYG{n}{x}\PYG{p}{[}\PYG{n}{i}\PYG{p}{]}\PYG{o}{\PYGZlt{}}\PYG{o}{=}\PYG{n}{threshold} \end{sphinxVerbatim} \sphinxstrong{See also:} {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.cross_from_below}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cross\_from\_below()}}}}} \end{fulllineitems} \index{cross\_from\_below() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.cross_from_below}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{cross\_from\_below}}}{\emph{x}, \emph{threshold}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The cross\_from\_below function was deprecated in version 2.2. return the indices into \sphinxstyleemphasis{x} where \sphinxstyleemphasis{x} crosses some threshold from below, e.g., the i’s where: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{x}\PYG{p}{[}\PYG{n}{i}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{\PYGZlt{}}\PYG{n}{threshold} \PYG{o+ow}{and} \PYG{n}{x}\PYG{p}{[}\PYG{n}{i}\PYG{p}{]}\PYG{o}{\PYGZgt{}}\PYG{o}{=}\PYG{n}{threshold} \end{sphinxVerbatim} Example code: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{t} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{2.0}\PYG{p}{,} \PYG{l+m+mf}{0.1}\PYG{p}{)} \PYG{n}{s} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{t}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{t}\PYG{p}{,} \PYG{n}{s}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}o}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axhline}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{axhline}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.5}\PYG{p}{)} \PYG{n}{ind} \PYG{o}{=} \PYG{n}{cross\PYGZus{}from\PYGZus{}below}\PYG{p}{(}\PYG{n}{s}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{vlines}\PYG{p}{(}\PYG{n}{t}\PYG{p}{[}\PYG{n}{ind}\PYG{p}{]}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{ind} \PYG{o}{=} \PYG{n}{cross\PYGZus{}from\PYGZus{}above}\PYG{p}{(}\PYG{n}{s}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.5}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{vlines}\PYG{p}{(}\PYG{n}{t}\PYG{p}{[}\PYG{n}{ind}\PYG{p}{]}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \sphinxstrong{See also:} {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.cross_from_above}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cross\_from\_above()}}}}} \end{fulllineitems} \index{csd() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.csd}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{csd}}}{\emph{x}, \emph{y}, \emph{NFFT=None}, \emph{Fs=None}, \emph{detrend=None}, \emph{window=None}, \emph{noverlap=None}, \emph{pad\_to=None}, \emph{sides=None}, \emph{scale\_by\_freq=None}}{} Compute the cross-spectral density. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{csd}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{NFFT}\PYG{o}{=}\PYG{l+m+mi}{256}\PYG{p}{,} \PYG{n}{Fs}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{detrend}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{detrend\PYGZus{}none}\PYG{p}{,} \PYG{n}{window}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{window\PYGZus{}hanning}\PYG{p}{,} \PYG{n}{noverlap}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{pad\PYGZus{}to}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{sides}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{scale\PYGZus{}by\PYGZus{}freq}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)} \end{sphinxVerbatim} The cross spectral density $P_{xy}$ by Welch’s average periodogram method. The vectors \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} are divided into \sphinxstyleemphasis{NFFT} length segments. Each segment is detrended by function \sphinxstyleemphasis{detrend} and windowed by function \sphinxstyleemphasis{window}. \sphinxstyleemphasis{noverlap} gives the length of the overlap between segments. The product of the direct FFTs of \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} are averaged over each segment to compute $P_{xy}$, with a scaling to correct for power loss due to windowing. If len(\sphinxstyleemphasis{x}) \textless{} \sphinxstyleemphasis{NFFT} or len(\sphinxstyleemphasis{y}) \textless{} \sphinxstyleemphasis{NFFT}, they will be zero padded to \sphinxstyleemphasis{NFFT}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}1-D arrays or sequences{]} Arrays or sequences containing the data \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_none()}}}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. This can be different from \sphinxstyleemphasis{NFFT}, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to \sphinxstyleemphasis{NFFT} \item[{\sphinxstylestrong{NFFT}}] \leavevmode{[}integer{]} The number of data points used in each block for the FFT. A power 2 is most efficient. The default value is 256. This should \sphinxstyleemphasis{NOT} be used to get zero padding, or the scaling of the result will be incorrect. Use \sphinxstyleemphasis{pad\_to} for this instead. \item[{\sphinxstylestrong{detrend}}] \leavevmode{[}\{‘default’, ‘constant’, ‘mean’, ‘linear’, ‘none’\} or callable{]} The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the \sphinxstyleemphasis{detrend} parameter is a vector, in matplotlib is it a function. The \sphinxcode{\sphinxupquote{pylab}} module defines \sphinxcode{\sphinxupquote{detrend\_none()}}, \sphinxcode{\sphinxupquote{detrend\_mean()}}, and \sphinxcode{\sphinxupquote{detrend\_linear()}}, but you can use a custom function as well. You can also use a string to choose one of the functions. ‘default’, ‘constant’, and ‘mean’ call \sphinxcode{\sphinxupquote{detrend\_mean()}}. ‘linear’ calls \sphinxcode{\sphinxupquote{detrend\_linear()}}. ‘none’ calls \sphinxcode{\sphinxupquote{detrend\_none()}}. \item[{\sphinxstylestrong{scale\_by\_freq}}] \leavevmode{[}boolean, optional{]} Specifies whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz\textasciicircum{}-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. \item[{\sphinxstylestrong{noverlap}}] \leavevmode{[}integer{]} The number of points of overlap between segments. The default value is 0 (no overlap). \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Pxy}}] \leavevmode{[}1-D array{]} The values for the cross spectrum \sphinxcode{\sphinxupquote{P\_\{xy\}}} before scaling (real valued) \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the elements in \sphinxstyleemphasis{Pxy} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}} is the equivalent to setting y=x. \end{description} \paragraph{References} Bendat \& Piersol \textendash{} Random Data: Analysis and Measurement Procedures, John Wiley \& Sons (1986) \end{fulllineitems} \index{csv2rec() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.csv2rec}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{csv2rec}}}{\emph{fname}, \emph{comments='\#'}, \emph{skiprows=0}, \emph{checkrows=0}, \emph{delimiter='}, \emph{'}, \emph{converterd=None}, \emph{names=None}, \emph{missing=''}, \emph{missingd=None}, \emph{use\_mrecords=False}, \emph{dayfirst=False}, \emph{yearfirst=False}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The csv2rec function was deprecated in version 2.2. Load data from comma/space/tab delimited file in \sphinxstyleemphasis{fname} into a numpy record array and return the record array. If \sphinxstyleemphasis{names} is \sphinxstyleemphasis{None}, a header row is required to automatically assign the recarray names. The headers will be lower cased, spaces will be converted to underscores, and illegal attribute name characters removed. If \sphinxstyleemphasis{names} is not \sphinxstyleemphasis{None}, it is a sequence of names to use for the column names. In this case, it is assumed there is no header row. \begin{itemize} \item {} \sphinxstyleemphasis{fname}: can be a filename or a file handle. Support for gzipped files is automatic, if the filename ends in ‘.gz’ \item {} \sphinxstyleemphasis{comments}: the character used to indicate the start of a comment in the file, or \sphinxstyleemphasis{None} to switch off the removal of comments \item {} \sphinxstyleemphasis{skiprows}: is the number of rows from the top to skip \item {} \sphinxstyleemphasis{checkrows}: is the number of rows to check to validate the column data type. When set to zero all rows are validated. \item {} \sphinxstyleemphasis{converterd}: if not \sphinxstyleemphasis{None}, is a dictionary mapping column number or munged column name to a converter function. \item {} \sphinxstyleemphasis{names}: if not None, is a list of header names. In this case, no header will be read from the file \item {} \sphinxstyleemphasis{missingd} is a dictionary mapping munged column names to field values which signify that the field does not contain actual data and should be masked, e.g., ‘0000-00-00’ or ‘unused’ \item {} \sphinxstyleemphasis{missing}: a string whose value signals a missing field regardless of the column it appears in \item {} \sphinxstyleemphasis{use\_mrecords}: if True, return an mrecords.fromrecords record array if any of the data are missing \item {} \sphinxstyleemphasis{dayfirst}: default is False so that MM-DD-YY has precedence over DD-MM-YY. See \sphinxurl{http://labix.org/python-dateutil\#head-b95ce2094d189a89f80f5ae52a05b4ab7b41af47} for further information. \item {} \sphinxstyleemphasis{yearfirst}: default is False so that MM-DD-YY has precedence over YY-MM-DD. See \sphinxurl{http://labix.org/python-dateutil\#head-b95ce2094d189a89f80f5ae52a05b4ab7b41af47} for further information. If no rows are found, \sphinxstyleemphasis{None} is returned \end{itemize} \end{fulllineitems} \index{csvformat\_factory() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.csvformat_factory}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{csvformat\_factory}}}{\emph{format}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The csvformat\_factory function was deprecated in version 2.2. \end{fulllineitems} \index{demean() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.demean}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{demean}}}{\emph{x}, \emph{axis=0}}{} Return x minus its mean along the specified axis. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}array or sequence{]} Array or sequence containing the data Can have any dimensionality \item[{\sphinxstylestrong{axis}}] \leavevmode{[}integer{]} The axis along which to take the mean. See numpy.mean for a description of this argument. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \sphinxcode{\sphinxupquote{delinear()}} \begin{description} \item[{\sphinxcode{\sphinxupquote{denone()}}}] \leavevmode \sphinxcode{\sphinxupquote{delinear()}} and \sphinxcode{\sphinxupquote{denone()}} are other detrend algorithms. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_mean}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_mean()}}}}}}] \leavevmode This function is the same as {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_mean}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_mean()}}}}} except for the default \sphinxstyleemphasis{axis}. \end{description} \end{fulllineitems} \index{detrend() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.detrend}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{detrend}}}{\emph{x}, \emph{key=None}, \emph{axis=None}}{} Return x with its trend removed. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}array or sequence{]} Array or sequence containing the data. \item[{\sphinxstylestrong{key}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘constant’ \textbar{} ‘mean’ \textbar{} ‘linear’ \textbar{} ‘none’{]} or function{]} Specifies the detrend algorithm to use. ‘default’ is ‘mean’, which is the same as {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_mean}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_mean()}}}}}. ‘constant’ is the same. ‘linear’ is the same as {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_linear}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_linear()}}}}}. ‘none’ is the same as {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_none()}}}}}. The default is ‘mean’. See the corresponding functions for more details regarding the algorithms. Can also be a function that carries out the detrend operation. \item[{\sphinxstylestrong{axis}}] \leavevmode{[}integer{]} The axis along which to do the detrending. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_mean}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_mean()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_mean}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_mean()}}}}} implements the ‘mean’ algorithm. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_linear}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_linear()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_linear}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_linear()}}}}} implements the ‘linear’ algorithm. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_none()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_none()}}}}} implements the ‘none’ algorithm. \end{description} \end{fulllineitems} \index{detrend\_linear() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.detrend_linear}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{detrend\_linear}}}{\emph{y}}{} Return x minus best fit line; ‘linear’ detrending. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{y}}] \leavevmode{[}0-D or 1-D array or sequence{]} Array or sequence containing the data \item[{\sphinxstylestrong{axis}}] \leavevmode{[}integer{]} The axis along which to take the mean. See numpy.mean for a description of this argument. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{\sphinxcode{\sphinxupquote{delinear()}}}] \leavevmode This function is the same as \sphinxcode{\sphinxupquote{delinear()}} except for the default \sphinxstyleemphasis{axis}. \end{description} {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_mean}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_mean()}}}}} \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_none()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_mean}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_mean()}}}}} and {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_none()}}}}} are other detrend algorithms. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend()}}}}} is a wrapper around all the detrend algorithms. \end{description} \end{fulllineitems} \index{detrend\_mean() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.detrend_mean}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{detrend\_mean}}}{\emph{x}, \emph{axis=None}}{} Return x minus the mean(x). \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}array or sequence{]} Array or sequence containing the data Can have any dimensionality \item[{\sphinxstylestrong{axis}}] \leavevmode{[}integer{]} The axis along which to take the mean. See numpy.mean for a description of this argument. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.demean}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{demean()}}}}}}] \leavevmode This function is the same as {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.demean}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{demean()}}}}} except for the default \sphinxstyleemphasis{axis}. \end{description} {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_linear}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_linear()}}}}} \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_none()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_linear}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_linear()}}}}} and {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_none()}}}}} are other detrend algorithms. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend()}}}}} is a wrapper around all the detrend algorithms. \end{description} \end{fulllineitems} \index{detrend\_none() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.detrend_none}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{detrend\_none}}}{\emph{x}, \emph{axis=None}}{} Return x: no detrending. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}any object{]} An object containing the data \item[{\sphinxstylestrong{axis}}] \leavevmode{[}integer{]} This parameter is ignored. It is included for compatibility with detrend\_mean \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{\sphinxcode{\sphinxupquote{denone()}}}] \leavevmode This function is the same as \sphinxcode{\sphinxupquote{denone()}} except for the default \sphinxstyleemphasis{axis}, which has no effect. \end{description} {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_mean}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_mean()}}}}} \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_linear}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_linear()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_mean}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_mean()}}}}} and {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend_linear}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend\_linear()}}}}} are other detrend algorithms. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.detrend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{detrend()}}}}} is a wrapper around all the detrend algorithms. \end{description} \end{fulllineitems} \index{dist() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.dist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{dist}}}{\emph{x}, \emph{y}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }numpy.hypot Return the distance between two points. \end{fulllineitems} \index{dist\_point\_to\_segment() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.dist_point_to_segment}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{dist\_point\_to\_segment}}}{\emph{p}, \emph{s0}, \emph{s1}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The dist\_point\_to\_segment function was deprecated in version 2.2. Get the distance of a point to a segment. \begin{quote} \sphinxstyleemphasis{p}, \sphinxstyleemphasis{s0}, \sphinxstyleemphasis{s1} are \sphinxstyleemphasis{xy} sequences \end{quote} This algorithm from \sphinxurl{http://geomalgorithms.com/a02-\_lines.html} \end{fulllineitems} \index{distances\_along\_curve() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.distances_along_curve}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{distances\_along\_curve}}}{\emph{X}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The distances\_along\_curve function was deprecated in version 2.2. Computes the distance between a set of successive points in \sphinxstyleemphasis{N} dimensions. Where \sphinxstyleemphasis{X} is an \sphinxstyleemphasis{M} x \sphinxstyleemphasis{N} array or matrix. The distances between successive rows is computed. Distance is the standard Euclidean distance. \end{fulllineitems} \index{donothing\_callback() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.donothing_callback}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{donothing\_callback}}}{\emph{*args}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The donothing\_callback function was deprecated in version 2.2. \end{fulllineitems} \index{entropy() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.entropy}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{entropy}}}{\emph{y}, \emph{bins}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }scipy.stats.entropy Return the entropy of the data in \sphinxstyleemphasis{y} in units of nat. \begin{equation}-\sum p_i \ln(p_i)\end{equation} where $p_i$ is the probability of observing \sphinxstyleemphasis{y} in the $i^{th}$ bin of \sphinxstyleemphasis{bins}. \sphinxstyleemphasis{bins} can be a number of bins or a range of bins; see \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html\#numpy.histogram}{\sphinxcode{\sphinxupquote{numpy.histogram()}}}. Compare \sphinxstyleemphasis{S} with analytic calculation for a Gaussian: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{x} \PYG{o}{=} \PYG{n}{mu} \PYG{o}{+} \PYG{n}{sigma} \PYG{o}{*} \PYG{n}{randn}\PYG{p}{(}\PYG{l+m+mi}{200000}\PYG{p}{)} \PYG{n}{Sanalytic} \PYG{o}{=} \PYG{l+m+mf}{0.5} \PYG{o}{*} \PYG{p}{(} \PYG{l+m+mf}{1.0} \PYG{o}{+} \PYG{n}{log}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{sigma}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mf}{2.0}\PYG{p}{)} \PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{exp\_safe() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.exp_safe}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{exp\_safe}}}{\emph{x}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }numpy.exp Compute exponentials which safely underflow to zero. Slow, but convenient to use. Note that numpy provides proper floating point exception handling with access to the underlying hardware. \end{fulllineitems} \index{fftsurr() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.fftsurr}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{fftsurr}}}{\emph{x}, \emph{detrend=\textless{}function detrend\_none\textgreater{}}, \emph{window=\textless{}function window\_none\textgreater{}}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The fftsurr function was deprecated in version 2.2. Compute an FFT phase randomized surrogate of \sphinxstyleemphasis{x}. \end{fulllineitems} \index{find() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.find}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{find}}}{\emph{condition}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The find function was deprecated in version 2.2. Return the indices where ravel(condition) is true \end{fulllineitems} \index{frange() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.frange}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{frange}}}{\emph{xini}, \emph{xfin=None}, \emph{delta=None}, \emph{**kw}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }numpy.arange frange({[}start,{]} stop{[}, step, keywords{]}) -\textgreater{} array of floats Return a numpy ndarray containing a progression of floats. Similar to \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.arange.html\#numpy.arange}{\sphinxcode{\sphinxupquote{numpy.arange()}}}, but defaults to a closed interval. \sphinxcode{\sphinxupquote{frange(x0, x1)}} returns \sphinxcode{\sphinxupquote{{[}x0, x0+1, x0+2, ..., x1{]}}}; \sphinxstyleemphasis{start} defaults to 0, and the endpoint \sphinxstyleemphasis{is included}. This behavior is different from that of \sphinxcode{\sphinxupquote{range()}} and \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.arange.html\#numpy.arange}{\sphinxcode{\sphinxupquote{numpy.arange()}}}. This is deliberate, since {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.frange}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{frange()}}}}} will probably be more useful for generating lists of points for function evaluation, and endpoints are often desired in this use. The usual behavior of \sphinxcode{\sphinxupquote{range()}} can be obtained by setting the keyword \sphinxstyleemphasis{closed} = 0, in this case, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.frange}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{frange()}}}}} basically becomes :func:numpy.arange{}`. When \sphinxstyleemphasis{step} is given, it specifies the increment (or decrement). All arguments can be floating point numbers. \sphinxcode{\sphinxupquote{frange(x0,x1,d)}} returns \sphinxcode{\sphinxupquote{{[}x0,x0+d,x0+2d,...,xfin{]}}} where \sphinxstyleemphasis{xfin} \textless{}= \sphinxstyleemphasis{x1}. {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.frange}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{frange()}}}}} can also be called with the keyword \sphinxstyleemphasis{npts}. This sets the number of points the list should contain (and overrides the value \sphinxstyleemphasis{step} might have been given). \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.arange.html\#numpy.arange}{\sphinxcode{\sphinxupquote{numpy.arange()}}} doesn’t offer this option. Examples: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{frange}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{)} \PYG{g+go}{array([ 0., 1., 2., 3.])} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{frange}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,}\PYG{n}{closed}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{)} \PYG{g+go}{array([ 0., 1., 2.])} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{frange}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{6}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{g+go}{array([1, 3, 5]) or 1,3,5,7, depending on floating point vagueries} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{frange}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mf}{6.5}\PYG{p}{,}\PYG{n}{npts}\PYG{o}{=}\PYG{l+m+mi}{5}\PYG{p}{)} \PYG{g+go}{array([ 1. , 2.375, 3.75 , 5.125, 6.5 ])} \end{sphinxVerbatim} \end{fulllineitems} \index{get\_formatd() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.get_formatd}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{get\_formatd}}}{\emph{r}, \emph{formatd=None}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The get\_formatd function was deprecated in version 2.2. build a formatd guaranteed to have a key for every dtype name \end{fulllineitems} \index{get\_sparse\_matrix() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.get_sparse_matrix}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{get\_sparse\_matrix}}}{\emph{M}, \emph{N}, \emph{frac=0.1}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The get\_sparse\_matrix function was deprecated in version 2.2. Return a \sphinxstyleemphasis{M} x \sphinxstyleemphasis{N} sparse matrix with \sphinxstyleemphasis{frac} elements randomly filled. \end{fulllineitems} \index{get\_xyz\_where() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.get_xyz_where}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{get\_xyz\_where}}}{\emph{Z}, \emph{Cond}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The get\_xyz\_where function was deprecated in version 2.2. \sphinxstyleemphasis{Z} and \sphinxstyleemphasis{Cond} are \sphinxstyleemphasis{M} x \sphinxstyleemphasis{N} matrices. \sphinxstyleemphasis{Z} are data and \sphinxstyleemphasis{Cond} is a boolean matrix where some condition is satisfied. Return value is (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}, \sphinxstyleemphasis{z}) where \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} are the indices into \sphinxstyleemphasis{Z} and \sphinxstyleemphasis{z} are the values of \sphinxstyleemphasis{Z} at those indices. \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}, and \sphinxstyleemphasis{z} are 1D arrays. \end{fulllineitems} \index{griddata() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.griddata}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{griddata}}}{\emph{x}, \emph{y}, \emph{z}, \emph{xi}, \emph{yi}, \emph{interp='nn'}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The griddata function was deprecated in version 2.2. Interpolates from a nonuniformly spaced grid to some other grid. Fits a surface of the form z = f(\sphinxcode{\sphinxupquote{x}}, \sphinxcode{\sphinxupquote{y}}) to the data in the (usually) nonuniformly spaced vectors (\sphinxcode{\sphinxupquote{x}}, \sphinxcode{\sphinxupquote{y}}, \sphinxcode{\sphinxupquote{z}}), then interpolates this surface at the points specified by (\sphinxcode{\sphinxupquote{xi}}, \sphinxcode{\sphinxupquote{yi}}) to produce \sphinxcode{\sphinxupquote{zi}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y, z}}] \leavevmode{[}1d array\_like{]} Coordinates of grid points to interpolate from. \item[{\sphinxstylestrong{xi, yi}}] \leavevmode{[}1d or 2d array\_like{]} Coordinates of grid points to interpolate to. \item[{\sphinxstylestrong{interp}}] \leavevmode{[}string key from \{‘nn’, ‘linear’\}{]} Interpolation algorithm, either ‘nn’ for natural neighbor, or ‘linear’ for linear interpolation. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{2d float array}}] \leavevmode Array of values interpolated at (\sphinxcode{\sphinxupquote{xi}}, \sphinxcode{\sphinxupquote{yi}}) points. Array will be masked is any of (\sphinxcode{\sphinxupquote{xi}}, \sphinxcode{\sphinxupquote{yi}}) are outside the convex hull of (\sphinxcode{\sphinxupquote{x}}, \sphinxcode{\sphinxupquote{y}}). \end{description} \end{description}\end{quote} \paragraph{Notes} If \sphinxcode{\sphinxupquote{interp}} is ‘nn’ (the default), uses natural neighbor interpolation based on Delaunay triangulation. This option is only available if the mpl\_toolkits.natgrid module is installed. This can be downloaded from \sphinxurl{https://github.com/matplotlib/natgrid}. The (\sphinxcode{\sphinxupquote{xi}}, \sphinxcode{\sphinxupquote{yi}}) grid must be regular and monotonically increasing in this case. If \sphinxcode{\sphinxupquote{interp}} is ‘linear’, linear interpolation is used via matplotlib.tri.LinearTriInterpolator. Instead of using {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.griddata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{griddata}}}}}, more flexible functionality and other interpolation options are available using a matplotlib.tri.Triangulation and a matplotlib.tri.TriInterpolator. \end{fulllineitems} \index{identity() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.identity}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{identity}}}{\emph{n}, \emph{rank=2}, \emph{dtype='l'}, \emph{typecode=None}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }numpy.identity Returns the identity matrix of shape (\sphinxstyleemphasis{n}, \sphinxstyleemphasis{n}, …, \sphinxstyleemphasis{n}) (rank \sphinxstyleemphasis{r}). For ranks higher than 2, this object is simply a multi-index Kronecker delta: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{/} \PYG{l+m+mi}{1} \PYG{k}{if} \PYG{n}{i0}\PYG{o}{=}\PYG{n}{i1}\PYG{o}{=}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{o}{=}\PYG{n}{iR}\PYG{p}{,} \PYG{n+nb}{id}\PYG{p}{[}\PYG{n}{i0}\PYG{p}{,}\PYG{n}{i1}\PYG{p}{,}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,}\PYG{n}{iR}\PYG{p}{]} \PYG{o}{=} \PYG{o}{\PYGZhy{}}\PYG{o}{\textbar{}} \PYGZbs{} \PYG{l+m+mi}{0} \PYG{n}{otherwise}\PYG{o}{.} \end{sphinxVerbatim} Optionally a \sphinxstyleemphasis{dtype} (or typecode) may be given (it defaults to ‘l’). Since rank defaults to 2, this function behaves in the default case (when only \sphinxstyleemphasis{n} is given) like \sphinxcode{\sphinxupquote{numpy.identity(n)}} \textendash{} but surprisingly, it is much faster. \end{fulllineitems} \index{inside\_poly() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.inside_poly}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{inside\_poly}}}{\emph{points}, \emph{verts}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The inside\_poly function was deprecated in version 2.2. \sphinxstyleemphasis{points} is a sequence of \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} points. \sphinxstyleemphasis{verts} is a sequence of \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} vertices of a polygon. Return value is a sequence of indices into points for the points that are inside the polygon. \end{fulllineitems} \index{is\_closed\_polygon() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.is_closed_polygon}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{is\_closed\_polygon}}}{\emph{X}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The is\_closed\_polygon function was deprecated in version 2.2. Tests whether first and last object in a sequence are the same. These are presumably coordinates on a polygonal curve, in which case this function tests if that curve is closed. \end{fulllineitems} \index{ispower2() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.ispower2}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{ispower2}}}{\emph{n}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The ispower2 function was deprecated in version 2.2. Returns the log base 2 of \sphinxstyleemphasis{n} if \sphinxstyleemphasis{n} is a power of 2, zero otherwise. Note the potential ambiguity if \sphinxstyleemphasis{n} == 1: 2**0 == 1, interpret accordingly. \end{fulllineitems} \index{isvector() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.isvector}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{isvector}}}{\emph{X}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The isvector function was deprecated in version 2.2. Like the MATLAB function with the same name, returns \sphinxstyleemphasis{True} if the supplied numpy array or matrix \sphinxstyleemphasis{X} looks like a vector, meaning it has a one non-singleton axis (i.e., it can have multiple axes, but all must have length 1, except for one of them). If you just want to see if the array has 1 axis, use X.ndim == 1. \end{fulllineitems} \index{l1norm() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.l1norm}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{l1norm}}}{\emph{a}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The l1norm function was deprecated in version 2.2. Use numpy.linalg.norm(a, ord=1) instead. Return the \sphinxstyleemphasis{l1} norm of \sphinxstyleemphasis{a}, flattened out. Implemented as a separate function (not a call to \sphinxcode{\sphinxupquote{norm()}} for speed). \end{fulllineitems} \index{l2norm() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.l2norm}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{l2norm}}}{\emph{a}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The l2norm function was deprecated in version 2.2. Use numpy.linalg.norm(a, ord=2) instead. Return the \sphinxstyleemphasis{l2} norm of \sphinxstyleemphasis{a}, flattened out. Implemented as a separate function (not a call to \sphinxcode{\sphinxupquote{norm()}} for speed). \end{fulllineitems} \index{less\_simple\_linear\_interpolation() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.less_simple_linear_interpolation}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{less\_simple\_linear\_interpolation}}}{\emph{x}, \emph{y}, \emph{xi}, \emph{extrap=False}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The less\_simple\_linear\_interpolation function was deprecated in version 2.2. Use numpy.interp instead. This function provides simple (but somewhat less so than \sphinxcode{\sphinxupquote{cbook.simple\_linear\_interpolation()}}) linear interpolation. \sphinxcode{\sphinxupquote{simple\_linear\_interpolation()}} will give a list of point between a start and an end, while this does true linear interpolation at an arbitrary set of points. This is very inefficient linear interpolation meant to be used only for a small number of points in relatively non-intensive use cases. For real linear interpolation, use scipy. \end{fulllineitems} \index{log2() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.log2}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{log2}}}{\emph{x}, \emph{ln2=0.6931471805599453}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }numpy.log2 Return the log(\sphinxstyleemphasis{x}) in base 2. This is a \_slow\_ function but which is guaranteed to return the correct integer value if the input is an integer exact power of 2. \end{fulllineitems} \index{logspace() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.logspace}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{logspace}}}{\emph{xmin}, \emph{xmax}, \emph{N}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The logspace function was deprecated in version 2.2. Use numpy.logspace or numpy.geomspace instead. Return N values logarithmically spaced between xmin and xmax. \end{fulllineitems} \index{longest\_contiguous\_ones() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.longest_contiguous_ones}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{longest\_contiguous\_ones}}}{\emph{x}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The longest\_contiguous\_ones function was deprecated in version 2.2. Return the indices of the longest stretch of contiguous ones in \sphinxstyleemphasis{x}, assuming \sphinxstyleemphasis{x} is a vector of zeros and ones. If there are two equally long stretches, pick the first. \end{fulllineitems} \index{longest\_ones() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.longest_ones}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{longest\_ones}}}{\emph{x}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The longest\_ones function was deprecated in version 2.2. alias for longest\_contiguous\_ones \end{fulllineitems} \index{magnitude\_spectrum() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.magnitude_spectrum}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{magnitude\_spectrum}}}{\emph{x}, \emph{Fs=None}, \emph{window=None}, \emph{pad\_to=None}, \emph{sides=None}}{} Compute the magnitude (absolute value) of the frequency spectrum of \sphinxstyleemphasis{x}. Data is padded to a length of \sphinxstyleemphasis{pad\_to} and the windowing function \sphinxstyleemphasis{window} is applied to the signal. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1-D array or sequence{]} Array or sequence containing the data \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_none()}}}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to the length of the input signal (i.e. no padding). \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{spectrum}}] \leavevmode{[}1-D array{]} The values for the magnitude spectrum (real valued) \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the elements in \sphinxstyleemphasis{spectrum} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}} returns the power spectral density. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.complex_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{complex\_spectrum()}}}}}}] \leavevmode This function returns the absolute value of {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.complex_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{complex\_spectrum()}}}}}. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}} returns the angles of the corresponding frequencies. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}} returns the phase (unwrapped angle) of the corresponding frequencies. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}} can return the magnitude spectrum of segments within the signal. \end{description} \end{fulllineitems} \index{movavg() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.movavg}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{movavg}}}{\emph{x}, \emph{n}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The movavg function was deprecated in version 2.2. Compute the len(\sphinxstyleemphasis{n}) moving average of \sphinxstyleemphasis{x}. \end{fulllineitems} \index{norm\_flat() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.norm_flat}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{norm\_flat}}}{\emph{a}, \emph{p=2}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The norm\_flat function was deprecated in version 2.2. Use numpy.linalg.norm(a.flat, ord=p) instead. norm(a,p=2) -\textgreater{} l-p norm of a.flat Return the l-p norm of \sphinxstyleemphasis{a}, considered as a flat array. This is NOT a true matrix norm, since arrays of arbitrary rank are always flattened. \sphinxstyleemphasis{p} can be a number or the string ‘Infinity’ to get the L-infinity norm. \end{fulllineitems} \index{normpdf() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.normpdf}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{normpdf}}}{\emph{x}, \emph{*args}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }scipy.stats.norm.pdf Return the normal pdf evaluated at \sphinxstyleemphasis{x}; args provides \sphinxstyleemphasis{mu}, \sphinxstyleemphasis{sigma} \end{fulllineitems} \index{offset\_line() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.offset_line}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{offset\_line}}}{\emph{y}, \emph{yerr}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The offset\_line function was deprecated in version 2.2. Offsets an array \sphinxstyleemphasis{y} by +/- an error and returns a tuple (y - err, y + err). The error term can be: \begin{itemize} \item {} A scalar. In this case, the returned tuple is obvious. \item {} A vector of the same length as \sphinxstyleemphasis{y}. The quantities y +/- err are computed component-wise. \item {} A tuple of length 2. In this case, yerr{[}0{]} is the error below \sphinxstyleemphasis{y} and yerr{[}1{]} is error above \sphinxstyleemphasis{y}. For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{pylab} \PYG{k}{import} \PYG{o}{*} \PYG{n}{x} \PYG{o}{=} \PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{pi}\PYG{p}{,} \PYG{n}{num}\PYG{o}{=}\PYG{l+m+mi}{100}\PYG{p}{,} \PYG{n}{endpoint}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)} \PYG{n}{y} \PYG{o}{=} \PYG{n}{sin}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)} \PYG{n}{y\PYGZus{}minus}\PYG{p}{,} \PYG{n}{y\PYGZus{}plus} \PYG{o}{=} \PYG{n}{mlab}\PYG{o}{.}\PYG{n}{offset\PYGZus{}line}\PYG{p}{(}\PYG{n}{y}\PYG{p}{,} \PYG{l+m+mf}{0.1}\PYG{p}{)} \PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{n}{fill\PYGZus{}between}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{ym}\PYG{p}{,} \PYG{n}{y2}\PYG{o}{=}\PYG{n}{yp}\PYG{p}{)} \PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \end{itemize} \end{fulllineitems} \index{path\_length() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.path_length}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{path\_length}}}{\emph{X}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The path\_length function was deprecated in version 2.2. Computes the distance travelled along a polygonal curve in \sphinxstyleemphasis{N} dimensions. Where \sphinxstyleemphasis{X} is an \sphinxstyleemphasis{M} x \sphinxstyleemphasis{N} array or matrix. Returns an array of length \sphinxstyleemphasis{M} consisting of the distance along the curve at each point (i.e., the rows of \sphinxstyleemphasis{X}). \end{fulllineitems} \index{phase\_spectrum() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.phase_spectrum}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{phase\_spectrum}}}{\emph{x}, \emph{Fs=None}, \emph{window=None}, \emph{pad\_to=None}, \emph{sides=None}}{} Compute the phase of the frequency spectrum (unwrapped angle spectrum) of \sphinxstyleemphasis{x}. Data is padded to a length of \sphinxstyleemphasis{pad\_to} and the windowing function \sphinxstyleemphasis{window} is applied to the signal. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1-D array or sequence{]} Array or sequence containing the data \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_none()}}}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to the length of the input signal (i.e. no padding). \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{spectrum}}] \leavevmode{[}1-D array{]} The values for the phase spectrum in radians (real valued) \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the elements in \sphinxstyleemphasis{spectrum} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.complex_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{complex\_spectrum()}}}}}}] \leavevmode This function returns the angle value of {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.complex_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{complex\_spectrum()}}}}}. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}} returns the magnitudes of the corresponding frequencies. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}} returns the wrapped version of this function. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}} can return the phase spectrum of segments within the signal. \end{description} \end{fulllineitems} \index{poly\_below() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.poly_below}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{poly\_below}}}{\emph{xmin}, \emph{xs}, \emph{ys}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The poly\_below function was deprecated in version 2.2. Given a sequence of \sphinxstyleemphasis{xs} and \sphinxstyleemphasis{ys}, return the vertices of a polygon that has a horizontal base at \sphinxstyleemphasis{xmin} and an upper bound at the \sphinxstyleemphasis{ys}. \sphinxstyleemphasis{xmin} is a scalar. Intended for use with {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.fill:matplotlib.axes.Axes.fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.fill()}}}}}, e.g.,: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{xv}\PYG{p}{,} \PYG{n}{yv} \PYG{o}{=} \PYG{n}{poly\PYGZus{}below}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{fill}\PYG{p}{(}\PYG{n}{xv}\PYG{p}{,} \PYG{n}{yv}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{poly\_between() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.poly_between}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{poly\_between}}}{\emph{x}, \emph{ylower}, \emph{yupper}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The poly\_between function was deprecated in version 2.2. Given a sequence of \sphinxstyleemphasis{x}, \sphinxstyleemphasis{ylower} and \sphinxstyleemphasis{yupper}, return the polygon that fills the regions between them. \sphinxstyleemphasis{ylower} or \sphinxstyleemphasis{yupper} can be scalar or iterable. If they are iterable, they must be equal in length to \sphinxstyleemphasis{x}. Return value is \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} arrays for use with {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.fill:matplotlib.axes.Axes.fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.fill()}}}}}. \end{fulllineitems} \index{prctile() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.prctile}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{prctile}}}{\emph{x}, \emph{p=(0.0}, \emph{25.0}, \emph{50.0}, \emph{75.0}, \emph{100.0)}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }numpy.percentile Return the percentiles of \sphinxstyleemphasis{x}. \sphinxstyleemphasis{p} can either be a sequence of percentile values or a scalar. If \sphinxstyleemphasis{p} is a sequence, the ith element of the return sequence is the \sphinxstyleemphasis{p*(i)-th percentile of *x}. If \sphinxstyleemphasis{p} is a scalar, the largest value of \sphinxstyleemphasis{x} less than or equal to the \sphinxstyleemphasis{p} percentage point in the sequence is returned. \end{fulllineitems} \index{prctile\_rank() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.prctile_rank}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{prctile\_rank}}}{\emph{x}, \emph{p}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The prctile\_rank function was deprecated in version 2.2. Return the rank for each element in \sphinxstyleemphasis{x}, return the rank 0..len(\sphinxstyleemphasis{p}). e.g., if \sphinxstyleemphasis{p} = (25, 50, 75), the return value will be a len(\sphinxstyleemphasis{x}) array with values in {[}0,1,2,3{]} where 0 indicates the value is less than the 25th percentile, 1 indicates the value is \textgreater{}= the 25th and \textless{} 50th percentile, … and 3 indicates the value is above the 75th percentile cutoff. \sphinxstyleemphasis{p} is either an array of percentiles in {[}0..100{]} or a scalar which indicates how many quantiles of data you want ranked. \end{fulllineitems} \index{psd() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.psd}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{psd}}}{\emph{x}, \emph{NFFT=None}, \emph{Fs=None}, \emph{detrend=None}, \emph{window=None}, \emph{noverlap=None}, \emph{pad\_to=None}, \emph{sides=None}, \emph{scale\_by\_freq=None}}{} Compute the power spectral density. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{psd}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{NFFT}\PYG{o}{=}\PYG{l+m+mi}{256}\PYG{p}{,} \PYG{n}{Fs}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{detrend}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{detrend\PYGZus{}none}\PYG{p}{,} \PYG{n}{window}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{window\PYGZus{}hanning}\PYG{p}{,} \PYG{n}{noverlap}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{pad\PYGZus{}to}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{sides}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{scale\PYGZus{}by\PYGZus{}freq}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)} \end{sphinxVerbatim} The power spectral density $P_{xx}$ by Welch’s average periodogram method. The vector \sphinxstyleemphasis{x} is divided into \sphinxstyleemphasis{NFFT} length segments. Each segment is detrended by function \sphinxstyleemphasis{detrend} and windowed by function \sphinxstyleemphasis{window}. \sphinxstyleemphasis{noverlap} gives the length of the overlap between segments. The $|\mathrm{fft}(i)|^2$ of each segment $i$ are averaged to compute $P_{xx}$. If len(\sphinxstyleemphasis{x}) \textless{} \sphinxstyleemphasis{NFFT}, it will be zero padded to \sphinxstyleemphasis{NFFT}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1-D array or sequence{]} Array or sequence containing the data \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_none()}}}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. This can be different from \sphinxstyleemphasis{NFFT}, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to \sphinxstyleemphasis{NFFT} \item[{\sphinxstylestrong{NFFT}}] \leavevmode{[}integer{]} The number of data points used in each block for the FFT. A power 2 is most efficient. The default value is 256. This should \sphinxstyleemphasis{NOT} be used to get zero padding, or the scaling of the result will be incorrect. Use \sphinxstyleemphasis{pad\_to} for this instead. \item[{\sphinxstylestrong{detrend}}] \leavevmode{[}\{‘default’, ‘constant’, ‘mean’, ‘linear’, ‘none’\} or callable{]} The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the \sphinxstyleemphasis{detrend} parameter is a vector, in matplotlib is it a function. The \sphinxcode{\sphinxupquote{pylab}} module defines \sphinxcode{\sphinxupquote{detrend\_none()}}, \sphinxcode{\sphinxupquote{detrend\_mean()}}, and \sphinxcode{\sphinxupquote{detrend\_linear()}}, but you can use a custom function as well. You can also use a string to choose one of the functions. ‘default’, ‘constant’, and ‘mean’ call \sphinxcode{\sphinxupquote{detrend\_mean()}}. ‘linear’ calls \sphinxcode{\sphinxupquote{detrend\_linear()}}. ‘none’ calls \sphinxcode{\sphinxupquote{detrend\_none()}}. \item[{\sphinxstylestrong{scale\_by\_freq}}] \leavevmode{[}boolean, optional{]} Specifies whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz\textasciicircum{}-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. \item[{\sphinxstylestrong{noverlap}}] \leavevmode{[}integer{]} The number of points of overlap between segments. The default value is 0 (no overlap). \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Pxx}}] \leavevmode{[}1-D array{]} The values for the power spectrum \sphinxcode{\sphinxupquote{P\_\{xx\}}} (real valued) \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the elements in \sphinxstyleemphasis{Pxx} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}} differs in the default overlap; in not returning the mean of the segment periodograms; and in returning the times of the segments. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}} returns the magnitude spectrum. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.csd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{csd()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.csd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{csd()}}}}} returns the spectral density between two signals. \end{description} \paragraph{References} Bendat \& Piersol \textendash{} Random Data: Analysis and Measurement Procedures, John Wiley \& Sons (1986) \end{fulllineitems} \index{quad2cubic() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.quad2cubic}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{quad2cubic}}}{\emph{q0x}, \emph{q0y}, \emph{q1x}, \emph{q1y}, \emph{q2x}, \emph{q2y}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The quad2cubic function was deprecated in version 2.2. Converts a quadratic Bezier curve to a cubic approximation. The inputs are the \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} coordinates of the three control points of a quadratic curve, and the output is a tuple of \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} coordinates of the four control points of the cubic curve. \end{fulllineitems} \index{rec2csv() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.rec2csv}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{rec2csv}}}{\emph{r}, \emph{fname}, \emph{delimiter='}, \emph{'}, \emph{formatd=None}, \emph{missing=''}, \emph{missingd=None}, \emph{withheader=True}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The rec2csv function was deprecated in version 2.2. Use numpy.recarray.tofile instead. Save the data from numpy recarray \sphinxstyleemphasis{r} into a comma-/space-/tab-delimited file. The record array dtype names will be used for column headers. \begin{description} \item[{\sphinxstyleemphasis{fname}: can be a filename or a file handle. Support for gzipped}] \leavevmode files is automatic, if the filename ends in ‘.gz’ \item[{\sphinxstyleemphasis{withheader}: if withheader is False, do not write the attribute}] \leavevmode names in the first row \end{description} for formatd type FormatFloat, we override the precision to store full precision floats in the CSV file \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.csv2rec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{csv2rec()}}}}}}] \leavevmode For information about \sphinxstyleemphasis{missing} and \sphinxstyleemphasis{missingd}, which can be used to fill in masked values into your CSV file. \end{description} \end{fulllineitems} \index{rec2txt() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.rec2txt}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{rec2txt}}}{\emph{r}, \emph{header=None}, \emph{padding=3}, \emph{precision=3}, \emph{fields=None}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The rec2txt function was deprecated in version 2.2. Use numpy.recarray.tofile instead. Returns a textual representation of a record array. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{r: numpy recarray}}] \leavevmode \item[{\sphinxstylestrong{header: list}}] \leavevmode column headers \item[{\sphinxstylestrong{padding:}}] \leavevmode space between each column \item[{\sphinxstylestrong{precision: number of decimal places to use for floats.}}] \leavevmode Set to an integer to apply to all floats. Set to a list of integers to apply precision individually. Precision for non-floats is simply ignored. \item[{\sphinxstylestrong{fields}}] \leavevmode{[}list{]} If not None, a list of field names to print. fields can be a list of strings like {[}‘field1’, ‘field2’{]} or a single comma separated string like ‘field1,field2’ \end{description} \end{description}\end{quote} \paragraph{Examples} For \sphinxcode{\sphinxupquote{precision={[}0,2,3{]}}}, the output is \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ID} \PYG{n}{Price} \PYG{n}{Return} \PYG{n}{ABC} \PYG{l+m+mf}{12.54} \PYG{l+m+mf}{0.234} \PYG{n}{XYZ} \PYG{l+m+mf}{6.32} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.076} \end{sphinxVerbatim} \end{fulllineitems} \index{rec\_append\_fields() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.rec_append_fields}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{rec\_append\_fields}}}{\emph{rec}, \emph{names}, \emph{arrs}, \emph{dtypes=None}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The rec\_append\_fields function was deprecated in version 2.2. Return a new record array with field names populated with data from arrays in \sphinxstyleemphasis{arrs}. If appending a single field, then \sphinxstyleemphasis{names}, \sphinxstyleemphasis{arrs} and \sphinxstyleemphasis{dtypes} do not have to be lists. They can just be the values themselves. \end{fulllineitems} \index{rec\_drop\_fields() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.rec_drop_fields}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{rec\_drop\_fields}}}{\emph{rec}, \emph{names}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The rec\_drop\_fields function was deprecated in version 2.2. Return a new numpy record array with fields in \sphinxstyleemphasis{names} dropped. \end{fulllineitems} \index{rec\_groupby() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.rec_groupby}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{rec\_groupby}}}{\emph{r}, \emph{groupby}, \emph{stats}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The rec\_groupby function was deprecated in version 2.2. \sphinxstyleemphasis{r} is a numpy record array \sphinxstyleemphasis{groupby} is a sequence of record array attribute names that together form the grouping key. e.g., (‘date’, ‘productcode’) \sphinxstyleemphasis{stats} is a sequence of (\sphinxstyleemphasis{attr}, \sphinxstyleemphasis{func}, \sphinxstyleemphasis{outname}) tuples which will call \sphinxcode{\sphinxupquote{x = func(attr)}} and assign \sphinxstyleemphasis{x} to the record array output with attribute \sphinxstyleemphasis{outname}. For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{stats} \PYG{o}{=} \PYG{p}{(} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{sales}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n+nb}{len}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{numsales}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{sales}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{mean}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{avgsale}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{p}{)} \end{sphinxVerbatim} Return record array has \sphinxstyleemphasis{dtype} names for each attribute name in the \sphinxstyleemphasis{groupby} argument, with the associated group values, and for each outname name in the \sphinxstyleemphasis{stats} argument, with the associated stat summary output. \end{fulllineitems} \index{rec\_join() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.rec_join}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{rec\_join}}}{\emph{key}, \emph{r1}, \emph{r2}, \emph{jointype='inner'}, \emph{defaults=None}, \emph{r1postfix='1'}, \emph{r2postfix='2'}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The rec\_join function was deprecated in version 2.2. Join record arrays \sphinxstyleemphasis{r1} and \sphinxstyleemphasis{r2} on \sphinxstyleemphasis{key}; \sphinxstyleemphasis{key} is a tuple of field names \textendash{} if \sphinxstyleemphasis{key} is a string it is assumed to be a single attribute name. If \sphinxstyleemphasis{r1} and \sphinxstyleemphasis{r2} have equal values on all the keys in the \sphinxstyleemphasis{key} tuple, then their fields will be merged into a new record array containing the intersection of the fields of \sphinxstyleemphasis{r1} and \sphinxstyleemphasis{r2}. \sphinxstyleemphasis{r1} (also \sphinxstyleemphasis{r2}) must not have any duplicate keys. The \sphinxstyleemphasis{jointype} keyword can be ‘inner’, ‘outer’, ‘leftouter’. To do a rightouter join just reverse \sphinxstyleemphasis{r1} and \sphinxstyleemphasis{r2}. The \sphinxstyleemphasis{defaults} keyword is a dictionary filled with \sphinxcode{\sphinxupquote{\{column\_name:default\_value\}}} pairs. The keywords \sphinxstyleemphasis{r1postfix} and \sphinxstyleemphasis{r2postfix} are postfixed to column names (other than keys) that are both in \sphinxstyleemphasis{r1} and \sphinxstyleemphasis{r2}. \end{fulllineitems} \index{rec\_keep\_fields() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.rec_keep_fields}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{rec\_keep\_fields}}}{\emph{rec}, \emph{names}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The rec\_keep\_fields function was deprecated in version 2.2. Return a new numpy record array with only fields listed in names \end{fulllineitems} \index{rec\_summarize() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.rec_summarize}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{rec\_summarize}}}{\emph{r}, \emph{summaryfuncs}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The rec\_summarize function was deprecated in version 2.2. \sphinxstyleemphasis{r} is a numpy record array \sphinxstyleemphasis{summaryfuncs} is a list of (\sphinxstyleemphasis{attr}, \sphinxstyleemphasis{func}, \sphinxstyleemphasis{outname}) tuples which will apply \sphinxstyleemphasis{func} to the array \sphinxstyleemphasis{r*{[}attr{]} and assign the output to a new attribute name *outname}. The returned record array is identical to \sphinxstyleemphasis{r}, with extra arrays for each element in \sphinxstyleemphasis{summaryfuncs}. \end{fulllineitems} \index{recs\_join() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.recs_join}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{recs\_join}}}{\emph{key}, \emph{name}, \emph{recs}, \emph{jointype='outer'}, \emph{missing=0.0}, \emph{postfixes=None}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The recs\_join function was deprecated in version 2.2. Join a sequence of record arrays on single column key. This function only joins a single column of the multiple record arrays \begin{description} \item[{\sphinxstyleemphasis{key}}] \leavevmode is the column name that acts as a key \item[{\sphinxstyleemphasis{name}}] \leavevmode is the name of the column that we want to join \item[{\sphinxstyleemphasis{recs}}] \leavevmode is a list of record arrays to join \item[{\sphinxstyleemphasis{jointype}}] \leavevmode is a string ‘inner’ or ‘outer’ \item[{\sphinxstyleemphasis{missing}}] \leavevmode is what any missing field is replaced by \item[{\sphinxstyleemphasis{postfixes}}] \leavevmode if not None, a len recs sequence of postfixes \end{description} returns a record array with columns {[}rowkey, name0, name1, … namen-1{]}. or if postfixes {[}PF0, PF1, …, PFN-1{]} are supplied, {[}rowkey, namePF0, namePF1, … namePFN-1{]}. Example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{r} \PYG{o}{=} \PYG{n}{recs\PYGZus{}join}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{date}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{close}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{recs}\PYG{o}{=}\PYG{p}{[}\PYG{n}{r0}\PYG{p}{,} \PYG{n}{r1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{missing}\PYG{o}{=}\PYG{l+m+mf}{0.}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{rk4() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.rk4}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{rk4}}}{\emph{derivs}, \emph{y0}, \emph{t}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }scipy.integrate.ode Integrate 1D or ND system of ODEs using 4-th order Runge-Kutta. This is a toy implementation which may be useful if you find yourself stranded on a system w/o scipy. Otherwise use \sphinxcode{\sphinxupquote{scipy.integrate()}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{y0}}] \leavevmode initial state vector \item[{\sphinxstylestrong{t}}] \leavevmode sample times \item[{\sphinxstylestrong{derivs}}] \leavevmode returns the derivative of the system and has the signature \sphinxcode{\sphinxupquote{dy = derivs(yi, ti)}} \end{description} \end{description}\end{quote} \paragraph{Examples} A 2D system: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{derivs6}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,}\PYG{n}{t}\PYG{p}{)}\PYG{p}{:} \PYG{n}{d1} \PYG{o}{=} \PYG{n}{x}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{+} \PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{x}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{n}{d2} \PYG{o}{=} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{3}\PYG{o}{*}\PYG{n}{x}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{+} \PYG{l+m+mi}{4}\PYG{o}{*}\PYG{n}{x}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{k}{return} \PYG{p}{(}\PYG{n}{d1}\PYG{p}{,} \PYG{n}{d2}\PYG{p}{)} \PYG{n}{dt} \PYG{o}{=} \PYG{l+m+mf}{0.0005} \PYG{n}{t} \PYG{o}{=} \PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{2.0}\PYG{p}{,} \PYG{n}{dt}\PYG{p}{)} \PYG{n}{y0} \PYG{o}{=} \PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{yout} \PYG{o}{=} \PYG{n}{rk4}\PYG{p}{(}\PYG{n}{derivs6}\PYG{p}{,} \PYG{n}{y0}\PYG{p}{,} \PYG{n}{t}\PYG{p}{)} \end{sphinxVerbatim} A 1D system: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{alpha} \PYG{o}{=} \PYG{l+m+mi}{2} \PYG{k}{def} \PYG{n+nf}{derivs}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,}\PYG{n}{t}\PYG{p}{)}\PYG{p}{:} \PYG{k}{return} \PYG{o}{\PYGZhy{}}\PYG{n}{alpha}\PYG{o}{*}\PYG{n}{x} \PYG{o}{+} \PYG{n}{exp}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{n}{t}\PYG{p}{)} \PYG{n}{y0} \PYG{o}{=} \PYG{l+m+mi}{1} \PYG{n}{yout} \PYG{o}{=} \PYG{n}{rk4}\PYG{p}{(}\PYG{n}{derivs}\PYG{p}{,} \PYG{n}{y0}\PYG{p}{,} \PYG{n}{t}\PYG{p}{)} \end{sphinxVerbatim} If you have access to scipy, you should probably be using the scipy.integrate tools rather than this function. \end{fulllineitems} \index{rms\_flat() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.rms_flat}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{rms\_flat}}}{\emph{a}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The rms\_flat function was deprecated in version 2.2. Return the root mean square of all the elements of \sphinxstyleemphasis{a}, flattened out. \end{fulllineitems} \index{safe\_isinf() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.safe_isinf}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{safe\_isinf}}}{\emph{x}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }numpy.isinf \sphinxcode{\sphinxupquote{numpy.isinf()}} for arbitrary types \end{fulllineitems} \index{safe\_isnan() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.safe_isnan}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{safe\_isnan}}}{\emph{x}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }numpy.isnan \sphinxcode{\sphinxupquote{numpy.isnan()}} for arbitrary types \end{fulllineitems} \index{segments\_intersect() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.segments_intersect}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{segments\_intersect}}}{\emph{s1}, \emph{s2}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The segments\_intersect function was deprecated in version 2.2. Return \sphinxstyleemphasis{True} if \sphinxstyleemphasis{s1} and \sphinxstyleemphasis{s2} intersect. \sphinxstyleemphasis{s1} and \sphinxstyleemphasis{s2} are defined as: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{s1}\PYG{p}{:} \PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{n}{x2}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{)} \PYG{n}{s2}\PYG{p}{:} \PYG{p}{(}\PYG{n}{x3}\PYG{p}{,} \PYG{n}{y3}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{n}{x4}\PYG{p}{,} \PYG{n}{y4}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{slopes() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.slopes}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{slopes}}}{\emph{x}, \emph{y}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The slopes function was deprecated in version 2.2. {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.slopes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{slopes()}}}}} calculates the slope \sphinxstyleemphasis{y}’(\sphinxstyleemphasis{x}) The slope is estimated using the slope obtained from that of a parabola through any three consecutive points. This method should be superior to that described in the appendix of A CONSISTENTLY WELL BEHAVED METHOD OF INTERPOLATION by Russel W. Stineman (Creative Computing July 1980) in at least one aspect: \begin{quote} Circles for interpolation demand a known aspect ratio between \sphinxstyleemphasis{x}- and \sphinxstyleemphasis{y}-values. For many functions, however, the abscissa are given in different dimensions, so an aspect ratio is completely arbitrary. \end{quote} The parabola method gives very similar results to the circle method for most regular cases but behaves much better in special cases. Norbert Nemec, Institute of Theoretical Physics, University or Regensburg, April 2006 Norbert.Nemec at physik.uni-regensburg.de (inspired by a original implementation by Halldor Bjornsson, Icelandic Meteorological Office, March 2006 halldor at vedur.is) \end{fulllineitems} \index{specgram() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.specgram}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{specgram}}}{\emph{x}, \emph{NFFT=None}, \emph{Fs=None}, \emph{detrend=None}, \emph{window=None}, \emph{noverlap=None}, \emph{pad\_to=None}, \emph{sides=None}, \emph{scale\_by\_freq=None}, \emph{mode=None}}{} Compute a spectrogram. Compute and plot a spectrogram of data in x. Data are split into NFFT length segments and the spectrum of each section is computed. The windowing function window is applied to each segment, and the amount of overlap of each segment is specified with noverlap. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}array\_like{]} 1-D array or sequence. \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}}, {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_none()}}}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. This can be different from \sphinxstyleemphasis{NFFT}, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to \sphinxstyleemphasis{NFFT} \item[{\sphinxstylestrong{NFFT}}] \leavevmode{[}integer{]} The number of data points used in each block for the FFT. A power 2 is most efficient. The default value is 256. This should \sphinxstyleemphasis{NOT} be used to get zero padding, or the scaling of the result will be incorrect. Use \sphinxstyleemphasis{pad\_to} for this instead. \item[{\sphinxstylestrong{detrend}}] \leavevmode{[}\{‘default’, ‘constant’, ‘mean’, ‘linear’, ‘none’\} or callable{]} The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the \sphinxstyleemphasis{detrend} parameter is a vector, in matplotlib is it a function. The \sphinxcode{\sphinxupquote{pylab}} module defines \sphinxcode{\sphinxupquote{detrend\_none()}}, \sphinxcode{\sphinxupquote{detrend\_mean()}}, and \sphinxcode{\sphinxupquote{detrend\_linear()}}, but you can use a custom function as well. You can also use a string to choose one of the functions. ‘default’, ‘constant’, and ‘mean’ call \sphinxcode{\sphinxupquote{detrend\_mean()}}. ‘linear’ calls \sphinxcode{\sphinxupquote{detrend\_linear()}}. ‘none’ calls \sphinxcode{\sphinxupquote{detrend\_none()}}. \item[{\sphinxstylestrong{scale\_by\_freq}}] \leavevmode{[}boolean, optional{]} Specifies whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz\textasciicircum{}-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. \item[{\sphinxstylestrong{noverlap}}] \leavevmode{[}int, optional{]} The number of points of overlap between blocks. The default value is 128. \item[{\sphinxstylestrong{mode}}] \leavevmode{[}str, optional{]}\begin{description} \item[{What sort of spectrum to use, default is ‘psd’.}] \leavevmode\begin{description} \item[{‘psd’}] \leavevmode Returns the power spectral density. \item[{‘complex’}] \leavevmode Returns the complex-valued frequency spectrum. \item[{‘magnitude’}] \leavevmode Returns the magnitude spectrum. \item[{‘angle’}] \leavevmode Returns the phase spectrum without unwrapping. \item[{‘phase’}] \leavevmode Returns the phase spectrum with unwrapping. \end{description} \end{description} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{spectrum}}] \leavevmode{[}array\_like{]} 2-D array, columns are the periodograms of successive segments. \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}array\_like{]} 1-D array, frequencies corresponding to the rows in \sphinxstyleemphasis{spectrum}. \item[{\sphinxstylestrong{t}}] \leavevmode{[}array\_like{]} 1-D array, the times corresponding to midpoints of segments (i.e the columns in \sphinxstyleemphasis{spectrum}). \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd}}}}}}] \leavevmode differs in the overlap and in the return values. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.complex_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{complex\_spectrum}}}}}}] \leavevmode similar, but with complex valued frequencies. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum}}}}}}] \leavevmode similar single segment when mode is ‘magnitude’. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum}}}}}}] \leavevmode similar to single segment when mode is ‘angle’. \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum}}}}}}] \leavevmode similar to single segment when mode is ‘phase’. \end{description} \paragraph{Notes} detrend and scale\_by\_freq only apply when \sphinxstyleemphasis{mode} is set to ‘psd’. \end{fulllineitems} \index{stineman\_interp() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.stineman_interp}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{stineman\_interp}}}{\emph{xi}, \emph{x}, \emph{y}, \emph{yp=None}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The stineman\_interp function was deprecated in version 2.2. Given data vectors \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}, the slope vector \sphinxstyleemphasis{yp} and a new abscissa vector \sphinxstyleemphasis{xi}, the function {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.stineman_interp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stineman\_interp()}}}}} uses Stineman interpolation to calculate a vector \sphinxstyleemphasis{yi} corresponding to \sphinxstyleemphasis{xi}. Here’s an example that generates a coarse sine curve, then interpolates over a finer abscissa: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{x} \PYG{o}{=} \PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{pi}\PYG{p}{,}\PYG{l+m+mi}{20}\PYG{p}{)}\PYG{p}{;} \PYG{n}{y} \PYG{o}{=} \PYG{n}{sin}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)}\PYG{p}{;} \PYG{n}{yp} \PYG{o}{=} \PYG{n}{cos}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)} \PYG{n}{xi} \PYG{o}{=} \PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{pi}\PYG{p}{,}\PYG{l+m+mi}{40}\PYG{p}{)}\PYG{p}{;} \PYG{n}{yi} \PYG{o}{=} \PYG{n}{stineman\PYGZus{}interp}\PYG{p}{(}\PYG{n}{xi}\PYG{p}{,}\PYG{n}{x}\PYG{p}{,}\PYG{n}{y}\PYG{p}{,}\PYG{n}{yp}\PYG{p}{)}\PYG{p}{;} \PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,}\PYG{n}{y}\PYG{p}{,}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{o}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,}\PYG{n}{xi}\PYG{p}{,}\PYG{n}{yi}\PYG{p}{)} \end{sphinxVerbatim} The interpolation method is described in the article A CONSISTENTLY WELL BEHAVED METHOD OF INTERPOLATION by Russell W. Stineman. The article appeared in the July 1980 issue of Creative Computing with a note from the editor stating that while they were: \begin{quote} not an academic journal but once in a while something serious and original comes in adding that this was “apparently a real solution” to a well known problem. \end{quote} For \sphinxstyleemphasis{yp} = \sphinxstyleemphasis{None}, the routine automatically determines the slopes using the {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.slopes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{slopes()}}}}} routine. \sphinxstyleemphasis{x} is assumed to be sorted in increasing order. For values \sphinxcode{\sphinxupquote{xi{[}j{]} \textless{} x{[}0{]}}} or \sphinxcode{\sphinxupquote{xi{[}j{]} \textgreater{} x{[}-1{]}}}, the routine tries an extrapolation. The relevance of the data obtained from this, of course, is questionable… Original implementation by Halldor Bjornsson, Icelandic Meteorolocial Office, March 2006 halldor at vedur.is Completely reworked and optimized for Python by Norbert Nemec, Institute of Theoretical Physics, University or Regensburg, April 2006 Norbert.Nemec at physik.uni-regensburg.de \end{fulllineitems} \index{stride\_repeat() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.stride_repeat}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{stride\_repeat}}}{\emph{x}, \emph{n}, \emph{axis=0}}{} Repeat the values in an array in a memory-efficient manner. Array x is stacked vertically n times. \begin{sphinxadmonition}{warning}{Warning:} It is not safe to write to the output array. Multiple elements may point to the same piece of memory, so modifying one value may change others. \end{sphinxadmonition} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1D array or sequence{]} Array or sequence containing the data. \item[{\sphinxstylestrong{n}}] \leavevmode{[}integer{]} The number of time to repeat the array. \item[{\sphinxstylestrong{axis}}] \leavevmode{[}integer{]} The axis along which the data will run. \end{description} \end{description}\end{quote} \paragraph{References} \sphinxhref{http://stackoverflow.com/a/5568169}{stackoverflow: Repeat NumPy array without replicating data?} \end{fulllineitems} \index{stride\_windows() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.stride_windows}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{stride\_windows}}}{\emph{x}, \emph{n}, \emph{noverlap=None}, \emph{axis=0}}{} Get all windows of x with length n as a single array, using strides to avoid data duplication. \begin{sphinxadmonition}{warning}{Warning:} It is not safe to write to the output array. Multiple elements may point to the same piece of memory, so modifying one value may change others. \end{sphinxadmonition} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1D array or sequence{]} Array or sequence containing the data. \item[{\sphinxstylestrong{n}}] \leavevmode{[}integer{]} The number of data points in each window. \item[{\sphinxstylestrong{noverlap}}] \leavevmode{[}integer{]} The overlap between adjacent windows. Default is 0 (no overlap) \item[{\sphinxstylestrong{axis}}] \leavevmode{[}integer{]} The axis along which the windows will run. \end{description} \end{description}\end{quote} \paragraph{References} \sphinxhref{http://stackoverflow.com/a/6811241}{stackoverflow: Rolling window for 1D arrays in Numpy?} \sphinxhref{http://stackoverflow.com/a/4947453}{stackoverflow: Using strides for an efficient moving average filter} \end{fulllineitems} \index{vector\_lengths() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.vector_lengths}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{vector\_lengths}}}{\emph{X}, \emph{P=2.0}, \emph{axis=None}}{}~ \DUrole{versionmodified}{Deprecated since version 2.2: }The vector\_lengths function was deprecated in version 2.2. Finds the length of a set of vectors in \sphinxstyleemphasis{n} dimensions. This is like the \sphinxcode{\sphinxupquote{numpy.norm()}} function for vectors, but has the ability to work over a particular axis of the supplied array or matrix. Computes \sphinxcode{\sphinxupquote{(sum((x\_i)\textasciicircum{}P))\textasciicircum{}(1/P)}} for each \sphinxcode{\sphinxupquote{\{x\_i\}}} being the elements of \sphinxstyleemphasis{X} along the given axis. If \sphinxstyleemphasis{axis} is \sphinxstyleemphasis{None}, compute over all elements of \sphinxstyleemphasis{X}. \end{fulllineitems} \index{window\_hanning() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{window\_hanning}}}{\emph{x}}{} Return x times the hanning window of len(x). \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_none()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_none}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_none()}}}}} is another window algorithm. \end{description} \end{fulllineitems} \index{window\_none() (in module matplotlib.mlab)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/mlab_api:matplotlib.mlab.window_none}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.mlab.}}\sphinxbfcode{\sphinxupquote{window\_none}}}{\emph{x}}{} No window function; simply return x. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}}}] \leavevmode {\hyperref[\detokenize{api/mlab_api:matplotlib.mlab.window_hanning}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{window\_hanning()}}}}} is another window algorithm. \end{description} \end{fulllineitems} \chapter{offsetbox} \label{\detokenize{api/offsetbox_api:offsetbox}}\label{\detokenize{api/offsetbox_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.offsetbox}}} \label{\detokenize{api/offsetbox_api:module-matplotlib.offsetbox}}\label{\detokenize{api/offsetbox_api:matplotlib-offsetbox}}\index{matplotlib.offsetbox (module)} The OffsetBox is a simple container artist. The child artist are meant to be drawn at a relative position to its parent. The {[}VH{]}Packer, DrawingArea and TextArea are derived from the OffsetBox. The {[}VH{]}Packer automatically adjust the relative postisions of their children, which should be instances of the OffsetBox. This is used to align similar artists together, e.g., in legend. The DrawingArea can contain any Artist as a child. The DrawingArea has a fixed width and height. The position of children relative to the parent is fixed. The TextArea is contains a single Text instance. The width and height of the TextArea instance is the width and height of the its child text. \index{AnchoredOffsetbox (class in matplotlib.offsetbox)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnchoredOffsetbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.offsetbox.}}\sphinxbfcode{\sphinxupquote{AnchoredOffsetbox}}}{\emph{loc}, \emph{pad=0.4}, \emph{borderpad=0.5}, \emph{child=None}, \emph{prop=None}, \emph{frameon=True}, \emph{bbox\_to\_anchor=None}, \emph{bbox\_transform=None}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.offsetbox.OffsetBox}}}}} An offset box placed according to the legend location loc. AnchoredOffsetbox has a single child. When multiple children is needed, use other OffsetBox class to enclose them. By default, the offset box is anchored against its parent axes. You may explicitly specify the bbox\_to\_anchor. loc is a string or an integer specifying the legend location. The valid location codes are: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{upper right}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{upper left}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lower left}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lower right}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{p}{(}\PYG{n}{same} \PYG{k}{as} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{k}{for} \PYG{n}{back}\PYG{o}{\PYGZhy{}}\PYG{n}{compatibility}\PYG{p}{)} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center left}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{l+m+mi}{6}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center right}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{l+m+mi}{7}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lower center}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{l+m+mi}{8}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{upper center}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{l+m+mi}{9}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{l+m+mi}{10}\PYG{p}{,} \end{sphinxVerbatim} \begin{description} \item[{pad}] \leavevmode{[}pad around the child for drawing a frame. given in{]} fraction of fontsize. \end{description} borderpad : pad between offsetbox frame and the bbox\_to\_anchor, child : OffsetBox instance that will be anchored. prop : font property. This is only used as a reference for paddings. frameon : draw a frame box if True. bbox\_to\_anchor : bbox to anchor. Use self.axes.bbox if None. bbox\_transform : with which the bbox\_to\_anchor will be transformed. \index{codes (matplotlib.offsetbox.AnchoredOffsetbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnchoredOffsetbox.codes}}\pysigline{\sphinxbfcode{\sphinxupquote{codes}}\sphinxbfcode{\sphinxupquote{ = \{'center': 10, 'center left': 6, 'center right': 7, 'lower center': 8, 'lower left': 3, 'lower right': 4, 'right': 5, 'upper center': 9, 'upper left': 2, 'upper right': 1\}}}} \end{fulllineitems} \index{draw() (matplotlib.offsetbox.AnchoredOffsetbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnchoredOffsetbox.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} draw the artist \end{fulllineitems} \index{get\_bbox\_to\_anchor() (matplotlib.offsetbox.AnchoredOffsetbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnchoredOffsetbox.get_bbox_to_anchor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_bbox\_to\_anchor}}}{}{} return the bbox that the legend will be anchored \end{fulllineitems} \index{get\_child() (matplotlib.offsetbox.AnchoredOffsetbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnchoredOffsetbox.get_child}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_child}}}{}{} return the child \end{fulllineitems} \index{get\_children() (matplotlib.offsetbox.AnchoredOffsetbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnchoredOffsetbox.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} return the list of children \end{fulllineitems} \index{get\_extent() (matplotlib.offsetbox.AnchoredOffsetbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnchoredOffsetbox.get_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_extent}}}{\emph{renderer}}{} return the extent of the artist. The extent of the child added with the pad is returned \end{fulllineitems} \index{get\_window\_extent() (matplotlib.offsetbox.AnchoredOffsetbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnchoredOffsetbox.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} get the bounding box in display space. \end{fulllineitems} \index{set\_bbox\_to\_anchor() (matplotlib.offsetbox.AnchoredOffsetbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_bbox\_to\_anchor}}}{\emph{bbox}, \emph{transform=None}}{} set the bbox that the child will be anchored. \sphinxstyleemphasis{bbox} can be a Bbox instance, a list of {[}left, bottom, width, height{]}, or a list of {[}left, bottom{]} where the width and height will be assumed to be zero. The bbox will be transformed to display coordinate by the given transform. \end{fulllineitems} \index{set\_child() (matplotlib.offsetbox.AnchoredOffsetbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnchoredOffsetbox.set_child}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_child}}}{\emph{child}}{} set the child to be anchored \end{fulllineitems} \index{update\_frame() (matplotlib.offsetbox.AnchoredOffsetbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnchoredOffsetbox.update_frame}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_frame}}}{\emph{bbox}, \emph{fontsize=None}}{}~ \end{fulllineitems} \index{zorder (matplotlib.offsetbox.AnchoredOffsetbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnchoredOffsetbox.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 5}}} \end{fulllineitems} \end{fulllineitems} \index{AnchoredText (class in matplotlib.offsetbox)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnchoredText}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.offsetbox.}}\sphinxbfcode{\sphinxupquote{AnchoredText}}}{\emph{s}, \emph{loc}, \emph{pad=0.4}, \emph{borderpad=0.5}, \emph{prop=None}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnchoredOffsetbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.offsetbox.AnchoredOffsetbox}}}}} AnchoredOffsetbox with Text. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}string{]} Text. \item[{\sphinxstylestrong{loc}}] \leavevmode{[}str{]} Location code. \item[{\sphinxstylestrong{pad}}] \leavevmode{[}float, optional{]} Pad between the text and the frame as fraction of the font size. \item[{\sphinxstylestrong{borderpad}}] \leavevmode{[}float, optional{]} Pad between the frame and the axes (or \sphinxstyleemphasis{bbox\_to\_anchor}). \item[{\sphinxstylestrong{prop}}] \leavevmode{[}{\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}}{]} Font properties. \end{description} \end{description}\end{quote} \paragraph{Notes} Other keyword parameters of {\hyperref[\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnchoredOffsetbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AnchoredOffsetbox}}}}} are also allowed. \end{fulllineitems} \index{AnnotationBbox (class in matplotlib.offsetbox)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnnotationBbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.offsetbox.}}\sphinxbfcode{\sphinxupquote{AnnotationBbox}}}{\emph{offsetbox}, \emph{xy}, \emph{xybox=None}, \emph{xycoords='data'}, \emph{boxcoords=None}, \emph{frameon=True}, \emph{pad=0.4}, \emph{annotation\_clip=None}, \emph{box\_alignment=(0.5}, \emph{0.5)}, \emph{bboxprops=None}, \emph{arrowprops=None}, \emph{fontsize=None}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.Artist}}}}}, \sphinxcode{\sphinxupquote{matplotlib.text.\_AnnotationBase}} Annotation-like class, but with offsetbox instead of Text. \sphinxstyleemphasis{offsetbox} : OffsetBox instance \begin{description} \item[{\sphinxstyleemphasis{xycoords}}] \leavevmode{[}same as Annotation but can be a tuple of two{]} strings which are interpreted as x and y coordinates. \item[{\sphinxstyleemphasis{boxcoords}}] \leavevmode{[}similar to textcoords as Annotation but can be a{]} tuple of two strings which are interpreted as x and y coordinates. \item[{\sphinxstyleemphasis{box\_alignment}}] \leavevmode{[}a tuple of two floats for a vertical and{]} horizontal alignment of the offset box w.r.t. the \sphinxstyleemphasis{boxcoords}. The lower-left corner is (0.0) and upper-right corner is (1.1). \end{description} other parameters are identical to that of Annotation. \index{anncoords (matplotlib.offsetbox.AnnotationBbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnnotationBbox.anncoords}}\pysigline{\sphinxbfcode{\sphinxupquote{anncoords}}}~ \end{fulllineitems} \index{contains() (matplotlib.offsetbox.AnnotationBbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnnotationBbox.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{event}}{} Test whether the artist contains the mouse event. Returns the truth value and a dictionary of artist specific details of selection, such as which points are contained in the pick radius. See individual artists for details. \end{fulllineitems} \index{draw() (matplotlib.offsetbox.AnnotationBbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnnotationBbox.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draw the \sphinxcode{\sphinxupquote{Annotation}} object to the given \sphinxstyleemphasis{renderer}. \end{fulllineitems} \index{get\_children() (matplotlib.offsetbox.AnnotationBbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnnotationBbox.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of the child \sphinxcode{\sphinxupquote{Artist{}`s this :class:{}`Artist}} contains. \end{fulllineitems} \index{get\_fontsize() (matplotlib.offsetbox.AnnotationBbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnnotationBbox.get_fontsize}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fontsize}}}{\emph{s=None}}{} return fontsize in points \end{fulllineitems} \index{set\_figure() (matplotlib.offsetbox.AnnotationBbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnnotationBbox.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_fontsize() (matplotlib.offsetbox.AnnotationBbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnnotationBbox.set_fontsize}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_fontsize}}}{\emph{s=None}}{} set fontsize in points \end{fulllineitems} \index{update\_positions() (matplotlib.offsetbox.AnnotationBbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnnotationBbox.update_positions}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_positions}}}{\emph{renderer}}{} Update the pixel positions of the annotated point and the text. \end{fulllineitems} \index{xyann (matplotlib.offsetbox.AnnotationBbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnnotationBbox.xyann}}\pysigline{\sphinxbfcode{\sphinxupquote{xyann}}}~ \end{fulllineitems} \index{zorder (matplotlib.offsetbox.AnnotationBbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AnnotationBbox.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 3}}} \end{fulllineitems} \end{fulllineitems} \index{AuxTransformBox (class in matplotlib.offsetbox)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AuxTransformBox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.offsetbox.}}\sphinxbfcode{\sphinxupquote{AuxTransformBox}}}{\emph{aux\_transform}}{} Bases: {\hyperref[\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.offsetbox.OffsetBox}}}}} Offset Box with the aux\_transform . Its children will be transformed with the aux\_transform first then will be offseted. The absolute coordinate of the aux\_transform is meaning as it will be automatically adjust so that the left-lower corner of the bounding box of children will be set to (0,0) before the offset transform. It is similar to drawing area, except that the extent of the box is not predetermined but calculated from the window extent of its children. Furthermore, the extent of the children will be calculated in the transformed coordinate. \index{add\_artist() (matplotlib.offsetbox.AuxTransformBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AuxTransformBox.add_artist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_artist}}}{\emph{a}}{} Add any {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} to the container box \end{fulllineitems} \index{draw() (matplotlib.offsetbox.AuxTransformBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AuxTransformBox.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draw the children \end{fulllineitems} \index{get\_extent() (matplotlib.offsetbox.AuxTransformBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AuxTransformBox.get_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_extent}}}{\emph{renderer}}{} Return with, height, xdescent, ydescent of box \end{fulllineitems} \index{get\_offset() (matplotlib.offsetbox.AuxTransformBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AuxTransformBox.get_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset}}}{}{} return offset of the container. \end{fulllineitems} \index{get\_transform() (matplotlib.offsetbox.AuxTransformBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AuxTransformBox.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} applied to the children \end{fulllineitems} \index{get\_window\_extent() (matplotlib.offsetbox.AuxTransformBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AuxTransformBox.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} get the bounding box in display space. \end{fulllineitems} \index{set\_offset() (matplotlib.offsetbox.AuxTransformBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AuxTransformBox.set_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset}}}{\emph{xy}}{} set offset of the container. Accept : tuple of x,y coordinate in display units. \end{fulllineitems} \index{set\_transform() (matplotlib.offsetbox.AuxTransformBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.AuxTransformBox.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} set\_transform is ignored. \end{fulllineitems} \end{fulllineitems} \index{DraggableAnnotation (class in matplotlib.offsetbox)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableAnnotation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.offsetbox.}}\sphinxbfcode{\sphinxupquote{DraggableAnnotation}}}{\emph{annotation}, \emph{use\_blit=False}}{} Bases: {\hyperref[\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.offsetbox.DraggableBase}}}}} \index{save\_offset() (matplotlib.offsetbox.DraggableAnnotation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableAnnotation.save_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{save\_offset}}}{}{}~ \end{fulllineitems} \index{update\_offset() (matplotlib.offsetbox.DraggableAnnotation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableAnnotation.update_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_offset}}}{\emph{dx}, \emph{dy}}{}~ \end{fulllineitems} \end{fulllineitems} \index{DraggableBase (class in matplotlib.offsetbox)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.offsetbox.}}\sphinxbfcode{\sphinxupquote{DraggableBase}}}{\emph{ref\_artist}, \emph{use\_blit=False}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} helper code for a draggable artist (legend, offsetbox) The derived class must override following two method. \begin{quote} \begin{description} \item[{def save\_offset(self):}] \leavevmode pass \item[{def update\_offset(self, dx, dy):}] \leavevmode pass \end{description} \end{quote} \sphinxstyleemphasis{save\_offset} is called when the object is picked for dragging and it is meant to save reference position of the artist. \begin{description} \item[{\sphinxstyleemphasis{update\_offset} is called during the dragging. dx and dy is the pixel}] \leavevmode offset from the point where the mouse drag started. \end{description} Optionally you may override following two methods. \begin{quote} \begin{description} \item[{def artist\_picker(self, artist, evt):}] \leavevmode return self.ref\_artist.contains(evt) \item[{def finalize\_offset(self):}] \leavevmode pass \end{description} \end{quote} \begin{description} \item[{\sphinxstyleemphasis{artist\_picker} is a picker method that will be}] \leavevmode used. \sphinxstyleemphasis{finalize\_offset} is called when the mouse is released. In current implementation of DraggableLegend and DraggableAnnotation, \sphinxstyleemphasis{update\_offset} places the artists simply in display coordinates. And \sphinxstyleemphasis{finalize\_offset} recalculate their position in the normalized axes coordinate and set a relavant attribute. \end{description} \index{artist\_picker() (matplotlib.offsetbox.DraggableBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableBase.artist_picker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{artist\_picker}}}{\emph{artist}, \emph{evt}}{}~ \end{fulllineitems} \index{disconnect() (matplotlib.offsetbox.DraggableBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableBase.disconnect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{disconnect}}}{}{} disconnect the callbacks \end{fulllineitems} \index{finalize\_offset() (matplotlib.offsetbox.DraggableBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableBase.finalize_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{finalize\_offset}}}{}{}~ \end{fulllineitems} \index{on\_motion() (matplotlib.offsetbox.DraggableBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableBase.on_motion}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{on\_motion}}}{\emph{evt}}{}~ \end{fulllineitems} \index{on\_motion\_blit() (matplotlib.offsetbox.DraggableBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableBase.on_motion_blit}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{on\_motion\_blit}}}{\emph{evt}}{}~ \end{fulllineitems} \index{on\_pick() (matplotlib.offsetbox.DraggableBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableBase.on_pick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{on\_pick}}}{\emph{evt}}{}~ \end{fulllineitems} \index{on\_release() (matplotlib.offsetbox.DraggableBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableBase.on_release}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{on\_release}}}{\emph{event}}{}~ \end{fulllineitems} \index{save\_offset() (matplotlib.offsetbox.DraggableBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableBase.save_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{save\_offset}}}{}{}~ \end{fulllineitems} \index{update\_offset() (matplotlib.offsetbox.DraggableBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableBase.update_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_offset}}}{\emph{dx}, \emph{dy}}{}~ \end{fulllineitems} \end{fulllineitems} \index{DraggableOffsetBox (class in matplotlib.offsetbox)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableOffsetBox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.offsetbox.}}\sphinxbfcode{\sphinxupquote{DraggableOffsetBox}}}{\emph{ref\_artist}, \emph{offsetbox}, \emph{use\_blit=False}}{} Bases: {\hyperref[\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.offsetbox.DraggableBase}}}}} \index{get\_loc\_in\_canvas() (matplotlib.offsetbox.DraggableOffsetBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableOffsetBox.get_loc_in_canvas}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_loc\_in\_canvas}}}{}{}~ \end{fulllineitems} \index{save\_offset() (matplotlib.offsetbox.DraggableOffsetBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableOffsetBox.save_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{save\_offset}}}{}{}~ \end{fulllineitems} \index{update\_offset() (matplotlib.offsetbox.DraggableOffsetBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DraggableOffsetBox.update_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_offset}}}{\emph{dx}, \emph{dy}}{}~ \end{fulllineitems} \end{fulllineitems} \index{DrawingArea (class in matplotlib.offsetbox)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DrawingArea}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.offsetbox.}}\sphinxbfcode{\sphinxupquote{DrawingArea}}}{\emph{width}, \emph{height}, \emph{xdescent=0.0}, \emph{ydescent=0.0}, \emph{clip=False}}{} Bases: {\hyperref[\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.offsetbox.OffsetBox}}}}} The DrawingArea can contain any Artist as a child. The DrawingArea has a fixed width and height. The position of children relative to the parent is fixed. The children can be clipped at the boundaries of the parent. \sphinxstyleemphasis{width}, \sphinxstyleemphasis{height} : width and height of the container box. \sphinxstyleemphasis{xdescent}, \sphinxstyleemphasis{ydescent} : descent of the box in x- and y-direction. \sphinxstyleemphasis{clip} : Whether to clip the children \index{add\_artist() (matplotlib.offsetbox.DrawingArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DrawingArea.add_artist}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_artist}}}{\emph{a}}{} Add any {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} to the container box \end{fulllineitems} \index{clip\_children (matplotlib.offsetbox.DrawingArea attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DrawingArea.clip_children}}\pysigline{\sphinxbfcode{\sphinxupquote{clip\_children}}} If the children of this DrawingArea should be clipped by DrawingArea bounding box. \end{fulllineitems} \index{draw() (matplotlib.offsetbox.DrawingArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DrawingArea.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draw the children \end{fulllineitems} \index{get\_extent() (matplotlib.offsetbox.DrawingArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DrawingArea.get_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_extent}}}{\emph{renderer}}{} Return with, height, xdescent, ydescent of box \end{fulllineitems} \index{get\_offset() (matplotlib.offsetbox.DrawingArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DrawingArea.get_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset}}}{}{} return offset of the container. \end{fulllineitems} \index{get\_transform() (matplotlib.offsetbox.DrawingArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DrawingArea.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} applied to the children \end{fulllineitems} \index{get\_window\_extent() (matplotlib.offsetbox.DrawingArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DrawingArea.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} get the bounding box in display space. \end{fulllineitems} \index{set\_offset() (matplotlib.offsetbox.DrawingArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DrawingArea.set_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset}}}{\emph{xy}}{} set offset of the container. Accept : tuple of x,y coordinate in display units. \end{fulllineitems} \index{set\_transform() (matplotlib.offsetbox.DrawingArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.DrawingArea.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} set\_transform is ignored. \end{fulllineitems} \end{fulllineitems} \index{HPacker (class in matplotlib.offsetbox)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.HPacker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.offsetbox.}}\sphinxbfcode{\sphinxupquote{HPacker}}}{\emph{pad=None}, \emph{sep=None}, \emph{width=None}, \emph{height=None}, \emph{align='baseline'}, \emph{mode='fixed'}, \emph{children=None}}{} Bases: {\hyperref[\detokenize{api/offsetbox_api:matplotlib.offsetbox.PackerBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.offsetbox.PackerBase}}}}} The HPacker has its children packed horizontally. It automatically adjusts the relative positions of children at draw time. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{pad}}] \leavevmode{[}float, optional{]} Boundary pad. \item[{\sphinxstylestrong{sep}}] \leavevmode{[}float, optional{]} Spacing between items. \item[{\sphinxstylestrong{width}}] \leavevmode{[}float, optional{]} \item[{\sphinxstylestrong{height}}] \leavevmode{[}float, optional{]} Width and height of the container box, calculated if \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}. \item[{\sphinxstylestrong{align}}] \leavevmode{[}str{]} Alignment of boxes. \item[{\sphinxstylestrong{mode}}] \leavevmode{[}str{]} Packing mode. \end{description} \end{description}\end{quote} \paragraph{Notes} \sphinxstyleemphasis{pad} and \sphinxstyleemphasis{sep} need to given in points and will be scale with the renderer dpi, while \sphinxstyleemphasis{width} and \sphinxstyleemphasis{height} need to be in pixels. \index{get\_extent\_offsets() (matplotlib.offsetbox.HPacker method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.HPacker.get_extent_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_extent\_offsets}}}{\emph{renderer}}{} update offset of children and return the extents of the box \end{fulllineitems} \end{fulllineitems} \index{OffsetBox (class in matplotlib.offsetbox)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.offsetbox.}}\sphinxbfcode{\sphinxupquote{OffsetBox}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.Artist}}}}} The OffsetBox is a simple container artist. The child artist are meant to be drawn at a relative position to its parent. \index{axes (matplotlib.offsetbox.OffsetBox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox.axes}}\pysigline{\sphinxbfcode{\sphinxupquote{axes}}} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance the artist resides in, or \sphinxstyleemphasis{None}. \end{fulllineitems} \index{contains() (matplotlib.offsetbox.OffsetBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the artist contains the mouse event. Returns the truth value and a dictionary of artist specific details of selection, such as which points are contained in the pick radius. See individual artists for details. \end{fulllineitems} \index{draw() (matplotlib.offsetbox.OffsetBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Update the location of children if necessary and draw them to the given \sphinxstyleemphasis{renderer}. \end{fulllineitems} \index{get\_children() (matplotlib.offsetbox.OffsetBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of artists it contains. \end{fulllineitems} \index{get\_extent() (matplotlib.offsetbox.OffsetBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox.get_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_extent}}}{\emph{renderer}}{} Return with, height, xdescent, ydescent of box \end{fulllineitems} \index{get\_extent\_offsets() (matplotlib.offsetbox.OffsetBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox.get_extent_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_extent\_offsets}}}{\emph{renderer}}{}~ \end{fulllineitems} \index{get\_offset() (matplotlib.offsetbox.OffsetBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox.get_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset}}}{\emph{width}, \emph{height}, \emph{xdescent}, \emph{ydescent}, \emph{renderer}}{} Get the offset accepts extent of the box \end{fulllineitems} \index{get\_visible\_children() (matplotlib.offsetbox.OffsetBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox.get_visible_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_visible\_children}}}{}{} Return a list of visible artists it contains. \end{fulllineitems} \index{get\_window\_extent() (matplotlib.offsetbox.OffsetBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} get the bounding box in display space. \end{fulllineitems} \index{set\_figure() (matplotlib.offsetbox.OffsetBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the figure accepts a class:{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \end{fulllineitems} \index{set\_height() (matplotlib.offsetbox.OffsetBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox.set_height}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_height}}}{\emph{height}}{} Set the height accepts float \end{fulllineitems} \index{set\_offset() (matplotlib.offsetbox.OffsetBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox.set_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset}}}{\emph{xy}}{} Set the offset accepts x, y, tuple, or a callable object. \end{fulllineitems} \index{set\_width() (matplotlib.offsetbox.OffsetBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox.set_width}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_width}}}{\emph{width}}{} Set the width accepts float \end{fulllineitems} \end{fulllineitems} \index{OffsetImage (class in matplotlib.offsetbox)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetImage}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.offsetbox.}}\sphinxbfcode{\sphinxupquote{OffsetImage}}}{\emph{arr}, \emph{zoom=1}, \emph{cmap=None}, \emph{norm=None}, \emph{interpolation=None}, \emph{origin=None}, \emph{filternorm=1}, \emph{filterrad=4.0}, \emph{resample=False}, \emph{dpi\_cor=True}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.offsetbox.OffsetBox}}}}} \index{draw() (matplotlib.offsetbox.OffsetImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetImage.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draw the children \end{fulllineitems} \index{get\_children() (matplotlib.offsetbox.OffsetImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetImage.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return a list of artists it contains. \end{fulllineitems} \index{get\_data() (matplotlib.offsetbox.OffsetImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetImage.get_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_data}}}{}{}~ \end{fulllineitems} \index{get\_extent() (matplotlib.offsetbox.OffsetImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetImage.get_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_extent}}}{\emph{renderer}}{} Return with, height, xdescent, ydescent of box \end{fulllineitems} \index{get\_offset() (matplotlib.offsetbox.OffsetImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetImage.get_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset}}}{}{} return offset of the container. \end{fulllineitems} \index{get\_window\_extent() (matplotlib.offsetbox.OffsetImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetImage.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} get the bounding box in display space. \end{fulllineitems} \index{get\_zoom() (matplotlib.offsetbox.OffsetImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetImage.get_zoom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zoom}}}{}{}~ \end{fulllineitems} \index{set\_data() (matplotlib.offsetbox.OffsetImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetImage.set_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_data}}}{\emph{arr}}{}~ \end{fulllineitems} \index{set\_zoom() (matplotlib.offsetbox.OffsetImage method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetImage.set_zoom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zoom}}}{\emph{zoom}}{}~ \end{fulllineitems} \end{fulllineitems} \index{PackerBase (class in matplotlib.offsetbox)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.PackerBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.offsetbox.}}\sphinxbfcode{\sphinxupquote{PackerBase}}}{\emph{pad=None}, \emph{sep=None}, \emph{width=None}, \emph{height=None}, \emph{align=None}, \emph{mode=None}, \emph{children=None}}{} Bases: {\hyperref[\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.offsetbox.OffsetBox}}}}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{pad}}] \leavevmode{[}float, optional{]} Boundary pad. \item[{\sphinxstylestrong{sep}}] \leavevmode{[}float, optional{]} Spacing between items. \item[{\sphinxstylestrong{width}}] \leavevmode{[}float, optional{]} \item[{\sphinxstylestrong{height}}] \leavevmode{[}float, optional{]} Width and height of the container box, calculated if \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}. \item[{\sphinxstylestrong{align}}] \leavevmode{[}str, optional{]} Alignment of boxes. Can be one of \sphinxcode{\sphinxupquote{top}}, \sphinxcode{\sphinxupquote{bottom}}, \sphinxcode{\sphinxupquote{left}}, \sphinxcode{\sphinxupquote{right}}, \sphinxcode{\sphinxupquote{center}} and \sphinxcode{\sphinxupquote{baseline}} \item[{\sphinxstylestrong{mode}}] \leavevmode{[}str, optional{]} Packing mode. \end{description} \end{description}\end{quote} \paragraph{Notes} \sphinxstyleemphasis{pad} and \sphinxstyleemphasis{sep} need to given in points and will be scale with the renderer dpi, while \sphinxstyleemphasis{width} and \sphinxstyleemphasis{height} need to be in pixels. \end{fulllineitems} \index{PaddedBox (class in matplotlib.offsetbox)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.PaddedBox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.offsetbox.}}\sphinxbfcode{\sphinxupquote{PaddedBox}}}{\emph{child}, \emph{pad=None}, \emph{draw\_frame=False}, \emph{patch\_attrs=None}}{} Bases: {\hyperref[\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.offsetbox.OffsetBox}}}}} \sphinxstyleemphasis{pad} : boundary pad \begin{sphinxadmonition}{note}{Note:} \sphinxstyleemphasis{pad} need to given in points and will be scale with the renderer dpi, while \sphinxstyleemphasis{width} and \sphinxstyleemphasis{height} need to be in pixels. \end{sphinxadmonition} \index{draw() (matplotlib.offsetbox.PaddedBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.PaddedBox.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Update the location of children if necessary and draw them to the given \sphinxstyleemphasis{renderer}. \end{fulllineitems} \index{draw\_frame() (matplotlib.offsetbox.PaddedBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.PaddedBox.draw_frame}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_frame}}}{\emph{renderer}}{}~ \end{fulllineitems} \index{get\_extent\_offsets() (matplotlib.offsetbox.PaddedBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.PaddedBox.get_extent_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_extent\_offsets}}}{\emph{renderer}}{} update offset of childrens and return the extents of the box \end{fulllineitems} \index{update\_frame() (matplotlib.offsetbox.PaddedBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.PaddedBox.update_frame}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_frame}}}{\emph{bbox}, \emph{fontsize=None}}{}~ \end{fulllineitems} \end{fulllineitems} \index{TextArea (class in matplotlib.offsetbox)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.TextArea}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.offsetbox.}}\sphinxbfcode{\sphinxupquote{TextArea}}}{\emph{s}, \emph{textprops=None}, \emph{multilinebaseline=None}, \emph{minimumdescent=True}}{} Bases: {\hyperref[\detokenize{api/offsetbox_api:matplotlib.offsetbox.OffsetBox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.offsetbox.OffsetBox}}}}} The TextArea is contains a single Text instance. The text is placed at (0,0) with baseline+left alignment. The width and height of the TextArea instance is the width and height of the its child text. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}str{]} a string to be displayed. \item[{\sphinxstylestrong{textprops}}] \leavevmode{[}{\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FontProperties}}}}}, optional{]} \item[{\sphinxstylestrong{multilinebaseline}}] \leavevmode{[}bool, optional{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, baseline for multiline text is adjusted so that it is (approximatedly) center-aligned with singleline text. \item[{\sphinxstylestrong{minimumdescent}}] \leavevmode{[}bool, optional{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, the box has a minimum descent of “p”. \end{description} \end{description}\end{quote} \index{draw() (matplotlib.offsetbox.TextArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.TextArea.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draw the children \end{fulllineitems} \index{get\_extent() (matplotlib.offsetbox.TextArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.TextArea.get_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_extent}}}{\emph{renderer}}{} Return with, height, xdescent, ydescent of box \end{fulllineitems} \index{get\_minimumdescent() (matplotlib.offsetbox.TextArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.TextArea.get_minimumdescent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_minimumdescent}}}{}{} get minimumdescent. \end{fulllineitems} \index{get\_multilinebaseline() (matplotlib.offsetbox.TextArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.TextArea.get_multilinebaseline}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_multilinebaseline}}}{}{} get multilinebaseline . \end{fulllineitems} \index{get\_offset() (matplotlib.offsetbox.TextArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.TextArea.get_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset}}}{}{} return offset of the container. \end{fulllineitems} \index{get\_text() (matplotlib.offsetbox.TextArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.TextArea.get_text}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_text}}}{}{} Returns the string representation of this area’s text \end{fulllineitems} \index{get\_window\_extent() (matplotlib.offsetbox.TextArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.TextArea.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} get the bounding box in display space. \end{fulllineitems} \index{set\_minimumdescent() (matplotlib.offsetbox.TextArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.TextArea.set_minimumdescent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_minimumdescent}}}{\emph{t}}{} Set minimumdescent . If True, extent of the single line text is adjusted so that it has minimum descent of “p” \end{fulllineitems} \index{set\_multilinebaseline() (matplotlib.offsetbox.TextArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.TextArea.set_multilinebaseline}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_multilinebaseline}}}{\emph{t}}{} Set multilinebaseline . If True, baseline for multiline text is adjusted so that it is (approximatedly) center-aligned with singleline text. \end{fulllineitems} \index{set\_offset() (matplotlib.offsetbox.TextArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.TextArea.set_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset}}}{\emph{xy}}{} set offset of the container. Accept : tuple of x,y coordinates in display units. \end{fulllineitems} \index{set\_text() (matplotlib.offsetbox.TextArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.TextArea.set_text}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_text}}}{\emph{s}}{} Set the text of this area as a string. \end{fulllineitems} \index{set\_transform() (matplotlib.offsetbox.TextArea method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.TextArea.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} set\_transform is ignored. \end{fulllineitems} \end{fulllineitems} \index{VPacker (class in matplotlib.offsetbox)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.VPacker}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.offsetbox.}}\sphinxbfcode{\sphinxupquote{VPacker}}}{\emph{pad=None}, \emph{sep=None}, \emph{width=None}, \emph{height=None}, \emph{align='baseline'}, \emph{mode='fixed'}, \emph{children=None}}{} Bases: {\hyperref[\detokenize{api/offsetbox_api:matplotlib.offsetbox.PackerBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.offsetbox.PackerBase}}}}} The VPacker has its children packed vertically. It automatically adjust the relative positions of children in the drawing time. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{pad}}] \leavevmode{[}float, optional{]} Boundary pad. \item[{\sphinxstylestrong{sep}}] \leavevmode{[}float, optional{]} Spacing between items. \item[{\sphinxstylestrong{width}}] \leavevmode{[}float, optional{]} \item[{\sphinxstylestrong{height}}] \leavevmode{[}float, optional{]} width and height of the container box, calculated if \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}. \item[{\sphinxstylestrong{align}}] \leavevmode{[}str, optional{]} Alignment of boxes. \item[{\sphinxstylestrong{mode}}] \leavevmode{[}str, optional{]} Packing mode. \end{description} \end{description}\end{quote} \paragraph{Notes} \sphinxstyleemphasis{pad} and \sphinxstyleemphasis{sep} need to given in points and will be scale with the renderer dpi, while \sphinxstyleemphasis{width} and \sphinxstyleemphasis{height} need to be in pixels. \index{get\_extent\_offsets() (matplotlib.offsetbox.VPacker method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.VPacker.get_extent_offsets}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_extent\_offsets}}}{\emph{renderer}}{} update offset of childrens and return the extents of the box \end{fulllineitems} \end{fulllineitems} \index{bbox\_artist() (in module matplotlib.offsetbox)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/offsetbox_api:matplotlib.offsetbox.bbox_artist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.offsetbox.}}\sphinxbfcode{\sphinxupquote{bbox\_artist}}}{\emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \chapter{patches} \label{\detokenize{api/patches_api:patches}}\label{\detokenize{api/patches_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.patches}}} \label{\detokenize{api/patches_api:module-matplotlib.patches}}\label{\detokenize{api/patches_api:matplotlib-patches}}\index{matplotlib.patches (module)} \subsection{Classes} \label{\detokenize{api/patches_api:classes}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Arc:matplotlib.patches.Arc}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Arc}}}}}(xy, width, height{[}, angle, theta1, theta2{]}) & An elliptical arc. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Arrow:matplotlib.patches.Arrow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Arrow}}}}}(x, y, dx, dy{[}, width{]}) & An arrow patch. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ArrowStyle}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ArrowStyle}}}}} is a container class which defines several arrowstyle classes, which is used to create an arrow path along a given path. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BoxStyle}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BoxStyle}}}}} is a container class which defines several boxstyle classes, which are used for {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyBboxPatch}}}}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Circle:matplotlib.patches.Circle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Circle}}}}}(xy{[}, radius{]}) & A circle patch. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.CirclePolygon:matplotlib.patches.CirclePolygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CirclePolygon}}}}}(xy{[}, radius, resolution{]}) & A polygon-approximation of a circle patch. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.ConnectionPatch:matplotlib.patches.ConnectionPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ConnectionPatch}}}}}(xyA, xyB, coordsA{[}, …{]}) & A {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.ConnectionPatch:matplotlib.patches.ConnectionPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ConnectionPatch}}}}} class is to make connecting lines between two points (possibly in different axes). \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib.patches.ConnectionStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ConnectionStyle}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib.patches.ConnectionStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ConnectionStyle}}}}} is a container class which defines several connectionstyle classes, which is used to create a path between two points. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Ellipse:matplotlib.patches.Ellipse}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Ellipse}}}}}(xy, width, height{[}, angle{]}) & A scale-free ellipse. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrow:matplotlib.patches.FancyArrow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrow}}}}}(x, y, dx, dy{[}, width, …{]}) & Like Arrow, but lets you set head width and head height independently. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrowPatch}}}}}({[}posA, posB, path, …{]}) & A fancy arrow patch. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyBboxPatch}}}}}(xy, width, height{[}, …{]}) & Draw a fancy box around a rectangle with lower left at \sphinxstyleemphasis{xy*=(*x}, \sphinxstyleemphasis{y}) with specified width and height. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}}({[}edgecolor, facecolor, color, …{]}) & A patch is a 2D artist with a face color and an edge color. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.PathPatch:matplotlib.patches.PathPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathPatch}}}}}(path, **kwargs) & A general polycurve path patch. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Polygon}}}}}(xy{[}, closed{]}) & A general polygon patch. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}}(xy, width, height{[}, angle{]}) & Draw a rectangle with lower left at \sphinxstyleemphasis{xy} = (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) with specified \sphinxstyleemphasis{width}, \sphinxstyleemphasis{height} and rotation \sphinxstyleemphasis{angle}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.RegularPolygon:matplotlib.patches.RegularPolygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RegularPolygon}}}}}(xy, numVertices{[}, radius, …{]}) & A regular polygon patch. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Shadow:matplotlib.patches.Shadow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Shadow}}}}}(patch, ox, oy{[}, props{]}) & Create a shadow of the given \sphinxstyleemphasis{patch} offset by \sphinxstyleemphasis{ox}, \sphinxstyleemphasis{oy}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Wedge:matplotlib.patches.Wedge}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Wedge}}}}}(center, r, theta1, theta2{[}, width{]}) & Wedge shaped patch. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.YAArrow:matplotlib.patches.YAArrow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{YAArrow}}}}}(figure, xytip, xybase{[}, width, …{]}) & Yet another arrow class. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.patches.Arc} \label{\detokenize{api/_as_gen/matplotlib.patches.Arc:matplotlib-patches-arc}}\label{\detokenize{api/_as_gen/matplotlib.patches.Arc::doc}}\index{Arc (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Arc:matplotlib.patches.Arc}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{Arc}}}{\emph{xy}, \emph{width}, \emph{height}, \emph{angle=0.0}, \emph{theta1=0.0}, \emph{theta2=360.0}, \emph{**kwargs}}{} An elliptical arc. Because it performs various optimizations, it can not be filled. The arc must be used in an {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance—it can not be added directly to a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}—because it is optimized to only render the segments that are inside the axes bounding box with high resolution. The following args are supported: \begin{description} \item[{\sphinxstyleemphasis{xy}}] \leavevmode center of ellipse \item[{\sphinxstyleemphasis{width}}] \leavevmode length of horizontal axis \item[{\sphinxstyleemphasis{height}}] \leavevmode length of vertical axis \item[{\sphinxstyleemphasis{angle}}] \leavevmode rotation in degrees (anti-clockwise) \item[{\sphinxstyleemphasis{theta1}}] \leavevmode starting angle of the arc in degrees \item[{\sphinxstyleemphasis{theta2}}] \leavevmode ending angle of the arc in degrees \end{description} If \sphinxstyleemphasis{theta1} and \sphinxstyleemphasis{theta2} are not provided, the arc will form a complete ellipse. Valid kwargs are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \index{draw() (matplotlib.patches.Arc method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Arc:matplotlib.patches.Arc.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Ellipses are normally drawn using an approximation that uses eight cubic bezier splines. The error of this approximation is 1.89818e-6, according to this unverified source: \begin{quote} Lancaster, Don. Approximating a Circle or an Ellipse Using Four Bezier Cubic Splines. \sphinxurl{http://www.tinaja.com/glib/ellipse4.pdf} \end{quote} There is a use case where very large ellipses must be drawn with very high accuracy, and it is too expensive to render the entire ellipse with enough segments (either splines or line segments). Therefore, in the case where either radius of the ellipse is large enough that the error of the spline approximation will be visible (greater than one pixel offset from the ideal), a different technique is used. In that case, only the visible parts of the ellipse are drawn, with each visible arc using a fixed number of spline segments (8). The algorithm proceeds as follows: \begin{enumerate} \item {} The points where the ellipse intersects the axes bounding box are located. (This is done be performing an inverse transformation on the axes bbox such that it is relative to the unit circle \textendash{} this makes the intersection calculation much easier than doing rotated ellipse intersection directly). This uses the “line intersecting a circle” algorithm from: \begin{quote} Vince, John. Geometry for Computer Graphics: Formulae, Examples \& Proofs. London: Springer-Verlag, 2005. \end{quote} \item {} The angles of each of the intersection points are calculated. \item {} Proceeding counterclockwise starting in the positive x-direction, each of the visible arc-segments between the pairs of vertices are drawn using the bezier arc approximation technique implemented in {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.arc}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.path.Path.arc()}}}}}. \end{enumerate} \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.patches.Arc}}} \label{\detokenize{api/_as_gen/matplotlib.patches.Arc:examples-using-matplotlib-patches-arc}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_ellipse\_with\_units.py} \end{itemize} \subsubsection{matplotlib.patches.Arrow} \label{\detokenize{api/_as_gen/matplotlib.patches.Arrow:matplotlib-patches-arrow}}\label{\detokenize{api/_as_gen/matplotlib.patches.Arrow::doc}}\index{Arrow (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Arrow:matplotlib.patches.Arrow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{Arrow}}}{\emph{x}, \emph{y}, \emph{dx}, \emph{dy}, \emph{width=1.0}, \emph{**kwargs}}{} An arrow patch. Draws an arrow from (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) to (\sphinxstyleemphasis{x} + \sphinxstyleemphasis{dx}, \sphinxstyleemphasis{y} + \sphinxstyleemphasis{dy}). The width of the arrow is scaled by \sphinxstyleemphasis{width}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar{]} x coordinate of the arrow tail \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar{]} y coordinate of the arrow tail \item[{\sphinxstylestrong{dx}}] \leavevmode{[}scalar{]} Arrow length in the x direction \item[{\sphinxstylestrong{dy}}] \leavevmode{[}scalar{]} Arrow length in the y direction \item[{\sphinxstylestrong{width}}] \leavevmode{[}scalar, optional (default: 1){]} Scale factor for the width of the arrow. With a default value of 1, the tail width is 0.2 and head width is 0.6. \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Keyword arguments control the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} properties: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrow:matplotlib.patches.FancyArrow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrow}}}}}}] \leavevmode Patch that allows independent control of the head and tail properties \end{description} \index{get\_patch\_transform() (matplotlib.patches.Arrow method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Arrow:matplotlib.patches.Arrow.get_patch_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_patch\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance which takes patch coordinates to data coordinates. For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5. \end{fulllineitems} \index{get\_path() (matplotlib.patches.Arrow method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Arrow:matplotlib.patches.Arrow.get_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path}}}{}{} Return the path of this patch \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.patches.Arrow}}} \label{\detokenize{api/_as_gen/matplotlib.patches.Arrow:examples-using-matplotlib-patches-arrow}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_artist\_reference.py} \end{itemize} \subsubsection{matplotlib.patches.ArrowStyle} \label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib-patches-arrowstyle}}\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle::doc}}\index{ArrowStyle (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{ArrowStyle}}} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ArrowStyle}}}}} is a container class which defines several arrowstyle classes, which is used to create an arrow path along a given path. These are mainly used with {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrowPatch}}}}}. A arrowstyle object can be either created as: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ArrowStyle}\PYG{o}{.}\PYG{n}{Fancy}\PYG{p}{(}\PYG{n}{head\PYGZus{}length}\PYG{o}{=}\PYG{o}{.}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{n}{head\PYGZus{}width}\PYG{o}{=}\PYG{o}{.}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{n}{tail\PYGZus{}width}\PYG{o}{=}\PYG{o}{.}\PYG{l+m+mi}{4}\PYG{p}{)} \end{sphinxVerbatim} or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ArrowStyle}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Fancy}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{head\PYGZus{}length}\PYG{o}{=}\PYG{o}{.}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{n}{head\PYGZus{}width}\PYG{o}{=}\PYG{o}{.}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{n}{tail\PYGZus{}width}\PYG{o}{=}\PYG{o}{.}\PYG{l+m+mi}{4}\PYG{p}{)} \end{sphinxVerbatim} or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ArrowStyle}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Fancy, head\PYGZus{}length=.4, head\PYGZus{}width=.4, tail\PYGZus{}width=.4}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} The following classes are defined \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily Class &\sphinxstyletheadfamily Name &\sphinxstyletheadfamily Attrs \\ \hline Curve & \sphinxcode{\sphinxupquote{-}} & None \\ \hline CurveB & \sphinxcode{\sphinxupquote{-\textgreater{}}} & head\_length=0.4,head\_width=0.2 \\ \hline BracketB & \sphinxcode{\sphinxupquote{-{[}}} & widthB=1.0,lengthB=0.2,angleB=None \\ \hline CurveFilledB & \sphinxcode{\sphinxupquote{-\textbar{}\textgreater{}}} & head\_length=0.4,head\_width=0.2 \\ \hline CurveA & \sphinxcode{\sphinxupquote{\textless{}-}} & head\_length=0.4,head\_width=0.2 \\ \hline CurveAB & \sphinxcode{\sphinxupquote{\textless{}-\textgreater{}}} & head\_length=0.4,head\_width=0.2 \\ \hline CurveFilledA & \sphinxcode{\sphinxupquote{\textless{}\textbar{}-}} & head\_length=0.4,head\_width=0.2 \\ \hline CurveFilledAB & \sphinxcode{\sphinxupquote{\textless{}\textbar{}-\textbar{}\textgreater{}}} & head\_length=0.4,head\_width=0.2 \\ \hline BracketA & \sphinxcode{\sphinxupquote{{]}-}} & widthA=1.0,lengthA=0.2,angleA=None \\ \hline BracketAB & \sphinxcode{\sphinxupquote{{]}-{[}}} & widthA=1.0,lengthA=0.2,angleA=None,widthB=1.0,lengthB=0.2,angleB=None \\ \hline Fancy & \sphinxcode{\sphinxupquote{fancy}} & head\_length=0.4,head\_width=0.4,tail\_width=0.4 \\ \hline Simple & \sphinxcode{\sphinxupquote{simple}} & head\_length=0.5,head\_width=0.5,tail\_width=0.2 \\ \hline Wedge & \sphinxcode{\sphinxupquote{wedge}} & tail\_width=0.3,shrink\_factor=0.5 \\ \hline BarAB & \sphinxcode{\sphinxupquote{\textbar{}-\textbar{}}} & widthA=1.0,angleA=None,widthB=1.0,angleB=None \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} An instance of any arrow style class is a callable object, whose call signature is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n+nf+fm}{\PYGZus{}\PYGZus{}call\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{path}\PYG{p}{,} \PYG{n}{mutation\PYGZus{}size}\PYG{p}{,} \PYG{n}{linewidth}\PYG{p}{,} \PYG{n}{aspect\PYGZus{}ratio}\PYG{o}{=}\PYG{l+m+mf}{1.}\PYG{p}{)} \end{sphinxVerbatim} and it returns a tuple of a \sphinxcode{\sphinxupquote{Path}} instance and a boolean value. \sphinxstyleemphasis{path} is a \sphinxcode{\sphinxupquote{Path}} instance along which the arrow will be drawn. \sphinxstyleemphasis{mutation\_size} and \sphinxstyleemphasis{aspect\_ratio} have the same meaning as in {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BoxStyle}}}}}. \sphinxstyleemphasis{linewidth} is a line width to be stroked. This is meant to be used to correct the location of the head so that it does not overshoot the destination point, but not all classes support it. return the instance of the subclass with the given style name. \index{ArrowStyle.BarAB (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle.BarAB}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{BarAB}}}{\emph{widthA=1.0}, \emph{angleA=None}, \emph{widthB=1.0}, \emph{angleB=None}}{} An arrow with a bar(\textbar{}) at both ends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{widthA}}] \leavevmode{[}float, optional, default{]} Width of the bracket \item[{\sphinxstylestrong{angleA}}] \leavevmode{[}float, optional, default{]} Angle between the bracket and the line \item[{\sphinxstylestrong{widthB}}] \leavevmode{[}float, optional, default{]} Width of the bracket \item[{\sphinxstylestrong{angleB}}] \leavevmode{[}float, optional, default{]} Angle between the bracket and the line \end{description} \end{description}\end{quote} \end{fulllineitems} \index{ArrowStyle.BracketA (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle.BracketA}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{BracketA}}}{\emph{widthA=1.0}, \emph{lengthA=0.2}, \emph{angleA=None}}{} An arrow with a bracket({]}) at its end. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{widthA}}] \leavevmode{[}float, optional, default{]} Width of the bracket \item[{\sphinxstylestrong{lengthA}}] \leavevmode{[}float, optional, default{]} Length of the bracket \item[{\sphinxstylestrong{angleA}}] \leavevmode{[}float, optional, default{]} Angle between the bracket and the line \end{description} \end{description}\end{quote} \end{fulllineitems} \index{ArrowStyle.BracketAB (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle.BracketAB}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{BracketAB}}}{\emph{widthA=1.0}, \emph{lengthA=0.2}, \emph{angleA=None}, \emph{widthB=1.0}, \emph{lengthB=0.2}, \emph{angleB=None}}{} An arrow with a bracket({]}) at both ends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{widthA}}] \leavevmode{[}float, optional, default{]} Width of the bracket \item[{\sphinxstylestrong{lengthA}}] \leavevmode{[}float, optional, default{]} Length of the bracket \item[{\sphinxstylestrong{angleA}}] \leavevmode{[}float, optional, default{]} Angle between the bracket and the line \item[{\sphinxstylestrong{widthB}}] \leavevmode{[}float, optional, default{]} Width of the bracket \item[{\sphinxstylestrong{lengthB}}] \leavevmode{[}float, optional, default{]} Length of the bracket \item[{\sphinxstylestrong{angleB}}] \leavevmode{[}float, optional, default{]} Angle between the bracket and the line \end{description} \end{description}\end{quote} \end{fulllineitems} \index{ArrowStyle.BracketB (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle.BracketB}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{BracketB}}}{\emph{widthB=1.0}, \emph{lengthB=0.2}, \emph{angleB=None}}{} An arrow with a bracket({[}) at its end. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{widthB}}] \leavevmode{[}float, optional, default{]} Width of the bracket \item[{\sphinxstylestrong{lengthB}}] \leavevmode{[}float, optional, default{]} Length of the bracket \item[{\sphinxstylestrong{angleB}}] \leavevmode{[}float, optional, default{]} Angle between the bracket and the line \end{description} \end{description}\end{quote} \end{fulllineitems} \index{ArrowStyle.Curve (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle.Curve}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{Curve}}} A simple curve without any arrow head. \end{fulllineitems} \index{ArrowStyle.CurveA (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle.CurveA}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{CurveA}}}{\emph{head\_length=0.4}, \emph{head\_width=0.2}}{} An arrow with a head at its begin point. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{head\_length}}] \leavevmode{[}float, optional, default{]} Length of the arrow head \item[{\sphinxstylestrong{head\_width}}] \leavevmode{[}float, optional, default{]} Width of the arrow head \end{description} \end{description}\end{quote} \end{fulllineitems} \index{ArrowStyle.CurveAB (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle.CurveAB}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{CurveAB}}}{\emph{head\_length=0.4}, \emph{head\_width=0.2}}{} An arrow with heads both at the begin and the end point. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{head\_length}}] \leavevmode{[}float, optional, default{]} Length of the arrow head \item[{\sphinxstylestrong{head\_width}}] \leavevmode{[}float, optional, default{]} Width of the arrow head \end{description} \end{description}\end{quote} \end{fulllineitems} \index{ArrowStyle.CurveB (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle.CurveB}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{CurveB}}}{\emph{head\_length=0.4}, \emph{head\_width=0.2}}{} An arrow with a head at its end point. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{head\_length}}] \leavevmode{[}float, optional, default{]} Length of the arrow head \item[{\sphinxstylestrong{head\_width}}] \leavevmode{[}float, optional, default{]} Width of the arrow head \end{description} \end{description}\end{quote} \end{fulllineitems} \index{ArrowStyle.CurveFilledA (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle.CurveFilledA}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{CurveFilledA}}}{\emph{head\_length=0.4}, \emph{head\_width=0.2}}{} An arrow with filled triangle head at the begin. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{head\_length}}] \leavevmode{[}float, optional, default{]} Length of the arrow head \item[{\sphinxstylestrong{head\_width}}] \leavevmode{[}float, optional, default{]} Width of the arrow head \end{description} \end{description}\end{quote} \end{fulllineitems} \index{ArrowStyle.CurveFilledAB (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle.CurveFilledAB}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{CurveFilledAB}}}{\emph{head\_length=0.4}, \emph{head\_width=0.2}}{} An arrow with filled triangle heads at both ends. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{head\_length}}] \leavevmode{[}float, optional, default{]} Length of the arrow head \item[{\sphinxstylestrong{head\_width}}] \leavevmode{[}float, optional, default{]} Width of the arrow head \end{description} \end{description}\end{quote} \end{fulllineitems} \index{ArrowStyle.CurveFilledB (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle.CurveFilledB}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{CurveFilledB}}}{\emph{head\_length=0.4}, \emph{head\_width=0.2}}{} An arrow with filled triangle head at the end. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{head\_length}}] \leavevmode{[}float, optional, default{]} Length of the arrow head \item[{\sphinxstylestrong{head\_width}}] \leavevmode{[}float, optional, default{]} Width of the arrow head \end{description} \end{description}\end{quote} \end{fulllineitems} \index{ArrowStyle.Fancy (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle.Fancy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{Fancy}}}{\emph{head\_length=0.4}, \emph{head\_width=0.4}, \emph{tail\_width=0.4}}{} A fancy arrow. Only works with a quadratic bezier curve. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{head\_length}}] \leavevmode{[}float, optional, default{]} Length of the arrow head \item[{\sphinxstylestrong{head\_width}}] \leavevmode{[}float, optional, default{]} Width of the arrow head \item[{\sphinxstylestrong{tail\_width}}] \leavevmode{[}float, optional, default{]} Width of the arrow tail \end{description} \end{description}\end{quote} \index{transmute() (matplotlib.patches.ArrowStyle.Fancy method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle.Fancy.transmute}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transmute}}}{\emph{path}, \emph{mutation\_size}, \emph{linewidth}}{} The transmute method is the very core of the ArrowStyle class and must be overridden in the subclasses. It receives the path object along which the arrow will be drawn, and the mutation\_size, with which the arrow head etc. will be scaled. The linewidth may be used to adjust the path so that it does not pass beyond the given points. It returns a tuple of a Path instance and a boolean. The boolean value indicate whether the path can be filled or not. The return value can also be a list of paths and list of booleans of a same length. \end{fulllineitems} \end{fulllineitems} \index{ArrowStyle.Simple (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle.Simple}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{Simple}}}{\emph{head\_length=0.5}, \emph{head\_width=0.5}, \emph{tail\_width=0.2}}{} A simple arrow. Only works with a quadratic bezier curve. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{head\_length}}] \leavevmode{[}float, optional, default{]} Length of the arrow head \item[{\sphinxstylestrong{head\_width}}] \leavevmode{[}float, optional, default{]} Width of the arrow head \item[{\sphinxstylestrong{tail\_width}}] \leavevmode{[}float, optional, default{]} Width of the arrow tail \end{description} \end{description}\end{quote} \index{transmute() (matplotlib.patches.ArrowStyle.Simple method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle.Simple.transmute}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transmute}}}{\emph{path}, \emph{mutation\_size}, \emph{linewidth}}{} The transmute method is the very core of the ArrowStyle class and must be overridden in the subclasses. It receives the path object along which the arrow will be drawn, and the mutation\_size, with which the arrow head etc. will be scaled. The linewidth may be used to adjust the path so that it does not pass beyond the given points. It returns a tuple of a Path instance and a boolean. The boolean value indicate whether the path can be filled or not. The return value can also be a list of paths and list of booleans of a same length. \end{fulllineitems} \end{fulllineitems} \index{ArrowStyle.Wedge (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle.Wedge}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{Wedge}}}{\emph{tail\_width=0.3}, \emph{shrink\_factor=0.5}}{} Wedge(?) shape. Only works with a quadratic bezier curve. The begin point has a width of the tail\_width and the end point has a width of 0. At the middle, the width is shrink\_factor*tail\_width. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{tail\_width}}] \leavevmode{[}float, optional, default{]} Width of the tail \item[{\sphinxstylestrong{shrink\_factor}}] \leavevmode{[}float, optional, default{]} Fraction of the arrow width at the middle point \end{description} \end{description}\end{quote} \index{transmute() (matplotlib.patches.ArrowStyle.Wedge method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle.Wedge.transmute}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transmute}}}{\emph{path}, \emph{mutation\_size}, \emph{linewidth}}{} The transmute method is the very core of the ArrowStyle class and must be overridden in the subclasses. It receives the path object along which the arrow will be drawn, and the mutation\_size, with which the arrow head etc. will be scaled. The linewidth may be used to adjust the path so that it does not pass beyond the given points. It returns a tuple of a Path instance and a boolean. The boolean value indicate whether the path can be filled or not. The return value can also be a list of paths and list of booleans of a same length. \end{fulllineitems} \end{fulllineitems} \end{fulllineitems} \subsubsection{matplotlib.patches.BoxStyle} \label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib-patches-boxstyle}}\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle::doc}}\index{BoxStyle (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{BoxStyle}}} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BoxStyle}}}}} is a container class which defines several boxstyle classes, which are used for {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyBboxPatch}}}}}. A style object can be created as: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{BoxStyle}\PYG{o}{.}\PYG{n}{Round}\PYG{p}{(}\PYG{n}{pad}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)} \end{sphinxVerbatim} or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{BoxStyle}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Round}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{pad}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)} \end{sphinxVerbatim} or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{BoxStyle}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Round, pad=0.2}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} Following boxstyle classes are defined. \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily Class &\sphinxstyletheadfamily Name &\sphinxstyletheadfamily Attrs \\ \hline Circle & \sphinxcode{\sphinxupquote{circle}} & pad=0.3 \\ \hline DArrow & \sphinxcode{\sphinxupquote{darrow}} & pad=0.3 \\ \hline LArrow & \sphinxcode{\sphinxupquote{larrow}} & pad=0.3 \\ \hline RArrow & \sphinxcode{\sphinxupquote{rarrow}} & pad=0.3 \\ \hline Round & \sphinxcode{\sphinxupquote{round}} & pad=0.3,rounding\_size=None \\ \hline Round4 & \sphinxcode{\sphinxupquote{round4}} & pad=0.3,rounding\_size=None \\ \hline Roundtooth & \sphinxcode{\sphinxupquote{roundtooth}} & pad=0.3,tooth\_size=None \\ \hline Sawtooth & \sphinxcode{\sphinxupquote{sawtooth}} & pad=0.3,tooth\_size=None \\ \hline Square & \sphinxcode{\sphinxupquote{square}} & pad=0.3 \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} An instance of any boxstyle class is an callable object, whose call signature is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n+nf+fm}{\PYGZus{}\PYGZus{}call\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{x0}\PYG{p}{,} \PYG{n}{y0}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{n}{mutation\PYGZus{}size}\PYG{p}{,} \PYG{n}{aspect\PYGZus{}ratio}\PYG{o}{=}\PYG{l+m+mf}{1.}\PYG{p}{)} \end{sphinxVerbatim} and returns a \sphinxcode{\sphinxupquote{Path}} instance. \sphinxstyleemphasis{x0}, \sphinxstyleemphasis{y0}, \sphinxstyleemphasis{width} and \sphinxstyleemphasis{height} specify the location and size of the box to be drawn. \sphinxstyleemphasis{mutation\_scale} determines the overall size of the mutation (by which I mean the transformation of the rectangle to the fancy box). \sphinxstyleemphasis{mutation\_aspect} determines the aspect-ratio of the mutation. return the instance of the subclass with the given style name. \index{BoxStyle.Circle (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.Circle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{Circle}}}{\emph{pad=0.3}}{} A simple circle box. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{pad}}] \leavevmode{[}float{]} The amount of padding around the original box. \end{description} \end{description}\end{quote} \index{transmute() (matplotlib.patches.BoxStyle.Circle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.Circle.transmute}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transmute}}}{\emph{x0}, \emph{y0}, \emph{width}, \emph{height}, \emph{mutation\_size}}{} The transmute method is a very core of the \sphinxcode{\sphinxupquote{BboxTransmuter}} class and must be overridden in the subclasses. It receives the location and size of the rectangle, and the mutation\_size, with which the amount of padding and etc. will be scaled. It returns a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \end{fulllineitems} \end{fulllineitems} \index{BoxStyle.DArrow (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.DArrow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{DArrow}}}{\emph{pad=0.3}}{} (Double) Arrow Box \index{transmute() (matplotlib.patches.BoxStyle.DArrow method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.DArrow.transmute}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transmute}}}{\emph{x0}, \emph{y0}, \emph{width}, \emph{height}, \emph{mutation\_size}}{} The transmute method is a very core of the \sphinxcode{\sphinxupquote{BboxTransmuter}} class and must be overridden in the subclasses. It receives the location and size of the rectangle, and the mutation\_size, with which the amount of padding and etc. will be scaled. It returns a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \end{fulllineitems} \end{fulllineitems} \index{BoxStyle.LArrow (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.LArrow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{LArrow}}}{\emph{pad=0.3}}{} (left) Arrow Box \index{transmute() (matplotlib.patches.BoxStyle.LArrow method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.LArrow.transmute}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transmute}}}{\emph{x0}, \emph{y0}, \emph{width}, \emph{height}, \emph{mutation\_size}}{} The transmute method is a very core of the \sphinxcode{\sphinxupquote{BboxTransmuter}} class and must be overridden in the subclasses. It receives the location and size of the rectangle, and the mutation\_size, with which the amount of padding and etc. will be scaled. It returns a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \end{fulllineitems} \end{fulllineitems} \index{BoxStyle.RArrow (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.RArrow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{RArrow}}}{\emph{pad=0.3}}{} (right) Arrow Box \index{transmute() (matplotlib.patches.BoxStyle.RArrow method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.RArrow.transmute}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transmute}}}{\emph{x0}, \emph{y0}, \emph{width}, \emph{height}, \emph{mutation\_size}}{} The transmute method is a very core of the \sphinxcode{\sphinxupquote{BboxTransmuter}} class and must be overridden in the subclasses. It receives the location and size of the rectangle, and the mutation\_size, with which the amount of padding and etc. will be scaled. It returns a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \end{fulllineitems} \end{fulllineitems} \index{BoxStyle.Round (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.Round}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{Round}}}{\emph{pad=0.3}, \emph{rounding\_size=None}}{} A box with round corners. \begin{description} \item[{\sphinxstyleemphasis{pad}}] \leavevmode amount of padding \item[{\sphinxstyleemphasis{rounding\_size}}] \leavevmode rounding radius of corners. \sphinxstyleemphasis{pad} if None \end{description} \index{transmute() (matplotlib.patches.BoxStyle.Round method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.Round.transmute}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transmute}}}{\emph{x0}, \emph{y0}, \emph{width}, \emph{height}, \emph{mutation\_size}}{} The transmute method is a very core of the \sphinxcode{\sphinxupquote{BboxTransmuter}} class and must be overridden in the subclasses. It receives the location and size of the rectangle, and the mutation\_size, with which the amount of padding and etc. will be scaled. It returns a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \end{fulllineitems} \end{fulllineitems} \index{BoxStyle.Round4 (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.Round4}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{Round4}}}{\emph{pad=0.3}, \emph{rounding\_size=None}}{} Another box with round edges. \begin{description} \item[{\sphinxstyleemphasis{pad}}] \leavevmode amount of padding \item[{\sphinxstyleemphasis{rounding\_size}}] \leavevmode rounding size of edges. \sphinxstyleemphasis{pad} if None \end{description} \index{transmute() (matplotlib.patches.BoxStyle.Round4 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.Round4.transmute}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transmute}}}{\emph{x0}, \emph{y0}, \emph{width}, \emph{height}, \emph{mutation\_size}}{} The transmute method is a very core of the \sphinxcode{\sphinxupquote{BboxTransmuter}} class and must be overridden in the subclasses. It receives the location and size of the rectangle, and the mutation\_size, with which the amount of padding and etc. will be scaled. It returns a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \end{fulllineitems} \end{fulllineitems} \index{BoxStyle.Roundtooth (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.Roundtooth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{Roundtooth}}}{\emph{pad=0.3}, \emph{tooth\_size=None}}{} A rounded tooth box. \begin{description} \item[{\sphinxstyleemphasis{pad}}] \leavevmode amount of padding \item[{\sphinxstyleemphasis{tooth\_size}}] \leavevmode size of the sawtooth. pad* if None \end{description} \index{transmute() (matplotlib.patches.BoxStyle.Roundtooth method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.Roundtooth.transmute}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transmute}}}{\emph{x0}, \emph{y0}, \emph{width}, \emph{height}, \emph{mutation\_size}}{} The transmute method is a very core of the \sphinxcode{\sphinxupquote{BboxTransmuter}} class and must be overridden in the subclasses. It receives the location and size of the rectangle, and the mutation\_size, with which the amount of padding and etc. will be scaled. It returns a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \end{fulllineitems} \end{fulllineitems} \index{BoxStyle.Sawtooth (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.Sawtooth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{Sawtooth}}}{\emph{pad=0.3}, \emph{tooth\_size=None}}{} A sawtooth box. \begin{description} \item[{\sphinxstyleemphasis{pad}}] \leavevmode amount of padding \item[{\sphinxstyleemphasis{tooth\_size}}] \leavevmode size of the sawtooth. pad* if None \end{description} \index{transmute() (matplotlib.patches.BoxStyle.Sawtooth method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.Sawtooth.transmute}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transmute}}}{\emph{x0}, \emph{y0}, \emph{width}, \emph{height}, \emph{mutation\_size}}{} The transmute method is a very core of the \sphinxcode{\sphinxupquote{BboxTransmuter}} class and must be overridden in the subclasses. It receives the location and size of the rectangle, and the mutation\_size, with which the amount of padding and etc. will be scaled. It returns a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \end{fulllineitems} \end{fulllineitems} \index{BoxStyle.Square (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.Square}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{Square}}}{\emph{pad=0.3}}{} A simple square box. \begin{description} \item[{\sphinxstyleemphasis{pad}}] \leavevmode amount of padding \end{description} \index{transmute() (matplotlib.patches.BoxStyle.Square method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle.Square.transmute}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transmute}}}{\emph{x0}, \emph{y0}, \emph{width}, \emph{height}, \emph{mutation\_size}}{} The transmute method is a very core of the \sphinxcode{\sphinxupquote{BboxTransmuter}} class and must be overridden in the subclasses. It receives the location and size of the rectangle, and the mutation\_size, with which the amount of padding and etc. will be scaled. It returns a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \end{fulllineitems} \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.patches.BoxStyle}}} \label{\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:examples-using-matplotlib-patches-boxstyle}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_artist\_reference.py} \end{itemize} \subsubsection{matplotlib.patches.Circle} \label{\detokenize{api/_as_gen/matplotlib.patches.Circle:matplotlib-patches-circle}}\label{\detokenize{api/_as_gen/matplotlib.patches.Circle::doc}}\index{Circle (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Circle:matplotlib.patches.Circle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{Circle}}}{\emph{xy}, \emph{radius=5}, \emph{**kwargs}}{} A circle patch. Create true circle at center \sphinxstyleemphasis{xy} = (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) with given \sphinxstyleemphasis{radius}. Unlike {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.CirclePolygon:matplotlib.patches.CirclePolygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CirclePolygon}}}}} which is a polygonal approximation, this uses Bézier splines and is much closer to a scale-free circle. Valid kwargs are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \index{get\_radius() (matplotlib.patches.Circle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Circle:matplotlib.patches.Circle.get_radius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_radius}}}{}{} return the radius of the circle \end{fulllineitems} \index{radius (matplotlib.patches.Circle attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Circle:matplotlib.patches.Circle.radius}}\pysigline{\sphinxbfcode{\sphinxupquote{radius}}} return the radius of the circle \end{fulllineitems} \index{set\_radius() (matplotlib.patches.Circle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Circle:matplotlib.patches.Circle.set_radius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_radius}}}{\emph{radius}}{} Set the radius of the circle ACCEPTS: float \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.patches.Circle}}} \label{\detokenize{api/_as_gen/matplotlib.patches.Circle:examples-using-matplotlib-patches-circle}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_patch\_collection.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_98\_4\_fancy.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_clip\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_artist\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_dolphin.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_fancyarrow\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_demo\_annotation\_box.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_anatomy.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_anchored\_artists.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_looking\_glass.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_anchored\_artists.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_custom\_projection.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_pathpatch3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_anchored\_box02.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Legend guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/advanced/transforms_tutorial:sphx-glr-tutorials-advanced-transforms-tutorial-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Transformations Tutorial}}}} \end{itemize} \subsubsection{matplotlib.patches.CirclePolygon} \label{\detokenize{api/_as_gen/matplotlib.patches.CirclePolygon:matplotlib-patches-circlepolygon}}\label{\detokenize{api/_as_gen/matplotlib.patches.CirclePolygon::doc}}\index{CirclePolygon (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.CirclePolygon:matplotlib.patches.CirclePolygon}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{CirclePolygon}}}{\emph{xy}, \emph{radius=5}, \emph{resolution=20}, \emph{**kwargs}}{} A polygon-approximation of a circle patch. Create a circle at \sphinxstyleemphasis{xy} = (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) with given \sphinxstyleemphasis{radius}. This circle is approximated by a regular polygon with \sphinxstyleemphasis{resolution} sides. For a smoother circle drawn with splines, see {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Circle:matplotlib.patches.Circle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Circle}}}}}. Valid kwargs are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \end{fulllineitems} \subsubsection{matplotlib.patches.ConnectionPatch} \label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionPatch:matplotlib-patches-connectionpatch}}\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionPatch::doc}}\index{ConnectionPatch (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionPatch:matplotlib.patches.ConnectionPatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{ConnectionPatch}}}{\emph{xyA}, \emph{xyB}, \emph{coordsA}, \emph{coordsB=None}, \emph{axesA=None}, \emph{axesB=None}, \emph{arrowstyle='-'}, \emph{arrow\_transmuter=None}, \emph{connectionstyle='arc3'}, \emph{connector=None}, \emph{patchA=None}, \emph{patchB=None}, \emph{shrinkA=0.0}, \emph{shrinkB=0.0}, \emph{mutation\_scale=10.0}, \emph{mutation\_aspect=None}, \emph{clip\_on=False}, \emph{dpi\_cor=1.0}, \emph{**kwargs}}{} A {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.ConnectionPatch:matplotlib.patches.ConnectionPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ConnectionPatch}}}}} class is to make connecting lines between two points (possibly in different axes). Connect point \sphinxstyleemphasis{xyA} in \sphinxstyleemphasis{coordsA} with point \sphinxstyleemphasis{xyB} in \sphinxstyleemphasis{coordsB} Valid keys are \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Key &\sphinxstyletheadfamily Description \\ \hline arrowstyle & the arrow style \\ \hline connectionstyle & the connection style \\ \hline relpos & default is (0.5, 0.5) \\ \hline patchA & default is bounding box of the text \\ \hline patchB & default is None \\ \hline shrinkA & default is 2 points \\ \hline shrinkB & default is 2 points \\ \hline mutation\_scale & default is text size (in points) \\ \hline mutation\_aspect & default is 1. \\ \hline ? & any key for {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.PathPatch:matplotlib.patches.PathPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.PathPatch}}}}} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \sphinxstyleemphasis{coordsA} and \sphinxstyleemphasis{coordsB} are strings that indicate the coordinates of \sphinxstyleemphasis{xyA} and \sphinxstyleemphasis{xyB}. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline ‘figure points’ & points from the lower left corner of the figure \\ \hline ‘figure pixels’ & pixels from the lower left corner of the figure \\ \hline ‘figure fraction’ & 0,0 is lower left of figure and 1,1 is upper, right \\ \hline ‘axes points’ & points from lower left corner of axes \\ \hline ‘axes pixels’ & pixels from lower left corner of axes \\ \hline ‘axes fraction’ & 0,1 is lower left of axes and 1,1 is upper right \\ \hline ‘data’ & use the coordinate system of the object being annotated (default) \\ \hline ‘offset points’ & Specify an offset (in points) from the \sphinxstyleemphasis{xy} value \\ \hline ‘polar’ & you can specify \sphinxstyleemphasis{theta}, \sphinxstyleemphasis{r} for the annotation, even in cartesian plots. Note that if you are using a polar axes, you do not need to specify polar for the coordinate system since that is the native “data” coordinate system. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \index{draw() (matplotlib.patches.ConnectionPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionPatch:matplotlib.patches.ConnectionPatch.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draw. \end{fulllineitems} \index{get\_annotation\_clip() (matplotlib.patches.ConnectionPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionPatch:matplotlib.patches.ConnectionPatch.get_annotation_clip}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_annotation\_clip}}}{}{} Return \sphinxstyleemphasis{annotation\_clip} attribute. See {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.ConnectionPatch:matplotlib.patches.ConnectionPatch.set_annotation_clip}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_annotation\_clip()}}}}} for the meaning of return values. \end{fulllineitems} \index{get\_path\_in\_displaycoord() (matplotlib.patches.ConnectionPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionPatch:matplotlib.patches.ConnectionPatch.get_path_in_displaycoord}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path\_in\_displaycoord}}}{}{} Return the mutated path of the arrow in the display coord \end{fulllineitems} \index{set\_annotation\_clip() (matplotlib.patches.ConnectionPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionPatch:matplotlib.patches.ConnectionPatch.set_annotation_clip}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_annotation\_clip}}}{\emph{b}}{} set \sphinxstyleemphasis{annotation\_clip} attribute. \begin{itemize} \item {} \begin{description} \item[{True: the annotation will only be drawn when self.xy is inside the}] \leavevmode axes. \end{description} \item {} \begin{description} \item[{False: the annotation will always be drawn regardless of its}] \leavevmode position. \end{description} \item {} None: the self.xy will be checked only if \sphinxstyleemphasis{xycoords} is “data” \end{itemize} \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.patches.ConnectionPatch}}} \label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionPatch:examples-using-matplotlib-patches-connectionpatch}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_connect\_simple01.py} \end{itemize} \subsubsection{matplotlib.patches.ConnectionStyle} \label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib-patches-connectionstyle}}\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle::doc}}\index{ConnectionStyle (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib.patches.ConnectionStyle}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{ConnectionStyle}}} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib.patches.ConnectionStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ConnectionStyle}}}}} is a container class which defines several connectionstyle classes, which is used to create a path between two points. These are mainly used with {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrowPatch}}}}}. A connectionstyle object can be either created as: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ConnectionStyle}\PYG{o}{.}\PYG{n}{Arc3}\PYG{p}{(}\PYG{n}{rad}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)} \end{sphinxVerbatim} or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ConnectionStyle}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Arc3}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{rad}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)} \end{sphinxVerbatim} or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ConnectionStyle}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Arc3, rad=0.2}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} The following classes are defined \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily Class &\sphinxstyletheadfamily Name &\sphinxstyletheadfamily Attrs \\ \hline Angle & \sphinxcode{\sphinxupquote{angle}} & angleA=90,angleB=0,rad=0.0 \\ \hline Angle3 & \sphinxcode{\sphinxupquote{angle3}} & angleA=90,angleB=0 \\ \hline Arc & \sphinxcode{\sphinxupquote{arc}} & angleA=0,angleB=0,armA=None,armB=None,rad=0.0 \\ \hline Arc3 & \sphinxcode{\sphinxupquote{arc3}} & rad=0.0 \\ \hline Bar & \sphinxcode{\sphinxupquote{bar}} & armA=0.0,armB=0.0,fraction=0.3,angle=None \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} An instance of any connection style class is an callable object, whose call signature is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n+nf+fm}{\PYGZus{}\PYGZus{}call\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{posA}\PYG{p}{,} \PYG{n}{posB}\PYG{p}{,} \PYG{n}{patchA}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{patchB}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{shrinkA}\PYG{o}{=}\PYG{l+m+mf}{2.}\PYG{p}{,} \PYG{n}{shrinkB}\PYG{o}{=}\PYG{l+m+mf}{2.}\PYG{p}{)} \end{sphinxVerbatim} and it returns a \sphinxcode{\sphinxupquote{Path}} instance. \sphinxstyleemphasis{posA} and \sphinxstyleemphasis{posB} are tuples of x,y coordinates of the two points to be connected. \sphinxstyleemphasis{patchA} (or \sphinxstyleemphasis{patchB}) is given, the returned path is clipped so that it start (or end) from the boundary of the patch. The path is further shrunk by \sphinxstyleemphasis{shrinkA} (or \sphinxstyleemphasis{shrinkB}) which is given in points. return the instance of the subclass with the given style name. \index{ConnectionStyle.Angle (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib.patches.ConnectionStyle.Angle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{Angle}}}{\emph{angleA=90}, \emph{angleB=0}, \emph{rad=0.0}}{} Creates a picewise continuous quadratic bezier path between two points. The path has a one passing-through point placed at the intersecting point of two lines which crosses the start (or end) point and has a angle of angleA (or angleB). The connecting edges are rounded with \sphinxstyleemphasis{rad}. \begin{description} \item[{\sphinxstyleemphasis{angleA}}] \leavevmode starting angle of the path \item[{\sphinxstyleemphasis{angleB}}] \leavevmode ending angle of the path \item[{\sphinxstyleemphasis{rad}}] \leavevmode rounding radius of the edge \end{description} \index{connect() (matplotlib.patches.ConnectionStyle.Angle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib.patches.ConnectionStyle.Angle.connect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{connect}}}{\emph{posA}, \emph{posB}}{}~ \end{fulllineitems} \end{fulllineitems} \index{ConnectionStyle.Angle3 (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib.patches.ConnectionStyle.Angle3}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{Angle3}}}{\emph{angleA=90}, \emph{angleB=0}}{} Creates a simple quadratic bezier curve between two points. The middle control points is placed at the intersecting point of two lines which crosses the start (or end) point and has a angle of angleA (or angleB). \begin{description} \item[{\sphinxstyleemphasis{angleA}}] \leavevmode starting angle of the path \item[{\sphinxstyleemphasis{angleB}}] \leavevmode ending angle of the path \end{description} \index{connect() (matplotlib.patches.ConnectionStyle.Angle3 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib.patches.ConnectionStyle.Angle3.connect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{connect}}}{\emph{posA}, \emph{posB}}{}~ \end{fulllineitems} \end{fulllineitems} \index{ConnectionStyle.Arc (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib.patches.ConnectionStyle.Arc}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{Arc}}}{\emph{angleA=0}, \emph{angleB=0}, \emph{armA=None}, \emph{armB=None}, \emph{rad=0.0}}{} Creates a picewise continuous quadratic bezier path between two points. The path can have two passing-through points, a point placed at the distance of armA and angle of angleA from point A, another point with respect to point B. The edges are rounded with \sphinxstyleemphasis{rad}. \begin{description} \item[{\sphinxstyleemphasis{angleA} :}] \leavevmode starting angle of the path \item[{\sphinxstyleemphasis{angleB} :}] \leavevmode ending angle of the path \item[{\sphinxstyleemphasis{armA} :}] \leavevmode length of the starting arm \item[{\sphinxstyleemphasis{armB} :}] \leavevmode length of the ending arm \item[{\sphinxstyleemphasis{rad} :}] \leavevmode rounding radius of the edges \end{description} \index{connect() (matplotlib.patches.ConnectionStyle.Arc method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib.patches.ConnectionStyle.Arc.connect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{connect}}}{\emph{posA}, \emph{posB}}{}~ \end{fulllineitems} \end{fulllineitems} \index{ConnectionStyle.Arc3 (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib.patches.ConnectionStyle.Arc3}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{Arc3}}}{\emph{rad=0.0}}{} Creates a simple quadratic bezier curve between two points. The curve is created so that the middle control point (C1) is located at the same distance from the start (C0) and end points(C2) and the distance of the C1 to the line connecting C0-C2 is \sphinxstyleemphasis{rad} times the distance of C0-C2. \begin{description} \item[{\sphinxstyleemphasis{rad}}] \leavevmode curvature of the curve. \end{description} \index{connect() (matplotlib.patches.ConnectionStyle.Arc3 method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib.patches.ConnectionStyle.Arc3.connect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{connect}}}{\emph{posA}, \emph{posB}}{}~ \end{fulllineitems} \end{fulllineitems} \index{ConnectionStyle.Bar (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib.patches.ConnectionStyle.Bar}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{Bar}}}{\emph{armA=0.0}, \emph{armB=0.0}, \emph{fraction=0.3}, \emph{angle=None}}{} A line with \sphinxstyleemphasis{angle} between A and B with \sphinxstyleemphasis{armA} and \sphinxstyleemphasis{armB}. One of the arms is extended so that they are connected in a right angle. The length of armA is determined by (\sphinxstyleemphasis{armA} + \sphinxstyleemphasis{fraction} x AB distance). Same for armB. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{armA}}] \leavevmode{[}float{]} minimum length of armA \item[{\sphinxstylestrong{armB}}] \leavevmode{[}float{]} minimum length of armB \item[{\sphinxstylestrong{fraction}}] \leavevmode{[}float{]} a fraction of the distance between two points that will be added to armA and armB. \item[{\sphinxstylestrong{angle}}] \leavevmode{[}float or None{]} angle of the connecting line (if None, parallel to A and B) \end{description} \end{description}\end{quote} \index{connect() (matplotlib.patches.ConnectionStyle.Bar method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib.patches.ConnectionStyle.Bar.connect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{connect}}}{\emph{posA}, \emph{posB}}{}~ \end{fulllineitems} \end{fulllineitems} \end{fulllineitems} \subsubsection{matplotlib.patches.Ellipse} \label{\detokenize{api/_as_gen/matplotlib.patches.Ellipse:matplotlib-patches-ellipse}}\label{\detokenize{api/_as_gen/matplotlib.patches.Ellipse::doc}}\index{Ellipse (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Ellipse:matplotlib.patches.Ellipse}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{Ellipse}}}{\emph{xy}, \emph{width}, \emph{height}, \emph{angle=0.0}, \emph{**kwargs}}{} A scale-free ellipse. \begin{description} \item[{\sphinxstyleemphasis{xy}}] \leavevmode center of ellipse \item[{\sphinxstyleemphasis{width}}] \leavevmode total length (diameter) of horizontal axis \item[{\sphinxstyleemphasis{height}}] \leavevmode total length (diameter) of vertical axis \item[{\sphinxstyleemphasis{angle}}] \leavevmode rotation in degrees (anti-clockwise) \end{description} Valid kwargs are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \index{get\_patch\_transform() (matplotlib.patches.Ellipse method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Ellipse:matplotlib.patches.Ellipse.get_patch_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_patch\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance which takes patch coordinates to data coordinates. For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5. \end{fulllineitems} \index{get\_path() (matplotlib.patches.Ellipse method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Ellipse:matplotlib.patches.Ellipse.get_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path}}}{}{} Return the vertices of the rectangle \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.patches.Ellipse}}} \label{\detokenize{api/_as_gen/matplotlib.patches.Ellipse:examples-using-matplotlib-patches-ellipse}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_ellipse\_rotated.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_ellipse\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_hatch\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_artist\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_annotation\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_anchored\_artists.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_ellipse\_with\_units.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_anchored\_box03.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_anchored\_box04.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_explain.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_simple\_annotate01.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Legend guide}}}} \end{itemize} \subsubsection{matplotlib.patches.FancyArrow} \label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrow:matplotlib-patches-fancyarrow}}\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrow::doc}}\index{FancyArrow (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrow:matplotlib.patches.FancyArrow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{FancyArrow}}}{\emph{x}, \emph{y}, \emph{dx}, \emph{dy}, \emph{width=0.001}, \emph{length\_includes\_head=False}, \emph{head\_width=None}, \emph{head\_length=None}, \emph{shape='full'}, \emph{overhang=0}, \emph{head\_starts\_at\_zero=False}, \emph{**kwargs}}{} Like Arrow, but lets you set head width and head height independently. \begin{description} \item[{Constructor arguments}] \leavevmode\begin{description} \item[{\sphinxstyleemphasis{width}: float (default: 0.001)}] \leavevmode width of full arrow tail \item[{\sphinxstyleemphasis{length\_includes\_head}: bool (default: False)}] \leavevmode True if head is to be counted in calculating the length. \item[{\sphinxstyleemphasis{head\_width}: float or None (default: 3*width)}] \leavevmode total width of the full arrow head \item[{\sphinxstyleemphasis{head\_length}: float or None (default: 1.5 * head\_width)}] \leavevmode length of arrow head \item[{\sphinxstyleemphasis{shape}: {[}‘full’, ‘left’, ‘right’{]} (default: ‘full’)}] \leavevmode draw the left-half, right-half, or full arrow \item[{\sphinxstyleemphasis{overhang}: float (default: 0)}] \leavevmode fraction that the arrow is swept back (0 overhang means triangular shape). Can be negative or greater than one. \item[{\sphinxstyleemphasis{head\_starts\_at\_zero}: bool (default: False)}] \leavevmode if True, the head starts being drawn at coordinate 0 instead of ending at coordinate 0. \end{description} \end{description} Other valid kwargs (inherited from {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}}) are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \end{fulllineitems} \subsubsection{matplotlib.patches.FancyArrowPatch} \label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib-patches-fancyarrowpatch}}\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch::doc}}\index{FancyArrowPatch (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{FancyArrowPatch}}}{\emph{posA=None}, \emph{posB=None}, \emph{path=None}, \emph{arrowstyle='simple'}, \emph{arrow\_transmuter=None}, \emph{connectionstyle='arc3'}, \emph{connector=None}, \emph{patchA=None}, \emph{patchB=None}, \emph{shrinkA=2}, \emph{shrinkB=2}, \emph{mutation\_scale=1}, \emph{mutation\_aspect=None}, \emph{dpi\_cor=1}, \emph{**kwargs}}{} A fancy arrow patch. It draws an arrow using the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ArrowStyle}}}}}. The head and tail positions are fixed at the specified start and end points of the arrow, but the size and shape (in display coordinates) of the arrow does not change when the axis is moved or zoomed. If \sphinxstyleemphasis{posA} and \sphinxstyleemphasis{posB} are given, a path connecting two points is created according to \sphinxstyleemphasis{connectionstyle}. The path will be clipped with \sphinxstyleemphasis{patchA} and \sphinxstyleemphasis{patchB} and further shrunken by \sphinxstyleemphasis{shrinkA} and \sphinxstyleemphasis{shrinkB}. An arrow is drawn along this resulting path using the \sphinxstyleemphasis{arrowstyle} parameter. Alternatively if \sphinxstyleemphasis{path} is provided, an arrow is drawn along this path and \sphinxstyleemphasis{patchA}, \sphinxstyleemphasis{patchB}, \sphinxstyleemphasis{shrinkA}, and \sphinxstyleemphasis{shrinkB} are ignored. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{posA, posB}}] \leavevmode{[}None, tuple, optional (default: None){]} (x,y) coordinates of arrow tail and arrow head respectively. \item[{\sphinxstylestrong{path}}] \leavevmode{[}None, Path (default: None){]} {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.path.Path}}}}} instance. If provided, an arrow is drawn along this path and \sphinxstyleemphasis{patchA}, \sphinxstyleemphasis{patchB}, \sphinxstyleemphasis{shrinkA}, and \sphinxstyleemphasis{shrinkB} are ignored. \item[{\sphinxstylestrong{arrowstyle}}] \leavevmode{[}str or ArrowStyle, optional (default: ‘simple’){]}\begin{quote} Describes how the fancy arrow will be drawn. It can be string of the available arrowstyle names, with optional comma-separated attributes, or an {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.ArrowStyle:matplotlib.patches.ArrowStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ArrowStyle}}}}} instance. The optional attributes are meant to be scaled with the \sphinxstyleemphasis{mutation\_scale}. The following arrow styles are available: \end{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily Class &\sphinxstyletheadfamily Name &\sphinxstyletheadfamily Attrs \\ \hline Curve & \sphinxcode{\sphinxupquote{-}} & None \\ \hline CurveB & \sphinxcode{\sphinxupquote{-\textgreater{}}} & head\_length=0.4,head\_width=0.2 \\ \hline BracketB & \sphinxcode{\sphinxupquote{-{[}}} & widthB=1.0,lengthB=0.2,angleB=None \\ \hline CurveFilledB & \sphinxcode{\sphinxupquote{-\textbar{}\textgreater{}}} & head\_length=0.4,head\_width=0.2 \\ \hline CurveA & \sphinxcode{\sphinxupquote{\textless{}-}} & head\_length=0.4,head\_width=0.2 \\ \hline CurveAB & \sphinxcode{\sphinxupquote{\textless{}-\textgreater{}}} & head\_length=0.4,head\_width=0.2 \\ \hline CurveFilledA & \sphinxcode{\sphinxupquote{\textless{}\textbar{}-}} & head\_length=0.4,head\_width=0.2 \\ \hline CurveFilledAB & \sphinxcode{\sphinxupquote{\textless{}\textbar{}-\textbar{}\textgreater{}}} & head\_length=0.4,head\_width=0.2 \\ \hline BracketA & \sphinxcode{\sphinxupquote{{]}-}} & widthA=1.0,lengthA=0.2,angleA=None \\ \hline BracketAB & \sphinxcode{\sphinxupquote{{]}-{[}}} & widthA=1.0,lengthA=0.2,angleA=None,widthB=1.0,lengthB=0.2,angleB=None \\ \hline Fancy & \sphinxcode{\sphinxupquote{fancy}} & head\_length=0.4,head\_width=0.4,tail\_width=0.4 \\ \hline Simple & \sphinxcode{\sphinxupquote{simple}} & head\_length=0.5,head\_width=0.5,tail\_width=0.2 \\ \hline Wedge & \sphinxcode{\sphinxupquote{wedge}} & tail\_width=0.3,shrink\_factor=0.5 \\ \hline BarAB & \sphinxcode{\sphinxupquote{\textbar{}-\textbar{}}} & widthA=1.0,angleA=None,widthB=1.0,angleB=None \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \item[{\sphinxstylestrong{arrow\_transmuter :}}] \leavevmode Ignored \item[{\sphinxstylestrong{connectionstyle}}] \leavevmode{[}str, ConnectionStyle, or None, optional{]} \item[{\sphinxstylestrong{(default: ‘arc3’)}}] \leavevmode\begin{quote} Describes how \sphinxstyleemphasis{posA} and \sphinxstyleemphasis{posB} are connected. It can be an instance of the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib.patches.ConnectionStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ConnectionStyle}}}}} class or a string of the connectionstyle name, with optional comma-separated attributes. The following connection styles are available: \end{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily Class &\sphinxstyletheadfamily Name &\sphinxstyletheadfamily Attrs \\ \hline Angle & \sphinxcode{\sphinxupquote{angle}} & angleA=90,angleB=0,rad=0.0 \\ \hline Angle3 & \sphinxcode{\sphinxupquote{angle3}} & angleA=90,angleB=0 \\ \hline Arc & \sphinxcode{\sphinxupquote{arc}} & angleA=0,angleB=0,armA=None,armB=None,rad=0.0 \\ \hline Arc3 & \sphinxcode{\sphinxupquote{arc3}} & rad=0.0 \\ \hline Bar & \sphinxcode{\sphinxupquote{bar}} & armA=0.0,armB=0.0,fraction=0.3,angle=None \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \item[{\sphinxstylestrong{connector :}}] \leavevmode Ignored \item[{\sphinxstylestrong{patchA, patchB}}] \leavevmode{[}None, Patch, optional (default: None){]} Head and tail patch respectively. \sphinxcode{\sphinxupquote{matplotlib.patch.Patch}} instance. \item[{\sphinxstylestrong{shrinkA, shrinkB}}] \leavevmode{[}scalar, optional (default: 2){]} Shrinking factor of the tail and head of the arrow respectively \item[{\sphinxstylestrong{mutation\_scale}}] \leavevmode{[}scalar, optional (default: 1){]} Value with which attributes of \sphinxstyleemphasis{arrowstyle} (e.g., \sphinxstyleemphasis{head\_length}) will be scaled. \item[{\sphinxstylestrong{mutation\_aspect}}] \leavevmode{[}None, scalar, optional (default: None){]} The height of the rectangle will be squeezed by this value before the mutation and the mutated box will be stretched by the inverse of it. \item[{\sphinxstylestrong{dpi\_cor}}] \leavevmode{[}scalar, optional (default: 1){]} dpi\_cor is currently used for linewidth-related things and shrink factor. Mutation scale is affected by this. \end{description} \end{description}\end{quote} \paragraph{Notes} Valid kwargs are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \index{draw() (matplotlib.patches.FancyArrowPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draw the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} to the given \sphinxstyleemphasis{renderer}. \end{fulllineitems} \index{get\_arrowstyle() (matplotlib.patches.FancyArrowPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch.get_arrowstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_arrowstyle}}}{}{} Return the arrowstyle object. \end{fulllineitems} \index{get\_connectionstyle() (matplotlib.patches.FancyArrowPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch.get_connectionstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_connectionstyle}}}{}{} Return the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.ConnectionStyle:matplotlib.patches.ConnectionStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ConnectionStyle}}}}} instance. \end{fulllineitems} \index{get\_dpi\_cor() (matplotlib.patches.FancyArrowPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch.get_dpi_cor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dpi\_cor}}}{}{} dpi\_cor is currently used for linewidth-related things and shrink factor. Mutation scale is affected by this. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{dpi\_cor}}] \leavevmode{[}scalar{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_mutation\_aspect() (matplotlib.patches.FancyArrowPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch.get_mutation_aspect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_mutation\_aspect}}}{}{} Return the aspect ratio of the bbox mutation. \end{fulllineitems} \index{get\_mutation\_scale() (matplotlib.patches.FancyArrowPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch.get_mutation_scale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_mutation\_scale}}}{}{} Return the mutation scale. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}scalar{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_path() (matplotlib.patches.FancyArrowPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch.get_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path}}}{}{} Return the path of the arrow in the data coordinates. Use get\_path\_in\_displaycoord() method to retrieve the arrow path in display coordinates. \end{fulllineitems} \index{get\_path\_in\_displaycoord() (matplotlib.patches.FancyArrowPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch.get_path_in_displaycoord}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path\_in\_displaycoord}}}{}{} Return the mutated path of the arrow in display coordinates. \end{fulllineitems} \index{set\_arrowstyle() (matplotlib.patches.FancyArrowPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch.set_arrowstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_arrowstyle}}}{\emph{arrowstyle=None}, \emph{**kw}}{} Set the arrow style. Old attributes are forgotten. Without arguments (or with \sphinxcode{\sphinxupquote{arrowstyle=None}}) returns available box styles as a list of strings. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{arrowstyle}}] \leavevmode{[}None, ArrowStyle, str, optional (default: None){]} Can be a string with arrowstyle name with optional comma-separated attributes, e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{set\PYGZus{}arrowstyle}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Fancy,head\PYGZus{}length=0.2}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} Alternatively attributes can be provided as keywords, e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{set\PYGZus{}arrowstyle}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{fancy}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{head\PYGZus{}length}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)} \end{sphinxVerbatim} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_connectionstyle() (matplotlib.patches.FancyArrowPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch.set_connectionstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_connectionstyle}}}{\emph{connectionstyle}, \emph{**kw}}{} Set the connection style. Old attributes are forgotten. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{connectionstyle}}] \leavevmode{[}None, ConnectionStyle instance, or string{]} Can be a string with connectionstyle name with optional comma-separated attributes, e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{set\PYGZus{}connectionstyle}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{arc,angleA=0,armA=30,rad=10}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} Alternatively, the attributes can be provided as keywords, e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{set\PYGZus{}connectionstyle}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{arc}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{angleA}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{n}{armA}\PYG{o}{=}\PYG{l+m+mi}{30}\PYG{p}{,}\PYG{n}{rad}\PYG{o}{=}\PYG{l+m+mi}{10}\PYG{p}{)} \end{sphinxVerbatim} Without any arguments (or with \sphinxcode{\sphinxupquote{connectionstyle=None}}), return available styles as a list of strings. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_dpi\_cor() (matplotlib.patches.FancyArrowPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch.set_dpi_cor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dpi\_cor}}}{\emph{dpi\_cor}}{} dpi\_cor is currently used for linewidth-related things and shrink factor. Mutation scale is affected by this. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{dpi\_cor}}] \leavevmode{[}scalar{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_mutation\_aspect() (matplotlib.patches.FancyArrowPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch.set_mutation_aspect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_mutation\_aspect}}}{\emph{aspect}}{} Set the aspect ratio of the bbox mutation. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{aspect}}] \leavevmode{[}scalar{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_mutation\_scale() (matplotlib.patches.FancyArrowPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch.set_mutation_scale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_mutation\_scale}}}{\emph{scale}}{} Set the mutation scale. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}scalar{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_patchA() (matplotlib.patches.FancyArrowPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch.set_patchA}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_patchA}}}{\emph{patchA}}{} Set the tail patch. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{patchA}}] \leavevmode{[}Patch{]} \sphinxcode{\sphinxupquote{matplotlib.patch.Patch}} instance. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_patchB() (matplotlib.patches.FancyArrowPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch.set_patchB}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_patchB}}}{\emph{patchB}}{} Set the head patch. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{patchB}}] \leavevmode{[}Patch{]} \sphinxcode{\sphinxupquote{matplotlib.patch.Patch}} instance. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_positions() (matplotlib.patches.FancyArrowPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch.set_positions}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_positions}}}{\emph{posA}, \emph{posB}}{} Set the begin and end positions of the connecting path. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{posA, posB}}] \leavevmode{[}None, tuple{]} (x,y) coordinates of arrow tail and arrow head respectively. If \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}} use current value. \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \subsubsection{matplotlib.patches.FancyBboxPatch} \label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib-patches-fancybboxpatch}}\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch::doc}}\index{FancyBboxPatch (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{FancyBboxPatch}}}{\emph{xy}, \emph{width}, \emph{height}, \emph{boxstyle='round'}, \emph{bbox\_transmuter=None}, \emph{mutation\_scale=1.0}, \emph{mutation\_aspect=None}, \emph{**kwargs}}{} Draw a fancy box around a rectangle with lower left at \sphinxstyleemphasis{xy*=(*x}, \sphinxstyleemphasis{y}) with specified width and height. {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyBboxPatch}}}}} class is similar to {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}} class, but it draws a fancy box around the rectangle. The transformation of the rectangle box to the fancy box is delegated to the \sphinxcode{\sphinxupquote{BoxTransmuterBase}} and its derived classes. \sphinxstyleemphasis{xy} = lower left corner \sphinxstyleemphasis{width}, \sphinxstyleemphasis{height} \sphinxstyleemphasis{boxstyle} determines what kind of fancy box will be drawn. It can be a string of the style name with a comma separated attribute, or an instance of {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.BoxStyle:matplotlib.patches.BoxStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BoxStyle}}}}}. Following box styles are available. \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily Class &\sphinxstyletheadfamily Name &\sphinxstyletheadfamily Attrs \\ \hline Circle & \sphinxcode{\sphinxupquote{circle}} & pad=0.3 \\ \hline DArrow & \sphinxcode{\sphinxupquote{darrow}} & pad=0.3 \\ \hline LArrow & \sphinxcode{\sphinxupquote{larrow}} & pad=0.3 \\ \hline RArrow & \sphinxcode{\sphinxupquote{rarrow}} & pad=0.3 \\ \hline Round & \sphinxcode{\sphinxupquote{round}} & pad=0.3,rounding\_size=None \\ \hline Round4 & \sphinxcode{\sphinxupquote{round4}} & pad=0.3,rounding\_size=None \\ \hline Roundtooth & \sphinxcode{\sphinxupquote{roundtooth}} & pad=0.3,tooth\_size=None \\ \hline Sawtooth & \sphinxcode{\sphinxupquote{sawtooth}} & pad=0.3,tooth\_size=None \\ \hline Square & \sphinxcode{\sphinxupquote{square}} & pad=0.3 \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \sphinxstyleemphasis{mutation\_scale} : a value with which attributes of boxstyle (e.g., pad) will be scaled. default=1. \sphinxstyleemphasis{mutation\_aspect} : The height of the rectangle will be squeezed by this value before the mutation and the mutated box will be stretched by the inverse of it. default=None. Valid kwargs are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \index{get\_bbox() (matplotlib.patches.FancyBboxPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch.get_bbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_bbox}}}{}{}~ \end{fulllineitems} \index{get\_boxstyle() (matplotlib.patches.FancyBboxPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch.get_boxstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_boxstyle}}}{}{} Return the boxstyle object \end{fulllineitems} \index{get\_height() (matplotlib.patches.FancyBboxPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch.get_height}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_height}}}{}{} Return the height of the rectangle \end{fulllineitems} \index{get\_mutation\_aspect() (matplotlib.patches.FancyBboxPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch.get_mutation_aspect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_mutation\_aspect}}}{}{} Return the aspect ratio of the bbox mutation. \end{fulllineitems} \index{get\_mutation\_scale() (matplotlib.patches.FancyBboxPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch.get_mutation_scale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_mutation\_scale}}}{}{} Return the mutation scale. \end{fulllineitems} \index{get\_path() (matplotlib.patches.FancyBboxPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch.get_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path}}}{}{} Return the mutated path of the rectangle \end{fulllineitems} \index{get\_width() (matplotlib.patches.FancyBboxPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch.get_width}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_width}}}{}{} Return the width of the rectangle \end{fulllineitems} \index{get\_x() (matplotlib.patches.FancyBboxPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch.get_x}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_x}}}{}{} Return the left coord of the rectangle \end{fulllineitems} \index{get\_y() (matplotlib.patches.FancyBboxPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch.get_y}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_y}}}{}{} Return the bottom coord of the rectangle \end{fulllineitems} \index{set\_bounds() (matplotlib.patches.FancyBboxPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch.set_bounds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_bounds}}}{\emph{*args}}{} Set the bounds of the rectangle: l,b,w,h ACCEPTS: (left, bottom, width, height) \end{fulllineitems} \index{set\_boxstyle() (matplotlib.patches.FancyBboxPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch.set_boxstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_boxstyle}}}{\emph{boxstyle=None}, \emph{**kw}}{} Set the box style. \sphinxstyleemphasis{boxstyle} can be a string with boxstyle name with optional comma-separated attributes. Alternatively, the attrs can be provided as keywords: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{set\PYGZus{}boxstyle}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{round,pad=0.2}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{set\PYGZus{}boxstyle}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{round}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{pad}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)} \end{sphinxVerbatim} Old attrs simply are forgotten. Without argument (or with \sphinxstyleemphasis{boxstyle} = None), it returns available box styles. The following boxstyles are available: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily Class &\sphinxstyletheadfamily Name &\sphinxstyletheadfamily Attrs \\ \hline Circle & \sphinxcode{\sphinxupquote{circle}} & pad=0.3 \\ \hline DArrow & \sphinxcode{\sphinxupquote{darrow}} & pad=0.3 \\ \hline LArrow & \sphinxcode{\sphinxupquote{larrow}} & pad=0.3 \\ \hline RArrow & \sphinxcode{\sphinxupquote{rarrow}} & pad=0.3 \\ \hline Round & \sphinxcode{\sphinxupquote{round}} & pad=0.3,rounding\_size=None \\ \hline Round4 & \sphinxcode{\sphinxupquote{round4}} & pad=0.3,rounding\_size=None \\ \hline Roundtooth & \sphinxcode{\sphinxupquote{roundtooth}} & pad=0.3,tooth\_size=None \\ \hline Sawtooth & \sphinxcode{\sphinxupquote{sawtooth}} & pad=0.3,tooth\_size=None \\ \hline Square & \sphinxcode{\sphinxupquote{square}} & pad=0.3 \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} ACCEPTS: {[} ‘circle’ \textbar{} ‘darrow’ \textbar{} ‘larrow’ \textbar{} ‘rarrow’ \textbar{} ‘round’ \textbar{} ‘round4’ \textbar{} ‘roundtooth’ \textbar{} ‘sawtooth’ \textbar{} ‘square’ {]} \end{fulllineitems} \index{set\_height() (matplotlib.patches.FancyBboxPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch.set_height}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_height}}}{\emph{h}}{} Set the width rectangle ACCEPTS: float \end{fulllineitems} \index{set\_mutation\_aspect() (matplotlib.patches.FancyBboxPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch.set_mutation_aspect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_mutation\_aspect}}}{\emph{aspect}}{} Set the aspect ratio of the bbox mutation. ACCEPTS: float \end{fulllineitems} \index{set\_mutation\_scale() (matplotlib.patches.FancyBboxPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch.set_mutation_scale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_mutation\_scale}}}{\emph{scale}}{} Set the mutation scale. ACCEPTS: float \end{fulllineitems} \index{set\_width() (matplotlib.patches.FancyBboxPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch.set_width}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_width}}}{\emph{w}}{} Set the width rectangle ACCEPTS: float \end{fulllineitems} \index{set\_x() (matplotlib.patches.FancyBboxPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch.set_x}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_x}}}{\emph{x}}{} Set the left coord of the rectangle ACCEPTS: float \end{fulllineitems} \index{set\_y() (matplotlib.patches.FancyBboxPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch.set_y}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_y}}}{\emph{y}}{} Set the bottom coord of the rectangle ACCEPTS: float \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.patches.FancyBboxPatch}}} \label{\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:examples-using-matplotlib-patches-fancybboxpatch}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_artist\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_fancybox\_demo.py} \end{itemize} \subsubsection{matplotlib.patches.Patch} \label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib-patches-patch}}\label{\detokenize{api/_as_gen/matplotlib.patches.Patch::doc}}\index{Patch (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{Patch}}}{\emph{edgecolor=None}, \emph{facecolor=None}, \emph{color=None}, \emph{linewidth=None}, \emph{linestyle=None}, \emph{antialiased=None}, \emph{hatch=None}, \emph{fill=True}, \emph{capstyle=None}, \emph{joinstyle=None}, \emph{**kwargs}}{} A patch is a 2D artist with a face color and an edge color. If any of \sphinxstyleemphasis{edgecolor}, \sphinxstyleemphasis{facecolor}, \sphinxstyleemphasis{linewidth}, or \sphinxstyleemphasis{antialiased} are \sphinxstyleemphasis{None}, they default to their rc params setting. The following kwarg properties are supported \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \index{contains() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}, \emph{radius=None}}{} Test whether the mouse event occurred in the patch. Returns T/F, \{\} \end{fulllineitems} \index{contains\_point() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.contains_point}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains\_point}}}{\emph{point}, \emph{radius=None}}{} Returns \sphinxcode{\sphinxupquote{True}} if the given \sphinxstyleemphasis{point} is inside the path (transformed with its transform attribute). \sphinxstyleemphasis{radius} allows the path to be made slightly larger or smaller. \end{fulllineitems} \index{contains\_points() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.contains_points}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains\_points}}}{\emph{points}, \emph{radius=None}}{} Returns a bool array which is \sphinxcode{\sphinxupquote{True}} if the (closed) path contains the corresponding point. (transformed with its transform attribute). \sphinxstyleemphasis{points} must be Nx2 array. \sphinxstyleemphasis{radius} allows the path to be made slightly larger or smaller. \end{fulllineitems} \index{draw() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draw the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} to the given \sphinxstyleemphasis{renderer}. \end{fulllineitems} \index{fill (matplotlib.patches.Patch attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.fill}}\pysigline{\sphinxbfcode{\sphinxupquote{fill}}} return whether fill is set \end{fulllineitems} \index{get\_aa() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_aa}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_aa}}}{}{} Returns True if the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} is to be drawn with antialiasing. \end{fulllineitems} \index{get\_antialiased() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_antialiased}}}{}{} Returns True if the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} is to be drawn with antialiasing. \end{fulllineitems} \index{get\_capstyle() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_capstyle}}}{}{} Return the current capstyle \end{fulllineitems} \index{get\_data\_transform() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_data_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_data\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance which maps data coordinates to physical coordinates. \end{fulllineitems} \index{get\_ec() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_ec}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_ec}}}{}{} Return the edge color of the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}}. \end{fulllineitems} \index{get\_edgecolor() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolor}}}{}{} Return the edge color of the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}}. \end{fulllineitems} \index{get\_extents() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_extents}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_extents}}}{}{} Return a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} object defining the axis-aligned extents of the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}}. \end{fulllineitems} \index{get\_facecolor() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{} Return the face color of the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}}. \end{fulllineitems} \index{get\_fc() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_fc}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fc}}}{}{} Return the face color of the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}}. \end{fulllineitems} \index{get\_fill() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_fill}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fill}}}{}{} return whether fill is set \end{fulllineitems} \index{get\_hatch() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_hatch}}}{}{} Return the current hatching pattern \end{fulllineitems} \index{get\_joinstyle() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_joinstyle}}}{}{} Return the current joinstyle \end{fulllineitems} \index{get\_linestyle() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linestyle}}}{}{} Return the linestyle. Will be one of {[}‘solid’ \textbar{} ‘dashed’ \textbar{} ‘dashdot’ \textbar{} ‘dotted’{]} \end{fulllineitems} \index{get\_linewidth() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_linewidth}}}{}{} Return the line width in points. \end{fulllineitems} \index{get\_ls() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_ls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_ls}}}{}{} Return the linestyle. Will be one of {[}‘solid’ \textbar{} ‘dashed’ \textbar{} ‘dashdot’ \textbar{} ‘dotted’{]} \end{fulllineitems} \index{get\_lw() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_lw}}}{}{} Return the line width in points. \end{fulllineitems} \index{get\_patch\_transform() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_patch_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_patch\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance which takes patch coordinates to data coordinates. For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5. \end{fulllineitems} \index{get\_path() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path}}}{}{} Return the path of this patch \end{fulllineitems} \index{get\_transform() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} applied to the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}}. \end{fulllineitems} \index{get\_verts() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_verts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_verts}}}{}{} Return a copy of the vertices used in this patch If the patch contains Bezier curves, the curves will be interpolated by line segments. To access the curves as curves, use {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_path()}}}}}. \end{fulllineitems} \index{get\_window\_extent() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer=None}}{} Get the axes bounding box in display space. Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. \end{fulllineitems} \index{set\_aa() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_aa}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_aa}}}{\emph{aa}}{} alias for set\_antialiased \end{fulllineitems} \index{set\_alpha() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha tranparency of the patch. ACCEPTS: float or None \end{fulllineitems} \index{set\_antialiased() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_antialiased}}}{\emph{aa}}{} Set whether to use antialiased rendering. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool or None{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_capstyle() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_capstyle}}}{\emph{s}}{} Set the patch capstyle ACCEPTS: {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \end{fulllineitems} \index{set\_color() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{c}}{} Set both the edgecolor and the facecolor. ACCEPTS: matplotlib color spec \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_facecolor()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_edgecolor()}}}}}}] \leavevmode For setting the edge or face color individually. \end{description} \end{fulllineitems} \index{set\_ec() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_ec}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_ec}}}{\emph{color}}{} alias for set\_edgecolor \end{fulllineitems} \index{set\_edgecolor() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolor}}}{\emph{color}}{} Set the patch edge color ACCEPTS: mpl color spec, None, ‘none’, or ‘auto’ \end{fulllineitems} \index{set\_facecolor() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{color}}{} Set the patch face color ACCEPTS: mpl color spec, or None for default, or ‘none’ for no color \end{fulllineitems} \index{set\_fc() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fc}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_fc}}}{\emph{color}}{} alias for set\_facecolor \end{fulllineitems} \index{set\_fill() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_fill}}}{\emph{b}}{} Set whether to fill the patch. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_hatch() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_hatch}}}{\emph{hatch}}{} Set the hatching pattern \sphinxstyleemphasis{hatch} can be one of: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{/} \PYG{o}{\PYGZhy{}} \PYG{n}{diagonal} \PYG{n}{hatching} \PYGZbs{} \PYG{o}{\PYGZhy{}} \PYG{n}{back} \PYG{n}{diagonal} \PYG{o}{\textbar{}} \PYG{o}{\PYGZhy{}} \PYG{n}{vertical} \PYG{o}{\PYGZhy{}} \PYG{o}{\PYGZhy{}} \PYG{n}{horizontal} \PYG{o}{+} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{x} \PYG{o}{\PYGZhy{}} \PYG{n}{crossed} \PYG{n}{diagonal} \PYG{n}{o} \PYG{o}{\PYGZhy{}} \PYG{n}{small} \PYG{n}{circle} \PYG{n}{O} \PYG{o}{\PYGZhy{}} \PYG{n}{large} \PYG{n}{circle} \PYG{o}{.} \PYG{o}{\PYGZhy{}} \PYG{n}{dots} \PYG{o}{*} \PYG{o}{\PYGZhy{}} \PYG{n}{stars} \end{sphinxVerbatim} Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. ACCEPTS: {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \end{fulllineitems} \index{set\_joinstyle() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_joinstyle}}}{\emph{s}}{} Set the patch joinstyle ACCEPTS: {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \end{fulllineitems} \index{set\_linestyle() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linestyle}}}{\emph{ls}}{} Set the patch linestyle \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily linestyle &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} or \sphinxcode{\sphinxupquote{'solid'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} or \sphinxcode{\sphinxupquote{'dashed'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} or \sphinxcode{\sphinxupquote{'dashdot'}} & dash-dotted line \\ \hline \sphinxcode{\sphinxupquote{':'}} or \sphinxcode{\sphinxupquote{'dotted'}} & dotted line \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Alternatively a dash tuple of the following form can be provided: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxcode{\sphinxupquote{onoffseq}} is an even length tuple of on and off ink in points. \begin{description} \item[{ACCEPTS: {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{}}] \leavevmode (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \end{description} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ls}}] \leavevmode{[}\{ ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’\} and more see description{]} The line style. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_linewidth() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linewidth}}}{\emph{w}}{} Set the patch linewidth in points ACCEPTS: float or None for default \end{fulllineitems} \index{set\_ls() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_ls}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_ls}}}{\emph{ls}}{} alias for set\_linestyle \end{fulllineitems} \index{set\_lw() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_lw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_lw}}}{\emph{lw}}{} alias for set\_linewidth \end{fulllineitems} \index{update\_from() (matplotlib.patches.Patch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.update_from}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} Updates this {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} from the properties of \sphinxstyleemphasis{other}. \end{fulllineitems} \index{validCap (matplotlib.patches.Patch attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.validCap}}\pysigline{\sphinxbfcode{\sphinxupquote{validCap}}\sphinxbfcode{\sphinxupquote{ = ('butt', 'round', 'projecting')}}} \end{fulllineitems} \index{validJoin (matplotlib.patches.Patch attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.validJoin}}\pysigline{\sphinxbfcode{\sphinxupquote{validJoin}}\sphinxbfcode{\sphinxupquote{ = ('miter', 'round', 'bevel')}}} \end{fulllineitems} \index{zorder (matplotlib.patches.Patch attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.patches.Patch}}} \label{\detokenize{api/_as_gen/matplotlib.patches.Patch:examples-using-matplotlib-patches-patch}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_custom\_legends.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Legend guide}}}} \end{itemize} \subsubsection{matplotlib.patches.PathPatch} \label{\detokenize{api/_as_gen/matplotlib.patches.PathPatch:matplotlib-patches-pathpatch}}\label{\detokenize{api/_as_gen/matplotlib.patches.PathPatch::doc}}\index{PathPatch (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.PathPatch:matplotlib.patches.PathPatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{PathPatch}}}{\emph{path}, \emph{**kwargs}}{} A general polycurve path patch. \sphinxstyleemphasis{path} is a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.path.Path}}}}} object. Valid kwargs are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}}}] \leavevmode For additional kwargs \end{description} \index{get\_path() (matplotlib.patches.PathPatch method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.PathPatch:matplotlib.patches.PathPatch.get_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path}}}{}{} Return the path of this patch \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.patches.PathPatch}}} \label{\detokenize{api/_as_gen/matplotlib.patches.PathPatch:examples-using-matplotlib-patches-pathpatch}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_quad\_bezier.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_histogram\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_compound\_path\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_compound\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_path\_patch.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_donut.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_artist\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_dolphin.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_demo\_text\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_firefox.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/animated_histogram:sphx-glr-gallery-animation-animated-histogram-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Animated histogram}}}} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_path\_editor.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_pathpatch3d.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/advanced/path_tutorial:sphx-glr-tutorials-advanced-path-tutorial-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Path Tutorial}}}} \end{itemize} \subsubsection{matplotlib.patches.Polygon} \label{\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib-patches-polygon}}\label{\detokenize{api/_as_gen/matplotlib.patches.Polygon::doc}}\index{Polygon (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{Polygon}}}{\emph{xy}, \emph{closed=True}, \emph{**kwargs}}{} A general polygon patch. \sphinxstyleemphasis{xy} is a numpy array with shape Nx2. If \sphinxstyleemphasis{closed} is \sphinxstyleemphasis{True}, the polygon will be closed so the starting and ending points are the same. Valid kwargs are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}}}] \leavevmode For additional kwargs \end{description} \index{get\_closed() (matplotlib.patches.Polygon method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon.get_closed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_closed}}}{}{} Returns if the polygon is closed \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{closed}}] \leavevmode{[}bool{]} If the path is closed \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_path() (matplotlib.patches.Polygon method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon.get_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path}}}{}{} Get the path of the polygon \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path}}] \leavevmode{[}Path{]} The {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} object for the polygon \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_xy() (matplotlib.patches.Polygon method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon.get_xy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_xy}}}{}{} Get the vertices of the path \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{vertices}}] \leavevmode{[}numpy array{]} The coordinates of the vertices as a Nx2 ndarray. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_closed() (matplotlib.patches.Polygon method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon.set_closed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_closed}}}{\emph{closed}}{} Set if the polygon is closed \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{closed}}] \leavevmode{[}bool{]} True if the polygon is closed \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_xy() (matplotlib.patches.Polygon method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon.set_xy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_xy}}}{\emph{xy}}{} Set the vertices of the polygon \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{xy}}] \leavevmode{[}numpy array or iterable of pairs{]} The coordinates of the vertices as a Nx2 ndarray or iterable of pairs. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{xy (matplotlib.patches.Polygon attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon.xy}}\pysigline{\sphinxbfcode{\sphinxupquote{xy}}} Set/get the vertices of the polygon. This property is provided for backward compatibility with matplotlib 0.91.x only. New code should use {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon.get_xy}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_xy()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon.set_xy}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xy()}}}}} instead. \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.patches.Polygon}}} \label{\detokenize{api/_as_gen/matplotlib.patches.Polygon:examples-using-matplotlib-patches-polygon}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_patch\_collection.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_boxplot\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_hatch\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_integral.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_trifinder\_event\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_poly\_editor.py} \end{itemize} \subsubsection{matplotlib.patches.Rectangle} \label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib-patches-rectangle}}\label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle::doc}}\index{Rectangle (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{Rectangle}}}{\emph{xy}, \emph{width}, \emph{height}, \emph{angle=0.0}, \emph{**kwargs}}{} Draw a rectangle with lower left at \sphinxstyleemphasis{xy} = (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) with specified \sphinxstyleemphasis{width}, \sphinxstyleemphasis{height} and rotation \sphinxstyleemphasis{angle}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{xy: length-2 tuple}}] \leavevmode The bottom and left rectangle coordinates \item[{\sphinxstylestrong{width:}}] \leavevmode Rectangle width \item[{\sphinxstylestrong{height:}}] \leavevmode Rectangle height \item[{\sphinxstylestrong{angle: float, optional}}] \leavevmode rotation in degrees anti-clockwise about \sphinxstyleemphasis{xy} (default is 0.0) \item[{\sphinxstylestrong{fill: bool, optional}}] \leavevmode Whether to fill the rectangle (default is \sphinxcode{\sphinxupquote{True}}) \end{description} \end{description}\end{quote} \paragraph{Notes} Valid kwargs are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \index{get\_bbox() (matplotlib.patches.Rectangle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle.get_bbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_bbox}}}{}{}~ \end{fulllineitems} \index{get\_height() (matplotlib.patches.Rectangle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle.get_height}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_height}}}{}{} Return the height of the rectangle \end{fulllineitems} \index{get\_patch\_transform() (matplotlib.patches.Rectangle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle.get_patch_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_patch\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance which takes patch coordinates to data coordinates. For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5. \end{fulllineitems} \index{get\_path() (matplotlib.patches.Rectangle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle.get_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path}}}{}{} Return the vertices of the rectangle \end{fulllineitems} \index{get\_width() (matplotlib.patches.Rectangle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle.get_width}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_width}}}{}{} Return the width of the rectangle \end{fulllineitems} \index{get\_x() (matplotlib.patches.Rectangle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle.get_x}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_x}}}{}{} Return the left coord of the rectangle \end{fulllineitems} \index{get\_xy() (matplotlib.patches.Rectangle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle.get_xy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_xy}}}{}{} Return the left and bottom coords of the rectangle \end{fulllineitems} \index{get\_y() (matplotlib.patches.Rectangle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle.get_y}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_y}}}{}{} Return the bottom coord of the rectangle \end{fulllineitems} \index{set\_bounds() (matplotlib.patches.Rectangle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle.set_bounds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_bounds}}}{\emph{*args}}{} Set the bounds of the rectangle: l,b,w,h ACCEPTS: (left, bottom, width, height) \end{fulllineitems} \index{set\_height() (matplotlib.patches.Rectangle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle.set_height}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_height}}}{\emph{h}}{} Set the height of the rectangle \end{fulllineitems} \index{set\_width() (matplotlib.patches.Rectangle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle.set_width}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_width}}}{\emph{w}}{} Set the width of the rectangle \end{fulllineitems} \index{set\_x() (matplotlib.patches.Rectangle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle.set_x}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_x}}}{\emph{x}}{} Set the left coord of the rectangle \end{fulllineitems} \index{set\_xy() (matplotlib.patches.Rectangle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle.set_xy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_xy}}}{\emph{xy}}{} Set the left and bottom coords of the rectangle ACCEPTS: 2-item sequence \end{fulllineitems} \index{set\_y() (matplotlib.patches.Rectangle method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle.set_y}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_y}}}{\emph{y}}{} Set the bottom coord of the rectangle \end{fulllineitems} \index{xy (matplotlib.patches.Rectangle attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle.xy}}\pysigline{\sphinxbfcode{\sphinxupquote{xy}}} Return the left and bottom coords of the rectangle \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.patches.Rectangle}}} \label{\detokenize{api/_as_gen/matplotlib.patches.Rectangle:examples-using-matplotlib-patches-rectangle}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_text\_layout.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_errorbars\_and\_boxes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_artist\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_viewlims.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_pick\_event\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_anchored\_artists.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_artist\_tests.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_menu.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Legend guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/advanced/transforms_tutorial:sphx-glr-tutorials-advanced-transforms-tutorial-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Transformations Tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/colors/colors:sphx-glr-tutorials-colors-colors-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Specifying Colors}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/text/text_props:sphx-glr-tutorials-text-text-props-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Text properties and layout}}}} \end{itemize} \subsubsection{matplotlib.patches.RegularPolygon} \label{\detokenize{api/_as_gen/matplotlib.patches.RegularPolygon:matplotlib-patches-regularpolygon}}\label{\detokenize{api/_as_gen/matplotlib.patches.RegularPolygon::doc}}\index{RegularPolygon (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.RegularPolygon:matplotlib.patches.RegularPolygon}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{RegularPolygon}}}{\emph{xy}, \emph{numVertices}, \emph{radius=5}, \emph{orientation=0}, \emph{**kwargs}}{} A regular polygon patch. Constructor arguments: \begin{description} \item[{\sphinxstyleemphasis{xy}}] \leavevmode A length 2 tuple (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) of the center. \item[{\sphinxstyleemphasis{numVertices}}] \leavevmode the number of vertices. \item[{\sphinxstyleemphasis{radius}}] \leavevmode The distance from the center to each of the vertices. \item[{\sphinxstyleemphasis{orientation}}] \leavevmode rotates the polygon (in radians). \end{description} Valid kwargs are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \index{get\_patch\_transform() (matplotlib.patches.RegularPolygon method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.RegularPolygon:matplotlib.patches.RegularPolygon.get_patch_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_patch\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance which takes patch coordinates to data coordinates. For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5. \end{fulllineitems} \index{get\_path() (matplotlib.patches.RegularPolygon method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.RegularPolygon:matplotlib.patches.RegularPolygon.get_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path}}}{}{} Return the path of this patch \end{fulllineitems} \index{numvertices (matplotlib.patches.RegularPolygon attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.RegularPolygon:matplotlib.patches.RegularPolygon.numvertices}}\pysigline{\sphinxbfcode{\sphinxupquote{numvertices}}}~ \end{fulllineitems} \index{orientation (matplotlib.patches.RegularPolygon attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.RegularPolygon:matplotlib.patches.RegularPolygon.orientation}}\pysigline{\sphinxbfcode{\sphinxupquote{orientation}}}~ \end{fulllineitems} \index{radius (matplotlib.patches.RegularPolygon attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.RegularPolygon:matplotlib.patches.RegularPolygon.radius}}\pysigline{\sphinxbfcode{\sphinxupquote{radius}}}~ \end{fulllineitems} \index{xy (matplotlib.patches.RegularPolygon attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.RegularPolygon:matplotlib.patches.RegularPolygon.xy}}\pysigline{\sphinxbfcode{\sphinxupquote{xy}}}~ \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.patches.RegularPolygon}}} \label{\detokenize{api/_as_gen/matplotlib.patches.RegularPolygon:examples-using-matplotlib-patches-regularpolygon}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_artist\_reference.py} \end{itemize} \subsubsection{matplotlib.patches.Shadow} \label{\detokenize{api/_as_gen/matplotlib.patches.Shadow:matplotlib-patches-shadow}}\label{\detokenize{api/_as_gen/matplotlib.patches.Shadow::doc}}\index{Shadow (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Shadow:matplotlib.patches.Shadow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{Shadow}}}{\emph{patch}, \emph{ox}, \emph{oy}, \emph{props=None}, \emph{**kwargs}}{} Create a shadow of the given \sphinxstyleemphasis{patch} offset by \sphinxstyleemphasis{ox}, \sphinxstyleemphasis{oy}. \sphinxstyleemphasis{props}, if not \sphinxstyleemphasis{None}, is a patch property update dictionary. If \sphinxstyleemphasis{None}, the shadow will have have the same color as the face, but darkened. kwargs are \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \index{draw() (matplotlib.patches.Shadow method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Shadow:matplotlib.patches.Shadow.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draw the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} to the given \sphinxstyleemphasis{renderer}. \end{fulllineitems} \index{get\_patch\_transform() (matplotlib.patches.Shadow method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Shadow:matplotlib.patches.Shadow.get_patch_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_patch\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance which takes patch coordinates to data coordinates. For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5. \end{fulllineitems} \index{get\_path() (matplotlib.patches.Shadow method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Shadow:matplotlib.patches.Shadow.get_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path}}}{}{} Return the path of this patch \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.patches.Shadow}}} \label{\detokenize{api/_as_gen/matplotlib.patches.Shadow:examples-using-matplotlib-patches-shadow}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_demo\_text\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_svg\_filter\_pie.py} \end{itemize} \subsubsection{matplotlib.patches.Wedge} \label{\detokenize{api/_as_gen/matplotlib.patches.Wedge:matplotlib-patches-wedge}}\label{\detokenize{api/_as_gen/matplotlib.patches.Wedge::doc}}\index{Wedge (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Wedge:matplotlib.patches.Wedge}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{Wedge}}}{\emph{center}, \emph{r}, \emph{theta1}, \emph{theta2}, \emph{width=None}, \emph{**kwargs}}{} Wedge shaped patch. Draw a wedge centered at \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} center with radius \sphinxstyleemphasis{r} that sweeps \sphinxstyleemphasis{theta1} to \sphinxstyleemphasis{theta2} (in degrees). If \sphinxstyleemphasis{width} is given, then a partial wedge is drawn from inner radius \sphinxstyleemphasis{r} - \sphinxstyleemphasis{width} to outer radius \sphinxstyleemphasis{r}. Valid kwargs are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \index{get\_path() (matplotlib.patches.Wedge method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Wedge:matplotlib.patches.Wedge.get_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path}}}{}{} Return the path of this patch \end{fulllineitems} \index{set\_center() (matplotlib.patches.Wedge method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Wedge:matplotlib.patches.Wedge.set_center}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_center}}}{\emph{center}}{}~ \end{fulllineitems} \index{set\_radius() (matplotlib.patches.Wedge method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Wedge:matplotlib.patches.Wedge.set_radius}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_radius}}}{\emph{radius}}{}~ \end{fulllineitems} \index{set\_theta1() (matplotlib.patches.Wedge method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Wedge:matplotlib.patches.Wedge.set_theta1}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_theta1}}}{\emph{theta1}}{}~ \end{fulllineitems} \index{set\_theta2() (matplotlib.patches.Wedge method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Wedge:matplotlib.patches.Wedge.set_theta2}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_theta2}}}{\emph{theta2}}{}~ \end{fulllineitems} \index{set\_width() (matplotlib.patches.Wedge method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.Wedge:matplotlib.patches.Wedge.set_width}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_width}}}{\emph{width}}{}~ \end{fulllineitems} \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.patches.Wedge}}} \label{\detokenize{api/_as_gen/matplotlib.patches.Wedge:examples-using-matplotlib-patches-wedge}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_patch\_collection.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_artist\_reference.py} \end{itemize} \subsubsection{matplotlib.patches.YAArrow} \label{\detokenize{api/_as_gen/matplotlib.patches.YAArrow:matplotlib-patches-yaarrow}}\label{\detokenize{api/_as_gen/matplotlib.patches.YAArrow::doc}}\index{YAArrow (class in matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.YAArrow:matplotlib.patches.YAArrow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{YAArrow}}}{\emph{figure}, \emph{xytip}, \emph{xybase}, \emph{width=4}, \emph{frac=0.1}, \emph{headwidth=12}, \emph{**kwargs}}{} Yet another arrow class. This is an arrow that is defined in display space and has a tip at \sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1} and a base at \sphinxstyleemphasis{x2}, \sphinxstyleemphasis{y2}. Constructor arguments: \begin{description} \item[{\sphinxstyleemphasis{xytip}}] \leavevmode (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) location of arrow tip \item[{\sphinxstyleemphasis{xybase}}] \leavevmode (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) location the arrow base mid point \item[{\sphinxstyleemphasis{figure}}] \leavevmode The {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance (fig.dpi) \item[{\sphinxstyleemphasis{width}}] \leavevmode The width of the arrow in points \item[{\sphinxstyleemphasis{frac}}] \leavevmode The fraction of the arrow length occupied by the head \item[{\sphinxstyleemphasis{headwidth}}] \leavevmode The width of the base of the arrow head in points \end{description} Valid kwargs are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \index{get\_patch\_transform() (matplotlib.patches.YAArrow method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.YAArrow:matplotlib.patches.YAArrow.get_patch_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_patch\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance which takes patch coordinates to data coordinates. For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5. \end{fulllineitems} \index{get\_path() (matplotlib.patches.YAArrow method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.YAArrow:matplotlib.patches.YAArrow.get_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path}}}{}{} Return the path of this patch \end{fulllineitems} \index{getpoints() (matplotlib.patches.YAArrow method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.YAArrow:matplotlib.patches.YAArrow.getpoints}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{getpoints}}}{\emph{x1}, \emph{y1}, \emph{x2}, \emph{y2}, \emph{k}}{} For line segment defined by (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) and (\sphinxstyleemphasis{x2}, \sphinxstyleemphasis{y2}) return the points on the line that is perpendicular to the line and intersects (\sphinxstyleemphasis{x2}, \sphinxstyleemphasis{y2}) and the distance from (\sphinxstyleemphasis{x2}, \sphinxstyleemphasis{y2}) of the returned points is \sphinxstyleemphasis{k}. \end{fulllineitems} \end{fulllineitems} \subsection{Functions} \label{\detokenize{api/patches_api:functions}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.bbox_artist:matplotlib.patches.bbox_artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bbox\_artist}}}}}(artist, renderer{[}, props, fill{]}) & This is a debug function to draw a rectangle around the bounding box returned by {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_window_extent:matplotlib.artist.Artist.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_window\_extent()}}}}} of an artist, to test whether the artist is returning the correct bbox. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.draw_bbox:matplotlib.patches.draw_bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_bbox}}}}}(bbox, renderer{[}, color, trans{]}) & This is a debug function to draw a rectangle around the bounding box returned by {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_window_extent:matplotlib.artist.Artist.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_window\_extent()}}}}} of an artist, to test whether the artist is returning the correct bbox. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{matplotlib.patches.bbox\_artist} \label{\detokenize{api/_as_gen/matplotlib.patches.bbox_artist:matplotlib-patches-bbox-artist}}\label{\detokenize{api/_as_gen/matplotlib.patches.bbox_artist::doc}}\index{bbox\_artist() (in module matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.bbox_artist:matplotlib.patches.bbox_artist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{bbox\_artist}}}{\emph{artist}, \emph{renderer}, \emph{props=None}, \emph{fill=True}}{} This is a debug function to draw a rectangle around the bounding box returned by {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_window_extent:matplotlib.artist.Artist.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_window\_extent()}}}}} of an artist, to test whether the artist is returning the correct bbox. \sphinxstyleemphasis{props} is a dict of rectangle props with the additional property ‘pad’ that sets the padding around the bbox in points. \end{fulllineitems} \subsubsection{matplotlib.patches.draw\_bbox} \label{\detokenize{api/_as_gen/matplotlib.patches.draw_bbox:matplotlib-patches-draw-bbox}}\label{\detokenize{api/_as_gen/matplotlib.patches.draw_bbox::doc}}\index{draw\_bbox() (in module matplotlib.patches)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.patches.draw_bbox:matplotlib.patches.draw_bbox}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.patches.}}\sphinxbfcode{\sphinxupquote{draw\_bbox}}}{\emph{bbox}, \emph{renderer}, \emph{color='k'}, \emph{trans=None}}{} This is a debug function to draw a rectangle around the bounding box returned by {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_window_extent:matplotlib.artist.Artist.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_window\_extent()}}}}} of an artist, to test whether the artist is returning the correct bbox. \end{fulllineitems} \chapter{path} \label{\detokenize{api/path_api:path}}\label{\detokenize{api/path_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.path}}} \label{\detokenize{api/path_api:module-matplotlib.path}}\label{\detokenize{api/path_api:matplotlib-path}}\index{matplotlib.path (module)} A module for dealing with the polylines used throughout Matplotlib. The primary class for polyline handling in Matplotlib is {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}. Almost all vector drawing makes use of {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}s somewhere in the drawing pipeline. Whilst a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance itself cannot be drawn, some {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} subclasses, such as {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.PathPatch:matplotlib.patches.PathPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathPatch}}}}} and {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PathCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathCollection}}}}}, can be used for convenient {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} visualisation. \index{Path (class in matplotlib.path)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.path.}}\sphinxbfcode{\sphinxupquote{Path}}}{\emph{vertices}, \emph{codes=None}, \emph{\_interpolation\_steps=1}, \emph{closed=False}, \emph{readonly=False}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} represents a series of possibly disconnected, possibly closed, line and curve segments. \begin{description} \item[{The underlying storage is made up of two parallel numpy arrays:}] \leavevmode\begin{itemize} \item {} \sphinxstyleemphasis{vertices}: an Nx2 float array of vertices \item {} \sphinxstyleemphasis{codes}: an N-length uint8 array of vertex types \end{itemize} \end{description} These two arrays always have the same length in the first dimension. For example, to represent a cubic curve, you must provide three vertices as well as three codes \sphinxcode{\sphinxupquote{CURVE3}}. The code types are: \begin{itemize} \item {} \begin{description} \item[{\sphinxcode{\sphinxupquote{STOP}}}] \leavevmode{[}1 vertex (ignored){]} A marker for the end of the entire path (currently not required and ignored) \end{description} \item {} \begin{description} \item[{\sphinxcode{\sphinxupquote{MOVETO}}}] \leavevmode{[}1 vertex{]} Pick up the pen and move to the given vertex. \end{description} \item {} \begin{description} \item[{\sphinxcode{\sphinxupquote{LINETO}}}] \leavevmode{[}1 vertex{]} Draw a line from the current position to the given vertex. \end{description} \item {} \begin{description} \item[{\sphinxcode{\sphinxupquote{CURVE3}}}] \leavevmode{[}1 control point, 1 endpoint{]} Draw a quadratic Bezier curve from the current position, with the given control point, to the given end point. \end{description} \item {} \begin{description} \item[{\sphinxcode{\sphinxupquote{CURVE4}}}] \leavevmode{[}2 control points, 1 endpoint{]} Draw a cubic Bezier curve from the current position, with the given control points, to the given end point. \end{description} \item {} \begin{description} \item[{\sphinxcode{\sphinxupquote{CLOSEPOLY}}}] \leavevmode{[}1 vertex (ignored){]} Draw a line segment to the start point of the current polyline. \end{description} \end{itemize} Users of Path objects should not access the vertices and codes arrays directly. Instead, they should use {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.iter_segments}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{iter\_segments()}}}}} or {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.cleaned}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cleaned()}}}}} to get the vertex/code pairs. This is important, since many {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} objects, as an optimization, do not store a \sphinxstyleemphasis{codes} at all, but have a default one provided for them by {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.iter_segments}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{iter\_segments()}}}}}. Some behavior of Path objects can be controlled by rcParams. See the rcParams whose keys contain ‘path.’. \begin{sphinxadmonition}{note}{Note:} The vertices and codes arrays should be treated as immutable \textendash{} there are a number of optimizations and assumptions made up front in the constructor that will not change when the data changes. \end{sphinxadmonition} Create a new path with the given vertices and codes. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{vertices}}] \leavevmode{[}array\_like{]} The \sphinxcode{\sphinxupquote{(n, 2)}} float array, masked array or sequence of pairs representing the vertices of the path. If \sphinxstyleemphasis{vertices} contains masked values, they will be converted to NaNs which are then handled correctly by the Agg PathIterator and other consumers of path data, such as {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.iter_segments}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{iter\_segments()}}}}}. \item[{\sphinxstylestrong{codes}}] \leavevmode{[}\{None, array\_like\}, optional{]} n-length array integers representing the codes of the path. If not None, codes must be the same length as vertices. If None, \sphinxstyleemphasis{vertices} will be treated as a series of line segments. \item[{\sphinxstylestrong{\_interpolation\_steps}}] \leavevmode{[}int, optional{]} Used as a hint to certain projections, such as Polar, that this path should be linearly interpolated immediately before drawing. This attribute is primarily an implementation detail and is not intended for public use. \item[{\sphinxstylestrong{closed}}] \leavevmode{[}bool, optional{]} If \sphinxstyleemphasis{codes} is None and closed is True, vertices will be treated as line segments of a closed polygon. \item[{\sphinxstylestrong{readonly}}] \leavevmode{[}bool, optional{]} Makes the path behave in an immutable way and sets the vertices and codes as read-only arrays. \end{description} \end{description}\end{quote} \index{CLOSEPOLY (matplotlib.path.Path attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.CLOSEPOLY}}\pysigline{\sphinxbfcode{\sphinxupquote{CLOSEPOLY}}\sphinxbfcode{\sphinxupquote{ = 79}}} \end{fulllineitems} \index{CURVE3 (matplotlib.path.Path attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.CURVE3}}\pysigline{\sphinxbfcode{\sphinxupquote{CURVE3}}\sphinxbfcode{\sphinxupquote{ = 3}}} \end{fulllineitems} \index{CURVE4 (matplotlib.path.Path attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.CURVE4}}\pysigline{\sphinxbfcode{\sphinxupquote{CURVE4}}\sphinxbfcode{\sphinxupquote{ = 4}}} \end{fulllineitems} \index{LINETO (matplotlib.path.Path attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.LINETO}}\pysigline{\sphinxbfcode{\sphinxupquote{LINETO}}\sphinxbfcode{\sphinxupquote{ = 2}}} \end{fulllineitems} \index{MOVETO (matplotlib.path.Path attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.MOVETO}}\pysigline{\sphinxbfcode{\sphinxupquote{MOVETO}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{NUM\_VERTICES\_FOR\_CODE (matplotlib.path.Path attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.NUM_VERTICES_FOR_CODE}}\pysigline{\sphinxbfcode{\sphinxupquote{NUM\_VERTICES\_FOR\_CODE}}\sphinxbfcode{\sphinxupquote{ = \{0: 1, 1: 1, 2: 1, 3: 2, 4: 3, 79: 1\}}}} A dictionary mapping Path codes to the number of vertices that the code expects. \end{fulllineitems} \index{STOP (matplotlib.path.Path attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.STOP}}\pysigline{\sphinxbfcode{\sphinxupquote{STOP}}\sphinxbfcode{\sphinxupquote{ = 0}}} \end{fulllineitems} \index{arc() (matplotlib.path.Path class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.arc}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{arc}}}{\emph{theta1}, \emph{theta2}, \emph{n=None}, \emph{is\_wedge=False}}{} Return an arc on the unit circle from angle \sphinxstyleemphasis{theta1} to angle \sphinxstyleemphasis{theta2} (in degrees). \sphinxstyleemphasis{theta2} is unwrapped to produce the shortest arc within 360 degrees. That is, if \sphinxstyleemphasis{theta2} \textgreater{} \sphinxstyleemphasis{theta1} + 360, the arc will be from \sphinxstyleemphasis{theta1} to \sphinxstyleemphasis{theta2} - 360 and not a full circle plus some extra overlap. If \sphinxstyleemphasis{n} is provided, it is the number of spline segments to make. If \sphinxstyleemphasis{n} is not provided, the number of spline segments is determined based on the delta between \sphinxstyleemphasis{theta1} and \sphinxstyleemphasis{theta2}. \begin{quote} Masionobe, L. 2003. \sphinxhref{http://www.spaceroots.org/documents/ellipse/index.html}{Drawing an elliptical arc using polylines, quadratic or cubic Bezier curves}. \end{quote} \end{fulllineitems} \index{circle() (matplotlib.path.Path class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.circle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{circle}}}{\emph{center=(0.0}, \emph{0.0)}, \emph{radius=1.0}, \emph{readonly=False}}{} Return a Path representing a circle of a given radius and center. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{center}}] \leavevmode{[}pair of floats{]} The center of the circle. Default \sphinxcode{\sphinxupquote{(0, 0)}}. \item[{\sphinxstylestrong{radius}}] \leavevmode{[}float{]} The radius of the circle. Default is 1. \item[{\sphinxstylestrong{readonly}}] \leavevmode{[}bool{]} Whether the created path should have the “readonly” argument set when creating the Path instance. \end{description} \end{description}\end{quote} \paragraph{Notes} The circle is approximated using cubic Bezier curves. This uses 8 splines around the circle using the approach presented here: \begin{quote} Lancaster, Don. \sphinxhref{http://www.tinaja.com/glib/ellipse4.pdf}{Approximating a Circle or an Ellipse Using Four Bezier Cubic Splines}. \end{quote} \end{fulllineitems} \index{cleaned() (matplotlib.path.Path method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.cleaned}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{cleaned}}}{\emph{transform=None}, \emph{remove\_nans=False}, \emph{clip=None}, \emph{quantize=False}, \emph{simplify=False}, \emph{curves=False}, \emph{stroke\_width=1.0}, \emph{snap=False}, \emph{sketch=None}}{} Cleans up the path according to the parameters returning a new Path instance. \sphinxstrong{See also:} See {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.iter_segments}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{iter\_segments()}}}}} for details of the keyword arguments. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Path instance with cleaned up vertices and codes.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{clip\_to\_bbox() (matplotlib.path.Path method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.clip_to_bbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{clip\_to\_bbox}}}{\emph{bbox}, \emph{inside=True}}{} Clip the path to the given bounding box. The path must be made up of one or more closed polygons. This algorithm will not behave correctly for unclosed paths. If \sphinxstyleemphasis{inside} is \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, clip to the inside of the box, otherwise to the outside of the box. \end{fulllineitems} \index{code\_type (matplotlib.path.Path attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.code_type}}\pysigline{\sphinxbfcode{\sphinxupquote{code\_type}}} alias of \sphinxcode{\sphinxupquote{numpy.uint8}} \end{fulllineitems} \index{codes (matplotlib.path.Path attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.codes}}\pysigline{\sphinxbfcode{\sphinxupquote{codes}}} The list of codes in the {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} as a 1-D numpy array. Each code is one of {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.STOP}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{STOP}}}}}, {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.MOVETO}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MOVETO}}}}}, {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.LINETO}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LINETO}}}}}, {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.CURVE3}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CURVE3}}}}}, {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.CURVE4}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CURVE4}}}}} or {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.CLOSEPOLY}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CLOSEPOLY}}}}}. For codes that correspond to more than one vertex ({\hyperref[\detokenize{api/path_api:matplotlib.path.Path.CURVE3}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CURVE3}}}}} and {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.CURVE4}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CURVE4}}}}}), that code will be repeated so that the length of \sphinxcode{\sphinxupquote{self.vertices}} and \sphinxcode{\sphinxupquote{self.codes}} is always the same. \end{fulllineitems} \index{contains\_path() (matplotlib.path.Path method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.contains_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains\_path}}}{\emph{path}, \emph{transform=None}}{} Returns whether this (closed) path completely contains the given path. If \sphinxstyleemphasis{transform} is not \sphinxcode{\sphinxupquote{None}}, the path will be transformed before performing the test. \end{fulllineitems} \index{contains\_point() (matplotlib.path.Path method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.contains_point}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains\_point}}}{\emph{point}, \emph{transform=None}, \emph{radius=0.0}}{} Returns whether the (closed) path contains the given point. If \sphinxstyleemphasis{transform} is not \sphinxcode{\sphinxupquote{None}}, the path will be transformed before performing the test. \sphinxstyleemphasis{radius} allows the path to be made slightly larger or smaller. \end{fulllineitems} \index{contains\_points() (matplotlib.path.Path method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.contains_points}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains\_points}}}{\emph{points}, \emph{transform=None}, \emph{radius=0.0}}{} Returns a bool array which is \sphinxcode{\sphinxupquote{True}} if the (closed) path contains the corresponding point. If \sphinxstyleemphasis{transform} is not \sphinxcode{\sphinxupquote{None}}, the path will be transformed before performing the test. \sphinxstyleemphasis{radius} allows the path to be made slightly larger or smaller. \end{fulllineitems} \index{copy() (matplotlib.path.Path method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.copy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{copy}}}{}{} Returns a shallow copy of the {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, which will share the vertices and codes with the source {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}. \end{fulllineitems} \index{deepcopy() (matplotlib.path.Path method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.deepcopy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{deepcopy}}}{\emph{memo=None}}{} Returns a deepcopy of the {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}. The {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} will not be readonly, even if the source {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} is. \end{fulllineitems} \index{get\_extents() (matplotlib.path.Path method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.get_extents}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_extents}}}{\emph{transform=None}}{} Returns the extents (\sphinxstyleemphasis{xmin}, \sphinxstyleemphasis{ymin}, \sphinxstyleemphasis{xmax}, \sphinxstyleemphasis{ymax}) of the path. Unlike computing the extents on the \sphinxstyleemphasis{vertices} alone, this algorithm will take into account the curves and deal with control points appropriately. \end{fulllineitems} \index{has\_nonfinite (matplotlib.path.Path attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.has_nonfinite}}\pysigline{\sphinxbfcode{\sphinxupquote{has\_nonfinite}}} \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} if the vertices array has nonfinite values. \end{fulllineitems} \index{hatch() (matplotlib.path.Path class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.hatch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{hatch}}}{\emph{hatchpattern}, \emph{density=6}}{} Given a hatch specifier, \sphinxstyleemphasis{hatchpattern}, generates a Path that can be used in a repeated hatching pattern. \sphinxstyleemphasis{density} is the number of lines per unit square. \end{fulllineitems} \index{interpolated() (matplotlib.path.Path method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.interpolated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{interpolated}}}{\emph{steps}}{} Returns a new path resampled to length N x steps. Does not currently handle interpolating curves. \end{fulllineitems} \index{intersects\_bbox() (matplotlib.path.Path method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.intersects_bbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{intersects\_bbox}}}{\emph{bbox}, \emph{filled=True}}{} Returns \sphinxstyleemphasis{True} if this path intersects a given {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \sphinxstyleemphasis{filled}, when True, treats the path as if it was filled. That is, if the path completely encloses the bounding box, {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.intersects_bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{intersects\_bbox()}}}}} will return True. The bounding box is always considered filled. \end{fulllineitems} \index{intersects\_path() (matplotlib.path.Path method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.intersects_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{intersects\_path}}}{\emph{other}, \emph{filled=True}}{} Returns \sphinxstyleemphasis{True} if this path intersects another given path. \sphinxstyleemphasis{filled}, when True, treats the paths as if they were filled. That is, if one path completely encloses the other, {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.intersects_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{intersects\_path()}}}}} will return True. \end{fulllineitems} \index{iter\_segments() (matplotlib.path.Path method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.iter_segments}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{iter\_segments}}}{\emph{transform=None}, \emph{remove\_nans=True}, \emph{clip=None}, \emph{snap=False}, \emph{stroke\_width=1.0}, \emph{simplify=None}, \emph{curves=True}, \emph{sketch=None}}{} Iterates over all of the curve segments in the path. Each iteration returns a 2-tuple (\sphinxstyleemphasis{vertices}, \sphinxstyleemphasis{code}), where \sphinxstyleemphasis{vertices} is a sequence of 1 - 3 coordinate pairs, and \sphinxstyleemphasis{code} is one of the {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} codes. Additionally, this method can provide a number of standard cleanups and conversions to the path. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{transform}}] \leavevmode{[}None or {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance{]} If not None, the given affine transformation will be applied to the path. \item[{\sphinxstylestrong{remove\_nans}}] \leavevmode{[}\{False, True\}, optional{]} If True, will remove all NaNs from the path and insert MOVETO commands to skip over them. \item[{\sphinxstylestrong{clip}}] \leavevmode{[}None or sequence, optional{]} If not None, must be a four-tuple (x1, y1, x2, y2) defining a rectangle in which to clip the path. \item[{\sphinxstylestrong{snap}}] \leavevmode{[}None or bool, optional{]} If None, auto-snap to pixels, to reduce fuzziness of rectilinear lines. If True, force snapping, and if False, don’t snap. \item[{\sphinxstylestrong{stroke\_width}}] \leavevmode{[}float, optional{]}\begin{description} \item[{The width of the stroke being drawn. Needed}] \leavevmode as a hint for the snapping algorithm. \end{description} \item[{\sphinxstylestrong{simplify}}] \leavevmode{[}None or bool, optional{]}\begin{description} \item[{If True, perform simplification, to remove}] \leavevmode vertices that do not affect the appearance of the path. If False, perform no simplification. If None, use the should\_simplify member variable. See also the rcParams path.simplify and path.simplify\_threshold. \end{description} \item[{\sphinxstylestrong{curves}}] \leavevmode{[}\{True, False\}, optional{]} If True, curve segments will be returned as curve segments. If False, all curves will be converted to line segments. \item[{\sphinxstylestrong{sketch}}] \leavevmode{[}None or sequence, optional{]} If not None, must be a 3-tuple of the form (scale, length, randomness), representing the sketch parameters. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{make\_compound\_path() (matplotlib.path.Path class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.make_compound_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{make\_compound\_path}}}{\emph{*args}}{} Make a compound path from a list of Path objects. \end{fulllineitems} \index{make\_compound\_path\_from\_polys() (matplotlib.path.Path class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.make_compound_path_from_polys}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{make\_compound\_path\_from\_polys}}}{\emph{XY}}{} Make a compound path object to draw a number of polygons with equal numbers of sides XY is a (numpolys x numsides x 2) numpy array of vertices. Return object is a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{histogram_path}.pdf} \end{figure} \end{fulllineitems} \index{readonly (matplotlib.path.Path attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.readonly}}\pysigline{\sphinxbfcode{\sphinxupquote{readonly}}} \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} if the {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} is read-only. \end{fulllineitems} \index{should\_simplify (matplotlib.path.Path attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.should_simplify}}\pysigline{\sphinxbfcode{\sphinxupquote{should\_simplify}}} \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} if the vertices array should be simplified. \end{fulllineitems} \index{simplify\_threshold (matplotlib.path.Path attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.simplify_threshold}}\pysigline{\sphinxbfcode{\sphinxupquote{simplify\_threshold}}} The fraction of a pixel difference below which vertices will be simplified out. \end{fulllineitems} \index{to\_polygons() (matplotlib.path.Path method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.to_polygons}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_polygons}}}{\emph{transform=None}, \emph{width=0}, \emph{height=0}, \emph{closed\_only=True}}{} Convert this path to a list of polygons or polylines. Each polygon/polyline is an Nx2 array of vertices. In other words, each polygon has no \sphinxcode{\sphinxupquote{MOVETO}} instructions or curves. This is useful for displaying in backends that do not support compound paths or Bezier curves, such as GDK. If \sphinxstyleemphasis{width} and \sphinxstyleemphasis{height} are both non-zero then the lines will be simplified so that vertices outside of (0, 0), (width, height) will be clipped. If \sphinxstyleemphasis{closed\_only} is \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} (default), only closed polygons, with the last point being the same as the first point, will be returned. Any unclosed polylines in the path will be explicitly closed. If \sphinxstyleemphasis{closed\_only} is \sphinxhref{https://docs.python.org/3/library/constants.html\#False}{\sphinxcode{\sphinxupquote{False}}}, any unclosed polygons in the path will be returned as unclosed polygons, and the closed polygons will be returned explicitly closed by setting the last point to the same as the first point. \end{fulllineitems} \index{transformed() (matplotlib.path.Path method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.transformed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transformed}}}{\emph{transform}}{} Return a transformed copy of the path. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformedPath}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.TransformedPath}}}}}}] \leavevmode A specialized path class that will cache the transformed result and automatically update when the transform changes. \end{description} \end{fulllineitems} \index{unit\_circle() (matplotlib.path.Path class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.unit_circle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{unit\_circle}}}{}{} Return the readonly {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} of the unit circle. For most cases, {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.circle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path.circle()}}}}} will be what you want. \end{fulllineitems} \index{unit\_circle\_righthalf() (matplotlib.path.Path class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.unit_circle_righthalf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{unit\_circle\_righthalf}}}{}{} Return a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} of the right half of a unit circle. The circle is approximated using cubic Bezier curves. This uses 4 splines around the circle using the approach presented here: \begin{quote} Lancaster, Don. \sphinxhref{http://www.tinaja.com/glib/ellipse4.pdf}{Approximating a Circle or an Ellipse Using Four Bezier Cubic Splines}. \end{quote} \end{fulllineitems} \index{unit\_rectangle() (matplotlib.path.Path class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.unit_rectangle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{unit\_rectangle}}}{}{} Return a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance of the unit rectangle from (0, 0) to (1, 1). \end{fulllineitems} \index{unit\_regular\_asterisk() (matplotlib.path.Path class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.unit_regular_asterisk}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{unit\_regular\_asterisk}}}{\emph{numVertices}}{} Return a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} for a unit regular asterisk with the given numVertices and radius of 1.0, centered at (0, 0). \end{fulllineitems} \index{unit\_regular\_polygon() (matplotlib.path.Path class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.unit_regular_polygon}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{unit\_regular\_polygon}}}{\emph{numVertices}}{} Return a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance for a unit regular polygon with the given \sphinxstyleemphasis{numVertices} and radius of 1.0, centered at (0, 0). \end{fulllineitems} \index{unit\_regular\_star() (matplotlib.path.Path class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.unit_regular_star}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{unit\_regular\_star}}}{\emph{numVertices}, \emph{innerCircle=0.5}}{} Return a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} for a unit regular star with the given numVertices and radius of 1.0, centered at (0, 0). \end{fulllineitems} \index{vertices (matplotlib.path.Path attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.vertices}}\pysigline{\sphinxbfcode{\sphinxupquote{vertices}}} The list of vertices in the {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} as an Nx2 numpy array. \end{fulllineitems} \index{wedge() (matplotlib.path.Path class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.Path.wedge}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{wedge}}}{\emph{theta1}, \emph{theta2}, \emph{n=None}}{} Return a wedge of the unit circle from angle \sphinxstyleemphasis{theta1} to angle \sphinxstyleemphasis{theta2} (in degrees). \sphinxstyleemphasis{theta2} is unwrapped to produce the shortest wedge within 360 degrees. That is, if \sphinxstyleemphasis{theta2} \textgreater{} \sphinxstyleemphasis{theta1} + 360, the wedge will be from \sphinxstyleemphasis{theta1} to \sphinxstyleemphasis{theta2} - 360 and not a full circle plus some extra overlap. If \sphinxstyleemphasis{n} is provided, it is the number of spline segments to make. If \sphinxstyleemphasis{n} is not provided, the number of spline segments is determined based on the delta between \sphinxstyleemphasis{theta1} and \sphinxstyleemphasis{theta2}. \end{fulllineitems} \end{fulllineitems} \index{get\_path\_collection\_extents() (in module matplotlib.path)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.get_path_collection_extents}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.path.}}\sphinxbfcode{\sphinxupquote{get\_path\_collection\_extents}}}{\emph{master\_transform}, \emph{paths}, \emph{transforms}, \emph{offsets}, \emph{offset\_transform}}{} Given a sequence of {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} objects, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} objects and offsets, as found in a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PathCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathCollection}}}}}, returns the bounding box that encapsulates all of them. \sphinxstyleemphasis{master\_transform} is a global transformation to apply to all paths \sphinxstyleemphasis{paths} is a sequence of {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instances. \sphinxstyleemphasis{transforms} is a sequence of {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Affine2D}}}}} instances. \sphinxstyleemphasis{offsets} is a sequence of (x, y) offsets (or an Nx2 array) \sphinxstyleemphasis{offset\_transform} is a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Affine2D}}}}} to apply to the offsets before applying the offset to the path. The way that \sphinxstyleemphasis{paths}, \sphinxstyleemphasis{transforms} and \sphinxstyleemphasis{offsets} are combined follows the same method as for collections. Each is iterated over independently, so if you have 3 paths, 2 transforms and 1 offset, their combinations are as follows: \begin{quote} (A, A, A), (B, B, A), (C, A, A) \end{quote} \end{fulllineitems} \index{get\_paths\_extents() (in module matplotlib.path)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/path_api:matplotlib.path.get_paths_extents}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.path.}}\sphinxbfcode{\sphinxupquote{get\_paths\_extents}}}{\emph{paths}, \emph{transforms={[}{]}}}{} Given a sequence of {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} objects and optional {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} objects, returns the bounding box that encapsulates all of them. \sphinxstyleemphasis{paths} is a sequence of {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instances. \sphinxstyleemphasis{transforms} is an optional sequence of {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Affine2D}}}}} instances to apply to each path. \end{fulllineitems} \chapter{patheffects} \label{\detokenize{api/patheffects_api:patheffects}}\label{\detokenize{api/patheffects_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.patheffects}}} \label{\detokenize{api/patheffects_api:module-matplotlib.patheffects}}\label{\detokenize{api/patheffects_api:matplotlib-patheffects}}\index{matplotlib.patheffects (module)} Defines classes for path effects. The path effects are supported in {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}}. \index{AbstractPathEffect (class in matplotlib.patheffects)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patheffects.}}\sphinxbfcode{\sphinxupquote{AbstractPathEffect}}}{\emph{offset=(0.0}, \emph{0.0)}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} A base class for path effects. Subclasses should override the \sphinxcode{\sphinxupquote{draw\_path}} method to add effect functionality. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{offset}}] \leavevmode{[}pair of floats{]} The offset to apply to the path, measured in points. \end{description} \end{description}\end{quote} \index{draw\_path() (matplotlib.patheffects.AbstractPathEffect method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect.draw_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path}}}{\emph{renderer}, \emph{gc}, \emph{tpath}, \emph{affine}, \emph{rgbFace=None}}{} Derived should override this method. The arguments are the same as {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.RendererBase.draw\_path()}}}}} except the first argument is a renderer. \end{fulllineitems} \end{fulllineitems} \index{Normal (class in matplotlib.patheffects)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.Normal}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patheffects.}}\sphinxbfcode{\sphinxupquote{Normal}}}{\emph{offset=(0.0}, \emph{0.0)}}{} Bases: {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patheffects.AbstractPathEffect}}}}} The “identity” PathEffect. The Normal PathEffect’s sole purpose is to draw the original artist with no special path effect. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{offset}}] \leavevmode{[}pair of floats{]} The offset to apply to the path, measured in points. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{PathEffectRenderer (class in matplotlib.patheffects)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.PathEffectRenderer}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patheffects.}}\sphinxbfcode{\sphinxupquote{PathEffectRenderer}}}{\emph{path\_effects}, \emph{renderer}}{} Bases: {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.RendererBase}}}}} Implements a Renderer which contains another renderer. This proxy then intercepts draw calls, calling the appropriate {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} draw method. \begin{sphinxadmonition}{note}{Note:} Not all methods have been overridden on this RendererBase subclass. It may be necessary to add further methods to extend the PathEffects capabilities further. \end{sphinxadmonition} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path\_effects}}] \leavevmode{[}iterable of {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}}{]} The path effects which this renderer represents. \item[{\sphinxstylestrong{renderer}}] \leavevmode{[}{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.RendererBase}}}}} instance{]} \end{description} \end{description}\end{quote} \index{copy\_with\_path\_effect() (matplotlib.patheffects.PathEffectRenderer method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.PathEffectRenderer.copy_with_path_effect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{copy\_with\_path\_effect}}}{\emph{path\_effects}}{}~ \end{fulllineitems} \index{draw\_markers() (matplotlib.patheffects.PathEffectRenderer method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.PathEffectRenderer.draw_markers}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_markers}}}{\emph{gc}, \emph{marker\_path}, \emph{marker\_trans}, \emph{path}, \emph{*args}, \emph{**kwargs}}{} Draws a marker at each of the vertices in path. This includes all vertices, including control points on curves. To avoid that behavior, those vertices should be removed before calling this function. This provides a fallback implementation of draw\_markers that makes multiple calls to {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.PathEffectRenderer.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path()}}}}}. Some backends may want to override this method in order to draw the marker only once and reuse it multiple times. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{gc}}] \leavevmode{[}\sphinxcode{\sphinxupquote{GraphicsContextBase}}{]} The graphics context \item[{\sphinxstylestrong{marker\_trans}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform applied to the marker. \item[{\sphinxstylestrong{trans}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} An affine transform applied to the path. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{draw\_path() (matplotlib.patheffects.PathEffectRenderer method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.PathEffectRenderer.draw_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path}}}{\emph{gc}, \emph{tpath}, \emph{affine}, \emph{rgbFace=None}}{} Draws a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance using the given affine transform. \end{fulllineitems} \index{draw\_path\_collection() (matplotlib.patheffects.PathEffectRenderer method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.PathEffectRenderer.draw_path_collection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path\_collection}}}{\emph{gc}, \emph{master\_transform}, \emph{paths}, \emph{*args}, \emph{**kwargs}}{} Draws a collection of paths selecting drawing properties from the lists \sphinxstyleemphasis{facecolors}, \sphinxstyleemphasis{edgecolors}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{linestyles} and \sphinxstyleemphasis{antialiaseds}. \sphinxstyleemphasis{offsets} is a list of offsets to apply to each of the paths. The offsets in \sphinxstyleemphasis{offsets} are first transformed by \sphinxstyleemphasis{offsetTrans} before being applied. \sphinxstyleemphasis{offset\_position} may be either “screen” or “data” depending on the space that the offsets are in. This provides a fallback implementation of {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.PathEffectRenderer.draw_path_collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path\_collection()}}}}} that makes multiple calls to {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.PathEffectRenderer.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path()}}}}}. Some backends may want to override this in order to render each set of path data only once, and then reference that path multiple times with the different offsets, colors, styles etc. The generator methods \sphinxcode{\sphinxupquote{\_iter\_collection\_raw\_paths()}} and \sphinxcode{\sphinxupquote{\_iter\_collection()}} are provided to help with (and standardize) the implementation across backends. It is highly recommended to use those generators, so that changes to the behavior of {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.PathEffectRenderer.draw_path_collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw\_path\_collection()}}}}} can be made globally. \end{fulllineitems} \index{new\_gc() (matplotlib.patheffects.PathEffectRenderer method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.PathEffectRenderer.new_gc}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{new\_gc}}}{}{} Return an instance of a \sphinxcode{\sphinxupquote{GraphicsContextBase}} \end{fulllineitems} \index{points\_to\_pixels() (matplotlib.patheffects.PathEffectRenderer method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.PathEffectRenderer.points_to_pixels}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{points\_to\_pixels}}}{\emph{points}}{} Convert points to display units You need to override this function (unless your backend doesn’t have a dpi, e.g., postscript or svg). Some imaging systems assume some value for pixels per inch: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{points} \PYG{n}{to} \PYG{n}{pixels} \PYG{o}{=} \PYG{n}{points} \PYG{o}{*} \PYG{n}{pixels\PYGZus{}per\PYGZus{}inch}\PYG{o}{/}\PYG{l+m+mf}{72.0} \PYG{o}{*} \PYG{n}{dpi}\PYG{o}{/}\PYG{l+m+mf}{72.0} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{points}}] \leavevmode{[}scalar or array\_like{]} a float or a numpy array of float \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Points converted to pixels}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{PathPatchEffect (class in matplotlib.patheffects)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.PathPatchEffect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patheffects.}}\sphinxbfcode{\sphinxupquote{PathPatchEffect}}}{\emph{offset=(0}, \emph{0)}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patheffects.AbstractPathEffect}}}}} Draws a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.PathPatch:matplotlib.patches.PathPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathPatch}}}}} instance whose Path comes from the original PathEffect artist. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{offset}}] \leavevmode{[}pair of floats{]} The offset to apply to the path, in points. \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode All keyword arguments are passed through to the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.PathPatch:matplotlib.patches.PathPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathPatch}}}}} constructor. The properties which cannot be overridden are “path”, “clip\_box” “transform” and “clip\_path”. \end{description} \end{description}\end{quote} \index{draw\_path() (matplotlib.patheffects.PathPatchEffect method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.PathPatchEffect.draw_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path}}}{\emph{renderer}, \emph{gc}, \emph{tpath}, \emph{affine}, \emph{rgbFace}}{} Derived should override this method. The arguments are the same as {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase.draw_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.RendererBase.draw\_path()}}}}} except the first argument is a renderer. \end{fulllineitems} \end{fulllineitems} \index{SimpleLineShadow (class in matplotlib.patheffects)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.SimpleLineShadow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patheffects.}}\sphinxbfcode{\sphinxupquote{SimpleLineShadow}}}{\emph{offset=(2}, \emph{-2)}, \emph{shadow\_color='k'}, \emph{alpha=0.3}, \emph{rho=0.3}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patheffects.AbstractPathEffect}}}}} A simple shadow via a line. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{offset}}] \leavevmode{[}pair of floats{]} The offset to apply to the path, in points. \item[{\sphinxstylestrong{shadow\_color}}] \leavevmode{[}color{]} The shadow color. Default is black. A value of \sphinxcode{\sphinxupquote{None}} takes the original artist’s color with a scale factor of \sphinxcode{\sphinxupquote{rho}}. \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}float{]} The alpha transparency of the created shadow patch. Default is 0.3. \item[{\sphinxstylestrong{rho}}] \leavevmode{[}float{]} A scale factor to apply to the rgbFace color if \sphinxcode{\sphinxupquote{shadow\_rgbFace}} is \sphinxcode{\sphinxupquote{None}}. Default is 0.3. \item[{\sphinxstylestrong{**kwargs}}] \leavevmode Extra keywords are stored and passed through to \sphinxcode{\sphinxupquote{AbstractPathEffect.\_update\_gc()}}. \end{description} \end{description}\end{quote} \index{draw\_path() (matplotlib.patheffects.SimpleLineShadow method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.SimpleLineShadow.draw_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path}}}{\emph{renderer}, \emph{gc}, \emph{tpath}, \emph{affine}, \emph{rgbFace}}{} Overrides the standard draw\_path to add the shadow offset and necessary color changes for the shadow. \end{fulllineitems} \end{fulllineitems} \index{SimplePatchShadow (class in matplotlib.patheffects)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.SimplePatchShadow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patheffects.}}\sphinxbfcode{\sphinxupquote{SimplePatchShadow}}}{\emph{offset=(2}, \emph{-2)}, \emph{shadow\_rgbFace=None}, \emph{alpha=None}, \emph{rho=0.3}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patheffects.AbstractPathEffect}}}}} A simple shadow via a filled patch. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{offset}}] \leavevmode{[}pair of floats{]} The offset of the shadow in points. \item[{\sphinxstylestrong{shadow\_rgbFace}}] \leavevmode{[}color{]} The shadow color. \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}float{]} The alpha transparency of the created shadow patch. Default is 0.3. \sphinxurl{http://matplotlib.1069221.n5.nabble.com/path-effects-question-td27630.html} \item[{\sphinxstylestrong{rho}}] \leavevmode{[}float{]} A scale factor to apply to the rgbFace color if \sphinxcode{\sphinxupquote{shadow\_rgbFace}} is not specified. Default is 0.3. \item[{\sphinxstylestrong{**kwargs}}] \leavevmode Extra keywords are stored and passed through to \sphinxcode{\sphinxupquote{AbstractPathEffect.\_update\_gc()}}. \end{description} \end{description}\end{quote} \index{draw\_path() (matplotlib.patheffects.SimplePatchShadow method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.SimplePatchShadow.draw_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path}}}{\emph{renderer}, \emph{gc}, \emph{tpath}, \emph{affine}, \emph{rgbFace}}{} Overrides the standard draw\_path to add the shadow offset and necessary color changes for the shadow. \end{fulllineitems} \end{fulllineitems} \index{Stroke (class in matplotlib.patheffects)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.Stroke}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patheffects.}}\sphinxbfcode{\sphinxupquote{Stroke}}}{\emph{offset=(0}, \emph{0)}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patheffects.AbstractPathEffect}}}}} A line based PathEffect which re-draws a stroke. The path will be stroked with its gc updated with the given keyword arguments, i.e., the keyword arguments should be valid gc parameter values. \index{draw\_path() (matplotlib.patheffects.Stroke method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.Stroke.draw_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path}}}{\emph{renderer}, \emph{gc}, \emph{tpath}, \emph{affine}, \emph{rgbFace}}{} draw the path with updated gc. \end{fulllineitems} \end{fulllineitems} \index{withSimplePatchShadow (class in matplotlib.patheffects)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.withSimplePatchShadow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patheffects.}}\sphinxbfcode{\sphinxupquote{withSimplePatchShadow}}}{\emph{offset=(2}, \emph{-2)}, \emph{shadow\_rgbFace=None}, \emph{alpha=None}, \emph{rho=0.3}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.SimplePatchShadow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patheffects.SimplePatchShadow}}}}} Adds a simple {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.SimplePatchShadow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SimplePatchShadow}}}}} and then draws the original Artist to avoid needing to call {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.Normal}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normal}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{offset}}] \leavevmode{[}pair of floats{]} The offset of the shadow in points. \item[{\sphinxstylestrong{shadow\_rgbFace}}] \leavevmode{[}color{]} The shadow color. \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}float{]} The alpha transparency of the created shadow patch. Default is 0.3. \sphinxurl{http://matplotlib.1069221.n5.nabble.com/path-effects-question-td27630.html} \item[{\sphinxstylestrong{rho}}] \leavevmode{[}float{]} A scale factor to apply to the rgbFace color if \sphinxcode{\sphinxupquote{shadow\_rgbFace}} is not specified. Default is 0.3. \item[{\sphinxstylestrong{**kwargs}}] \leavevmode Extra keywords are stored and passed through to \sphinxcode{\sphinxupquote{AbstractPathEffect.\_update\_gc()}}. \end{description} \end{description}\end{quote} \index{draw\_path() (matplotlib.patheffects.withSimplePatchShadow method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.withSimplePatchShadow.draw_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path}}}{\emph{renderer}, \emph{gc}, \emph{tpath}, \emph{affine}, \emph{rgbFace}}{} Overrides the standard draw\_path to add the shadow offset and necessary color changes for the shadow. \end{fulllineitems} \end{fulllineitems} \index{withStroke (class in matplotlib.patheffects)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.withStroke}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.patheffects.}}\sphinxbfcode{\sphinxupquote{withStroke}}}{\emph{offset=(0}, \emph{0)}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.Stroke}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patheffects.Stroke}}}}} Adds a simple {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.Stroke}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Stroke}}}}} and then draws the original Artist to avoid needing to call {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.Normal}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normal}}}}}. The path will be stroked with its gc updated with the given keyword arguments, i.e., the keyword arguments should be valid gc parameter values. \index{draw\_path() (matplotlib.patheffects.withStroke method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/patheffects_api:matplotlib.patheffects.withStroke.draw_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_path}}}{\emph{renderer}, \emph{gc}, \emph{tpath}, \emph{affine}, \emph{rgbFace}}{} draw the path with updated gc. \end{fulllineitems} \end{fulllineitems} \chapter{projections} \label{\detokenize{api/projections_api:projections}}\label{\detokenize{api/projections_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.projections}}} \label{\detokenize{api/projections_api:module-matplotlib.projections}}\label{\detokenize{api/projections_api:matplotlib-projections}}\index{matplotlib.projections (module)}\index{ProjectionRegistry (class in matplotlib.projections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.ProjectionRegistry}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.projections.}}\sphinxbfcode{\sphinxupquote{ProjectionRegistry}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Manages the set of projections available to the system. \index{get\_projection\_class() (matplotlib.projections.ProjectionRegistry method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.ProjectionRegistry.get_projection_class}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_projection\_class}}}{\emph{name}}{} Get a projection class from its \sphinxstyleemphasis{name}. \end{fulllineitems} \index{get\_projection\_names() (matplotlib.projections.ProjectionRegistry method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.ProjectionRegistry.get_projection_names}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_projection\_names}}}{}{} Get a list of the names of all projections currently registered. \end{fulllineitems} \index{register() (matplotlib.projections.ProjectionRegistry method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.ProjectionRegistry.register}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{register}}}{\emph{*projections}}{} Register a new set of projection(s). \end{fulllineitems} \end{fulllineitems} \index{get\_projection\_class() (in module matplotlib.projections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.get_projection_class}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.projections.}}\sphinxbfcode{\sphinxupquote{get\_projection\_class}}}{\emph{projection=None}}{} Get a projection class from its name. If \sphinxstyleemphasis{projection} is None, a standard rectilinear projection is returned. \end{fulllineitems} \index{get\_projection\_names() (in module matplotlib.projections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.get_projection_names}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.projections.}}\sphinxbfcode{\sphinxupquote{get\_projection\_names}}}{}{} Get a list of acceptable projection names. \end{fulllineitems} \index{process\_projection\_requirements() (in module matplotlib.projections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.process_projection_requirements}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.projections.}}\sphinxbfcode{\sphinxupquote{process\_projection\_requirements}}}{\emph{figure}, \emph{*args}, \emph{**kwargs}}{} Handle the args/kwargs to for add\_axes/add\_subplot/gca, returning: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{axes\PYGZus{}proj\PYGZus{}class}\PYG{p}{,} \PYG{n}{proj\PYGZus{}class\PYGZus{}kwargs}\PYG{p}{,} \PYG{n}{proj\PYGZus{}stack\PYGZus{}key}\PYG{p}{)} \end{sphinxVerbatim} Which can be used for new axes initialization/identification. \begin{sphinxadmonition}{note}{Note:} \sphinxstylestrong{kwargs} is modified in place. \end{sphinxadmonition} \end{fulllineitems} \index{register\_projection() (in module matplotlib.projections)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.register_projection}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.projections.}}\sphinxbfcode{\sphinxupquote{register\_projection}}}{\emph{cls}}{}~ \end{fulllineitems} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.projections.polar}}} \label{\detokenize{api/projections_api:module-matplotlib.projections.polar}}\label{\detokenize{api/projections_api:matplotlib-projections-polar}}\index{matplotlib.projections.polar (module)}\index{InvertedPolarTransform (class in matplotlib.projections.polar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.InvertedPolarTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.projections.polar.}}\sphinxbfcode{\sphinxupquote{InvertedPolarTransform}}}{\emph{axis=None}, \emph{use\_rmin=True}, \emph{\_apply\_theta\_transforms=True}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} The inverse of the polar transform, mapping Cartesian coordinate space \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} back to \sphinxstyleemphasis{theta} and \sphinxstyleemphasis{r}. \index{input\_dims (matplotlib.projections.polar.InvertedPolarTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.InvertedPolarTransform.input_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{input\_dims}}\sphinxbfcode{\sphinxupquote{ = 2}}} \end{fulllineitems} \index{inverted() (matplotlib.projections.polar.InvertedPolarTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.InvertedPolarTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \index{is\_separable (matplotlib.projections.polar.InvertedPolarTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.InvertedPolarTransform.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = False}}} \end{fulllineitems} \index{output\_dims (matplotlib.projections.polar.InvertedPolarTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.InvertedPolarTransform.output_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_dims}}\sphinxbfcode{\sphinxupquote{ = 2}}} \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.projections.polar.InvertedPolarTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.InvertedPolarTransform.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{xy}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.InvertedPolarTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}) and returns a numpy array of shape (N x {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.InvertedPolarTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}). Alternatively, accepts a numpy array of length {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.InvertedPolarTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}} and returns a numpy array of length {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.InvertedPolarTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \end{fulllineitems} \index{PolarAffine (class in matplotlib.projections.polar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAffine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.projections.polar.}}\sphinxbfcode{\sphinxupquote{PolarAffine}}}{\emph{scale\_transform}, \emph{limits}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Affine2DBase}}}}} The affine part of the polar projection. Scales the output so that maximum radius rests on the edge of the axes circle. \sphinxstyleemphasis{limits} is the view limit of the data. The only part of its bounds that is used is the y limits (for the radius limits). The theta range is handled by the non-affine transform. \index{get\_matrix() (matplotlib.projections.polar.PolarAffine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAffine.get_matrix}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_matrix}}}{}{} Get the Affine transformation array for the affine part of this transform. \end{fulllineitems} \end{fulllineitems} \index{PolarAxes (class in matplotlib.projections.polar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.projections.polar.}}\sphinxbfcode{\sphinxupquote{PolarAxes}}}{\emph{*args}, \emph{**kwargs}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.axes.\_axes.Axes}} A polar graph projection, where the input dimensions are \sphinxstyleemphasis{theta}, \sphinxstyleemphasis{r}. Theta starts pointing east and goes anti-clockwise. \index{PolarAxes.InvertedPolarTransform (class in matplotlib.projections.polar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.InvertedPolarTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{InvertedPolarTransform}}}{\emph{axis=None}, \emph{use\_rmin=True}, \emph{\_apply\_theta\_transforms=True}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} The inverse of the polar transform, mapping Cartesian coordinate space \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} back to \sphinxstyleemphasis{theta} and \sphinxstyleemphasis{r}. \index{input\_dims (matplotlib.projections.polar.PolarAxes.InvertedPolarTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.InvertedPolarTransform.input_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{input\_dims}}\sphinxbfcode{\sphinxupquote{ = 2}}} \end{fulllineitems} \index{inverted() (matplotlib.projections.polar.PolarAxes.InvertedPolarTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.InvertedPolarTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \index{is\_separable (matplotlib.projections.polar.PolarAxes.InvertedPolarTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.InvertedPolarTransform.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = False}}} \end{fulllineitems} \index{output\_dims (matplotlib.projections.polar.PolarAxes.InvertedPolarTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.InvertedPolarTransform.output_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_dims}}\sphinxbfcode{\sphinxupquote{ = 2}}} \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.projections.polar.PolarAxes.InvertedPolarTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.InvertedPolarTransform.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{xy}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.InvertedPolarTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}) and returns a numpy array of shape (N x {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.InvertedPolarTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}). Alternatively, accepts a numpy array of length {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.InvertedPolarTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}} and returns a numpy array of length {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.InvertedPolarTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \end{fulllineitems} \index{PolarAxes.PolarAffine (class in matplotlib.projections.polar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.PolarAffine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{PolarAffine}}}{\emph{scale\_transform}, \emph{limits}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Affine2DBase}}}}} The affine part of the polar projection. Scales the output so that maximum radius rests on the edge of the axes circle. \sphinxstyleemphasis{limits} is the view limit of the data. The only part of its bounds that is used is the y limits (for the radius limits). The theta range is handled by the non-affine transform. \index{get\_matrix() (matplotlib.projections.polar.PolarAxes.PolarAffine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.PolarAffine.get_matrix}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_matrix}}}{}{} Get the Affine transformation array for the affine part of this transform. \end{fulllineitems} \end{fulllineitems} \index{PolarAxes.PolarTransform (class in matplotlib.projections.polar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.PolarTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{PolarTransform}}}{\emph{axis=None}, \emph{use\_rmin=True}, \emph{\_apply\_theta\_transforms=True}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} The base polar transform. This handles projection \sphinxstyleemphasis{theta} and \sphinxstyleemphasis{r} into Cartesian coordinate space \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}, but does not perform the ultimate affine transformation into the correct position. \index{input\_dims (matplotlib.projections.polar.PolarAxes.PolarTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.PolarTransform.input_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{input\_dims}}\sphinxbfcode{\sphinxupquote{ = 2}}} \end{fulllineitems} \index{inverted() (matplotlib.projections.polar.PolarAxes.PolarTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.PolarTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \index{is\_separable (matplotlib.projections.polar.PolarAxes.PolarTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.PolarTransform.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = False}}} \end{fulllineitems} \index{output\_dims (matplotlib.projections.polar.PolarAxes.PolarTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.PolarTransform.output_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_dims}}\sphinxbfcode{\sphinxupquote{ = 2}}} \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.projections.polar.PolarAxes.PolarTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.PolarTransform.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{tr}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.PolarTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}) and returns a numpy array of shape (N x {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.PolarTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}). Alternatively, accepts a numpy array of length {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.PolarTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}} and returns a numpy array of length {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.PolarTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \index{transform\_path\_non\_affine() (matplotlib.projections.polar.PolarAxes.PolarTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.PolarTransform.transform_path_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_path\_non\_affine}}}{\emph{path}}{} Returns a path, transformed only by the non-affine part of this transform. \sphinxstyleemphasis{path}: a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \sphinxcode{\sphinxupquote{transform\_path(path)}} is equivalent to \sphinxcode{\sphinxupquote{transform\_path\_affine(transform\_path\_non\_affine(values))}}. \end{fulllineitems} \end{fulllineitems} \index{PolarAxes.RadialLocator (class in matplotlib.projections.polar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.RadialLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{RadialLocator}}}{\emph{base}, \emph{axes=None}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Locator}}}}} Used to locate radius ticks. Ensures that all ticks are strictly positive. For all other tasks, it delegates to the base {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Locator}}}}} (which may be different depending on the scale of the \sphinxstyleemphasis{r}-axis. \index{autoscale() (matplotlib.projections.polar.PolarAxes.RadialLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.RadialLocator.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} autoscale the view limits \end{fulllineitems} \index{pan() (matplotlib.projections.polar.PolarAxes.RadialLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.RadialLocator.pan}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pan}}}{\emph{numsteps}}{} Pan numticks (can be positive or negative) \end{fulllineitems} \index{refresh() (matplotlib.projections.polar.PolarAxes.RadialLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.RadialLocator.refresh}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{refresh}}}{}{} refresh internal information based on current lim \end{fulllineitems} \index{view\_limits() (matplotlib.projections.polar.PolarAxes.RadialLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.RadialLocator.view_limits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{view\_limits}}}{\emph{vmin}, \emph{vmax}}{} select a scale for the range from vmin to vmax Normally this method is overridden by subclasses to change locator behaviour. \end{fulllineitems} \index{zoom() (matplotlib.projections.polar.PolarAxes.RadialLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.RadialLocator.zoom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{zoom}}}{\emph{direction}}{} Zoom in/out on axis; if direction is \textgreater{}0 zoom in, else zoom out \end{fulllineitems} \end{fulllineitems} \index{PolarAxes.ThetaFormatter (class in matplotlib.projections.polar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.ThetaFormatter}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{ThetaFormatter}}} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Formatter}}}}} Used to format the \sphinxstyleemphasis{theta} tick labels. Converts the native unit of radians into degrees and adds a degree symbol. \end{fulllineitems} \index{PolarAxes.ThetaLocator (class in matplotlib.projections.polar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.ThetaLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{ThetaLocator}}}{\emph{base}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Locator}}}}} Used to locate theta ticks. This will work the same as the base locator except in the case that the view spans the entire circle. In such cases, the previously used default locations of every 45 degrees are returned. \index{autoscale() (matplotlib.projections.polar.PolarAxes.ThetaLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.ThetaLocator.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} autoscale the view limits \end{fulllineitems} \index{pan() (matplotlib.projections.polar.PolarAxes.ThetaLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.ThetaLocator.pan}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pan}}}{\emph{numsteps}}{} Pan numticks (can be positive or negative) \end{fulllineitems} \index{refresh() (matplotlib.projections.polar.PolarAxes.ThetaLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.ThetaLocator.refresh}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{refresh}}}{}{} refresh internal information based on current lim \end{fulllineitems} \index{set\_axis() (matplotlib.projections.polar.PolarAxes.ThetaLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.ThetaLocator.set_axis}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_axis}}}{\emph{axis}}{}~ \end{fulllineitems} \index{view\_limits() (matplotlib.projections.polar.PolarAxes.ThetaLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.ThetaLocator.view_limits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{view\_limits}}}{\emph{vmin}, \emph{vmax}}{} select a scale for the range from vmin to vmax Normally this method is overridden by subclasses to change locator behaviour. \end{fulllineitems} \index{zoom() (matplotlib.projections.polar.PolarAxes.ThetaLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.ThetaLocator.zoom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{zoom}}}{\emph{direction}}{} Zoom in/out on axis; if direction is \textgreater{}0 zoom in, else zoom out \end{fulllineitems} \end{fulllineitems} \index{can\_pan() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.can_pan}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{can\_pan}}}{}{} Return \sphinxstyleemphasis{True} if this axes supports the pan/zoom button functionality. For polar axes, this is slightly misleading. Both panning and zooming are performed by the same button. Panning is performed in azimuth while zooming is done along the radial. \end{fulllineitems} \index{can\_zoom() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.can_zoom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{can\_zoom}}}{}{} Return \sphinxstyleemphasis{True} if this axes supports the zoom box button functionality. Polar axes do not support zoom boxes. \end{fulllineitems} \index{cla() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.cla}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{cla}}}{}{} Clear the current axes. \end{fulllineitems} \index{drag\_pan() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.drag_pan}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{drag\_pan}}}{\emph{button}, \emph{key}, \emph{x}, \emph{y}}{} Called when the mouse moves during a pan operation. \sphinxstyleemphasis{button} is the mouse button number: \begin{itemize} \item {} 1: LEFT \item {} 2: MIDDLE \item {} 3: RIGHT \end{itemize} \sphinxstyleemphasis{key} is a “shift” key \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} are the mouse coordinates in display coords. \begin{sphinxadmonition}{note}{Note:} Intended to be overridden by new projection types. \end{sphinxadmonition} \end{fulllineitems} \index{draw() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{*args}, \emph{**kwargs}}{} Draw everything (plot lines, axes, labels) \end{fulllineitems} \index{end\_pan() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.end_pan}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{end\_pan}}}{}{} Called when a pan operation completes (when the mouse button is up.) \begin{sphinxadmonition}{note}{Note:} Intended to be overridden by new projection types. \end{sphinxadmonition} \end{fulllineitems} \index{format\_coord() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.format_coord}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_coord}}}{\emph{theta}, \emph{r}}{} Return a format string formatting the coordinate using Unicode characters. \end{fulllineitems} \index{get\_data\_ratio() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.get_data_ratio}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_data\_ratio}}}{}{} Return the aspect ratio of the data itself. For a polar plot, this should always be 1.0 \end{fulllineitems} \index{get\_rlabel\_position() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.get_rlabel_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rlabel\_position}}}{}{}~\begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{float}}] \leavevmode The theta position of the radius labels in degrees. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_rmax() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.get_rmax}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rmax}}}{}{}~ \end{fulllineitems} \index{get\_rmin() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.get_rmin}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rmin}}}{}{}~ \end{fulllineitems} \index{get\_rorigin() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.get_rorigin}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rorigin}}}{}{}~ \end{fulllineitems} \index{get\_theta\_direction() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.get_theta_direction}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_theta\_direction}}}{}{} Get the direction in which theta increases. \begin{description} \item[{-1:}] \leavevmode Theta increases in the clockwise direction \item[{1:}] \leavevmode Theta increases in the counterclockwise direction \end{description} \end{fulllineitems} \index{get\_theta\_offset() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.get_theta_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_theta\_offset}}}{}{} Get the offset for the location of 0 in radians. \end{fulllineitems} \index{get\_thetamax() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.get_thetamax}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_thetamax}}}{}{}~ \end{fulllineitems} \index{get\_thetamin() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.get_thetamin}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_thetamin}}}{}{}~ \end{fulllineitems} \index{get\_xaxis\_text1\_transform() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.get_xaxis_text1_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_xaxis\_text1\_transform}}}{\emph{pad}}{} Get the transformation used for drawing x-axis labels, which will add the given amount of padding (in points) between the axes and the label. The x-direction is in data coordinates and the y-direction is in axis coordinates. Returns a 3-tuple of the form: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{transform}\PYG{p}{,} \PYG{n}{valign}\PYG{p}{,} \PYG{n}{halign}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxstyleemphasis{valign} and \sphinxstyleemphasis{halign} are requested alignments for the text. \begin{sphinxadmonition}{note}{Note:} This transformation is primarily used by the {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations. \end{sphinxadmonition} \end{fulllineitems} \index{get\_xaxis\_text2\_transform() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.get_xaxis_text2_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_xaxis\_text2\_transform}}}{\emph{pad}}{} Get the transformation used for drawing the secondary x-axis labels, which will add the given amount of padding (in points) between the axes and the label. The x-direction is in data coordinates and the y-direction is in axis coordinates. Returns a 3-tuple of the form: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{transform}\PYG{p}{,} \PYG{n}{valign}\PYG{p}{,} \PYG{n}{halign}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxstyleemphasis{valign} and \sphinxstyleemphasis{halign} are requested alignments for the text. \begin{sphinxadmonition}{note}{Note:} This transformation is primarily used by the {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations. \end{sphinxadmonition} \end{fulllineitems} \index{get\_xaxis\_transform() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.get_xaxis_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_xaxis\_transform}}}{\emph{which='grid'}}{} Get the transformation used for drawing x-axis labels, ticks and gridlines. The x-direction is in data coordinates and the y-direction is in axis coordinates. \begin{sphinxadmonition}{note}{Note:} This transformation is primarily used by the {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations. \end{sphinxadmonition} \end{fulllineitems} \index{get\_yaxis\_text1\_transform() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.get_yaxis_text1_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_yaxis\_text1\_transform}}}{\emph{pad}}{} Get the transformation used for drawing y-axis labels, which will add the given amount of padding (in points) between the axes and the label. The x-direction is in axis coordinates and the y-direction is in data coordinates. Returns a 3-tuple of the form: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{transform}\PYG{p}{,} \PYG{n}{valign}\PYG{p}{,} \PYG{n}{halign}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxstyleemphasis{valign} and \sphinxstyleemphasis{halign} are requested alignments for the text. \begin{sphinxadmonition}{note}{Note:} This transformation is primarily used by the {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations. \end{sphinxadmonition} \end{fulllineitems} \index{get\_yaxis\_text2\_transform() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.get_yaxis_text2_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_yaxis\_text2\_transform}}}{\emph{pad}}{} Get the transformation used for drawing the secondary y-axis labels, which will add the given amount of padding (in points) between the axes and the label. The x-direction is in axis coordinates and the y-direction is in data coordinates. Returns a 3-tuple of the form: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{transform}\PYG{p}{,} \PYG{n}{valign}\PYG{p}{,} \PYG{n}{halign}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxstyleemphasis{valign} and \sphinxstyleemphasis{halign} are requested alignments for the text. \begin{sphinxadmonition}{note}{Note:} This transformation is primarily used by the {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations. \end{sphinxadmonition} \end{fulllineitems} \index{get\_yaxis\_transform() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.get_yaxis_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_yaxis\_transform}}}{\emph{which='grid'}}{} Get the transformation used for drawing y-axis labels, ticks and gridlines. The x-direction is in axis coordinates and the y-direction is in data coordinates. \begin{sphinxadmonition}{note}{Note:} This transformation is primarily used by the {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations. \end{sphinxadmonition} \end{fulllineitems} \index{name (matplotlib.projections.polar.PolarAxes attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.name}}\pysigline{\sphinxbfcode{\sphinxupquote{name}}\sphinxbfcode{\sphinxupquote{ = 'polar'}}} \end{fulllineitems} \index{set\_rgrids() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_rgrids}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rgrids}}}{\emph{radii}, \emph{labels=None}, \emph{angle=None}, \emph{fmt=None}, \emph{**kwargs}}{} Set the radial locations and labels of the \sphinxstyleemphasis{r} grids. The labels will appear at radial distances \sphinxstyleemphasis{radii} at the given \sphinxstyleemphasis{angle} in degrees. \sphinxstyleemphasis{labels}, if not None, is a \sphinxcode{\sphinxupquote{len(radii)}} list of strings of the labels to use at each radius. If \sphinxstyleemphasis{labels} is None, the built-in formatter will be used. Return value is a list of tuples (\sphinxstyleemphasis{line}, \sphinxstyleemphasis{label}), where \sphinxstyleemphasis{line} is {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instances and the \sphinxstyleemphasis{label} is {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. kwargs are optional text properties for the labels: \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_backgroundcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{backgroundcolor}}}}} & any matplotlib color \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bbox}}}}} & FancyBboxPatch prop dict \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[} ({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_family}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{family}}}}} or fontfamily or fontname or name & {[}FONTNAME \textbar{} ‘serif’ \textbar{} ‘sans-serif’ \textbar{} ‘cursive’ \textbar{} ‘fantasy’ \textbar{} ‘monospace’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_fontproperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fontproperties}}}}} or font\_properties & a {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_horizontalalignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{horizontalalignment}}}}} or ha & {[} ‘center’ \textbar{} ‘right’ \textbar{} ‘left’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_linespacing}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linespacing}}}}} & float (multiple of font size) \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_multialignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{multialignment}}}}} or ma & {[}‘left’ \textbar{} ‘right’ \textbar{} ‘center’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{position}}}}} & (x,y) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_rotation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotation}}}}} & {[} angle in degrees \textbar{} ‘vertical’ \textbar{} ‘horizontal’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_rotation_mode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotation\_mode}}}}} & {[} None \textbar{} “default” \textbar{} “anchor” {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_size}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{size}}}}} or fontsize & {[}size in points \textbar{} ‘xx-small’ \textbar{} ‘x-small’ \textbar{} ‘small’ \textbar{} ‘medium’ \textbar{} ‘large’ \textbar{} ‘x-large’ \textbar{} ‘xx-large’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_stretch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stretch}}}}} or fontstretch & {[}a numeric value in range 0-1000 \textbar{} ‘ultra-condensed’ \textbar{} ‘extra-condensed’ \textbar{} ‘condensed’ \textbar{} ‘semi-condensed’ \textbar{} ‘normal’ \textbar{} ‘semi-expanded’ \textbar{} ‘expanded’ \textbar{} ‘extra-expanded’ \textbar{} ‘ultra-expanded’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_style}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{style}}}}} or fontstyle & {[} ‘normal’ \textbar{} ‘italic’ \textbar{} ‘oblique’{]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text}}}}} & string or anything printable with ‘\%s’ conversion. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_usetex}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{usetex}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_variant}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{variant}}}}} or fontvariant & {[} ‘normal’ \textbar{} ‘small-caps’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_verticalalignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{verticalalignment}}}}} or va & {[} ‘center’ \textbar{} ‘top’ \textbar{} ‘bottom’ \textbar{} ‘baseline’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_weight}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{weight}}}}} or fontweight & {[}a numeric value in range 0-1000 \textbar{} ‘ultralight’ \textbar{} ‘light’ \textbar{} ‘normal’ \textbar{} ‘regular’ \textbar{} ‘book’ \textbar{} ‘medium’ \textbar{} ‘roman’ \textbar{} ‘semibold’ \textbar{} ‘demibold’ \textbar{} ‘demi’ \textbar{} ‘bold’ \textbar{} ‘heavy’ \textbar{} ‘extra bold’ \textbar{} ‘black’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_wrap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{wrap}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_x}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x}}}}} & float \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_y}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y}}}}} & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} ACCEPTS: sequence of floats \end{fulllineitems} \index{set\_rlabel\_position() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_rlabel_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rlabel\_position}}}{\emph{value}}{} Updates the theta position of the radius labels. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{value}}] \leavevmode{[}number{]} The angular position of the radius labels in degrees. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_rlim() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_rlim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rlim}}}{\emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \index{set\_rmax() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_rmax}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rmax}}}{\emph{rmax}}{}~ \end{fulllineitems} \index{set\_rmin() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_rmin}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rmin}}}{\emph{rmin}}{}~ \end{fulllineitems} \index{set\_rorigin() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_rorigin}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rorigin}}}{\emph{rorigin}}{}~ \end{fulllineitems} \index{set\_rscale() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_rscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rscale}}}{\emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \index{set\_rticks() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_rticks}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rticks}}}{\emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \index{set\_theta\_direction() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_theta_direction}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_theta\_direction}}}{\emph{direction}}{} Set the direction in which theta increases. \begin{description} \item[{clockwise, -1:}] \leavevmode Theta increases in the clockwise direction \item[{counterclockwise, anticlockwise, 1:}] \leavevmode Theta increases in the counterclockwise direction \end{description} \end{fulllineitems} \index{set\_theta\_offset() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_theta_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_theta\_offset}}}{\emph{offset}}{} Set the offset for the location of 0 in radians. \end{fulllineitems} \index{set\_theta\_zero\_location() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_theta_zero_location}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_theta\_zero\_location}}}{\emph{loc}, \emph{offset=0.0}}{} Sets the location of theta’s zero. (Calls set\_theta\_offset with the correct value in radians under the hood.) \begin{description} \item[{loc}] \leavevmode{[}str{]} May be one of “N”, “NW”, “W”, “SW”, “S”, “SE”, “E”, or “NE”. \item[{offset}] \leavevmode{[}float, optional{]} An offset in degrees to apply from the specified \sphinxcode{\sphinxupquote{loc}}. \sphinxstylestrong{Note:} this offset is \sphinxstyleemphasis{always} applied counter-clockwise regardless of the direction setting. \end{description} \end{fulllineitems} \index{set\_thetagrids() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_thetagrids}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_thetagrids}}}{\emph{angles}, \emph{labels=None}, \emph{frac=None}, \emph{fmt=None}, \emph{**kwargs}}{} Set the angles at which to place the theta grids (these gridlines are equal along the theta dimension). \sphinxstyleemphasis{angles} is in degrees. \sphinxstyleemphasis{labels}, if not None, is a \sphinxcode{\sphinxupquote{len(angles)}} list of strings of the labels to use at each angle. If \sphinxstyleemphasis{labels} is None, the labels will be \sphinxcode{\sphinxupquote{fmt \% angle}} \sphinxstyleemphasis{frac} is the fraction of the polar axes radius at which to place the label (1 is the edge). e.g., 1.05 is outside the axes and 0.95 is inside the axes. Return value is a list of tuples (\sphinxstyleemphasis{line}, \sphinxstyleemphasis{label}), where \sphinxstyleemphasis{line} is {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instances and the \sphinxstyleemphasis{label} is {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. kwargs are optional text properties for the labels: \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_backgroundcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{backgroundcolor}}}}} & any matplotlib color \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bbox}}}}} & FancyBboxPatch prop dict \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[} ({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_family}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{family}}}}} or fontfamily or fontname or name & {[}FONTNAME \textbar{} ‘serif’ \textbar{} ‘sans-serif’ \textbar{} ‘cursive’ \textbar{} ‘fantasy’ \textbar{} ‘monospace’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_fontproperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fontproperties}}}}} or font\_properties & a {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_horizontalalignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{horizontalalignment}}}}} or ha & {[} ‘center’ \textbar{} ‘right’ \textbar{} ‘left’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_linespacing}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linespacing}}}}} & float (multiple of font size) \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_multialignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{multialignment}}}}} or ma & {[}‘left’ \textbar{} ‘right’ \textbar{} ‘center’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{position}}}}} & (x,y) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_rotation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotation}}}}} & {[} angle in degrees \textbar{} ‘vertical’ \textbar{} ‘horizontal’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_rotation_mode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotation\_mode}}}}} & {[} None \textbar{} “default” \textbar{} “anchor” {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_size}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{size}}}}} or fontsize & {[}size in points \textbar{} ‘xx-small’ \textbar{} ‘x-small’ \textbar{} ‘small’ \textbar{} ‘medium’ \textbar{} ‘large’ \textbar{} ‘x-large’ \textbar{} ‘xx-large’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_stretch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stretch}}}}} or fontstretch & {[}a numeric value in range 0-1000 \textbar{} ‘ultra-condensed’ \textbar{} ‘extra-condensed’ \textbar{} ‘condensed’ \textbar{} ‘semi-condensed’ \textbar{} ‘normal’ \textbar{} ‘semi-expanded’ \textbar{} ‘expanded’ \textbar{} ‘extra-expanded’ \textbar{} ‘ultra-expanded’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_style}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{style}}}}} or fontstyle & {[} ‘normal’ \textbar{} ‘italic’ \textbar{} ‘oblique’{]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text}}}}} & string or anything printable with ‘\%s’ conversion. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_usetex}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{usetex}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_variant}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{variant}}}}} or fontvariant & {[} ‘normal’ \textbar{} ‘small-caps’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_verticalalignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{verticalalignment}}}}} or va & {[} ‘center’ \textbar{} ‘top’ \textbar{} ‘bottom’ \textbar{} ‘baseline’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_weight}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{weight}}}}} or fontweight & {[}a numeric value in range 0-1000 \textbar{} ‘ultralight’ \textbar{} ‘light’ \textbar{} ‘normal’ \textbar{} ‘regular’ \textbar{} ‘book’ \textbar{} ‘medium’ \textbar{} ‘roman’ \textbar{} ‘semibold’ \textbar{} ‘demibold’ \textbar{} ‘demi’ \textbar{} ‘bold’ \textbar{} ‘heavy’ \textbar{} ‘extra bold’ \textbar{} ‘black’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_wrap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{wrap}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_x}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x}}}}} & float \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_y}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y}}}}} & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} ACCEPTS: sequence of floats \end{fulllineitems} \index{set\_thetalim() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_thetalim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_thetalim}}}{\emph{*args}, \emph{**kwargs}}{}~ \end{fulllineitems} \index{set\_thetamax() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_thetamax}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_thetamax}}}{\emph{thetamax}}{}~ \end{fulllineitems} \index{set\_thetamin() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_thetamin}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_thetamin}}}{\emph{thetamin}}{}~ \end{fulllineitems} \index{set\_xscale() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_xscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_xscale}}}{\emph{scale}, \emph{*args}, \emph{**kwargs}}{} Set the x-axis scale. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{value}}] \leavevmode{[}\{“linear”, “log”, “symlog”, “logit”\}{]} scaling strategy to apply \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LinearScale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LinearScale}}}}}}] \leavevmode linear transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogTransform}}}}}}] \leavevmode log transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.SymmetricalLogTransform}}}}}}] \leavevmode symlog transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogisticTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogisticTransform}}}}}}] \leavevmode logit transform \end{description} \paragraph{Notes} Different kwargs are accepted, depending on the scale. See the {\hyperref[\detokenize{api/scale_api:module-matplotlib.scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scale}}}}} module for more information. \end{fulllineitems} \index{set\_yscale() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.set_yscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_yscale}}}{\emph{*args}, \emph{**kwargs}}{} Set the y-axis scale. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{value}}] \leavevmode{[}\{“linear”, “log”, “symlog”, “logit”\}{]} scaling strategy to apply \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LinearScale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LinearScale}}}}}}] \leavevmode linear transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogTransform}}}}}}] \leavevmode log transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.SymmetricalLogTransform}}}}}}] \leavevmode symlog transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogisticTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogisticTransform}}}}}}] \leavevmode logit transform \end{description} \paragraph{Notes} Different kwargs are accepted, depending on the scale. See the {\hyperref[\detokenize{api/scale_api:module-matplotlib.scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scale}}}}} module for more information. \end{fulllineitems} \index{start\_pan() (matplotlib.projections.polar.PolarAxes method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarAxes.start_pan}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{start\_pan}}}{\emph{x}, \emph{y}, \emph{button}}{} Called when a pan operation has started. \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} are the mouse coordinates in display coords. button is the mouse button number: \begin{itemize} \item {} 1: LEFT \item {} 2: MIDDLE \item {} 3: RIGHT \end{itemize} \begin{sphinxadmonition}{note}{Note:} Intended to be overridden by new projection types. \end{sphinxadmonition} \end{fulllineitems} \end{fulllineitems} \index{PolarTransform (class in matplotlib.projections.polar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.projections.polar.}}\sphinxbfcode{\sphinxupquote{PolarTransform}}}{\emph{axis=None}, \emph{use\_rmin=True}, \emph{\_apply\_theta\_transforms=True}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} The base polar transform. This handles projection \sphinxstyleemphasis{theta} and \sphinxstyleemphasis{r} into Cartesian coordinate space \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}, but does not perform the ultimate affine transformation into the correct position. \index{input\_dims (matplotlib.projections.polar.PolarTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarTransform.input_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{input\_dims}}\sphinxbfcode{\sphinxupquote{ = 2}}} \end{fulllineitems} \index{inverted() (matplotlib.projections.polar.PolarTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \index{is\_separable (matplotlib.projections.polar.PolarTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarTransform.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = False}}} \end{fulllineitems} \index{output\_dims (matplotlib.projections.polar.PolarTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarTransform.output_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_dims}}\sphinxbfcode{\sphinxupquote{ = 2}}} \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.projections.polar.PolarTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarTransform.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{tr}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}) and returns a numpy array of shape (N x {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}). Alternatively, accepts a numpy array of length {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}} and returns a numpy array of length {\hyperref[\detokenize{api/projections_api:matplotlib.projections.polar.PolarTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \index{transform\_path\_non\_affine() (matplotlib.projections.polar.PolarTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.PolarTransform.transform_path_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_path\_non\_affine}}}{\emph{path}}{} Returns a path, transformed only by the non-affine part of this transform. \sphinxstyleemphasis{path}: a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \sphinxcode{\sphinxupquote{transform\_path(path)}} is equivalent to \sphinxcode{\sphinxupquote{transform\_path\_affine(transform\_path\_non\_affine(values))}}. \end{fulllineitems} \end{fulllineitems} \index{RadialAxis (class in matplotlib.projections.polar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.RadialAxis}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.projections.polar.}}\sphinxbfcode{\sphinxupquote{RadialAxis}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/axis_api:matplotlib.axis.YAxis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axis.YAxis}}}}} A radial Axis. This overrides certain properties of a \sphinxcode{\sphinxupquote{YAxis}} to provide special-casing for a radial axis. \index{axis\_name (matplotlib.projections.polar.RadialAxis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.RadialAxis.axis_name}}\pysigline{\sphinxbfcode{\sphinxupquote{axis\_name}}\sphinxbfcode{\sphinxupquote{ = 'radius'}}} \end{fulllineitems} \index{cla() (matplotlib.projections.polar.RadialAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.RadialAxis.cla}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{cla}}}{}{} clear the current axis \end{fulllineitems} \end{fulllineitems} \index{RadialLocator (class in matplotlib.projections.polar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.RadialLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.projections.polar.}}\sphinxbfcode{\sphinxupquote{RadialLocator}}}{\emph{base}, \emph{axes=None}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Locator}}}}} Used to locate radius ticks. Ensures that all ticks are strictly positive. For all other tasks, it delegates to the base {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Locator}}}}} (which may be different depending on the scale of the \sphinxstyleemphasis{r}-axis. \index{autoscale() (matplotlib.projections.polar.RadialLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.RadialLocator.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} autoscale the view limits \end{fulllineitems} \index{pan() (matplotlib.projections.polar.RadialLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.RadialLocator.pan}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pan}}}{\emph{numsteps}}{} Pan numticks (can be positive or negative) \end{fulllineitems} \index{refresh() (matplotlib.projections.polar.RadialLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.RadialLocator.refresh}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{refresh}}}{}{} refresh internal information based on current lim \end{fulllineitems} \index{view\_limits() (matplotlib.projections.polar.RadialLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.RadialLocator.view_limits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{view\_limits}}}{\emph{vmin}, \emph{vmax}}{} select a scale for the range from vmin to vmax Normally this method is overridden by subclasses to change locator behaviour. \end{fulllineitems} \index{zoom() (matplotlib.projections.polar.RadialLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.RadialLocator.zoom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{zoom}}}{\emph{direction}}{} Zoom in/out on axis; if direction is \textgreater{}0 zoom in, else zoom out \end{fulllineitems} \end{fulllineitems} \index{RadialTick (class in matplotlib.projections.polar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.RadialTick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.projections.polar.}}\sphinxbfcode{\sphinxupquote{RadialTick}}}{\emph{axes}, \emph{loc}, \emph{label}, \emph{size=None}, \emph{width=None}, \emph{color=None}, \emph{tickdir=None}, \emph{pad=None}, \emph{labelsize=None}, \emph{labelcolor=None}, \emph{zorder=None}, \emph{gridOn=None}, \emph{tick1On=True}, \emph{tick2On=True}, \emph{label1On=True}, \emph{label2On=False}, \emph{major=True}, \emph{labelrotation=0}, \emph{grid\_color=None}, \emph{grid\_linestyle=None}, \emph{grid\_linewidth=None}, \emph{grid\_alpha=None}, \emph{**kw}}{} Bases: {\hyperref[\detokenize{api/axis_api:matplotlib.axis.YTick}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axis.YTick}}}}} A radial-axis tick. This subclass of \sphinxcode{\sphinxupquote{YTick}} provides radial ticks with some small modification to their re-positioning such that ticks are rotated based on axes limits. This results in ticks that are correctly perpendicular to the spine. Labels are also rotated to be perpendicular to the spine, when ‘auto’ rotation is enabled. bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points \index{update\_position() (matplotlib.projections.polar.RadialTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.RadialTick.update_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_position}}}{\emph{loc}}{} Set the location of tick in data coords with scalar \sphinxstyleemphasis{loc} \end{fulllineitems} \end{fulllineitems} \index{ThetaAxis (class in matplotlib.projections.polar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.ThetaAxis}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.projections.polar.}}\sphinxbfcode{\sphinxupquote{ThetaAxis}}}{\emph{axes}, \emph{pickradius=15}}{} Bases: {\hyperref[\detokenize{api/axis_api:matplotlib.axis.XAxis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axis.XAxis}}}}} A theta Axis. This overrides certain properties of an \sphinxcode{\sphinxupquote{XAxis}} to provide special-casing for an angular axis. Init the axis with the parent Axes instance \index{axis\_name (matplotlib.projections.polar.ThetaAxis attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.ThetaAxis.axis_name}}\pysigline{\sphinxbfcode{\sphinxupquote{axis\_name}}\sphinxbfcode{\sphinxupquote{ = 'theta'}}} \end{fulllineitems} \index{cla() (matplotlib.projections.polar.ThetaAxis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.ThetaAxis.cla}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{cla}}}{}{} clear the current axis \end{fulllineitems} \end{fulllineitems} \index{ThetaFormatter (class in matplotlib.projections.polar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.ThetaFormatter}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.projections.polar.}}\sphinxbfcode{\sphinxupquote{ThetaFormatter}}} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Formatter}}}}} Used to format the \sphinxstyleemphasis{theta} tick labels. Converts the native unit of radians into degrees and adds a degree symbol. \end{fulllineitems} \index{ThetaLocator (class in matplotlib.projections.polar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.ThetaLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.projections.polar.}}\sphinxbfcode{\sphinxupquote{ThetaLocator}}}{\emph{base}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Locator}}}}} Used to locate theta ticks. This will work the same as the base locator except in the case that the view spans the entire circle. In such cases, the previously used default locations of every 45 degrees are returned. \index{autoscale() (matplotlib.projections.polar.ThetaLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.ThetaLocator.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} autoscale the view limits \end{fulllineitems} \index{pan() (matplotlib.projections.polar.ThetaLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.ThetaLocator.pan}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pan}}}{\emph{numsteps}}{} Pan numticks (can be positive or negative) \end{fulllineitems} \index{refresh() (matplotlib.projections.polar.ThetaLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.ThetaLocator.refresh}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{refresh}}}{}{} refresh internal information based on current lim \end{fulllineitems} \index{set\_axis() (matplotlib.projections.polar.ThetaLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.ThetaLocator.set_axis}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_axis}}}{\emph{axis}}{}~ \end{fulllineitems} \index{view\_limits() (matplotlib.projections.polar.ThetaLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.ThetaLocator.view_limits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{view\_limits}}}{\emph{vmin}, \emph{vmax}}{} select a scale for the range from vmin to vmax Normally this method is overridden by subclasses to change locator behaviour. \end{fulllineitems} \index{zoom() (matplotlib.projections.polar.ThetaLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.ThetaLocator.zoom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{zoom}}}{\emph{direction}}{} Zoom in/out on axis; if direction is \textgreater{}0 zoom in, else zoom out \end{fulllineitems} \end{fulllineitems} \index{ThetaTick (class in matplotlib.projections.polar)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.ThetaTick}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.projections.polar.}}\sphinxbfcode{\sphinxupquote{ThetaTick}}}{\emph{axes}, \emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/axis_api:matplotlib.axis.XTick}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axis.XTick}}}}} A theta-axis tick. This subclass of \sphinxcode{\sphinxupquote{XTick}} provides angular ticks with some small modification to their re-positioning such that ticks are rotated based on tick location. This results in ticks that are correctly perpendicular to the arc spine. When ‘auto’ rotation is enabled, labels are also rotated to be parallel to the spine. The label padding is also applied here since it’s not possible to use a generic axes transform to produce tick-specific padding. \index{update\_position() (matplotlib.projections.polar.ThetaTick method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/projections_api:matplotlib.projections.polar.ThetaTick.update_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_position}}}{\emph{loc}}{} Set the location of tick in data coords with scalar \sphinxstyleemphasis{loc} \end{fulllineitems} \end{fulllineitems} \chapter{rcsetup} \label{\detokenize{api/rcsetup_api:rcsetup}}\label{\detokenize{api/rcsetup_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.rcsetup}}} \label{\detokenize{api/rcsetup_api:module-matplotlib.rcsetup}}\label{\detokenize{api/rcsetup_api:matplotlib-rcsetup}}\index{matplotlib.rcsetup (module)} The rcsetup module contains the default values and the validation code for customization using matplotlib’s rc settings. Each rc setting is assigned a default value and a function used to validate any attempted changes to that setting. The default values and validation functions are defined in the rcsetup module, and are used to construct the rcParams global object which stores the settings and is referenced throughout matplotlib. These default values should be consistent with the default matplotlibrc file that actually reflects the values given here. Any additions or deletions to the parameter set listed here should also be visited to the \sphinxcode{\sphinxupquote{matplotlibrc.template}} in matplotlib’s root source directory. \index{ValidateInStrings (class in matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.ValidateInStrings}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{ValidateInStrings}}}{\emph{key}, \emph{valid}, \emph{ignorecase=False}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} valid is a list of legal strings \end{fulllineitems} \index{ValidateInterval (class in matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.ValidateInterval}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{ValidateInterval}}}{\emph{vmin}, \emph{vmax}, \emph{closedmin=True}, \emph{closedmax=True}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Value must be in interval \end{fulllineitems} \index{cycler() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.cycler}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{cycler}}}{\emph{*args}, \emph{**kwargs}}{} Creates a \sphinxcode{\sphinxupquote{cycler.Cycler}} object much like \sphinxcode{\sphinxupquote{cycler.cycler()}}, but includes input validation. cycler(arg) cycler(label, itr) cycler(label1=itr1{[}, label2=itr2{[}, …{]}{]}) Form 1 simply copies a given \sphinxcode{\sphinxupquote{Cycler}} object. Form 2 creates a \sphinxcode{\sphinxupquote{Cycler}} from a label and an iterable. Form 3 composes a \sphinxcode{\sphinxupquote{Cycler}} as an inner product of the pairs of keyword arguments. In other words, all of the iterables are cycled simultaneously, as if through zip(). \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{arg}}] \leavevmode{[}Cycler{]} Copy constructor for Cycler. \item[{\sphinxstylestrong{label}}] \leavevmode{[}name{]} The property key. Must be a valid \sphinxcode{\sphinxupquote{Artist}} property. For example, ‘color’ or ‘linestyle’. Aliases are allowed, such as ‘c’ for ‘color’ and ‘lw’ for ‘linewidth’. \item[{\sphinxstylestrong{itr}}] \leavevmode{[}iterable{]} Finite-length iterable of the property values. These values are validated and will raise a ValueError if invalid. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cycler}}] \leavevmode{[}Cycler{]} New \sphinxcode{\sphinxupquote{cycler.Cycler}} for the given properties \end{description} \end{description}\end{quote} \end{fulllineitems} \index{deprecate\_axes\_hold() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.deprecate_axes_hold}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{deprecate\_axes\_hold}}}{\emph{value}}{}~ \end{fulllineitems} \index{update\_savefig\_format() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.update_savefig_format}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{update\_savefig\_format}}}{\emph{value}}{}~ \end{fulllineitems} \index{validate\_animation\_writer\_path() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_animation_writer_path}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_animation\_writer\_path}}}{\emph{p}}{}~ \end{fulllineitems} \index{validate\_any() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_any}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_any}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_anylist() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_anylist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_anylist}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_aspect() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_aspect}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_aspect}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_axisbelow() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_axisbelow}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_axisbelow}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_backend() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_backend}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_backend}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_bbox() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_bbox}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_bbox}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_bool() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_bool}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_bool}}}{\emph{b}}{} Convert b to a boolean or raise \end{fulllineitems} \index{validate\_bool\_maybe\_none() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_bool_maybe_none}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_bool\_maybe\_none}}}{\emph{b}}{} Convert b to a boolean or raise \end{fulllineitems} \index{validate\_capstylelist() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_capstylelist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_capstylelist}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_color() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_color}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_color}}}{\emph{s}}{} return a valid color arg \end{fulllineitems} \index{validate\_color\_for\_prop\_cycle() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_color_for_prop_cycle}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_color\_for\_prop\_cycle}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_color\_or\_auto() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_color_or_auto}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_color\_or\_auto}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_color\_or\_inherit() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_color_or_inherit}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_color\_or\_inherit}}}{\emph{s}}{} return a valid color arg \end{fulllineitems} \index{validate\_colorlist() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_colorlist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_colorlist}}}{\emph{s}}{} return a list of colorspecs \end{fulllineitems} \index{validate\_cycler() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_cycler}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_cycler}}}{\emph{s}}{} return a Cycler object from a string repr or the object itself \end{fulllineitems} \index{validate\_dashlist() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_dashlist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_dashlist}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_dpi() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_dpi}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_dpi}}}{\emph{s}}{} confirm s is string ‘figure’ or convert s to float or raise \end{fulllineitems} \index{validate\_fillstylelist() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_fillstylelist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_fillstylelist}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_float() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_float}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_float}}}{\emph{s}}{} convert s to float or raise \end{fulllineitems} \index{validate\_float\_or\_None() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_float_or_None}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_float\_or\_None}}}{\emph{s}}{} convert s to float, None or raise \end{fulllineitems} \index{validate\_floatlist() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_floatlist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_floatlist}}}{\emph{s}}{} convert s to float or raise \end{fulllineitems} \index{validate\_font\_properties() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_font_properties}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_font\_properties}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_fontsize() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_fontsize}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_fontsize}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_fontsizelist() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_fontsizelist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_fontsizelist}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_fonttype() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_fonttype}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_fonttype}}}{\emph{s}}{} confirm that this is a Postscript of PDF font type that we know how to convert to \end{fulllineitems} \index{validate\_hatch() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_hatch}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_hatch}}}{\emph{s}}{} Validate a hatch pattern. A hatch pattern string can have any sequence of the following characters: \sphinxcode{\sphinxupquote{\textbackslash{} / \textbar{} - + * . x o O}}. \end{fulllineitems} \index{validate\_hatchlist() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_hatchlist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_hatchlist}}}{\emph{s}}{} Validate a hatch pattern. A hatch pattern string can have any sequence of the following characters: \sphinxcode{\sphinxupquote{\textbackslash{} / \textbar{} - + * . x o O}}. \end{fulllineitems} \index{validate\_hinting() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_hinting}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_hinting}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_hist\_bins() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_hist_bins}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_hist\_bins}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_int() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_int}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_int}}}{\emph{s}}{} convert s to int or raise \end{fulllineitems} \index{validate\_int\_or\_None() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_int_or_None}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_int\_or\_None}}}{\emph{s}}{} if not None, tries to validate as an int \end{fulllineitems} \index{validate\_joinstylelist() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_joinstylelist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_joinstylelist}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_negative\_linestyle() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_negative_linestyle}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_negative\_linestyle}}}{\emph{s}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The validate\_negative\_linestyle function was deprecated in version 2.1. See ‘validate\_negative\_linestyle\_legacy’ deprecation warning for more information. \end{fulllineitems} \index{validate\_negative\_linestyle\_legacy() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_negative_linestyle_legacy}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_negative\_linestyle\_legacy}}}{\emph{s}}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The validate\_negative\_linestyle\_legacy function was deprecated in version 2.1. The ‘contour.negative\_linestyle’ rcParam now follows the same validation as the other rcParams that are related to line style. \end{fulllineitems} \index{validate\_nseq\_float (class in matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_nseq_float}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_nseq\_float}}}{\emph{n=None}, \emph{allow\_none=False}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} \end{fulllineitems} \index{validate\_nseq\_int (class in matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_nseq_int}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_nseq\_int}}}{\emph{n=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} \end{fulllineitems} \index{validate\_path\_exists() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_path_exists}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_path\_exists}}}{\emph{s}}{} If s is a path, return s, else False \end{fulllineitems} \index{validate\_ps\_distiller() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_ps_distiller}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_ps\_distiller}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_qt4() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_qt4}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_qt4}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_qt5() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_qt5}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_qt5}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_sketch() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_sketch}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_sketch}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_string() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_string}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_string}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_string\_or\_None() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_string_or_None}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_string\_or\_None}}}{\emph{s}}{} convert s to string or raise \end{fulllineitems} \index{validate\_stringlist() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_stringlist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_stringlist}}}{\emph{s}}{} return a list \end{fulllineitems} \index{validate\_svg\_fonttype() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_svg_fonttype}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_svg\_fonttype}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_toolbar() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_toolbar}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_toolbar}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_webagg\_address() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_webagg_address}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_webagg\_address}}}{\emph{s}}{}~ \end{fulllineitems} \index{validate\_whiskers() (in module matplotlib.rcsetup)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/rcsetup_api:matplotlib.rcsetup.validate_whiskers}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.rcsetup.}}\sphinxbfcode{\sphinxupquote{validate\_whiskers}}}{\emph{s}}{}~ \end{fulllineitems} \chapter{sankey} \label{\detokenize{api/sankey_api:sankey}}\label{\detokenize{api/sankey_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.sankey}}} \label{\detokenize{api/sankey_api:module-matplotlib.sankey}}\label{\detokenize{api/sankey_api:matplotlib-sankey}}\index{matplotlib.sankey (module)} Module for creating Sankey diagrams using matplotlib \index{Sankey (class in matplotlib.sankey)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/sankey_api:matplotlib.sankey.Sankey}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.sankey.}}\sphinxbfcode{\sphinxupquote{Sankey}}}{\emph{ax=None}, \emph{scale=1.0}, \emph{unit=''}, \emph{format='\%G'}, \emph{gap=0.25}, \emph{radius=0.1}, \emph{shoulder=0.03}, \emph{offset=0.15}, \emph{head\_angle=100}, \emph{margin=0.4}, \emph{tolerance=1e-06}, \emph{**kwargs}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Sankey diagram in matplotlib \begin{quote} Sankey diagrams are a specific type of flow diagram, in which the width of the arrows is shown proportionally to the flow quantity. They are typically used to visualize energy or material or cost transfers between processes. \sphinxhref{https://en.wikipedia.org/wiki/Sankey\_diagram}{Wikipedia (6/1/2011)} \end{quote} Create a new Sankey instance. Optional keyword arguments: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Field &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{ax} & axes onto which the data should be plotted If \sphinxstyleemphasis{ax} isn’t provided, new axes will be created. \\ \hline \sphinxstyleemphasis{scale} & scaling factor for the flows \sphinxstyleemphasis{scale} sizes the width of the paths in order to maintain proper layout. The same scale is applied to all subdiagrams. The value should be chosen such that the product of the scale and the sum of the inputs is approximately 1.0 (and the product of the scale and the sum of the outputs is approximately -1.0). \\ \hline \sphinxstyleemphasis{unit} & string representing the physical unit associated with the flow quantities If \sphinxstyleemphasis{unit} is None, then none of the quantities are labeled. \\ \hline \sphinxstyleemphasis{format} & a Python number formatting string to be used in labeling the flow as a quantity (i.e., a number times a unit, where the unit is given) \\ \hline \sphinxstyleemphasis{gap} & space between paths that break in/break away to/from the top or bottom \\ \hline \sphinxstyleemphasis{radius} & inner radius of the vertical paths \\ \hline \sphinxstyleemphasis{shoulder} & size of the shoulders of output arrowS \\ \hline \sphinxstyleemphasis{offset} & text offset (from the dip or tip of the arrow) \\ \hline \sphinxstyleemphasis{head\_angle} & angle of the arrow heads (and negative of the angle of the tails) {[}deg{]} \\ \hline \sphinxstyleemphasis{margin} & minimum space between Sankey outlines and the edge of the plot area \\ \hline \sphinxstyleemphasis{tolerance} & acceptable maximum of the magnitude of the sum of flows The magnitude of the sum of connected flows cannot be greater than \sphinxstyleemphasis{tolerance}. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} The optional arguments listed above are applied to all subdiagrams so that there is consistent alignment and formatting. If {\hyperref[\detokenize{api/sankey_api:matplotlib.sankey.Sankey}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Sankey}}}}} is instantiated with any keyword arguments other than those explicitly listed above (\sphinxcode{\sphinxupquote{**kwargs}}), they will be passed to {\hyperref[\detokenize{api/sankey_api:matplotlib.sankey.Sankey.add}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add()}}}}}, which will create the first subdiagram. In order to draw a complex Sankey diagram, create an instance of {\hyperref[\detokenize{api/sankey_api:matplotlib.sankey.Sankey}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Sankey}}}}} by calling it without any kwargs: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{sankey} \PYG{o}{=} \PYG{n}{Sankey}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} Then add simple Sankey sub-diagrams: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{sankey}\PYG{o}{.}\PYG{n}{add}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} 1} \PYG{n}{sankey}\PYG{o}{.}\PYG{n}{add}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} 2} \PYG{c+c1}{\PYGZsh{}...} \PYG{n}{sankey}\PYG{o}{.}\PYG{n}{add}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} n} \end{sphinxVerbatim} Finally, create the full diagram: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{sankey}\PYG{o}{.}\PYG{n}{finish}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} Or, instead, simply daisy-chain those calls: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{Sankey}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{add}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{add}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.} \PYG{o}{.}\PYG{n}{add}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{finish}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \sphinxstrong{See also:} {\hyperref[\detokenize{api/sankey_api:matplotlib.sankey.Sankey.add}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add()}}}}} {\hyperref[\detokenize{api/sankey_api:matplotlib.sankey.Sankey.finish}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{finish()}}}}} \sphinxstylestrong{Examples:} \begin{quote} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{sankey_basics_00}.pdf} \end{figure} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{sankey_basics_01}.pdf} \end{figure} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{sankey_basics_02}.pdf} \end{figure} \end{quote} \index{add() (matplotlib.sankey.Sankey method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/sankey_api:matplotlib.sankey.Sankey.add}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add}}}{\emph{patchlabel=''}, \emph{flows=None}, \emph{orientations=None}, \emph{labels=''}, \emph{trunklength=1.0}, \emph{pathlengths=0.25}, \emph{prior=None}, \emph{connect=(0}, \emph{0)}, \emph{rotation=0}, \emph{**kwargs}}{} Add a simple Sankey diagram with flows at the same hierarchical level. Return value is the instance of {\hyperref[\detokenize{api/sankey_api:matplotlib.sankey.Sankey}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Sankey}}}}}. Optional keyword arguments: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Keyword &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{patchlabel} & label to be placed at the center of the diagram Note: \sphinxstyleemphasis{label} (not \sphinxstyleemphasis{patchlabel}) will be passed to the patch through \sphinxcode{\sphinxupquote{**kwargs}} and can be used to create an entry in the legend. \\ \hline \sphinxstyleemphasis{flows} & array of flow values By convention, inputs are positive and outputs are negative. \\ \hline \sphinxstyleemphasis{orientations} & list of orientations of the paths Valid values are 1 (from/to the top), 0 (from/to the left or right), or -1 (from/to the bottom). If \sphinxstyleemphasis{orientations} == 0, inputs will break in from the left and outputs will break away to the right. \\ \hline \sphinxstyleemphasis{labels} & list of specifications of the labels for the flows Each value may be \sphinxstyleemphasis{None} (no labels), ‘’ (just label the quantities), or a labeling string. If a single value is provided, it will be applied to all flows. If an entry is a non-empty string, then the quantity for the corresponding flow will be shown below the string. However, if the \sphinxstyleemphasis{unit} of the main diagram is None, then quantities are never shown, regardless of the value of this argument. \\ \hline \sphinxstyleemphasis{trunklength} & length between the bases of the input and output groups \\ \hline \sphinxstyleemphasis{pathlengths} & list of lengths of the arrows before break-in or after break-away If a single value is given, then it will be applied to the first (inside) paths on the top and bottom, and the length of all other arrows will be justified accordingly. The \sphinxstyleemphasis{pathlengths} are not applied to the horizontal inputs and outputs. \\ \hline \sphinxstyleemphasis{prior} & index of the prior diagram to which this diagram should be connected \\ \hline \sphinxstyleemphasis{connect} & a (prior, this) tuple indexing the flow of the prior diagram and the flow of this diagram which should be connected If this is the first diagram or \sphinxstyleemphasis{prior} is \sphinxstyleemphasis{None}, \sphinxstyleemphasis{connect} will be ignored. \\ \hline \sphinxstyleemphasis{rotation} & angle of rotation of the diagram {[}deg{]} \sphinxstyleemphasis{rotation} is ignored if this diagram is connected to an existing one (using \sphinxstyleemphasis{prior} and \sphinxstyleemphasis{connect}). The interpretation of the \sphinxstyleemphasis{orientations} argument will be rotated accordingly (e.g., if \sphinxstyleemphasis{rotation} == 90, an \sphinxstyleemphasis{orientations} entry of 1 means to/from the left). \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} Valid kwargs are {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.PathPatch:matplotlib.patches.PathPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.PathPatch()}}}}} arguments: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} As examples, \sphinxcode{\sphinxupquote{fill=False}} and \sphinxcode{\sphinxupquote{label='A legend entry'}}. By default, \sphinxcode{\sphinxupquote{facecolor='\#bfd1d4'}} (light blue) and \sphinxcode{\sphinxupquote{linewidth=0.5}}. The indexing parameters (\sphinxstyleemphasis{prior} and \sphinxstyleemphasis{connect}) are zero-based. The flows are placed along the top of the diagram from the inside out in order of their index within the \sphinxstyleemphasis{flows} list or array. They are placed along the sides of the diagram from the top down and along the bottom from the outside in. If the sum of the inputs and outputs is nonzero, the discrepancy will appear as a cubic Bezier curve along the top and bottom edges of the trunk. \sphinxstrong{See also:} {\hyperref[\detokenize{api/sankey_api:matplotlib.sankey.Sankey.finish}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{finish()}}}}} \end{fulllineitems} \index{finish() (matplotlib.sankey.Sankey method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/sankey_api:matplotlib.sankey.Sankey.finish}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{finish}}}{}{} Adjust the axes and return a list of information about the Sankey subdiagram(s). Return value is a list of subdiagrams represented with the following fields: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Field &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{patch} & Sankey outline (an instance of \sphinxcode{\sphinxupquote{PathPatch}}) \\ \hline \sphinxstyleemphasis{flows} & values of the flows (positive for input, negative for output) \\ \hline \sphinxstyleemphasis{angles} & list of angles of the arrows {[}deg/90{]} For example, if the diagram has not been rotated, an input to the top side will have an angle of 3 (DOWN), and an output from the top side will have an angle of 1 (UP). If a flow has been skipped (because its magnitude is less than \sphinxstyleemphasis{tolerance}), then its angle will be \sphinxstyleemphasis{None}. \\ \hline \sphinxstyleemphasis{tips} & array in which each row is an {[}x, y{]} pair indicating the positions of the tips (or “dips”) of the flow paths If the magnitude of a flow is less the \sphinxstyleemphasis{tolerance} for the instance of {\hyperref[\detokenize{api/sankey_api:matplotlib.sankey.Sankey}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Sankey}}}}}, the flow is skipped and its tip will be at the center of the diagram. \\ \hline \sphinxstyleemphasis{text} & {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instance for the label of the diagram \\ \hline \sphinxstyleemphasis{texts} & list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances for the labels of flows \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \sphinxstrong{See also:} {\hyperref[\detokenize{api/sankey_api:matplotlib.sankey.Sankey.add}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add()}}}}} \end{fulllineitems} \end{fulllineitems} \chapter{scale} \label{\detokenize{api/scale_api:scale}}\label{\detokenize{api/scale_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.scale}}} \label{\detokenize{api/scale_api:module-matplotlib.scale}}\label{\detokenize{api/scale_api:matplotlib-scale}}\index{matplotlib.scale (module)}\index{InvertedLog10Transform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedLog10Transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{InvertedLog10Transform}}}{\emph{shorthand\_name=None}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.InvertedLogTransformBase}}}}} Creates a new \sphinxcode{\sphinxupquote{TransformNode}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{shorthand\_name}}] \leavevmode{[}str{]} A string representing the “name” of the transform. The name carries no significance other than to improve the readability of \sphinxcode{\sphinxupquote{str(transform)}} when DEBUG=True. \end{description} \end{description}\end{quote} \index{base (matplotlib.scale.InvertedLog10Transform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedLog10Transform.base}}\pysigline{\sphinxbfcode{\sphinxupquote{base}}\sphinxbfcode{\sphinxupquote{ = 10.0}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.InvertedLog10Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedLog10Transform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \end{fulllineitems} \index{InvertedLog2Transform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedLog2Transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{InvertedLog2Transform}}}{\emph{shorthand\_name=None}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.InvertedLogTransformBase}}}}} Creates a new \sphinxcode{\sphinxupquote{TransformNode}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{shorthand\_name}}] \leavevmode{[}str{]} A string representing the “name” of the transform. The name carries no significance other than to improve the readability of \sphinxcode{\sphinxupquote{str(transform)}} when DEBUG=True. \end{description} \end{description}\end{quote} \index{base (matplotlib.scale.InvertedLog2Transform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedLog2Transform.base}}\pysigline{\sphinxbfcode{\sphinxupquote{base}}\sphinxbfcode{\sphinxupquote{ = 2.0}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.InvertedLog2Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedLog2Transform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \end{fulllineitems} \index{InvertedLogTransform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{InvertedLogTransform}}}{\emph{base}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.InvertedLogTransformBase}}}}} \index{inverted() (matplotlib.scale.InvertedLogTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \end{fulllineitems} \index{InvertedLogTransformBase (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{InvertedLogTransformBase}}}{\emph{shorthand\_name=None}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} Creates a new \sphinxcode{\sphinxupquote{TransformNode}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{shorthand\_name}}] \leavevmode{[}str{]} A string representing the “name” of the transform. The name carries no significance other than to improve the readability of \sphinxcode{\sphinxupquote{str(transform)}} when DEBUG=True. \end{description} \end{description}\end{quote} \index{has\_inverse (matplotlib.scale.InvertedLogTransformBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase.has_inverse}}\pysigline{\sphinxbfcode{\sphinxupquote{has\_inverse}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{input\_dims (matplotlib.scale.InvertedLogTransformBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase.input_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{input\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{is\_separable (matplotlib.scale.InvertedLogTransformBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{output\_dims (matplotlib.scale.InvertedLogTransformBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase.output_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.scale.InvertedLogTransformBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{a}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x {\hyperref[\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}) and returns a numpy array of shape (N x {\hyperref[\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}). Alternatively, accepts a numpy array of length {\hyperref[\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}} and returns a numpy array of length {\hyperref[\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \end{fulllineitems} \index{InvertedNaturalLogTransform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedNaturalLogTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{InvertedNaturalLogTransform}}}{\emph{shorthand\_name=None}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.InvertedLogTransformBase}}}}} Creates a new \sphinxcode{\sphinxupquote{TransformNode}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{shorthand\_name}}] \leavevmode{[}str{]} A string representing the “name” of the transform. The name carries no significance other than to improve the readability of \sphinxcode{\sphinxupquote{str(transform)}} when DEBUG=True. \end{description} \end{description}\end{quote} \index{base (matplotlib.scale.InvertedNaturalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedNaturalLogTransform.base}}\pysigline{\sphinxbfcode{\sphinxupquote{base}}\sphinxbfcode{\sphinxupquote{ = 2.718281828459045}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.InvertedNaturalLogTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedNaturalLogTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \end{fulllineitems} \index{InvertedSymmetricalLogTransform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedSymmetricalLogTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{InvertedSymmetricalLogTransform}}}{\emph{base}, \emph{linthresh}, \emph{linscale}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} \index{has\_inverse (matplotlib.scale.InvertedSymmetricalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedSymmetricalLogTransform.has_inverse}}\pysigline{\sphinxbfcode{\sphinxupquote{has\_inverse}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{input\_dims (matplotlib.scale.InvertedSymmetricalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedSymmetricalLogTransform.input_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{input\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.InvertedSymmetricalLogTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedSymmetricalLogTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \index{is\_separable (matplotlib.scale.InvertedSymmetricalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedSymmetricalLogTransform.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{output\_dims (matplotlib.scale.InvertedSymmetricalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedSymmetricalLogTransform.output_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.scale.InvertedSymmetricalLogTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.InvertedSymmetricalLogTransform.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{a}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x {\hyperref[\detokenize{api/scale_api:matplotlib.scale.InvertedSymmetricalLogTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}) and returns a numpy array of shape (N x {\hyperref[\detokenize{api/scale_api:matplotlib.scale.InvertedSymmetricalLogTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}). Alternatively, accepts a numpy array of length {\hyperref[\detokenize{api/scale_api:matplotlib.scale.InvertedSymmetricalLogTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}} and returns a numpy array of length {\hyperref[\detokenize{api/scale_api:matplotlib.scale.InvertedSymmetricalLogTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \end{fulllineitems} \index{LinearScale (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LinearScale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{LinearScale}}}{\emph{axis}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.ScaleBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.ScaleBase}}}}} The default linear scale. \index{get\_transform() (matplotlib.scale.LinearScale method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LinearScale.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} The transform for linear scaling is just the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.IdentityTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{IdentityTransform}}}}}. \end{fulllineitems} \index{name (matplotlib.scale.LinearScale attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LinearScale.name}}\pysigline{\sphinxbfcode{\sphinxupquote{name}}\sphinxbfcode{\sphinxupquote{ = 'linear'}}} \end{fulllineitems} \index{set\_default\_locators\_and\_formatters() (matplotlib.scale.LinearScale method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LinearScale.set_default_locators_and_formatters}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_default\_locators\_and\_formatters}}}{\emph{axis}}{} Set the locators and formatters to reasonable defaults for linear scaling. \end{fulllineitems} \end{fulllineitems} \index{Log10Transform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.Log10Transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{Log10Transform}}}{\emph{nonpos='clip'}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransformBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogTransformBase}}}}} \index{base (matplotlib.scale.Log10Transform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.Log10Transform.base}}\pysigline{\sphinxbfcode{\sphinxupquote{base}}\sphinxbfcode{\sphinxupquote{ = 10.0}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.Log10Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.Log10Transform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \end{fulllineitems} \index{Log2Transform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.Log2Transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{Log2Transform}}}{\emph{nonpos='clip'}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransformBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogTransformBase}}}}} \index{base (matplotlib.scale.Log2Transform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.Log2Transform.base}}\pysigline{\sphinxbfcode{\sphinxupquote{base}}\sphinxbfcode{\sphinxupquote{ = 2.0}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.Log2Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.Log2Transform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \end{fulllineitems} \index{LogScale (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{LogScale}}}{\emph{axis}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.ScaleBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.ScaleBase}}}}} A standard logarithmic scale. Care is taken so non-positive values are not plotted. For computational efficiency (to push as much as possible to Numpy C code in the common cases), this scale provides different transforms depending on the base of the logarithm: \begin{itemize} \item {} base 10 ({\hyperref[\detokenize{api/scale_api:matplotlib.scale.Log10Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Log10Transform}}}}}) \item {} base 2 ({\hyperref[\detokenize{api/scale_api:matplotlib.scale.Log2Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Log2Transform}}}}}) \item {} base e ({\hyperref[\detokenize{api/scale_api:matplotlib.scale.NaturalLogTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{NaturalLogTransform}}}}}) \item {} arbitrary base ({\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogTransform}}}}}) \end{itemize} \begin{description} \item[{\sphinxstyleemphasis{basex}/\sphinxstyleemphasis{basey}:}] \leavevmode The base of the logarithm \item[{\sphinxstyleemphasis{nonposx}/\sphinxstyleemphasis{nonposy}: {[}‘mask’ \textbar{} ‘clip’ {]}}] \leavevmode non-positive values in \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} can be masked as invalid, or clipped to a very small positive number \item[{\sphinxstyleemphasis{subsx}/\sphinxstyleemphasis{subsy}:}] \leavevmode Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale: \sphinxcode{\sphinxupquote{{[}2, 3, 4, 5, 6, 7, 8, 9{]}}} will place 8 logarithmically spaced minor ticks between each major tick. \end{description} \index{LogScale.InvertedLog10Transform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.InvertedLog10Transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{InvertedLog10Transform}}}{\emph{shorthand\_name=None}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.InvertedLogTransformBase}}}}} Creates a new \sphinxcode{\sphinxupquote{TransformNode}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{shorthand\_name}}] \leavevmode{[}str{]} A string representing the “name” of the transform. The name carries no significance other than to improve the readability of \sphinxcode{\sphinxupquote{str(transform)}} when DEBUG=True. \end{description} \end{description}\end{quote} \index{base (matplotlib.scale.LogScale.InvertedLog10Transform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.InvertedLog10Transform.base}}\pysigline{\sphinxbfcode{\sphinxupquote{base}}\sphinxbfcode{\sphinxupquote{ = 10.0}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.LogScale.InvertedLog10Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.InvertedLog10Transform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \end{fulllineitems} \index{LogScale.InvertedLog2Transform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.InvertedLog2Transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{InvertedLog2Transform}}}{\emph{shorthand\_name=None}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.InvertedLogTransformBase}}}}} Creates a new \sphinxcode{\sphinxupquote{TransformNode}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{shorthand\_name}}] \leavevmode{[}str{]} A string representing the “name” of the transform. The name carries no significance other than to improve the readability of \sphinxcode{\sphinxupquote{str(transform)}} when DEBUG=True. \end{description} \end{description}\end{quote} \index{base (matplotlib.scale.LogScale.InvertedLog2Transform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.InvertedLog2Transform.base}}\pysigline{\sphinxbfcode{\sphinxupquote{base}}\sphinxbfcode{\sphinxupquote{ = 2.0}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.LogScale.InvertedLog2Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.InvertedLog2Transform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \end{fulllineitems} \index{LogScale.InvertedLogTransform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.InvertedLogTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{InvertedLogTransform}}}{\emph{base}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.InvertedLogTransformBase}}}}} \index{inverted() (matplotlib.scale.LogScale.InvertedLogTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.InvertedLogTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \end{fulllineitems} \index{LogScale.InvertedNaturalLogTransform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.InvertedNaturalLogTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{InvertedNaturalLogTransform}}}{\emph{shorthand\_name=None}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.InvertedLogTransformBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.InvertedLogTransformBase}}}}} Creates a new \sphinxcode{\sphinxupquote{TransformNode}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{shorthand\_name}}] \leavevmode{[}str{]} A string representing the “name” of the transform. The name carries no significance other than to improve the readability of \sphinxcode{\sphinxupquote{str(transform)}} when DEBUG=True. \end{description} \end{description}\end{quote} \index{base (matplotlib.scale.LogScale.InvertedNaturalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.InvertedNaturalLogTransform.base}}\pysigline{\sphinxbfcode{\sphinxupquote{base}}\sphinxbfcode{\sphinxupquote{ = 2.718281828459045}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.LogScale.InvertedNaturalLogTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.InvertedNaturalLogTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \end{fulllineitems} \index{LogScale.Log10Transform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.Log10Transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{Log10Transform}}}{\emph{nonpos='clip'}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransformBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogTransformBase}}}}} \index{base (matplotlib.scale.LogScale.Log10Transform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.Log10Transform.base}}\pysigline{\sphinxbfcode{\sphinxupquote{base}}\sphinxbfcode{\sphinxupquote{ = 10.0}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.LogScale.Log10Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.Log10Transform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \end{fulllineitems} \index{LogScale.Log2Transform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.Log2Transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{Log2Transform}}}{\emph{nonpos='clip'}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransformBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogTransformBase}}}}} \index{base (matplotlib.scale.LogScale.Log2Transform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.Log2Transform.base}}\pysigline{\sphinxbfcode{\sphinxupquote{base}}\sphinxbfcode{\sphinxupquote{ = 2.0}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.LogScale.Log2Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.Log2Transform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \end{fulllineitems} \index{LogScale.LogTransform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.LogTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{LogTransform}}}{\emph{base}, \emph{nonpos='clip'}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransformBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogTransformBase}}}}} \index{inverted() (matplotlib.scale.LogScale.LogTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.LogTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \end{fulllineitems} \index{LogScale.LogTransformBase (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.LogTransformBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{LogTransformBase}}}{\emph{nonpos='clip'}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} \index{has\_inverse (matplotlib.scale.LogScale.LogTransformBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.LogTransformBase.has_inverse}}\pysigline{\sphinxbfcode{\sphinxupquote{has\_inverse}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{input\_dims (matplotlib.scale.LogScale.LogTransformBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.LogTransformBase.input_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{input\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{is\_separable (matplotlib.scale.LogScale.LogTransformBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.LogTransformBase.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{output\_dims (matplotlib.scale.LogScale.LogTransformBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.LogTransformBase.output_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.scale.LogScale.LogTransformBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.LogTransformBase.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{a}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogScale.LogTransformBase.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}) and returns a numpy array of shape (N x {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogScale.LogTransformBase.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}). Alternatively, accepts a numpy array of length {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogScale.LogTransformBase.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}} and returns a numpy array of length {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogScale.LogTransformBase.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \end{fulllineitems} \index{LogScale.NaturalLogTransform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.NaturalLogTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{NaturalLogTransform}}}{\emph{nonpos='clip'}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransformBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogTransformBase}}}}} \index{base (matplotlib.scale.LogScale.NaturalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.NaturalLogTransform.base}}\pysigline{\sphinxbfcode{\sphinxupquote{base}}\sphinxbfcode{\sphinxupquote{ = 2.718281828459045}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.LogScale.NaturalLogTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.NaturalLogTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \end{fulllineitems} \index{get\_transform() (matplotlib.scale.LogScale method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance appropriate for the given logarithm base. \end{fulllineitems} \index{limit\_range\_for\_scale() (matplotlib.scale.LogScale method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.limit_range_for_scale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{limit\_range\_for\_scale}}}{\emph{vmin}, \emph{vmax}, \emph{minpos}}{} Limit the domain to positive values. \end{fulllineitems} \index{name (matplotlib.scale.LogScale attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.name}}\pysigline{\sphinxbfcode{\sphinxupquote{name}}\sphinxbfcode{\sphinxupquote{ = 'log'}}} \end{fulllineitems} \index{set\_default\_locators\_and\_formatters() (matplotlib.scale.LogScale method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogScale.set_default_locators_and_formatters}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_default\_locators\_and\_formatters}}}{\emph{axis}}{} Set the locators and formatters to specialized versions for log scaling. \end{fulllineitems} \end{fulllineitems} \index{LogTransform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{LogTransform}}}{\emph{base}, \emph{nonpos='clip'}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransformBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogTransformBase}}}}} \index{inverted() (matplotlib.scale.LogTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \end{fulllineitems} \index{LogTransformBase (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogTransformBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{LogTransformBase}}}{\emph{nonpos='clip'}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} \index{has\_inverse (matplotlib.scale.LogTransformBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogTransformBase.has_inverse}}\pysigline{\sphinxbfcode{\sphinxupquote{has\_inverse}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{input\_dims (matplotlib.scale.LogTransformBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogTransformBase.input_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{input\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{is\_separable (matplotlib.scale.LogTransformBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogTransformBase.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{output\_dims (matplotlib.scale.LogTransformBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogTransformBase.output_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.scale.LogTransformBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogTransformBase.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{a}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransformBase.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}) and returns a numpy array of shape (N x {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransformBase.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}). Alternatively, accepts a numpy array of length {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransformBase.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}} and returns a numpy array of length {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransformBase.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \end{fulllineitems} \index{LogisticTransform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogisticTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{LogisticTransform}}}{\emph{nonpos='mask'}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} \index{has\_inverse (matplotlib.scale.LogisticTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogisticTransform.has_inverse}}\pysigline{\sphinxbfcode{\sphinxupquote{has\_inverse}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{input\_dims (matplotlib.scale.LogisticTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogisticTransform.input_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{input\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.LogisticTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogisticTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \index{is\_separable (matplotlib.scale.LogisticTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogisticTransform.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{output\_dims (matplotlib.scale.LogisticTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogisticTransform.output_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.scale.LogisticTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogisticTransform.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{a}}{} logistic transform (base 10) \end{fulllineitems} \end{fulllineitems} \index{LogitScale (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogitScale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{LogitScale}}}{\emph{axis}, \emph{nonpos='mask'}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.ScaleBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.ScaleBase}}}}} Logit scale for data between zero and one, both excluded. This scale is similar to a log scale close to zero and to one, and almost linear around 0.5. It maps the interval {]}0, 1{[} onto {]}-infty, +infty{[}. \begin{description} \item[{\sphinxstyleemphasis{nonpos}: {[}‘mask’ \textbar{} ‘clip’ {]}}] \leavevmode values beyond {]}0, 1{[} can be masked as invalid, or clipped to a number very close to 0 or 1 \end{description} \index{get\_transform() (matplotlib.scale.LogitScale method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogitScale.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return a {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogitTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogitTransform}}}}} instance. \end{fulllineitems} \index{limit\_range\_for\_scale() (matplotlib.scale.LogitScale method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogitScale.limit_range_for_scale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{limit\_range\_for\_scale}}}{\emph{vmin}, \emph{vmax}, \emph{minpos}}{} Limit the domain to values between 0 and 1 (excluded). \end{fulllineitems} \index{name (matplotlib.scale.LogitScale attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogitScale.name}}\pysigline{\sphinxbfcode{\sphinxupquote{name}}\sphinxbfcode{\sphinxupquote{ = 'logit'}}} \end{fulllineitems} \index{set\_default\_locators\_and\_formatters() (matplotlib.scale.LogitScale method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogitScale.set_default_locators_and_formatters}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_default\_locators\_and\_formatters}}}{\emph{axis}}{} Set the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Locator}}}}} and {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Formatter}}}}} objects on the given axis to match this scale. \end{fulllineitems} \end{fulllineitems} \index{LogitTransform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogitTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{LogitTransform}}}{\emph{nonpos='mask'}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} \index{has\_inverse (matplotlib.scale.LogitTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogitTransform.has_inverse}}\pysigline{\sphinxbfcode{\sphinxupquote{has\_inverse}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{input\_dims (matplotlib.scale.LogitTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogitTransform.input_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{input\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.LogitTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogitTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \index{is\_separable (matplotlib.scale.LogitTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogitTransform.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{output\_dims (matplotlib.scale.LogitTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogitTransform.output_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.scale.LogitTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.LogitTransform.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{a}}{} logit transform (base 10), masked or clipped \end{fulllineitems} \end{fulllineitems} \index{NaturalLogTransform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.NaturalLogTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{NaturalLogTransform}}}{\emph{nonpos='clip'}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransformBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogTransformBase}}}}} \index{base (matplotlib.scale.NaturalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.NaturalLogTransform.base}}\pysigline{\sphinxbfcode{\sphinxupquote{base}}\sphinxbfcode{\sphinxupquote{ = 2.718281828459045}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.NaturalLogTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.NaturalLogTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \end{fulllineitems} \index{ScaleBase (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.ScaleBase}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{ScaleBase}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} The base class for all scales. Scales are separable transformations, working on a single dimension. Any subclasses will want to override: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{name}} \item {} {\hyperref[\detokenize{api/scale_api:matplotlib.scale.ScaleBase.get_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_transform()}}}}} \item {} {\hyperref[\detokenize{api/scale_api:matplotlib.scale.ScaleBase.set_default_locators_and_formatters}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_default\_locators\_and\_formatters()}}}}} \end{itemize} \begin{description} \item[{And optionally:}] \leavevmode\begin{itemize} \item {} {\hyperref[\detokenize{api/scale_api:matplotlib.scale.ScaleBase.limit_range_for_scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{limit\_range\_for\_scale()}}}}} \end{itemize} \end{description} \index{get\_transform() (matplotlib.scale.ScaleBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.ScaleBase.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} object associated with this scale. \end{fulllineitems} \index{limit\_range\_for\_scale() (matplotlib.scale.ScaleBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.ScaleBase.limit_range_for_scale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{limit\_range\_for\_scale}}}{\emph{vmin}, \emph{vmax}, \emph{minpos}}{} Returns the range \sphinxstyleemphasis{vmin}, \sphinxstyleemphasis{vmax}, possibly limited to the domain supported by this scale. \begin{description} \item[{\sphinxstyleemphasis{minpos} should be the minimum positive value in the data.}] \leavevmode This is used by log scales to determine a minimum value. \end{description} \end{fulllineitems} \index{set\_default\_locators\_and\_formatters() (matplotlib.scale.ScaleBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.ScaleBase.set_default_locators_and_formatters}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_default\_locators\_and\_formatters}}}{\emph{axis}}{} Set the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Locator}}}}} and {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Formatter}}}}} objects on the given axis to match this scale. \end{fulllineitems} \end{fulllineitems} \index{SymmetricalLogScale (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{SymmetricalLogScale}}}{\emph{axis}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/scale_api:matplotlib.scale.ScaleBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.ScaleBase}}}}} The symmetrical logarithmic scale is logarithmic in both the positive and negative directions from the origin. Since the values close to zero tend toward infinity, there is a need to have a range around zero that is linear. The parameter \sphinxstyleemphasis{linthresh} allows the user to specify the size of this range (-\sphinxstyleemphasis{linthresh}, \sphinxstyleemphasis{linthresh}). \begin{description} \item[{\sphinxstyleemphasis{basex}/\sphinxstyleemphasis{basey}:}] \leavevmode The base of the logarithm \item[{\sphinxstyleemphasis{linthreshx}/\sphinxstyleemphasis{linthreshy}:}] \leavevmode A single float which defines the range (-\sphinxstyleemphasis{x}, \sphinxstyleemphasis{x}), within which the plot is linear. This avoids having the plot go to infinity around zero. \item[{\sphinxstyleemphasis{subsx}/\sphinxstyleemphasis{subsy}:}] \leavevmode Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale: \sphinxcode{\sphinxupquote{{[}2, 3, 4, 5, 6, 7, 8, 9{]}}} will place 8 logarithmically spaced minor ticks between each major tick. \item[{\sphinxstyleemphasis{linscalex}/\sphinxstyleemphasis{linscaley}:}] \leavevmode This allows the linear range (-\sphinxstyleemphasis{linthresh} to \sphinxstyleemphasis{linthresh}) to be stretched relative to the logarithmic range. Its value is the number of decades to use for each half of the linear range. For example, when \sphinxstyleemphasis{linscale} == 1.0 (the default), the space used for the positive and negative halves of the linear range will be equal to one decade in the logarithmic range. \end{description} \index{SymmetricalLogScale.InvertedSymmetricalLogTransform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.InvertedSymmetricalLogTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{InvertedSymmetricalLogTransform}}}{\emph{base}, \emph{linthresh}, \emph{linscale}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} \index{has\_inverse (matplotlib.scale.SymmetricalLogScale.InvertedSymmetricalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.InvertedSymmetricalLogTransform.has_inverse}}\pysigline{\sphinxbfcode{\sphinxupquote{has\_inverse}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{input\_dims (matplotlib.scale.SymmetricalLogScale.InvertedSymmetricalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.InvertedSymmetricalLogTransform.input_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{input\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.SymmetricalLogScale.InvertedSymmetricalLogTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.InvertedSymmetricalLogTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \index{is\_separable (matplotlib.scale.SymmetricalLogScale.InvertedSymmetricalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.InvertedSymmetricalLogTransform.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{output\_dims (matplotlib.scale.SymmetricalLogScale.InvertedSymmetricalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.InvertedSymmetricalLogTransform.output_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.scale.SymmetricalLogScale.InvertedSymmetricalLogTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.InvertedSymmetricalLogTransform.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{a}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x {\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.InvertedSymmetricalLogTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}) and returns a numpy array of shape (N x {\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.InvertedSymmetricalLogTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}). Alternatively, accepts a numpy array of length {\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.InvertedSymmetricalLogTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}} and returns a numpy array of length {\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.InvertedSymmetricalLogTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \end{fulllineitems} \index{SymmetricalLogScale.SymmetricalLogTransform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.SymmetricalLogTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxbfcode{\sphinxupquote{SymmetricalLogTransform}}}{\emph{base}, \emph{linthresh}, \emph{linscale}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} \index{has\_inverse (matplotlib.scale.SymmetricalLogScale.SymmetricalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.SymmetricalLogTransform.has_inverse}}\pysigline{\sphinxbfcode{\sphinxupquote{has\_inverse}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{input\_dims (matplotlib.scale.SymmetricalLogScale.SymmetricalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.SymmetricalLogTransform.input_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{input\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.SymmetricalLogScale.SymmetricalLogTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.SymmetricalLogTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \index{is\_separable (matplotlib.scale.SymmetricalLogScale.SymmetricalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.SymmetricalLogTransform.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{output\_dims (matplotlib.scale.SymmetricalLogScale.SymmetricalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.SymmetricalLogTransform.output_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.scale.SymmetricalLogScale.SymmetricalLogTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.SymmetricalLogTransform.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{a}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x {\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.SymmetricalLogTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}) and returns a numpy array of shape (N x {\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.SymmetricalLogTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}). Alternatively, accepts a numpy array of length {\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.SymmetricalLogTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}} and returns a numpy array of length {\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.SymmetricalLogTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \end{fulllineitems} \index{get\_transform() (matplotlib.scale.SymmetricalLogScale method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.get_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transform}}}{}{} Return a {\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SymmetricalLogTransform}}}}} instance. \end{fulllineitems} \index{name (matplotlib.scale.SymmetricalLogScale attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.name}}\pysigline{\sphinxbfcode{\sphinxupquote{name}}\sphinxbfcode{\sphinxupquote{ = 'symlog'}}} \end{fulllineitems} \index{set\_default\_locators\_and\_formatters() (matplotlib.scale.SymmetricalLogScale method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogScale.set_default_locators_and_formatters}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_default\_locators\_and\_formatters}}}{\emph{axis}}{} Set the locators and formatters to specialized versions for symmetrical log scaling. \end{fulllineitems} \end{fulllineitems} \index{SymmetricalLogTransform (class in matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{SymmetricalLogTransform}}}{\emph{base}, \emph{linthresh}, \emph{linscale}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} \index{has\_inverse (matplotlib.scale.SymmetricalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform.has_inverse}}\pysigline{\sphinxbfcode{\sphinxupquote{has\_inverse}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{input\_dims (matplotlib.scale.SymmetricalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform.input_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{input\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{inverted() (matplotlib.scale.SymmetricalLogTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \index{is\_separable (matplotlib.scale.SymmetricalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{output\_dims (matplotlib.scale.SymmetricalLogTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform.output_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_dims}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.scale.SymmetricalLogTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{a}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x {\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}) and returns a numpy array of shape (N x {\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}). Alternatively, accepts a numpy array of length {\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}} and returns a numpy array of length {\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \end{fulllineitems} \index{get\_scale\_docs() (in module matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.get_scale_docs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{get\_scale\_docs}}}{}{} Helper function for generating docstrings related to scales. \end{fulllineitems} \index{get\_scale\_names() (in module matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.get_scale_names}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{get\_scale\_names}}}{}{}~ \end{fulllineitems} \index{register\_scale() (in module matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.register_scale}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{register\_scale}}}{\emph{scale\_class}}{} Register a new kind of scale. \sphinxstyleemphasis{scale\_class} must be a subclass of {\hyperref[\detokenize{api/scale_api:matplotlib.scale.ScaleBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScaleBase}}}}}. \end{fulllineitems} \index{scale\_factory() (in module matplotlib.scale)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/scale_api:matplotlib.scale.scale_factory}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.scale.}}\sphinxbfcode{\sphinxupquote{scale\_factory}}}{\emph{scale}, \emph{axis}, \emph{**kwargs}}{} Return a scale class by name. ACCEPTS: {[} linear \textbar{} log \textbar{} logit \textbar{} symlog {]} \end{fulllineitems} \chapter{spines} \label{\detokenize{api/spines_api:spines}}\label{\detokenize{api/spines_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.spines}}} \label{\detokenize{api/spines_api:module-matplotlib.spines}}\label{\detokenize{api/spines_api:matplotlib-spines}}\index{matplotlib.spines (module)}\index{Spine (class in matplotlib.spines)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.spines.}}\sphinxbfcode{\sphinxupquote{Spine}}}{\emph{axes}, \emph{spine\_type}, \emph{path}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.Patch}}}}} an axis spine \textendash{} the line noting the data area boundaries Spines are the lines connecting the axis tick marks and noting the boundaries of the data area. They can be placed at arbitrary positions. See function:{\hyperref[\detokenize{api/spines_api:matplotlib.spines.Spine.set_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_position}}}}} for more information. The default position is \sphinxcode{\sphinxupquote{('outward',0)}}. Spines are subclasses of class:{\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}}, and inherit much of their behavior. Spines draw a line, a circle, or an arc depending if function:{\hyperref[\detokenize{api/spines_api:matplotlib.spines.Spine.set_patch_line}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_patch\_line}}}}}, function:{\hyperref[\detokenize{api/spines_api:matplotlib.spines.Spine.set_patch_circle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_patch\_circle}}}}}, or function:{\hyperref[\detokenize{api/spines_api:matplotlib.spines.Spine.set_patch_arc}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_patch\_arc}}}}} has been called. Line-like is the default. \begin{itemize} \item {} \sphinxstyleemphasis{axes} : the Axes instance containing the spine \item {} \sphinxstyleemphasis{spine\_type} : a string specifying the spine type \item {} \sphinxstyleemphasis{path} : the path instance used to draw the spine \end{itemize} Valid kwargs are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \index{arc\_spine() (matplotlib.spines.Spine class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.arc_spine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{arc\_spine}}}{\emph{axes}, \emph{spine\_type}, \emph{center}, \emph{radius}, \emph{theta1}, \emph{theta2}, \emph{**kwargs}}{} (classmethod) Returns an arc {\hyperref[\detokenize{api/spines_api:matplotlib.spines.Spine}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Spine}}}}}. \end{fulllineitems} \index{circular\_spine() (matplotlib.spines.Spine class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.circular_spine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{circular\_spine}}}{\emph{axes}, \emph{center}, \emph{radius}, \emph{**kwargs}}{} (staticmethod) Returns a circular {\hyperref[\detokenize{api/spines_api:matplotlib.spines.Spine}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Spine}}}}}. \end{fulllineitems} \index{cla() (matplotlib.spines.Spine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.cla}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{cla}}}{}{} Clear the current spine \end{fulllineitems} \index{draw() (matplotlib.spines.Spine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draw the \sphinxcode{\sphinxupquote{Patch}} to the given \sphinxstyleemphasis{renderer}. \end{fulllineitems} \index{get\_bounds() (matplotlib.spines.Spine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.get_bounds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_bounds}}}{}{} Get the bounds of the spine. \end{fulllineitems} \index{get\_patch\_transform() (matplotlib.spines.Spine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.get_patch_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_patch\_transform}}}{}{} Return the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance which takes patch coordinates to data coordinates. For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5. \end{fulllineitems} \index{get\_path() (matplotlib.spines.Spine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.get_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path}}}{}{} Return the path of this patch \end{fulllineitems} \index{get\_position() (matplotlib.spines.Spine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.get_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_position}}}{}{} get the spine position \end{fulllineitems} \index{get\_smart\_bounds() (matplotlib.spines.Spine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.get_smart_bounds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_smart\_bounds}}}{}{} get whether the spine has smart bounds \end{fulllineitems} \index{get\_spine\_transform() (matplotlib.spines.Spine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.get_spine_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_spine\_transform}}}{}{} get the spine transform \end{fulllineitems} \index{is\_frame\_like() (matplotlib.spines.Spine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.is_frame_like}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_frame\_like}}}{}{} return True if directly on axes frame This is useful for determining if a spine is the edge of an old style MPL plot. If so, this function will return True. \end{fulllineitems} \index{linear\_spine() (matplotlib.spines.Spine class method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.linear_spine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{classmethod }}\sphinxbfcode{\sphinxupquote{linear\_spine}}}{\emph{axes}, \emph{spine\_type}, \emph{**kwargs}}{} (staticmethod) Returns a linear {\hyperref[\detokenize{api/spines_api:matplotlib.spines.Spine}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Spine}}}}}. \end{fulllineitems} \index{register\_axis() (matplotlib.spines.Spine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.register_axis}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{register\_axis}}}{\emph{axis}}{} register an axis An axis should be registered with its corresponding spine from the Axes instance. This allows the spine to clear any axis properties when needed. \end{fulllineitems} \index{set\_bounds() (matplotlib.spines.Spine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.set_bounds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_bounds}}}{\emph{low}, \emph{high}}{} Set the bounds of the spine. \end{fulllineitems} \index{set\_color() (matplotlib.spines.Spine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{c}}{} Set the edgecolor. ACCEPTS: matplotlib color arg or sequence of rgba tuples \sphinxstrong{See also:} \begin{description} \item[{\sphinxcode{\sphinxupquote{set\_facecolor()}}, \sphinxcode{\sphinxupquote{set\_edgecolor()}}}] \leavevmode For setting the edge or face color individually. \end{description} \end{fulllineitems} \index{set\_patch\_arc() (matplotlib.spines.Spine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.set_patch_arc}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_patch\_arc}}}{\emph{center}, \emph{radius}, \emph{theta1}, \emph{theta2}}{} set the spine to be arc-like \end{fulllineitems} \index{set\_patch\_circle() (matplotlib.spines.Spine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.set_patch_circle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_patch\_circle}}}{\emph{center}, \emph{radius}}{} set the spine to be circular \end{fulllineitems} \index{set\_patch\_line() (matplotlib.spines.Spine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.set_patch_line}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_patch\_line}}}{}{} set the spine to be linear \end{fulllineitems} \index{set\_position() (matplotlib.spines.Spine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.set_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_position}}}{\emph{position}}{} set the position of the spine Spine position is specified by a 2 tuple of (position type, amount). The position types are: \begin{itemize} \item {} ‘outward’ : place the spine out from the data area by the specified number of points. (Negative values specify placing the spine inward.) \item {} ‘axes’ : place the spine at the specified Axes coordinate (from 0.0-1.0). \item {} ‘data’ : place the spine at the specified data coordinate. \end{itemize} Additionally, shorthand notations define a special positions: \begin{itemize} \item {} ‘center’ -\textgreater{} (‘axes’,0.5) \item {} ‘zero’ -\textgreater{} (‘data’, 0.0) \end{itemize} \end{fulllineitems} \index{set\_smart\_bounds() (matplotlib.spines.Spine method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/spines_api:matplotlib.spines.Spine.set_smart_bounds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_smart\_bounds}}}{\emph{value}}{} set the spine and associated axis to have smart bounds \end{fulllineitems} \end{fulllineitems} \chapter{style} \label{\detokenize{api/style_api:style}}\label{\detokenize{api/style_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.style}}} \label{\detokenize{api/style_api:module-matplotlib.style}}\label{\detokenize{api/style_api:matplotlib-style}}\index{matplotlib.style (module)}\index{context() (in module matplotlib.style)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/style_api:matplotlib.style.context}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.style.}}\sphinxbfcode{\sphinxupquote{context}}}{\emph{style}, \emph{after\_reset=False}}{} Context manager for using style settings temporarily. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{style}}] \leavevmode{[}str, dict, or list{]} A style specification. Valid options are: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline str & The name of a style or a path/URL to a style file. For a list of available style names, see \sphinxcode{\sphinxupquote{style.available}}. \\ \hline dict & Dictionary with valid key/value pairs for {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcParams}}}}}. \\ \hline list & A list of style specifiers (str or dict) applied from first to last in the list. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \item[{\sphinxstylestrong{after\_reset}}] \leavevmode{[}bool{]} If True, apply style after resetting settings to their defaults; otherwise, apply style on top of the current settings. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{reload\_library() (in module matplotlib.style)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/style_api:matplotlib.style.reload_library}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.style.}}\sphinxbfcode{\sphinxupquote{reload\_library}}}{}{} Reload style library. \end{fulllineitems} \index{use() (in module matplotlib.style)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/style_api:matplotlib.style.use}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.style.}}\sphinxbfcode{\sphinxupquote{use}}}{\emph{style}}{} Use matplotlib style settings from a style specification. The style name of ‘default’ is reserved for reverting back to the default style settings. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{style}}] \leavevmode{[}str, dict, or list{]} A style specification. Valid options are: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline str & The name of a style or a path/URL to a style file. For a list of available style names, see \sphinxcode{\sphinxupquote{style.available}}. \\ \hline dict & Dictionary with valid key/value pairs for {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcParams}}}}}. \\ \hline list & A list of style specifiers (str or dict) applied from first to last in the list. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{matplotlib.style.library (in module matplotlib.style)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/style_api:matplotlib.style.matplotlib.style.library}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.style.}}\sphinxbfcode{\sphinxupquote{library}}} Dictionary of available styles \end{fulllineitems} \index{matplotlib.style.available (in module matplotlib.style)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/style_api:matplotlib.style.matplotlib.style.available}}\pysigline{\sphinxcode{\sphinxupquote{matplotlib.style.}}\sphinxbfcode{\sphinxupquote{available}}} List of available styles \end{fulllineitems} \chapter{table} \label{\detokenize{api/table_api:table}}\label{\detokenize{api/table_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.table}}} \label{\detokenize{api/table_api:module-matplotlib.table}}\label{\detokenize{api/table_api:matplotlib-table}}\index{matplotlib.table (module)} Place a table below the x-axis at location loc. The table consists of a grid of cells. The grid need not be rectangular and can have holes. Cells are added by specifying their row and column. For the purposes of positioning the cell at (0, 0) is assumed to be at the top left and the cell at (max\_row, max\_col) is assumed to be at bottom right. You can add additional cells outside this range to have convenient ways of positioning more interesting grids. Author : John Gill \textless{}\sphinxhref{mailto:jng@europe.renre.com}{jng@europe.renre.com}\textgreater{} Copyright : 2004 John Gill and John Hunter License : matplotlib license \index{Cell (class in matplotlib.table)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Cell}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.table.}}\sphinxbfcode{\sphinxupquote{Cell}}}{\emph{xy}, \emph{width}, \emph{height}, \emph{edgecolor='k'}, \emph{facecolor='w'}, \emph{fill=True}, \emph{text=''}, \emph{loc=None}, \emph{fontproperties=None}}{} Bases: {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.Rectangle}}}}} A cell is a Rectangle with some associated text. \index{PAD (matplotlib.table.Cell attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Cell.PAD}}\pysigline{\sphinxbfcode{\sphinxupquote{PAD}}\sphinxbfcode{\sphinxupquote{ = 0.1}}} \end{fulllineitems} \index{auto\_set\_font\_size() (matplotlib.table.Cell method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Cell.auto_set_font_size}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{auto\_set\_font\_size}}}{\emph{renderer}}{} Shrink font size until text fits. \end{fulllineitems} \index{draw() (matplotlib.table.Cell method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Cell.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draw the \sphinxcode{\sphinxupquote{Patch}} to the given \sphinxstyleemphasis{renderer}. \end{fulllineitems} \index{get\_fontsize() (matplotlib.table.Cell method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Cell.get_fontsize}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fontsize}}}{}{} Return the cell fontsize \end{fulllineitems} \index{get\_required\_width() (matplotlib.table.Cell method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Cell.get_required_width}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_required\_width}}}{\emph{renderer}}{} Get width required for this cell. \end{fulllineitems} \index{get\_text() (matplotlib.table.Cell method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Cell.get_text}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_text}}}{}{} Return the cell Text intance \end{fulllineitems} \index{get\_text\_bounds() (matplotlib.table.Cell method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Cell.get_text_bounds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_text\_bounds}}}{\emph{renderer}}{} Get text bounds in axes co-ordinates. \end{fulllineitems} \index{set\_figure() (matplotlib.table.Cell method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Cell.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_fontsize() (matplotlib.table.Cell method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Cell.set_fontsize}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_fontsize}}}{\emph{size}}{}~ \end{fulllineitems} \index{set\_text\_props() (matplotlib.table.Cell method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Cell.set_text_props}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_text\_props}}}{\emph{**kwargs}}{} update the text properties with kwargs \end{fulllineitems} \index{set\_transform() (matplotlib.table.Cell method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Cell.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{trans}}{} Set the artist transform. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{t}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{CustomCell (class in matplotlib.table)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.CustomCell}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.table.}}\sphinxbfcode{\sphinxupquote{CustomCell}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/table_api:matplotlib.table.Cell}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.table.Cell}}}}} A subclass of Cell where the sides may be visibly toggled. \index{get\_path() (matplotlib.table.CustomCell method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.CustomCell.get_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path}}}{}{} Return a path where the edges specified by \_visible\_edges are drawn \end{fulllineitems} \index{visible\_edges (matplotlib.table.CustomCell attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.CustomCell.visible_edges}}\pysigline{\sphinxbfcode{\sphinxupquote{visible\_edges}}}~ \end{fulllineitems} \end{fulllineitems} \index{Table (class in matplotlib.table)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Table}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.table.}}\sphinxbfcode{\sphinxupquote{Table}}}{\emph{ax}, \emph{loc=None}, \emph{bbox=None}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.Artist}}}}} Create a table of cells. Table can have (optional) row and column headers. Each entry in the table can be either text or patches. Column widths and row heights for the table can be specified. Return value is a sequence of text, line and patch instances that make up the table \index{AXESPAD (matplotlib.table.Table attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Table.AXESPAD}}\pysigline{\sphinxbfcode{\sphinxupquote{AXESPAD}}\sphinxbfcode{\sphinxupquote{ = 0.02}}} \end{fulllineitems} \index{FONTSIZE (matplotlib.table.Table attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Table.FONTSIZE}}\pysigline{\sphinxbfcode{\sphinxupquote{FONTSIZE}}\sphinxbfcode{\sphinxupquote{ = 10}}} \end{fulllineitems} \index{add\_cell() (matplotlib.table.Table method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Table.add_cell}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_cell}}}{\emph{row}, \emph{col}, \emph{*args}, \emph{**kwargs}}{} Add a cell to the table. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{row}}] \leavevmode{[}int{]} Row index \item[{\sphinxstylestrong{col}}] \leavevmode{[}int{]} Column index \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{{}`CustomCell{}`: Automatically created cell}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \index{auto\_set\_column\_width() (matplotlib.table.Table method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Table.auto_set_column_width}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{auto\_set\_column\_width}}}{\emph{col}}{} Given column indexs in either List, Tuple or int. Will be able to automatically set the columns into optimal sizes. Here is the example of the input, which triger automatic adjustment on columns to optimal size by given index numbers. -1: the row labling 0: the 1st column 1: the 2nd column \begin{description} \item[{Args:}] \leavevmode col(List): list of indexs \textgreater{}\textgreater{}\textgreater{}table.auto\_set\_column\_width({[}-1,0,1{]}) col(Tuple): tuple of indexs \textgreater{}\textgreater{}\textgreater{}table.auto\_set\_column\_width((-1,0,1)) col(int): index integer \textgreater{}\textgreater{}\textgreater{}table.auto\_set\_column\_width(-1) \textgreater{}\textgreater{}\textgreater{}table.auto\_set\_column\_width(0) \textgreater{}\textgreater{}\textgreater{}table.auto\_set\_column\_width(1) \end{description} \end{fulllineitems} \index{auto\_set\_font\_size() (matplotlib.table.Table method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Table.auto_set_font_size}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{auto\_set\_font\_size}}}{\emph{value=True}}{} Automatically set font size. \end{fulllineitems} \index{codes (matplotlib.table.Table attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Table.codes}}\pysigline{\sphinxbfcode{\sphinxupquote{codes}}\sphinxbfcode{\sphinxupquote{ = \{'best': 0, 'bottom': 17, 'bottom left': 12, 'bottom right': 13, 'center': 9, 'center left': 5, 'center right': 6, 'left': 15, 'lower center': 7, 'lower left': 3, 'lower right': 4, 'right': 14, 'top': 16, 'top left': 11, 'top right': 10, 'upper center': 8, 'upper left': 2, 'upper right': 1\}}}} \end{fulllineitems} \index{contains() (matplotlib.table.Table method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Table.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the table. Returns T/F, \{\} \end{fulllineitems} \index{draw() (matplotlib.table.Table method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Table.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \index{edges (matplotlib.table.Table attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Table.edges}}\pysigline{\sphinxbfcode{\sphinxupquote{edges}}}~ \end{fulllineitems} \index{get\_celld() (matplotlib.table.Table method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Table.get_celld}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_celld}}}{}{} return a dict of cells in the table \end{fulllineitems} \index{get\_child\_artists() (matplotlib.table.Table method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Table.get_child_artists}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_child\_artists}}}{}{} Return the Artists contained by the table \end{fulllineitems} \index{get\_children() (matplotlib.table.Table method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Table.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} Return the Artists contained by the table \end{fulllineitems} \index{get\_window\_extent() (matplotlib.table.Table method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Table.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer}}{} Return the bounding box of the table in window coords \end{fulllineitems} \index{scale() (matplotlib.table.Table method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Table.scale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{scale}}}{\emph{xscale}, \emph{yscale}}{} Scale column widths by xscale and row heights by yscale. \end{fulllineitems} \index{set\_fontsize() (matplotlib.table.Table method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.Table.set_fontsize}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_fontsize}}}{\emph{size}}{} Set the fontsize of the cell text ACCEPTS: a float in points \end{fulllineitems} \end{fulllineitems} \index{table() (in module matplotlib.table)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/table_api:matplotlib.table.table}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.table.}}\sphinxbfcode{\sphinxupquote{table}}}{\emph{cellText=None}, \emph{cellColours=None}, \emph{cellLoc='right'}, \emph{colWidths=None}, \emph{rowLabels=None}, \emph{rowColours=None}, \emph{rowLoc='left'}, \emph{colLabels=None}, \emph{colColours=None}, \emph{colLoc='center'}, \emph{loc='bottom'}, \emph{bbox=None}, \emph{edges='closed'}}{} Factory function to generate a Table instance. Thanks to John Gill for providing the class and table. \end{fulllineitems} \chapter{text} \label{\detokenize{api/text_api:text}}\label{\detokenize{api/text_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.text}}} \label{\detokenize{api/text_api:module-matplotlib.text}}\label{\detokenize{api/text_api:matplotlib-text}}\index{matplotlib.text (module)} Classes for including text in a figure. \index{Annotation (class in matplotlib.text)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Annotation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.text.}}\sphinxbfcode{\sphinxupquote{Annotation}}}{\emph{s}, \emph{xy}, \emph{xytext=None}, \emph{xycoords='data'}, \emph{textcoords=None}, \emph{arrowprops=None}, \emph{annotation\_clip=None}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}}, \sphinxcode{\sphinxupquote{matplotlib.text.\_AnnotationBase}} Annotate the point \sphinxcode{\sphinxupquote{xy}} with text \sphinxcode{\sphinxupquote{s}}. Additional kwargs are passed to {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}str{]} The text of the annotation \item[{\sphinxstylestrong{xy}}] \leavevmode{[}iterable{]} Length 2 sequence specifying the \sphinxstyleemphasis{(x,y)} point to annotate \item[{\sphinxstylestrong{xytext}}] \leavevmode{[}iterable, optional{]} Length 2 sequence specifying the \sphinxstyleemphasis{(x,y)} to place the text at. If None, defaults to \sphinxcode{\sphinxupquote{xy}}. \item[{\sphinxstylestrong{xycoords}}] \leavevmode{[}str, Artist, Transform, callable or tuple, optional{]} The coordinate system that \sphinxcode{\sphinxupquote{xy}} is given in. For a \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} the allowed values are: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline ‘figure points’ & points from the lower left of the figure \\ \hline ‘figure pixels’ & pixels from the lower left of the figure \\ \hline ‘figure fraction’ & fraction of figure from lower left \\ \hline ‘axes points’ & points from lower left corner of axes \\ \hline ‘axes pixels’ & pixels from lower left corner of axes \\ \hline ‘axes fraction’ & fraction of axes from lower left \\ \hline ‘data’ & use the coordinate system of the object being annotated (default) \\ \hline ‘polar’ & \sphinxstyleemphasis{(theta,r)} if not native ‘data’ coordinates \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} If a {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} object is passed in the units are fraction if it’s bounding box. If a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} object is passed in use that to transform \sphinxcode{\sphinxupquote{xy}} to screen coordinates If a callable it must take a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RendererBase}}}}} object as input and return a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} or {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} object If a \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#tuple}{\sphinxcode{\sphinxupquote{tuple}}} must be length 2 tuple of str, \sphinxcode{\sphinxupquote{Artist}}, \sphinxcode{\sphinxupquote{Transform}} or callable objects. The first transform is used for the \sphinxstyleemphasis{x} coordinate and the second for \sphinxstyleemphasis{y}. See {\hyperref[\detokenize{tutorials/text/annotations:plotting-guide-annotation}]{\sphinxcrossref{\DUrole{std,std-ref}{Advanced Annotation}}}} for more details. Defaults to \sphinxcode{\sphinxupquote{'data'}} \item[{\sphinxstylestrong{textcoords}}] \leavevmode{[}str, \sphinxcode{\sphinxupquote{Artist}}, \sphinxcode{\sphinxupquote{Transform}}, callable or tuple, optional{]} The coordinate system that \sphinxcode{\sphinxupquote{xytext}} is given, which may be different than the coordinate system used for \sphinxcode{\sphinxupquote{xy}}. All \sphinxcode{\sphinxupquote{xycoords}} values are valid as well as the following strings: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline ‘offset points’ & offset (in points) from the \sphinxstyleemphasis{xy} value \\ \hline ‘offset pixels’ & offset (in pixels) from the \sphinxstyleemphasis{xy} value \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} defaults to the input of \sphinxcode{\sphinxupquote{xycoords}} \item[{\sphinxstylestrong{arrowprops}}] \leavevmode{[}dict, optional{]} If not None, properties used to draw a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrowPatch}}}}} arrow between \sphinxcode{\sphinxupquote{xy}} and \sphinxcode{\sphinxupquote{xytext}}. If \sphinxcode{\sphinxupquote{arrowprops}} does not contain the key \sphinxcode{\sphinxupquote{'arrowstyle'}} the allowed keys are: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Key &\sphinxstyletheadfamily Description \\ \hline width & the width of the arrow in points \\ \hline headwidth & the width of the base of the arrow head in points \\ \hline headlength & the length of the arrow head in points \\ \hline shrink & fraction of total length to ‘shrink’ from both ends \\ \hline ? & any key to {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.FancyArrowPatch}}}}} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} If the \sphinxcode{\sphinxupquote{arrowprops}} contains the key \sphinxcode{\sphinxupquote{'arrowstyle'}} the above keys are forbidden. The allowed values of \sphinxcode{\sphinxupquote{'arrowstyle'}} are: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Name &\sphinxstyletheadfamily Attrs \\ \hline \sphinxcode{\sphinxupquote{'-'}} & None \\ \hline \sphinxcode{\sphinxupquote{'-\textgreater{}'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'-{[}'}} & widthB=1.0,lengthB=0.2,angleB=None \\ \hline \sphinxcode{\sphinxupquote{'\textbar{}-\textbar{}'}} & widthA=1.0,widthB=1.0 \\ \hline \sphinxcode{\sphinxupquote{'-\textbar{}\textgreater{}'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'\textless{}-'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'\textless{}-\textgreater{}'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'\textless{}\textbar{}-'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'\textless{}\textbar{}-\textbar{}\textgreater{}'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'fancy'}} & head\_length=0.4,head\_width=0.4,tail\_width=0.4 \\ \hline \sphinxcode{\sphinxupquote{'simple'}} & head\_length=0.5,head\_width=0.5,tail\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'wedge'}} & tail\_width=0.3,shrink\_factor=0.5 \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Valid keys for {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrowPatch}}}}} are: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Key &\sphinxstyletheadfamily Description \\ \hline arrowstyle & the arrow style \\ \hline connectionstyle & the connection style \\ \hline relpos & default is (0.5, 0.5) \\ \hline patchA & default is bounding box of the text \\ \hline patchB & default is None \\ \hline shrinkA & default is 2 points \\ \hline shrinkB & default is 2 points \\ \hline mutation\_scale & default is text size (in points) \\ \hline mutation\_aspect & default is 1. \\ \hline ? & any key for {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.PathPatch:matplotlib.patches.PathPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.PathPatch}}}}} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Defaults to None \item[{\sphinxstylestrong{annotation\_clip}}] \leavevmode{[}bool, optional{]} Controls the visibility of the annotation when it goes outside the axes area. If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, the annotation will only be drawn when the \sphinxcode{\sphinxupquote{xy}} is inside the axes. If \sphinxhref{https://docs.python.org/3/library/constants.html\#False}{\sphinxcode{\sphinxupquote{False}}}, the annotation will always be drawn regardless of its position. The default is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, which behave as \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} only if \sphinxstyleemphasis{xycoords} is “data”. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Annotation}}] \leavevmode \end{description} \end{description}\end{quote} \index{anncoords (matplotlib.text.Annotation attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Annotation.anncoords}}\pysigline{\sphinxbfcode{\sphinxupquote{anncoords}}}~ \end{fulllineitems} \index{contains() (matplotlib.text.Annotation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Annotation.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{event}}{} Test whether the mouse event occurred in the patch. In the case of text, a hit is true anywhere in the axis-aligned bounding-box containing the text. Returns True or False. \end{fulllineitems} \index{draw() (matplotlib.text.Annotation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Annotation.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draw the {\hyperref[\detokenize{api/text_api:matplotlib.text.Annotation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Annotation}}}}} object to the given \sphinxstyleemphasis{renderer}. \end{fulllineitems} \index{get\_window\_extent() (matplotlib.text.Annotation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Annotation.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer=None}}{} Return a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} object bounding the text and arrow annotation, in display units. \sphinxstyleemphasis{renderer} defaults to the \_renderer attribute of the text object. This is not assigned until the first execution of {\hyperref[\detokenize{api/text_api:matplotlib.text.Annotation.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw()}}}}}, so you must use this kwarg if you want to call {\hyperref[\detokenize{api/text_api:matplotlib.text.Annotation.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_window\_extent()}}}}} prior to the first {\hyperref[\detokenize{api/text_api:matplotlib.text.Annotation.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw()}}}}}. For getting web page regions, it is simpler to call the method after saving the figure. The \sphinxstyleemphasis{dpi} used defaults to self.figure.dpi; the renderer dpi is irrelevant. \end{fulllineitems} \index{set\_figure() (matplotlib.text.Annotation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Annotation.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance the artist belongs to. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{update\_positions() (matplotlib.text.Annotation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Annotation.update_positions}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_positions}}}{\emph{renderer}}{} “Update the pixel positions of the annotated point and the text. \end{fulllineitems} \index{xyann (matplotlib.text.Annotation attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Annotation.xyann}}\pysigline{\sphinxbfcode{\sphinxupquote{xyann}}}~ \end{fulllineitems} \end{fulllineitems} \index{OffsetFrom (class in matplotlib.text)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.OffsetFrom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.text.}}\sphinxbfcode{\sphinxupquote{OffsetFrom}}}{\emph{artist}, \emph{ref\_coord}, \emph{unit='points'}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Callable helper class for working with {\hyperref[\detokenize{api/text_api:matplotlib.text.Annotation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Annotation}}}}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{artist}}] \leavevmode{[}\sphinxcode{\sphinxupquote{Artist}}, \sphinxcode{\sphinxupquote{BboxBase}}, or \sphinxcode{\sphinxupquote{Transform}}{]} The object to compute the offset from. \item[{\sphinxstylestrong{ref\_coord}}] \leavevmode{[}length 2 sequence{]} If \sphinxcode{\sphinxupquote{artist}} is an \sphinxcode{\sphinxupquote{Artist}} or \sphinxcode{\sphinxupquote{BboxBase}}, this values is the location to of the offset origin in fractions of the \sphinxcode{\sphinxupquote{artist}} bounding box. If \sphinxcode{\sphinxupquote{artist}} is a transform, the offset origin is the transform applied to this value. \item[{\sphinxstylestrong{unit}}] \leavevmode{[}\{‘points, ‘pixels’\}{]} The screen units to use (pixels or points) for the offset input. \end{description} \end{description}\end{quote} \index{get\_unit() (matplotlib.text.OffsetFrom method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.OffsetFrom.get_unit}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_unit}}}{}{} The unit for input to the transform used by \sphinxcode{\sphinxupquote{\_\_call\_\_}} \end{fulllineitems} \index{set\_unit() (matplotlib.text.OffsetFrom method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.OffsetFrom.set_unit}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_unit}}}{\emph{unit}}{} The unit for input to the transform used by \sphinxcode{\sphinxupquote{\_\_call\_\_}} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{unit}}] \leavevmode{[}\{‘points’, ‘pixels’\}{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{Text (class in matplotlib.text)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.text.}}\sphinxbfcode{\sphinxupquote{Text}}}{\emph{x=0}, \emph{y=0}, \emph{text=''}, \emph{color=None}, \emph{verticalalignment='baseline'}, \emph{horizontalalignment='left'}, \emph{multialignment=None}, \emph{fontproperties=None}, \emph{rotation=None}, \emph{linespacing=None}, \emph{rotation\_mode=None}, \emph{usetex=None}, \emph{wrap=False}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.Artist}}}}} Handle storing and drawing of text in window or data coordinates. Create a {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instance at \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} with string \sphinxstyleemphasis{text}. Valid kwargs are \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_backgroundcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{backgroundcolor}}}}} & any matplotlib color \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bbox}}}}} & FancyBboxPatch prop dict \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[} ({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_family}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{family}}}}} or fontfamily or fontname or name & {[}FONTNAME \textbar{} ‘serif’ \textbar{} ‘sans-serif’ \textbar{} ‘cursive’ \textbar{} ‘fantasy’ \textbar{} ‘monospace’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_fontproperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fontproperties}}}}} or font\_properties & a {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_horizontalalignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{horizontalalignment}}}}} or ha & {[} ‘center’ \textbar{} ‘right’ \textbar{} ‘left’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_linespacing}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linespacing}}}}} & float (multiple of font size) \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_multialignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{multialignment}}}}} or ma & {[}‘left’ \textbar{} ‘right’ \textbar{} ‘center’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{position}}}}} & (x,y) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_rotation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotation}}}}} & {[} angle in degrees \textbar{} ‘vertical’ \textbar{} ‘horizontal’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_rotation_mode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotation\_mode}}}}} & {[} None \textbar{} “default” \textbar{} “anchor” {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_size}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{size}}}}} or fontsize & {[}size in points \textbar{} ‘xx-small’ \textbar{} ‘x-small’ \textbar{} ‘small’ \textbar{} ‘medium’ \textbar{} ‘large’ \textbar{} ‘x-large’ \textbar{} ‘xx-large’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_stretch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stretch}}}}} or fontstretch & {[}a numeric value in range 0-1000 \textbar{} ‘ultra-condensed’ \textbar{} ‘extra-condensed’ \textbar{} ‘condensed’ \textbar{} ‘semi-condensed’ \textbar{} ‘normal’ \textbar{} ‘semi-expanded’ \textbar{} ‘expanded’ \textbar{} ‘extra-expanded’ \textbar{} ‘ultra-expanded’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_style}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{style}}}}} or fontstyle & {[} ‘normal’ \textbar{} ‘italic’ \textbar{} ‘oblique’{]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text}}}}} & string or anything printable with ‘\%s’ conversion. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_usetex}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{usetex}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_variant}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{variant}}}}} or fontvariant & {[} ‘normal’ \textbar{} ‘small-caps’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_verticalalignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{verticalalignment}}}}} or va & {[} ‘center’ \textbar{} ‘top’ \textbar{} ‘bottom’ \textbar{} ‘baseline’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_weight}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{weight}}}}} or fontweight & {[}a numeric value in range 0-1000 \textbar{} ‘ultralight’ \textbar{} ‘light’ \textbar{} ‘normal’ \textbar{} ‘regular’ \textbar{} ‘book’ \textbar{} ‘medium’ \textbar{} ‘roman’ \textbar{} ‘semibold’ \textbar{} ‘demibold’ \textbar{} ‘demi’ \textbar{} ‘bold’ \textbar{} ‘heavy’ \textbar{} ‘extra bold’ \textbar{} ‘black’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_wrap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{wrap}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_x}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x}}}}} & float \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_y}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y}}}}} & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} \index{contains() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{mouseevent}}{} Test whether the mouse event occurred in the patch. In the case of text, a hit is true anywhere in the axis-aligned bounding-box containing the text. Returns True or False. \end{fulllineitems} \index{draw() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draws the {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} object to the given \sphinxstyleemphasis{renderer}. \end{fulllineitems} \index{get\_bbox\_patch() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_bbox_patch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_bbox\_patch}}}{}{} Return the bbox Patch object. Returns None if the FancyBboxPatch is not made. \end{fulllineitems} \index{get\_color() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_color}}}{}{} Return the color of the text \end{fulllineitems} \index{get\_family() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_family}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_family}}}{}{} Return the list of font families used for font lookup \end{fulllineitems} \index{get\_font\_properties() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_font_properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_font\_properties}}}{}{} alias for get\_fontproperties \end{fulllineitems} \index{get\_fontfamily() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_fontfamily}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fontfamily}}}{}{} alias for get\_family \end{fulllineitems} \index{get\_fontname() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_fontname}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fontname}}}{}{} alias for get\_name \end{fulllineitems} \index{get\_fontproperties() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_fontproperties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fontproperties}}}{}{} Return the \sphinxcode{\sphinxupquote{FontProperties}} object \end{fulllineitems} \index{get\_fontsize() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_fontsize}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fontsize}}}{}{} alias for get\_size \end{fulllineitems} \index{get\_fontstretch() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_fontstretch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fontstretch}}}{}{} alias for get\_stretch \end{fulllineitems} \index{get\_fontstyle() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_fontstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fontstyle}}}{}{} alias for get\_style \end{fulllineitems} \index{get\_fontvariant() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_fontvariant}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fontvariant}}}{}{} alias for get\_variant \end{fulllineitems} \index{get\_fontweight() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_fontweight}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fontweight}}}{}{} alias for get\_weight \end{fulllineitems} \index{get\_ha() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_ha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_ha}}}{}{} alias for get\_horizontalalignment \end{fulllineitems} \index{get\_horizontalalignment() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_horizontalalignment}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_horizontalalignment}}}{}{} Return the horizontal alignment as string. Will be one of ‘left’, ‘center’ or ‘right’. \end{fulllineitems} \index{get\_name() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_name}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_name}}}{}{} Return the font name as string \end{fulllineitems} \index{get\_position() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_position}}}{}{} Return the position of the text as a tuple (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) \end{fulllineitems} \index{get\_prop\_tup() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_prop_tup}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_prop\_tup}}}{\emph{renderer=None}}{} Return a hashable tuple of properties. Not intended to be human readable, but useful for backends who want to cache derived information about text (e.g., layouts) and need to know if the text has changed. \end{fulllineitems} \index{get\_rotation() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_rotation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rotation}}}{}{} return the text angle as float in degrees \end{fulllineitems} \index{get\_rotation\_mode() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_rotation_mode}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rotation\_mode}}}{}{} get text rotation mode \end{fulllineitems} \index{get\_size() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_size}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_size}}}{}{} Return the font size as integer \end{fulllineitems} \index{get\_stretch() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_stretch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_stretch}}}{}{} Get the font stretch as a string or number \end{fulllineitems} \index{get\_style() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_style}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_style}}}{}{} Return the font style as string \end{fulllineitems} \index{get\_text() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_text}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_text}}}{}{} Get the text as string \end{fulllineitems} \index{get\_unitless\_position() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_unitless_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_unitless\_position}}}{}{} Return the unitless position of the text as a tuple (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) \end{fulllineitems} \index{get\_usetex() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_usetex}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_usetex}}}{}{} Return whether this {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} object uses TeX for rendering. If the user has not manually set this value, it defaults to \sphinxcode{\sphinxupquote{rcParams{[}"text.usetex"{]}}}. \end{fulllineitems} \index{get\_va() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_va}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_va}}}{}{} alias for \sphinxcode{\sphinxupquote{getverticalalignment()}} \end{fulllineitems} \index{get\_variant() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_variant}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_variant}}}{}{} Return the font variant as a string \end{fulllineitems} \index{get\_verticalalignment() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_verticalalignment}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_verticalalignment}}}{}{} Return the vertical alignment as string. Will be one of ‘top’, ‘center’, ‘bottom’ or ‘baseline’. \end{fulllineitems} \index{get\_weight() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_weight}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_weight}}}{}{} Get the font weight as string or number \end{fulllineitems} \index{get\_window\_extent() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer=None}, \emph{dpi=None}}{} Return a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} object bounding the text, in display units. In addition to being used internally, this is useful for specifying clickable regions in a png file on a web page. \sphinxstyleemphasis{renderer} defaults to the \_renderer attribute of the text object. This is not assigned until the first execution of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw()}}}}}, so you must use this kwarg if you want to call {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_window\_extent()}}}}} prior to the first {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw()}}}}}. For getting web page regions, it is simpler to call the method after saving the figure. \sphinxstyleemphasis{dpi} defaults to self.figure.dpi; the renderer dpi is irrelevant. For the web application, if figure.dpi is not the value used when saving the figure, then the value that was used must be specified as the \sphinxstyleemphasis{dpi} argument. \end{fulllineitems} \index{get\_wrap() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.get_wrap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_wrap}}}{}{} Returns the wrapping state for the text. \end{fulllineitems} \index{is\_math\_text() (matplotlib.text.Text static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.is_math_text}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{is\_math\_text}}}{\emph{s}, \emph{usetex=None}}{} Returns a cleaned string and a boolean flag. The flag indicates if the given string \sphinxstyleemphasis{s} contains any mathtext, determined by counting unescaped dollar signs. If no mathtext is present, the cleaned string has its dollar signs unescaped. If usetex is on, the flag always has the value “TeX”. \end{fulllineitems} \index{set\_backgroundcolor() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_backgroundcolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_backgroundcolor}}}{\emph{color}}{} Set the background color of the text by updating the bbox. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_bbox()}}}}}}] \leavevmode To change the position of the bounding box. \end{description} ACCEPTS: any matplotlib color \end{fulllineitems} \index{set\_bbox() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_bbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_bbox}}}{\emph{rectprops}}{} Draw a bounding box around self. rectprops are any settable properties for a FancyBboxPatch, e.g., facecolor=’red’, alpha=0.5. \begin{quote} t.set\_bbox(dict(facecolor=’red’, alpha=0.5)) \end{quote} The default boxstyle is ‘square’. The mutation scale of the FancyBboxPatch is set to the fontsize. ACCEPTS: FancyBboxPatch prop dict \end{fulllineitems} \index{set\_clip\_box() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_clip_box}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_box}}}{\emph{clipbox}}{} Set the artist’s clip {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. ACCEPTS: a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Bbox}}}}} instance \end{fulllineitems} \index{set\_clip\_on() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_clip_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_on}}}{\emph{b}}{} Set whether artist uses clipping. When False, artists will be visible outside of the axes, which can lead to unexpected results. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_clip\_path() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_clip_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_clip\_path}}}{\emph{path}, \emph{transform=None}}{} Set the artist’s clip path, which may be: \begin{itemize} \item {} a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} (or subclass) instance \item {} \begin{description} \item[{a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance, in which case}] \leavevmode an optional {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance may be provided, which will be applied to the path before using it for clipping. \end{description} \item {} \sphinxstyleemphasis{None}, to remove the clipping path \end{itemize} For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to \sphinxstyleemphasis{None}. ACCEPTS: {[} ({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None {]} \end{fulllineitems} \index{set\_color() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_color}}}{\emph{color}}{} Set the foreground color of the text ACCEPTS: any matplotlib color \end{fulllineitems} \index{set\_family() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_family}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_family}}}{\emph{fontname}}{} Set the font family. May be either a single string, or a list of strings in decreasing priority. Each string may be either a real font name or a generic font class name. If the latter, the specific font names will be looked up in the \sphinxcode{\sphinxupquote{matplotlibrc}} file. \begin{description} \item[{ACCEPTS: {[}FONTNAME \textbar{} ‘serif’ \textbar{} ‘sans-serif’ \textbar{} ‘cursive’ \textbar{} ‘fantasy’ \textbar{}}] \leavevmode ‘monospace’ {]} \end{description} \end{fulllineitems} \index{set\_font\_properties() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_font_properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_font\_properties}}}{\emph{fp}}{} alias for set\_fontproperties \end{fulllineitems} \index{set\_fontname() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_fontname}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_fontname}}}{\emph{fontname}}{} alias for set\_family \end{fulllineitems} \index{set\_fontproperties() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_fontproperties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_fontproperties}}}{\emph{fp}}{} Set the font properties that control the text. \sphinxstyleemphasis{fp} must be a {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}} object. ACCEPTS: a {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}} instance \end{fulllineitems} \index{set\_fontsize() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_fontsize}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_fontsize}}}{\emph{fontsize}}{} alias for set\_size \end{fulllineitems} \index{set\_fontstretch() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_fontstretch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_fontstretch}}}{\emph{stretch}}{} alias for set\_stretch \end{fulllineitems} \index{set\_fontstyle() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_fontstyle}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_fontstyle}}}{\emph{fontstyle}}{} alias for set\_style \end{fulllineitems} \index{set\_fontvariant() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_fontvariant}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_fontvariant}}}{\emph{variant}}{} alias for set\_variant \end{fulllineitems} \index{set\_fontweight() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_fontweight}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_fontweight}}}{\emph{weight}}{} alias for set\_weight \end{fulllineitems} \index{set\_ha() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_ha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_ha}}}{\emph{align}}{} alias for set\_horizontalalignment \end{fulllineitems} \index{set\_horizontalalignment() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_horizontalalignment}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_horizontalalignment}}}{\emph{align}}{} Set the horizontal alignment to one of ACCEPTS: {[} ‘center’ \textbar{} ‘right’ \textbar{} ‘left’ {]} \end{fulllineitems} \index{set\_linespacing() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_linespacing}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_linespacing}}}{\emph{spacing}}{} Set the line spacing as a multiple of the font size. Default is 1.2. ACCEPTS: float (multiple of font size) \end{fulllineitems} \index{set\_ma() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_ma}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_ma}}}{\emph{align}}{} alias for set\_multialignment \end{fulllineitems} \index{set\_multialignment() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_multialignment}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_multialignment}}}{\emph{align}}{} Set the alignment for multiple lines layout. The layout of the bounding box of all the lines is determined bu the horizontalalignment and verticalalignment properties, but the multiline text within that box can be ACCEPTS: {[}‘left’ \textbar{} ‘right’ \textbar{} ‘center’ {]} \end{fulllineitems} \index{set\_name() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_name}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_name}}}{\emph{fontname}}{} alias for set\_family \end{fulllineitems} \index{set\_position() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_position}}}{\emph{xy}}{} Set the (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) position of the text ACCEPTS: (x,y) \end{fulllineitems} \index{set\_rotation() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_rotation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rotation}}}{\emph{s}}{} Set the rotation of the text ACCEPTS: {[} angle in degrees \textbar{} ‘vertical’ \textbar{} ‘horizontal’ {]} \end{fulllineitems} \index{set\_rotation\_mode() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_rotation_mode}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rotation\_mode}}}{\emph{m}}{} Set text rotation mode. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{m}}] \leavevmode{[}\sphinxcode{\sphinxupquote{None}} or \sphinxcode{\sphinxupquote{"default"}} or \sphinxcode{\sphinxupquote{"anchor"}}{]} If \sphinxcode{\sphinxupquote{None}} or \sphinxcode{\sphinxupquote{"default"}}, the text will be first rotated, then aligned according to their horizontal and vertical alignments. If \sphinxcode{\sphinxupquote{"anchor"}}, then alignment occurs before rotation. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_size() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_size}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_size}}}{\emph{fontsize}}{} Set the font size. May be either a size string, relative to the default font size, or an absolute font size in points. \begin{description} \item[{ACCEPTS: {[}size in points \textbar{} ‘xx-small’ \textbar{} ‘x-small’ \textbar{} ‘small’ \textbar{}}] \leavevmode ‘medium’ \textbar{} ‘large’ \textbar{} ‘x-large’ \textbar{} ‘xx-large’ {]} \end{description} \end{fulllineitems} \index{set\_stretch() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_stretch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_stretch}}}{\emph{stretch}}{} Set the font stretch (horizontal condensation or expansion). \begin{description} \item[{ACCEPTS: {[}a numeric value in range 0-1000 \textbar{} ‘ultra-condensed’ \textbar{}}] \leavevmode ‘extra-condensed’ \textbar{} ‘condensed’ \textbar{} ‘semi-condensed’ \textbar{} ‘normal’ \textbar{} ‘semi-expanded’ \textbar{} ‘expanded’ \textbar{} ‘extra-expanded’ \textbar{} ‘ultra-expanded’ {]} \end{description} \end{fulllineitems} \index{set\_style() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_style}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_style}}}{\emph{fontstyle}}{} Set the font style. ACCEPTS: {[} ‘normal’ \textbar{} ‘italic’ \textbar{} ‘oblique’{]} \end{fulllineitems} \index{set\_text() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_text}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_text}}}{\emph{s}}{} Set the text string \sphinxstyleemphasis{s} It may contain newlines (\sphinxcode{\sphinxupquote{\textbackslash{}n}}) or math in LaTeX syntax. ACCEPTS: string or anything printable with ‘\%s’ conversion. \end{fulllineitems} \index{set\_usetex() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_usetex}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_usetex}}}{\emph{usetex}}{}~\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{usetex}}] \leavevmode{[}bool or None{]} Whether to render using TeX, \sphinxcode{\sphinxupquote{None}} means to use \sphinxcode{\sphinxupquote{rcParams{[}"text.usetex"{]}}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_va() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_va}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_va}}}{\emph{align}}{} alias for set\_verticalalignment \end{fulllineitems} \index{set\_variant() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_variant}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_variant}}}{\emph{variant}}{} Set the font variant, either ‘normal’ or ‘small-caps’. ACCEPTS: {[} ‘normal’ \textbar{} ‘small-caps’ {]} \end{fulllineitems} \index{set\_verticalalignment() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_verticalalignment}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_verticalalignment}}}{\emph{align}}{} Set the vertical alignment ACCEPTS: {[} ‘center’ \textbar{} ‘top’ \textbar{} ‘bottom’ \textbar{} ‘baseline’ {]} \end{fulllineitems} \index{set\_weight() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_weight}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_weight}}}{\emph{weight}}{} Set the font weight. \begin{description} \item[{ACCEPTS: {[}a numeric value in range 0-1000 \textbar{} ‘ultralight’ \textbar{} ‘light’ \textbar{}}] \leavevmode ‘normal’ \textbar{} ‘regular’ \textbar{} ‘book’ \textbar{} ‘medium’ \textbar{} ‘roman’ \textbar{} ‘semibold’ \textbar{} ‘demibold’ \textbar{} ‘demi’ \textbar{} ‘bold’ \textbar{} ‘heavy’ \textbar{} ‘extra bold’ \textbar{} ‘black’ {]} \end{description} \end{fulllineitems} \index{set\_wrap() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_wrap}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_wrap}}}{\emph{wrap}}{} Sets the wrapping state for the text. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{wrap}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_x() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_x}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_x}}}{\emph{x}}{} Set the \sphinxstyleemphasis{x} position of the text ACCEPTS: float \end{fulllineitems} \index{set\_y() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.set_y}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_y}}}{\emph{y}}{} Set the \sphinxstyleemphasis{y} position of the text ACCEPTS: float \end{fulllineitems} \index{update() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.update}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update}}}{\emph{kwargs}}{} Update properties from a dictionary. \end{fulllineitems} \index{update\_bbox\_position\_size() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.update_bbox_position_size}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_bbox\_position\_size}}}{\emph{renderer}}{} Update the location and the size of the bbox. This method should be used when the position and size of the bbox needs to be updated before actually drawing the bbox. \end{fulllineitems} \index{update\_from() (matplotlib.text.Text method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.update_from}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from}}}{\emph{other}}{} Copy properties from other to self \end{fulllineitems} \index{zorder (matplotlib.text.Text attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.Text.zorder}}\pysigline{\sphinxbfcode{\sphinxupquote{zorder}}\sphinxbfcode{\sphinxupquote{ = 3}}} \end{fulllineitems} \end{fulllineitems} \index{TextWithDash (class in matplotlib.text)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.text.}}\sphinxbfcode{\sphinxupquote{TextWithDash}}}{\emph{x=0}, \emph{y=0}, \emph{text=''}, \emph{color=None}, \emph{verticalalignment='center'}, \emph{horizontalalignment='center'}, \emph{multialignment=None}, \emph{fontproperties=None}, \emph{rotation=None}, \emph{linespacing=None}, \emph{dashlength=0.0}, \emph{dashdirection=0}, \emph{dashrotation=None}, \emph{dashpad=3}, \emph{dashpush=0}}{} Bases: {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}} This is basically a {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} with a dash (drawn with a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}}) before/after it. It is intended to be a drop-in replacement for {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}}, and should behave identically to it when \sphinxstyleemphasis{dashlength} = 0.0. The dash always comes between the point specified by {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_position()}}}}} and the text. When a dash exists, the text alignment arguments (\sphinxstyleemphasis{horizontalalignment}, \sphinxstyleemphasis{verticalalignment}) are ignored. \sphinxstyleemphasis{dashlength} is the length of the dash in canvas units. (default = 0.0). \sphinxstyleemphasis{dashdirection} is one of 0 or 1, where 0 draws the dash after the text and 1 before. (default = 0). \sphinxstyleemphasis{dashrotation} specifies the rotation of the dash, and should generally stay \sphinxstyleemphasis{None}. In this case {\hyperref[\detokenize{api/text_api:matplotlib.text.TextWithDash.get_dashrotation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_dashrotation()}}}}} returns {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.get_rotation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_rotation()}}}}}. (i.e., the dash takes its rotation from the text’s rotation). Because the text center is projected onto the dash, major deviations in the rotation cause what may be considered visually unappealing results. (default = \sphinxstyleemphasis{None}) \sphinxstyleemphasis{dashpad} is a padding length to add (or subtract) space between the text and the dash, in canvas units. (default = 3) \sphinxstyleemphasis{dashpush} “pushes” the dash and text away from the point specified by {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_position()}}}}} by the amount in canvas units. (default = 0) \begin{sphinxadmonition}{note}{Note:} The alignment of the two objects is based on the bounding box of the {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}}, as obtained by {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.get_window_extent:matplotlib.artist.Artist.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_window\_extent()}}}}}. This, in turn, appears to depend on the font metrics as given by the rendering backend. Hence the quality of the “centering” of the label text with respect to the dash varies depending on the backend used. \end{sphinxadmonition} \begin{sphinxadmonition}{note}{Note:} I’m not sure that I got the {\hyperref[\detokenize{api/text_api:matplotlib.text.TextWithDash.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_window\_extent()}}}}} right, or whether that’s sufficient for providing the object bounding box. \end{sphinxadmonition} \index{draw() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draw the {\hyperref[\detokenize{api/text_api:matplotlib.text.TextWithDash}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TextWithDash}}}}} object to the given \sphinxstyleemphasis{renderer}. \end{fulllineitems} \index{get\_dashdirection() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.get_dashdirection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashdirection}}}{}{} Get the direction dash. 1 is before the text and 0 is after. \end{fulllineitems} \index{get\_dashlength() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.get_dashlength}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashlength}}}{}{} Get the length of the dash. \end{fulllineitems} \index{get\_dashpad() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.get_dashpad}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashpad}}}{}{} Get the extra spacing between the dash and the text, in canvas units. \end{fulllineitems} \index{get\_dashpush() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.get_dashpush}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashpush}}}{}{} Get the extra spacing between the dash and the specified text position, in canvas units. \end{fulllineitems} \index{get\_dashrotation() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.get_dashrotation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_dashrotation}}}{}{} Get the rotation of the dash in degrees. \end{fulllineitems} \index{get\_figure() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.get_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_figure}}}{}{} return the figure instance the artist belongs to \end{fulllineitems} \index{get\_position() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.get_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_position}}}{}{} Return the position of the text as a tuple (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) \end{fulllineitems} \index{get\_prop\_tup() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.get_prop_tup}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_prop\_tup}}}{\emph{renderer=None}}{} Return a hashable tuple of properties. Not intended to be human readable, but useful for backends who want to cache derived information about text (e.g., layouts) and need to know if the text has changed. \end{fulllineitems} \index{get\_unitless\_position() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.get_unitless_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_unitless\_position}}}{}{} Return the unitless position of the text as a tuple (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) \end{fulllineitems} \index{get\_window\_extent() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.get_window_extent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_window\_extent}}}{\emph{renderer=None}}{} Return a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} object bounding the text, in display units. In addition to being used internally, this is useful for specifying clickable regions in a png file on a web page. \sphinxstyleemphasis{renderer} defaults to the \_renderer attribute of the text object. This is not assigned until the first execution of {\hyperref[\detokenize{api/text_api:matplotlib.text.TextWithDash.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw()}}}}}, so you must use this kwarg if you want to call {\hyperref[\detokenize{api/text_api:matplotlib.text.TextWithDash.get_window_extent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_window\_extent()}}}}} prior to the first {\hyperref[\detokenize{api/text_api:matplotlib.text.TextWithDash.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw()}}}}}. For getting web page regions, it is simpler to call the method after saving the figure. \end{fulllineitems} \index{set\_dashdirection() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.set_dashdirection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashdirection}}}{\emph{dd}}{} Set the direction of the dash following the text. 1 is before the text and 0 is after. The default is 0, which is what you’d want for the typical case of ticks below and on the left of the figure. ACCEPTS: int (1 is before, 0 is after) \end{fulllineitems} \index{set\_dashlength() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.set_dashlength}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashlength}}}{\emph{dl}}{} Set the length of the dash. ACCEPTS: float (canvas units) \end{fulllineitems} \index{set\_dashpad() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.set_dashpad}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashpad}}}{\emph{dp}}{} Set the “pad” of the TextWithDash, which is the extra spacing between the dash and the text, in canvas units. ACCEPTS: float (canvas units) \end{fulllineitems} \index{set\_dashpush() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.set_dashpush}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashpush}}}{\emph{dp}}{} Set the “push” of the TextWithDash, which is the extra spacing between the beginning of the dash and the specified position. ACCEPTS: float (canvas units) \end{fulllineitems} \index{set\_dashrotation() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.set_dashrotation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_dashrotation}}}{\emph{dr}}{} Set the rotation of the dash, in degrees ACCEPTS: float (degrees) \end{fulllineitems} \index{set\_figure() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.set_figure}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_figure}}}{\emph{fig}}{} Set the figure instance the artist belong to. ACCEPTS: a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure}}}}} instance \end{fulllineitems} \index{set\_position() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.set_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_position}}}{\emph{xy}}{} Set the (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) position of the {\hyperref[\detokenize{api/text_api:matplotlib.text.TextWithDash}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TextWithDash}}}}}. ACCEPTS: (x, y) \end{fulllineitems} \index{set\_transform() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.set_transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_transform}}}{\emph{t}}{} Set the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance used by this artist. ACCEPTS: a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \end{fulllineitems} \index{set\_x() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.set_x}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_x}}}{\emph{x}}{} Set the \sphinxstyleemphasis{x} position of the {\hyperref[\detokenize{api/text_api:matplotlib.text.TextWithDash}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TextWithDash}}}}}. ACCEPTS: float \end{fulllineitems} \index{set\_y() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.set_y}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_y}}}{\emph{y}}{} Set the \sphinxstyleemphasis{y} position of the {\hyperref[\detokenize{api/text_api:matplotlib.text.TextWithDash}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TextWithDash}}}}}. ACCEPTS: float \end{fulllineitems} \index{update\_coords() (matplotlib.text.TextWithDash method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.TextWithDash.update_coords}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_coords}}}{\emph{renderer}}{} Computes the actual \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} coordinates for text based on the input \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} and the \sphinxstyleemphasis{dashlength}. Since the rotation is with respect to the actual canvas’s coordinates we need to map back and forth. \end{fulllineitems} \end{fulllineitems} \index{get\_rotation() (in module matplotlib.text)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/text_api:matplotlib.text.get_rotation}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.text.}}\sphinxbfcode{\sphinxupquote{get\_rotation}}}{\emph{rotation}}{} Return the text angle as float. The returned angle is between 0 and 360 deg. \sphinxstyleemphasis{rotation} may be ‘horizontal’, ‘vertical’, or a numeric value in degrees. \end{fulllineitems} \chapter{ticker} \label{\detokenize{api/ticker_api:ticker}}\label{\detokenize{api/ticker_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.ticker}}} \label{\detokenize{api/ticker_api:module-matplotlib.ticker}}\label{\detokenize{api/ticker_api:matplotlib-ticker}}\index{matplotlib.ticker (module)} \subsection{Tick locating and formatting} \label{\detokenize{api/ticker_api:tick-locating-and-formatting}} This module contains classes to support completely configurable tick locating and formatting. Although the locators know nothing about major or minor ticks, they are used by the Axis class to support major and minor tick locating and formatting. Generic tick locators and formatters are provided, as well as domain specific custom ones. \subsubsection{Default Formatter} \label{\detokenize{api/ticker_api:default-formatter}} The default formatter identifies when the x-data being plotted is a small range on top of a large off set. To reduce the chances that the ticklabels overlap the ticks are labeled as deltas from a fixed offset. For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{2000}\PYG{p}{,} \PYG{l+m+mi}{2010}\PYG{p}{)}\PYG{p}{,} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} will have tick of 0-9 with an offset of +2e3. If this is not desired turn off the use of the offset on the default formatter: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{get\PYGZus{}xaxis}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{get\PYGZus{}major\PYGZus{}formatter}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{set\PYGZus{}useOffset}\PYG{p}{(}\PYG{k+kc}{False}\PYG{p}{)} \end{sphinxVerbatim} set the rcParam \sphinxcode{\sphinxupquote{axes.formatter.useoffset=False}} to turn it off globally, or set a different formatter. \subsubsection{Tick locating} \label{\detokenize{api/ticker_api:tick-locating}} The Locator class is the base class for all tick locators. The locators handle autoscaling of the view limits based on the data limits, and the choosing of tick locations. A useful semi-automatic tick locator is {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MultipleLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MultipleLocator}}}}}. It is initialized with a base, e.g., 10, and it picks axis limits and ticks that are multiples of that base. The Locator subclasses defined here are \begin{description} \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.AutoLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AutoLocator}}}}}}] \leavevmode {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MaxNLocator}}}}} with simple defaults. This is the default tick locator for most plotting. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MaxNLocator}}}}}}] \leavevmode Finds up to a max number of intervals with ticks at nice locations. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LinearLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LinearLocator}}}}}}] \leavevmode Space ticks evenly from min to max. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogLocator}}}}}}] \leavevmode Space ticks logarithmically from min to max. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MultipleLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MultipleLocator}}}}}}] \leavevmode Ticks and range are a multiple of base; either integer or float. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.FixedLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FixedLocator}}}}}}] \leavevmode Tick locations are fixed. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.IndexLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{IndexLocator}}}}}}] \leavevmode Locator for index plots (e.g., where \sphinxcode{\sphinxupquote{x = range(len(y))}}). \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.NullLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{NullLocator}}}}}}] \leavevmode No ticks. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.SymmetricalLogLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SymmetricalLogLocator}}}}}}] \leavevmode Locator for use with with the symlog norm; works like {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogLocator}}}}} for the part outside of the threshold and adds 0 if inside the limits. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogitLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogitLocator}}}}}}] \leavevmode Locator for logit scaling. \item[{\sphinxcode{\sphinxupquote{OldAutoLocator}}}] \leavevmode Choose a {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MultipleLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MultipleLocator}}}}} and dynamically reassign it for intelligent ticking during navigation. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.AutoMinorLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AutoMinorLocator}}}}}}] \leavevmode Locator for minor ticks when the axis is linear and the major ticks are uniformly spaced. Subdivides the major tick interval into a specified number of minor intervals, defaulting to 4 or 5 depending on the major interval. \end{description} There are a number of locators specialized for date locations - see the \sphinxcode{\sphinxupquote{dates}} module. You can define your own locator by deriving from Locator. You must override the \sphinxcode{\sphinxupquote{\_\_call\_\_}} method, which returns a sequence of locations, and you will probably want to override the autoscale method to set the view limits from the data limits. If you want to override the default locator, use one of the above or a custom locator and pass it to the x or y axis instance. The relevant methods are: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}locator}\PYG{p}{(}\PYG{n}{xmajor\PYGZus{}locator}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}minor\PYGZus{}locator}\PYG{p}{(}\PYG{n}{xminor\PYGZus{}locator}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{yaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}locator}\PYG{p}{(}\PYG{n}{ymajor\PYGZus{}locator}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{yaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}minor\PYGZus{}locator}\PYG{p}{(}\PYG{n}{yminor\PYGZus{}locator}\PYG{p}{)} \end{sphinxVerbatim} The default minor locator is {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.NullLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{NullLocator}}}}}, i.e., no minor ticks on by default. \subsubsection{Tick formatting} \label{\detokenize{api/ticker_api:tick-formatting}} Tick formatting is controlled by classes derived from Formatter. The formatter operates on a single tick value and returns a string to the axis. \begin{description} \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.NullFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{NullFormatter}}}}}}] \leavevmode No labels on the ticks. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.IndexFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{IndexFormatter}}}}}}] \leavevmode Set the strings from a list of labels. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.FixedFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FixedFormatter}}}}}}] \leavevmode Set the strings manually for the labels. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.FuncFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FuncFormatter}}}}}}] \leavevmode User defined function sets the labels. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.StrMethodFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{StrMethodFormatter}}}}}}] \leavevmode Use string \sphinxhref{https://docs.python.org/3/library/functions.html\#format}{\sphinxcode{\sphinxupquote{format}}} method. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.FormatStrFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FormatStrFormatter}}}}}}] \leavevmode Use an old-style sprintf format string. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarFormatter}}}}}}] \leavevmode Default formatter for scalars: autopick the format string. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogFormatter}}}}}}] \leavevmode Formatter for log axes. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogFormatterExponent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogFormatterExponent}}}}}}] \leavevmode Format values for log axis using \sphinxcode{\sphinxupquote{exponent = log\_base(value)}}. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogFormatterMathtext}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogFormatterMathtext}}}}}}] \leavevmode Format values for log axis using \sphinxcode{\sphinxupquote{exponent = log\_base(value)}} using Math text. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogFormatterSciNotation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogFormatterSciNotation}}}}}}] \leavevmode Format values for log axis using scientific notation. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogitFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogitFormatter}}}}}}] \leavevmode Probability formatter. \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.EngFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{EngFormatter}}}}}}] \leavevmode Format labels in engineering notation \item[{{\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.PercentFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PercentFormatter}}}}}}] \leavevmode Format labels as a percentage \end{description} You can derive your own formatter from the Formatter base class by simply overriding the \sphinxcode{\sphinxupquote{\_\_call\_\_}} method. The formatter class has access to the axis view and data limits. To control the major and minor tick label formats, use one of the following methods: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}formatter}\PYG{p}{(}\PYG{n}{xmajor\PYGZus{}formatter}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}minor\PYGZus{}formatter}\PYG{p}{(}\PYG{n}{xminor\PYGZus{}formatter}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{yaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}major\PYGZus{}formatter}\PYG{p}{(}\PYG{n}{ymajor\PYGZus{}formatter}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{yaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}minor\PYGZus{}formatter}\PYG{p}{(}\PYG{n}{yminor\PYGZus{}formatter}\PYG{p}{)} \end{sphinxVerbatim} See \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_major\_minor\_demo.py} for an example of setting major and minor ticks. See the {\hyperref[\detokenize{api/dates_api:module-matplotlib.dates}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates}}}}} module for more information and examples of using date locators and formatters. \index{TickHelper (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.TickHelper}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{TickHelper}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} \index{axis (matplotlib.ticker.TickHelper attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.TickHelper.axis}}\pysigline{\sphinxbfcode{\sphinxupquote{axis}}\sphinxbfcode{\sphinxupquote{ = None}}} \end{fulllineitems} \index{create\_dummy\_axis() (matplotlib.ticker.TickHelper method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.TickHelper.create_dummy_axis}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{create\_dummy\_axis}}}{\emph{**kwargs}}{}~ \end{fulllineitems} \index{set\_axis() (matplotlib.ticker.TickHelper method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.TickHelper.set_axis}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_axis}}}{\emph{axis}}{}~ \end{fulllineitems} \index{set\_bounds() (matplotlib.ticker.TickHelper method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.TickHelper.set_bounds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_bounds}}}{\emph{vmin}, \emph{vmax}}{}~ \end{fulllineitems} \index{set\_data\_interval() (matplotlib.ticker.TickHelper method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.TickHelper.set_data_interval}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_data\_interval}}}{\emph{vmin}, \emph{vmax}}{}~ \end{fulllineitems} \index{set\_view\_interval() (matplotlib.ticker.TickHelper method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.TickHelper.set_view_interval}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_view\_interval}}}{\emph{vmin}, \emph{vmax}}{}~ \end{fulllineitems} \end{fulllineitems} \index{Formatter (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.Formatter}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{Formatter}}} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.TickHelper}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.TickHelper}}}}} Create a string based on a tick value and location. \index{fix\_minus() (matplotlib.ticker.Formatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.Formatter.fix_minus}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{fix\_minus}}}{\emph{s}}{} Some classes may want to replace a hyphen for minus with the proper unicode symbol (U+2212) for typographical correctness. The default is to not replace it. Note, if you use this method, e.g., in {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter.format_data}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{format\_data()}}}}} or call, you probably don’t want to use it for {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter.format_data_short}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{format\_data\_short()}}}}} since the toolbar uses this for interactive coord reporting and I doubt we can expect GUIs across platforms will handle the unicode correctly. So for now the classes that override {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter.fix_minus}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fix\_minus()}}}}} should have an explicit {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter.format_data_short}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{format\_data\_short()}}}}} method \end{fulllineitems} \index{format\_data() (matplotlib.ticker.Formatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.Formatter.format_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_data}}}{\emph{value}}{} Returns the full string representation of the value with the position unspecified. \end{fulllineitems} \index{format\_data\_short() (matplotlib.ticker.Formatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.Formatter.format_data_short}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_data\_short}}}{\emph{value}}{} Return a short string version of the tick value. Defaults to the position-independent long value. \end{fulllineitems} \index{get\_offset() (matplotlib.ticker.Formatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.Formatter.get_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset}}}{}{}~ \end{fulllineitems} \index{locs (matplotlib.ticker.Formatter attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.Formatter.locs}}\pysigline{\sphinxbfcode{\sphinxupquote{locs}}\sphinxbfcode{\sphinxupquote{ = {[}{]}}}} \end{fulllineitems} \index{set\_locs() (matplotlib.ticker.Formatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.Formatter.set_locs}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_locs}}}{\emph{locs}}{}~ \end{fulllineitems} \end{fulllineitems} \index{FixedFormatter (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.FixedFormatter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{FixedFormatter}}}{\emph{seq}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Formatter}}}}} Return fixed strings for tick labels based only on position, not value. Set the sequence of strings that will be used for labels. \index{get\_offset() (matplotlib.ticker.FixedFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.FixedFormatter.get_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset}}}{}{}~ \end{fulllineitems} \index{set\_offset\_string() (matplotlib.ticker.FixedFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.FixedFormatter.set_offset_string}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_offset\_string}}}{\emph{ofs}}{}~ \end{fulllineitems} \end{fulllineitems} \index{NullFormatter (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.NullFormatter}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{NullFormatter}}} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Formatter}}}}} Always return the empty string. \end{fulllineitems} \index{FuncFormatter (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.FuncFormatter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{FuncFormatter}}}{\emph{func}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Formatter}}}}} Use a user-defined function for formatting. The function should take in two inputs (a tick value \sphinxcode{\sphinxupquote{x}} and a position \sphinxcode{\sphinxupquote{pos}}), and return a string containing the corresponding tick label. \end{fulllineitems} \index{FormatStrFormatter (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.FormatStrFormatter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{FormatStrFormatter}}}{\emph{fmt}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Formatter}}}}} Use an old-style (‘\%’ operator) format string to format the tick. The format string should have a single variable format (\%) in it. It will be applied to the value (not the position) of the tick. \end{fulllineitems} \index{StrMethodFormatter (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.StrMethodFormatter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{StrMethodFormatter}}}{\emph{fmt}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Formatter}}}}} Use a new-style format string (as used by \sphinxcode{\sphinxupquote{str.format()}}) to format the tick. The field used for the value must be labeled \sphinxcode{\sphinxupquote{x}} and the field used for the position must be labeled \sphinxcode{\sphinxupquote{pos}}. \end{fulllineitems} \index{ScalarFormatter (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{ScalarFormatter}}}{\emph{useOffset=None}, \emph{useMathText=None}, \emph{useLocale=None}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Formatter}}}}} Format tick values as a number. Tick value is interpreted as a plain old number. If \sphinxcode{\sphinxupquote{useOffset==True}} and the data range is much smaller than the data average, then an offset will be determined such that the tick labels are meaningful. Scientific notation is used for \sphinxcode{\sphinxupquote{data \textless{} 10\textasciicircum{}-n}} or \sphinxcode{\sphinxupquote{data \textgreater{}= 10\textasciicircum{}m}}, where \sphinxcode{\sphinxupquote{n}} and \sphinxcode{\sphinxupquote{m}} are the power limits set using \sphinxcode{\sphinxupquote{set\_powerlimits((n,m))}}. The defaults for these are controlled by the \sphinxcode{\sphinxupquote{axes.formatter.limits}} rc parameter. \index{fix\_minus() (matplotlib.ticker.ScalarFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.fix_minus}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{fix\_minus}}}{\emph{s}}{} Replace hyphens with a unicode minus. \end{fulllineitems} \index{format\_data() (matplotlib.ticker.ScalarFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.format_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_data}}}{\emph{value}}{} Return a formatted string representation of a number. \end{fulllineitems} \index{format\_data\_short() (matplotlib.ticker.ScalarFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.format_data_short}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_data\_short}}}{\emph{value}}{} Return a short formatted string representation of a number. \end{fulllineitems} \index{get\_offset() (matplotlib.ticker.ScalarFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.get_offset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_offset}}}{}{} Return scientific notation, plus offset. \end{fulllineitems} \index{get\_useLocale() (matplotlib.ticker.ScalarFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.get_useLocale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_useLocale}}}{}{}~ \end{fulllineitems} \index{get\_useMathText() (matplotlib.ticker.ScalarFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.get_useMathText}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_useMathText}}}{}{}~ \end{fulllineitems} \index{get\_useOffset() (matplotlib.ticker.ScalarFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.get_useOffset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_useOffset}}}{}{}~ \end{fulllineitems} \index{pprint\_val() (matplotlib.ticker.ScalarFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.pprint_val}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pprint\_val}}}{\emph{x}}{}~ \end{fulllineitems} \index{set\_locs() (matplotlib.ticker.ScalarFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.set_locs}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_locs}}}{\emph{locs}}{} Set the locations of the ticks. \end{fulllineitems} \index{set\_powerlimits() (matplotlib.ticker.ScalarFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.set_powerlimits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_powerlimits}}}{\emph{lims}}{} Sets size thresholds for scientific notation. \sphinxcode{\sphinxupquote{lims}} is a two-element sequence containing the powers of 10 that determine the switchover threshold. Numbers below \sphinxcode{\sphinxupquote{10**lims{[}0{]}}} and above \sphinxcode{\sphinxupquote{10**lims{[}1{]}}} will be displayed in scientific notation. For example, \sphinxcode{\sphinxupquote{formatter.set\_powerlimits((-3, 4))}} sets the pre-2007 default in which scientific notation is used for numbers less than 1e-3 or greater than 1e4. \sphinxstrong{See also:} Method {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.set_scientific}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_scientific()}}}}} \end{fulllineitems} \index{set\_scientific() (matplotlib.ticker.ScalarFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.set_scientific}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_scientific}}}{\emph{b}}{} Turn scientific notation on or off. \sphinxstrong{See also:} Method {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.set_powerlimits}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_powerlimits()}}}}} \end{fulllineitems} \index{set\_useLocale() (matplotlib.ticker.ScalarFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.set_useLocale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_useLocale}}}{\emph{val}}{}~ \end{fulllineitems} \index{set\_useMathText() (matplotlib.ticker.ScalarFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.set_useMathText}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_useMathText}}}{\emph{val}}{}~ \end{fulllineitems} \index{set\_useOffset() (matplotlib.ticker.ScalarFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.set_useOffset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_useOffset}}}{\emph{val}}{}~ \end{fulllineitems} \index{useLocale (matplotlib.ticker.ScalarFormatter attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.useLocale}}\pysigline{\sphinxbfcode{\sphinxupquote{useLocale}}}~ \end{fulllineitems} \index{useMathText (matplotlib.ticker.ScalarFormatter attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.useMathText}}\pysigline{\sphinxbfcode{\sphinxupquote{useMathText}}}~ \end{fulllineitems} \index{useOffset (matplotlib.ticker.ScalarFormatter attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter.useOffset}}\pysigline{\sphinxbfcode{\sphinxupquote{useOffset}}}~ \end{fulllineitems} \end{fulllineitems} \index{LogFormatter (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogFormatter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{LogFormatter}}}{\emph{base=10.0}, \emph{labelOnlyBase=False}, \emph{minor\_thresholds=None}, \emph{linthresh=None}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Formatter}}}}} Base class for formatting ticks on a log or symlog scale. It may be instantiated directly, or subclassed. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{base}}] \leavevmode{[}float, optional, default: 10.{]} Base of the logarithm used in all calculations. \item[{\sphinxstylestrong{labelOnlyBase}}] \leavevmode{[}bool, optional, default: False{]} If True, label ticks only at integer powers of base. This is normally True for major ticks and False for minor ticks. \item[{\sphinxstylestrong{minor\_thresholds}}] \leavevmode{[}(subset, all), optional, default: (1, 0.4){]} If labelOnlyBase is False, these two numbers control the labeling of ticks that are not at integer powers of base; normally these are the minor ticks. The controlling parameter is the log of the axis data range. In the typical case where base is 10 it is the number of decades spanned by the axis, so we can call it ‘numdec’. If \sphinxcode{\sphinxupquote{numdec \textless{}= all}}, all minor ticks will be labeled. If \sphinxcode{\sphinxupquote{all \textless{} numdec \textless{}= subset}}, then only a subset of minor ticks will be labeled, so as to avoid crowding. If \sphinxcode{\sphinxupquote{numdec \textgreater{} subset}} then no minor ticks will be labeled. \item[{\sphinxstylestrong{linthresh}}] \leavevmode{[}None or float, optional, default: None{]} If a symmetric log scale is in use, its \sphinxcode{\sphinxupquote{linthresh}} parameter must be supplied here. \end{description} \end{description}\end{quote} \paragraph{Notes} The {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogFormatter.set_locs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_locs}}}}} method must be called to enable the subsetting logic controlled by the \sphinxcode{\sphinxupquote{minor\_thresholds}} parameter. In some cases such as the colorbar, there is no distinction between major and minor ticks; the tick locations might be set manually, or by a locator that puts ticks at integer powers of base and at intermediate locations. For this situation, disable the minor\_thresholds logic by using \sphinxcode{\sphinxupquote{minor\_thresholds=(np.inf, np.inf)}}, so that all ticks will be labeled. To disable labeling of minor ticks when ‘labelOnlyBase’ is False, use \sphinxcode{\sphinxupquote{minor\_thresholds=(0, 0)}}. This is the default for the “classic” style. \paragraph{Examples} To label a subset of minor ticks when the view limits span up to 2 decades, and all of the ticks when zoomed in to 0.5 decades or less, use \sphinxcode{\sphinxupquote{minor\_thresholds=(2, 0.5)}}. To label all minor ticks when the view limits span up to 1.5 decades, use \sphinxcode{\sphinxupquote{minor\_thresholds=(1.5, 1.5)}}. \index{base() (matplotlib.ticker.LogFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogFormatter.base}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{base}}}{\emph{base}}{} change the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogFormatter.base}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{base}}}}} for labeling. \begin{sphinxadmonition}{warning}{Warning:} Should always match the base used for {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LogLocator}}}}} \end{sphinxadmonition} \end{fulllineitems} \index{format\_data() (matplotlib.ticker.LogFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogFormatter.format_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_data}}}{\emph{value}}{} Returns the full string representation of the value with the position unspecified. \end{fulllineitems} \index{format\_data\_short() (matplotlib.ticker.LogFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogFormatter.format_data_short}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_data\_short}}}{\emph{value}}{} Return a short formatted string representation of a number. \end{fulllineitems} \index{label\_minor() (matplotlib.ticker.LogFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogFormatter.label_minor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{label\_minor}}}{\emph{labelOnlyBase}}{} Switch minor tick labeling on or off. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{labelOnlyBase}}] \leavevmode{[}bool{]} If True, label ticks only at integer powers of base. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{pprint\_val() (matplotlib.ticker.LogFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogFormatter.pprint_val}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pprint\_val}}}{\emph{x}, \emph{d}}{}~ \end{fulllineitems} \index{set\_locs() (matplotlib.ticker.LogFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogFormatter.set_locs}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_locs}}}{\emph{locs=None}}{} Use axis view limits to control which ticks are labeled. The \sphinxcode{\sphinxupquote{locs}} parameter is ignored in the present algorithm. \end{fulllineitems} \end{fulllineitems} \index{LogFormatterExponent (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogFormatterExponent}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{LogFormatterExponent}}}{\emph{base=10.0}, \emph{labelOnlyBase=False}, \emph{minor\_thresholds=None}, \emph{linthresh=None}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.LogFormatter}}}}} Format values for log axis using \sphinxcode{\sphinxupquote{exponent = log\_base(value)}}. \end{fulllineitems} \index{LogFormatterMathtext (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogFormatterMathtext}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{LogFormatterMathtext}}}{\emph{base=10.0}, \emph{labelOnlyBase=False}, \emph{minor\_thresholds=None}, \emph{linthresh=None}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.LogFormatter}}}}} Format values for log axis using \sphinxcode{\sphinxupquote{exponent = log\_base(value)}}. \end{fulllineitems} \index{IndexFormatter (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.IndexFormatter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{IndexFormatter}}}{\emph{labels}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Formatter}}}}} Format the position x to the nearest i-th label where i=int(x+0.5) \end{fulllineitems} \index{LogFormatterSciNotation (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogFormatterSciNotation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{LogFormatterSciNotation}}}{\emph{base=10.0}, \emph{labelOnlyBase=False}, \emph{minor\_thresholds=None}, \emph{linthresh=None}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.LogFormatterMathtext}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.LogFormatterMathtext}}}}} Format values following scientific notation in a logarithmic axis \end{fulllineitems} \index{LogitFormatter (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogitFormatter}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{LogitFormatter}}} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Formatter}}}}} Probability formatter (using Math text). \index{format\_data\_short() (matplotlib.ticker.LogitFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogitFormatter.format_data_short}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_data\_short}}}{\emph{value}}{} return a short formatted string representation of a number \end{fulllineitems} \end{fulllineitems} \index{EngFormatter (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.EngFormatter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{EngFormatter}}}{\emph{unit=''}, \emph{places=None}, \emph{sep=' '}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Formatter}}}}} Formats axis values using engineering prefixes to represent powers of 1000, plus a specified unit, e.g., 10 MHz instead of 1e7. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{unit}}] \leavevmode{[}str (default: “”){]} Unit symbol to use, suitable for use with single-letter representations of powers of 1000. For example, ‘Hz’ or ‘m’. \item[{\sphinxstylestrong{places}}] \leavevmode{[}int (default: None){]} Precision with which to display the number, specified in digits after the decimal point (there will be between one and three digits before the decimal point). If it is None, the formatting falls back to the floating point format ‘\%g’, which displays up to 6 \sphinxstyleemphasis{significant} digits, i.e. the equivalent value for \sphinxstyleemphasis{places} varies between 0 and 5 (inclusive). \item[{\sphinxstylestrong{sep}}] \leavevmode{[}str (default: ” “){]} Separator used between the value and the prefix/unit. For example, one get ‘3.14 mV’ if \sphinxcode{\sphinxupquote{sep}} is ” ” (default) and ‘3.14mV’ if \sphinxcode{\sphinxupquote{sep}} is “”. Besides the default behavior, some other useful options may be: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{sep=""}} to append directly the prefix/unit to the value; \item {} \sphinxcode{\sphinxupquote{sep="\textbackslash{}N\{THIN SPACE\}"}} (\sphinxcode{\sphinxupquote{U+2009}}); \item {} \sphinxcode{\sphinxupquote{sep="\textbackslash{}N\{NARROW NO-BREAK SPACE\}"}} (\sphinxcode{\sphinxupquote{U+202F}}); \item {} \sphinxcode{\sphinxupquote{sep="\textbackslash{}N\{NO-BREAK SPACE\}"}} (\sphinxcode{\sphinxupquote{U+00A0}}). \end{itemize} \end{description} \end{description}\end{quote} \index{ENG\_PREFIXES (matplotlib.ticker.EngFormatter attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.EngFormatter.ENG_PREFIXES}}\pysigline{\sphinxbfcode{\sphinxupquote{ENG\_PREFIXES}}\sphinxbfcode{\sphinxupquote{ = \{-24: 'y', -21: 'z', -18: 'a', -15: 'f', -12: 'p', -9: 'n', -6: '\(\mu\)', -3: 'm', 0: '', 3: 'k', 6: 'M', 9: 'G', 12: 'T', 15: 'P', 18: 'E', 21: 'Z', 24: 'Y'\}}}} \end{fulllineitems} \index{format\_eng() (matplotlib.ticker.EngFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.EngFormatter.format_eng}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_eng}}}{\emph{num}}{} Formats a number in engineering notation, appending a letter representing the power of 1000 of the original number. Some examples: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{format\PYGZus{}eng}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} for self.places = 0} \PYG{g+go}{\PYGZsq{}0\PYGZsq{}} \end{sphinxVerbatim} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{format\PYGZus{}eng}\PYG{p}{(}\PYG{l+m+mi}{1000000}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} for self.places = 1} \PYG{g+go}{\PYGZsq{}1.0 M\PYGZsq{}} \end{sphinxVerbatim} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{format\PYGZus{}eng}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZhy{}1e\PYGZhy{}6}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} for self.places = 2} \PYG{g+go}{u\PYGZsq{}\PYGZhy{}1.00 \(\mu\)\PYGZsq{}} \end{sphinxVerbatim} \sphinxcode{\sphinxupquote{num}} may be a numeric value or a string that can be converted to a numeric value with \sphinxcode{\sphinxupquote{float(num)}}. \end{fulllineitems} \end{fulllineitems} \index{PercentFormatter (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.PercentFormatter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{PercentFormatter}}}{\emph{xmax=100}, \emph{decimals=None}, \emph{symbol='\%'}, \emph{is\_latex=False}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Formatter}}}}} Format numbers as a percentage. How the number is converted into a percentage is determined by the \sphinxcode{\sphinxupquote{xmax}} parameter. \sphinxcode{\sphinxupquote{xmax}} is the data value that corresponds to 100\%. Percentages are computed as \sphinxcode{\sphinxupquote{x / xmax * 100}}. So if the data is already scaled to be percentages, \sphinxcode{\sphinxupquote{xmax}} will be 100. Another common situation is where \sphinxcode{\sphinxupquote{xmax}} is 1.0. {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.PercentFormatter.symbol}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{symbol}}}}} is a string which will be appended to the label. It may be \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}} or empty to indicate that no symbol should be used. LaTeX special characters are escaped in {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.PercentFormatter.symbol}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{symbol}}}}} whenever latex mode is enabled, unless \sphinxcode{\sphinxupquote{is\_latex}} is \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}. \sphinxcode{\sphinxupquote{decimals}} is the number of decimal places to place after the point. If it is set to \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}} (the default), the number will be computed automatically. \index{convert\_to\_pct() (matplotlib.ticker.PercentFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.PercentFormatter.convert_to_pct}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_to\_pct}}}{\emph{x}}{}~ \end{fulllineitems} \index{format\_pct() (matplotlib.ticker.PercentFormatter method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.PercentFormatter.format_pct}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_pct}}}{\emph{x}, \emph{display\_range}}{} Formats the number as a percentage number with the correct number of decimals and adds the percent symbol, if any. If \sphinxcode{\sphinxupquote{self.decimals}} is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, the number of digits after the decimal point is set based on the \sphinxcode{\sphinxupquote{display\_range}} of the axis as follows: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline display\_range & decimals & sample \\ \hline \textgreater{}50 & 0 & \sphinxcode{\sphinxupquote{x = 34.5}} =\textgreater{} 35\% \\ \hline \textgreater{}5 & 1 & \sphinxcode{\sphinxupquote{x = 34.5}} =\textgreater{} 34.5\% \\ \hline \textgreater{}0.5 & 2 & \sphinxcode{\sphinxupquote{x = 34.5}} =\textgreater{} 34.50\% \\ \hline … & … & … \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} This method will not be very good for tiny axis ranges or extremely large ones. It assumes that the values on the chart are percentages displayed on a reasonable scale. \end{fulllineitems} \index{symbol (matplotlib.ticker.PercentFormatter attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.PercentFormatter.symbol}}\pysigline{\sphinxbfcode{\sphinxupquote{symbol}}} The configured percent symbol as a string. If LaTeX is enabled via \sphinxcode{\sphinxupquote{rcParams{[}"text.usetex"{]}}}, the special characters \sphinxcode{\sphinxupquote{\{'\#', '\$', '\%', '\&', '\textasciitilde{}', '\_', '\textasciicircum{}', '\textbackslash{}', '\{', '\}'\}}} are automatically escaped in the string. \end{fulllineitems} \end{fulllineitems} \index{Locator (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.Locator}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{Locator}}} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.TickHelper}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.TickHelper}}}}} Determine the tick locations; Note, you should not use the same locator between different {\hyperref[\detokenize{api/axis_api:matplotlib.axis.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axis}}}}} because the locator stores references to the Axis data and view limits \index{MAXTICKS (matplotlib.ticker.Locator attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.Locator.MAXTICKS}}\pysigline{\sphinxbfcode{\sphinxupquote{MAXTICKS}}\sphinxbfcode{\sphinxupquote{ = 1000}}} \end{fulllineitems} \index{autoscale() (matplotlib.ticker.Locator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.Locator.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{}{} autoscale the view limits \end{fulllineitems} \index{pan() (matplotlib.ticker.Locator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.Locator.pan}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pan}}}{\emph{numsteps}}{} Pan numticks (can be positive or negative) \end{fulllineitems} \index{raise\_if\_exceeds() (matplotlib.ticker.Locator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.Locator.raise_if_exceeds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{raise\_if\_exceeds}}}{\emph{locs}}{} raise a RuntimeError if Locator attempts to create more than MAXTICKS locs \end{fulllineitems} \index{refresh() (matplotlib.ticker.Locator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.Locator.refresh}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{refresh}}}{}{} refresh internal information based on current lim \end{fulllineitems} \index{set\_params() (matplotlib.ticker.Locator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.Locator.set_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_params}}}{\emph{**kwargs}}{} Do nothing, and rase a warning. Any locator class not supporting the set\_params() function will call this. \end{fulllineitems} \index{tick\_values() (matplotlib.ticker.Locator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.Locator.tick_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tick\_values}}}{\emph{vmin}, \emph{vmax}}{} Return the values of the located ticks given \sphinxstylestrong{vmin} and \sphinxstylestrong{vmax}. \begin{sphinxadmonition}{note}{Note:} To get tick locations with the vmin and vmax values defined automatically for the associated \sphinxcode{\sphinxupquote{axis}} simply call the Locator instance: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n+nb}{type}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{\PYGZlt{}type \PYGZsq{}Locator\PYGZsq{}\PYGZgt{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{[1, 2, 3, 4]} \end{sphinxVerbatim} \end{sphinxadmonition} \end{fulllineitems} \index{view\_limits() (matplotlib.ticker.Locator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.Locator.view_limits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{view\_limits}}}{\emph{vmin}, \emph{vmax}}{} select a scale for the range from vmin to vmax Normally this method is overridden by subclasses to change locator behaviour. \end{fulllineitems} \index{zoom() (matplotlib.ticker.Locator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.Locator.zoom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{zoom}}}{\emph{direction}}{} Zoom in/out on axis; if direction is \textgreater{}0 zoom in, else zoom out \end{fulllineitems} \end{fulllineitems} \index{IndexLocator (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.IndexLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{IndexLocator}}}{\emph{base}, \emph{offset}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Locator}}}}} Place a tick on every multiple of some base number of points plotted, e.g., on every 5th point. It is assumed that you are doing index plotting; i.e., the axis is 0, len(data). This is mainly useful for x ticks. place ticks on the i-th data points where (i-offset)\%base==0 \index{set\_params() (matplotlib.ticker.IndexLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.IndexLocator.set_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_params}}}{\emph{base=None}, \emph{offset=None}}{} Set parameters within this locator \end{fulllineitems} \index{tick\_values() (matplotlib.ticker.IndexLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.IndexLocator.tick_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tick\_values}}}{\emph{vmin}, \emph{vmax}}{} Return the values of the located ticks given \sphinxstylestrong{vmin} and \sphinxstylestrong{vmax}. \begin{sphinxadmonition}{note}{Note:} To get tick locations with the vmin and vmax values defined automatically for the associated \sphinxcode{\sphinxupquote{axis}} simply call the Locator instance: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n+nb}{type}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{\PYGZlt{}type \PYGZsq{}Locator\PYGZsq{}\PYGZgt{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{[1, 2, 3, 4]} \end{sphinxVerbatim} \end{sphinxadmonition} \end{fulllineitems} \end{fulllineitems} \index{FixedLocator (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.FixedLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{FixedLocator}}}{\emph{locs}, \emph{nbins=None}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Locator}}}}} Tick locations are fixed. If nbins is not None, the array of possible positions will be subsampled to keep the number of ticks \textless{}= nbins +1. The subsampling will be done so as to include the smallest absolute value; for example, if zero is included in the array of possibilities, then it is guaranteed to be one of the chosen ticks. \index{set\_params() (matplotlib.ticker.FixedLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.FixedLocator.set_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_params}}}{\emph{nbins=None}}{} Set parameters within this locator. \end{fulllineitems} \index{tick\_values() (matplotlib.ticker.FixedLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.FixedLocator.tick_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tick\_values}}}{\emph{vmin}, \emph{vmax}}{} ” Return the locations of the ticks. \begin{sphinxadmonition}{note}{Note:} Because the values are fixed, vmin and vmax are not used in this method. \end{sphinxadmonition} \end{fulllineitems} \end{fulllineitems} \index{NullLocator (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.NullLocator}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{NullLocator}}} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Locator}}}}} No ticks \index{tick\_values() (matplotlib.ticker.NullLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.NullLocator.tick_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tick\_values}}}{\emph{vmin}, \emph{vmax}}{} ” Return the locations of the ticks. \begin{sphinxadmonition}{note}{Note:} Because the values are Null, vmin and vmax are not used in this method. \end{sphinxadmonition} \end{fulllineitems} \end{fulllineitems} \index{LinearLocator (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LinearLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{LinearLocator}}}{\emph{numticks=None}, \emph{presets=None}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Locator}}}}} Determine the tick locations The first time this function is called it will try to set the number of ticks to make a nice tick partitioning. Thereafter the number of ticks will be fixed so that interactive navigation will be nice Use presets to set locs based on lom. A dict mapping vmin, vmax-\textgreater{}locs \index{set\_params() (matplotlib.ticker.LinearLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LinearLocator.set_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_params}}}{\emph{numticks=None}, \emph{presets=None}}{} Set parameters within this locator. \end{fulllineitems} \index{tick\_values() (matplotlib.ticker.LinearLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LinearLocator.tick_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tick\_values}}}{\emph{vmin}, \emph{vmax}}{} Return the values of the located ticks given \sphinxstylestrong{vmin} and \sphinxstylestrong{vmax}. \begin{sphinxadmonition}{note}{Note:} To get tick locations with the vmin and vmax values defined automatically for the associated \sphinxcode{\sphinxupquote{axis}} simply call the Locator instance: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n+nb}{type}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{\PYGZlt{}type \PYGZsq{}Locator\PYGZsq{}\PYGZgt{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{[1, 2, 3, 4]} \end{sphinxVerbatim} \end{sphinxadmonition} \end{fulllineitems} \index{view\_limits() (matplotlib.ticker.LinearLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LinearLocator.view_limits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{view\_limits}}}{\emph{vmin}, \emph{vmax}}{} Try to choose the view limits intelligently \end{fulllineitems} \end{fulllineitems} \index{LogLocator (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{LogLocator}}}{\emph{base=10.0}, \emph{subs=(1.0}, \emph{)}, \emph{numdecs=4}, \emph{numticks=None}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Locator}}}}} Determine the tick locations for log axes Place ticks on the locations : subs{[}j{]} * base**i \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{subs}}] \leavevmode{[}None, string, or sequence of float, optional, default (1.0,){]} Gives the multiples of integer powers of the base at which to place ticks. The default places ticks only at integer powers of the base. The permitted string values are \sphinxcode{\sphinxupquote{'auto'}} and \sphinxcode{\sphinxupquote{'all'}}, both of which use an algorithm based on the axis view limits to determine whether and how to put ticks between integer powers of the base. With \sphinxcode{\sphinxupquote{'auto'}}, ticks are placed only between integer powers; with \sphinxcode{\sphinxupquote{'all'}}, the integer powers are included. A value of None is equivalent to \sphinxcode{\sphinxupquote{'auto'}}. \end{description} \end{description}\end{quote} \index{base() (matplotlib.ticker.LogLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogLocator.base}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{base}}}{\emph{base}}{} set the base of the log scaling (major tick every base**i, i integer) \end{fulllineitems} \index{nonsingular() (matplotlib.ticker.LogLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogLocator.nonsingular}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{nonsingular}}}{\emph{vmin}, \emph{vmax}}{}~ \end{fulllineitems} \index{set\_params() (matplotlib.ticker.LogLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogLocator.set_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_params}}}{\emph{base=None}, \emph{subs=None}, \emph{numdecs=None}, \emph{numticks=None}}{} Set parameters within this locator. \end{fulllineitems} \index{subs() (matplotlib.ticker.LogLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogLocator.subs}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subs}}}{\emph{subs}}{} set the minor ticks for the log scaling every base**i*subs{[}j{]} \end{fulllineitems} \index{tick\_values() (matplotlib.ticker.LogLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogLocator.tick_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tick\_values}}}{\emph{vmin}, \emph{vmax}}{} Return the values of the located ticks given \sphinxstylestrong{vmin} and \sphinxstylestrong{vmax}. \begin{sphinxadmonition}{note}{Note:} To get tick locations with the vmin and vmax values defined automatically for the associated \sphinxcode{\sphinxupquote{axis}} simply call the Locator instance: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n+nb}{type}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{\PYGZlt{}type \PYGZsq{}Locator\PYGZsq{}\PYGZgt{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{[1, 2, 3, 4]} \end{sphinxVerbatim} \end{sphinxadmonition} \end{fulllineitems} \index{view\_limits() (matplotlib.ticker.LogLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogLocator.view_limits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{view\_limits}}}{\emph{vmin}, \emph{vmax}}{} Try to choose the view limits intelligently \end{fulllineitems} \end{fulllineitems} \index{AutoLocator (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.AutoLocator}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{AutoLocator}}} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.MaxNLocator}}}}} Dynamically find major tick positions. This is actually a subclass of {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MaxNLocator}}}}}, with parameters \sphinxstyleemphasis{nbins = ‘auto’} and \sphinxstyleemphasis{steps = {[}1, 2, 2.5, 5, 10{]}}. To know the values of the non-public parameters, please have a look to the defaults of {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MaxNLocator}}}}}. \end{fulllineitems} \index{MultipleLocator (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.MultipleLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{MultipleLocator}}}{\emph{base=1.0}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Locator}}}}} Set a tick on every integer that is multiple of base in the view interval \index{set\_params() (matplotlib.ticker.MultipleLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.MultipleLocator.set_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_params}}}{\emph{base}}{} Set parameters within this locator. \end{fulllineitems} \index{tick\_values() (matplotlib.ticker.MultipleLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.MultipleLocator.tick_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tick\_values}}}{\emph{vmin}, \emph{vmax}}{} Return the values of the located ticks given \sphinxstylestrong{vmin} and \sphinxstylestrong{vmax}. \begin{sphinxadmonition}{note}{Note:} To get tick locations with the vmin and vmax values defined automatically for the associated \sphinxcode{\sphinxupquote{axis}} simply call the Locator instance: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n+nb}{type}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{\PYGZlt{}type \PYGZsq{}Locator\PYGZsq{}\PYGZgt{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{[1, 2, 3, 4]} \end{sphinxVerbatim} \end{sphinxadmonition} \end{fulllineitems} \index{view\_limits() (matplotlib.ticker.MultipleLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.MultipleLocator.view_limits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{view\_limits}}}{\emph{dmin}, \emph{dmax}}{} Set the view limits to the nearest multiples of base that contain the data \end{fulllineitems} \end{fulllineitems} \index{MaxNLocator (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{MaxNLocator}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Locator}}}}} Select no more than N intervals at nice locations. Keyword args: \begin{description} \item[{\sphinxstyleemphasis{nbins}}] \leavevmode Maximum number of intervals; one less than max number of ticks. If the string \sphinxcode{\sphinxupquote{'auto'}}, the number of bins will be automatically determined based on the length of the axis. \item[{\sphinxstyleemphasis{steps}}] \leavevmode Sequence of nice numbers starting with 1 and ending with 10; e.g., {[}1, 2, 4, 5, 10{]}, where the values are acceptable tick multiples. i.e. for the example, 20, 40, 60 would be an acceptable set of ticks, as would 0.4, 0.6, 0.8, because they are multiples of 2. However, 30, 60, 90 would not be allowed because 3 does not appear in the list of steps. \item[{\sphinxstyleemphasis{integer}}] \leavevmode If True, ticks will take only integer values, provided at least \sphinxcode{\sphinxupquote{min\_n\_ticks}} integers are found within the view limits. \item[{\sphinxstyleemphasis{symmetric}}] \leavevmode If True, autoscaling will result in a range symmetric about zero. \item[{\sphinxstyleemphasis{prune}}] \leavevmode {[}‘lower’ \textbar{} ‘upper’ \textbar{} ‘both’ \textbar{} None{]} Remove edge ticks \textendash{} useful for stacked or ganged plots where the upper tick of one axes overlaps with the lower tick of the axes above it, primarily when \sphinxcode{\sphinxupquote{rcParams{[}"axes.autolimit\_mode"{]}}} is \sphinxcode{\sphinxupquote{'round\_numbers'}}. If \sphinxcode{\sphinxupquote{prune=='lower'}}, the smallest tick will be removed. If \sphinxcode{\sphinxupquote{prune == 'upper'}}, the largest tick will be removed. If \sphinxcode{\sphinxupquote{prune == 'both'}}, the largest and smallest ticks will be removed. If \sphinxcode{\sphinxupquote{prune == None}}, no ticks will be removed. \item[{\sphinxstyleemphasis{min\_n\_ticks}}] \leavevmode Relax \sphinxcode{\sphinxupquote{nbins}} and \sphinxcode{\sphinxupquote{integer}} constraints if necessary to obtain this minimum number of ticks. \end{description} \index{default\_params (matplotlib.ticker.MaxNLocator attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator.default_params}}\pysigline{\sphinxbfcode{\sphinxupquote{default\_params}}\sphinxbfcode{\sphinxupquote{ = \{'integer': False, 'min\_n\_ticks': 2, 'nbins': 10, 'prune': None, 'steps': None, 'symmetric': False\}}}} \end{fulllineitems} \index{set\_params() (matplotlib.ticker.MaxNLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator.set_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_params}}}{\emph{**kwargs}}{} Set parameters within this locator. \end{fulllineitems} \index{tick\_values() (matplotlib.ticker.MaxNLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator.tick_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tick\_values}}}{\emph{vmin}, \emph{vmax}}{} Return the values of the located ticks given \sphinxstylestrong{vmin} and \sphinxstylestrong{vmax}. \begin{sphinxadmonition}{note}{Note:} To get tick locations with the vmin and vmax values defined automatically for the associated \sphinxcode{\sphinxupquote{axis}} simply call the Locator instance: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n+nb}{type}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{\PYGZlt{}type \PYGZsq{}Locator\PYGZsq{}\PYGZgt{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{[1, 2, 3, 4]} \end{sphinxVerbatim} \end{sphinxadmonition} \end{fulllineitems} \index{view\_limits() (matplotlib.ticker.MaxNLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator.view_limits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{view\_limits}}}{\emph{dmin}, \emph{dmax}}{} select a scale for the range from vmin to vmax Normally this method is overridden by subclasses to change locator behaviour. \end{fulllineitems} \end{fulllineitems} \index{AutoMinorLocator (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.AutoMinorLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{AutoMinorLocator}}}{\emph{n=None}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Locator}}}}} Dynamically find minor tick positions based on the positions of major ticks. The scale must be linear with major ticks evenly spaced. \sphinxstyleemphasis{n} is the number of subdivisions of the interval between major ticks; e.g., n=2 will place a single minor tick midway between major ticks. If \sphinxstyleemphasis{n} is omitted or None, it will be set to 5 or 4. \index{tick\_values() (matplotlib.ticker.AutoMinorLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.AutoMinorLocator.tick_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tick\_values}}}{\emph{vmin}, \emph{vmax}}{} Return the values of the located ticks given \sphinxstylestrong{vmin} and \sphinxstylestrong{vmax}. \begin{sphinxadmonition}{note}{Note:} To get tick locations with the vmin and vmax values defined automatically for the associated \sphinxcode{\sphinxupquote{axis}} simply call the Locator instance: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n+nb}{type}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{\PYGZlt{}type \PYGZsq{}Locator\PYGZsq{}\PYGZgt{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{[1, 2, 3, 4]} \end{sphinxVerbatim} \end{sphinxadmonition} \end{fulllineitems} \end{fulllineitems} \index{SymmetricalLogLocator (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.SymmetricalLogLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{SymmetricalLogLocator}}}{\emph{transform=None}, \emph{subs=None}, \emph{linthresh=None}, \emph{base=None}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Locator}}}}} Determine the tick locations for symmetric log axes place ticks on the location= base**i*subs{[}j{]} \index{set\_params() (matplotlib.ticker.SymmetricalLogLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.SymmetricalLogLocator.set_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_params}}}{\emph{subs=None}, \emph{numticks=None}}{} Set parameters within this locator. \end{fulllineitems} \index{tick\_values() (matplotlib.ticker.SymmetricalLogLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.SymmetricalLogLocator.tick_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tick\_values}}}{\emph{vmin}, \emph{vmax}}{} Return the values of the located ticks given \sphinxstylestrong{vmin} and \sphinxstylestrong{vmax}. \begin{sphinxadmonition}{note}{Note:} To get tick locations with the vmin and vmax values defined automatically for the associated \sphinxcode{\sphinxupquote{axis}} simply call the Locator instance: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n+nb}{type}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{\PYGZlt{}type \PYGZsq{}Locator\PYGZsq{}\PYGZgt{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{[1, 2, 3, 4]} \end{sphinxVerbatim} \end{sphinxadmonition} \end{fulllineitems} \index{view\_limits() (matplotlib.ticker.SymmetricalLogLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.SymmetricalLogLocator.view_limits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{view\_limits}}}{\emph{vmin}, \emph{vmax}}{} Try to choose the view limits intelligently \end{fulllineitems} \end{fulllineitems} \index{LogitLocator (class in matplotlib.ticker)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogitLocator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.ticker.}}\sphinxbfcode{\sphinxupquote{LogitLocator}}}{\emph{minor=False}}{} Bases: {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Locator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.ticker.Locator}}}}} Determine the tick locations for logit axes place ticks on the logit locations \index{nonsingular() (matplotlib.ticker.LogitLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogitLocator.nonsingular}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{nonsingular}}}{\emph{vmin}, \emph{vmax}}{}~ \end{fulllineitems} \index{set\_params() (matplotlib.ticker.LogitLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogitLocator.set_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_params}}}{\emph{minor=None}}{} Set parameters within this locator. \end{fulllineitems} \index{tick\_values() (matplotlib.ticker.LogitLocator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/ticker_api:matplotlib.ticker.LogitLocator.tick_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tick\_values}}}{\emph{vmin}, \emph{vmax}}{} Return the values of the located ticks given \sphinxstylestrong{vmin} and \sphinxstylestrong{vmax}. \begin{sphinxadmonition}{note}{Note:} To get tick locations with the vmin and vmax values defined automatically for the associated \sphinxcode{\sphinxupquote{axis}} simply call the Locator instance: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n+nb}{type}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{\PYGZlt{}type \PYGZsq{}Locator\PYGZsq{}\PYGZgt{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{print}\PYG{p}{(}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \PYG{g+go}{[1, 2, 3, 4]} \end{sphinxVerbatim} \end{sphinxadmonition} \end{fulllineitems} \end{fulllineitems} \chapter{tight\_layout} \label{\detokenize{api/tight_layout_api:tight-layout}}\label{\detokenize{api/tight_layout_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.tight\_layout}}} \label{\detokenize{api/tight_layout_api:module-matplotlib.tight_layout}}\label{\detokenize{api/tight_layout_api:matplotlib-tight-layout}}\index{matplotlib.tight\_layout (module)} This module provides routines to adjust subplot params so that subplots are nicely fit in the figure. In doing so, only axis labels, tick labels, axes titles and offsetboxes that are anchored to axes are currently considered. Internally, it assumes that the margins (left\_margin, etc.) which are differences between ax.get\_tightbbox and ax.bbox are independent of axes position. This may fail if Axes.adjustable is datalim. Also, This will fail for some cases (for example, left or right margin is affected by xlabel). \index{auto\_adjust\_subplotpars() (in module matplotlib.tight\_layout)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tight_layout_api:matplotlib.tight_layout.auto_adjust_subplotpars}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.tight\_layout.}}\sphinxbfcode{\sphinxupquote{auto\_adjust\_subplotpars}}}{\emph{fig}, \emph{renderer}, \emph{nrows\_ncols}, \emph{num1num2\_list}, \emph{subplot\_list}, \emph{ax\_bbox\_list=None}, \emph{pad=1.08}, \emph{h\_pad=None}, \emph{w\_pad=None}, \emph{rect=None}}{} Return a dict of subplot parameters to adjust spacing between subplots. Note that this function ignores geometry information of subplot itself, but uses what is given by the \sphinxstyleemphasis{nrows\_ncols} and \sphinxstyleemphasis{num1num2\_list} parameters. Also, the results could be incorrect if some subplots have \sphinxcode{\sphinxupquote{adjustable=datalim}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{nrows\_ncols}}] \leavevmode{[}Tuple{[}int, int{]}{]} Number of rows and number of columns of the grid. \item[{\sphinxstylestrong{num1num2\_list}}] \leavevmode{[}List{[}int{]}{]} List of numbers specifying the area occupied by the subplot \item[{\sphinxstylestrong{subplot\_list}}] \leavevmode{[}list of subplots{]} List of subplots that will be used to calculate optimal subplot\_params. \item[{\sphinxstylestrong{pad}}] \leavevmode{[}float{]} Padding between the figure edge and the edges of subplots, as a fraction of the font size. \item[{\sphinxstylestrong{h\_pad, w\_pad}}] \leavevmode{[}float{]} Padding (height/width) between edges of adjacent subplots, as a fraction of the font size. Defaults to \sphinxstyleemphasis{pad}. \item[{\sphinxstylestrong{rect}}] \leavevmode{[}Tuple{[}float, float, float, float{]}{]} {[}left, bottom, right, top{]} in normalized (0, 1) figure coordinates. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_renderer() (in module matplotlib.tight\_layout)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tight_layout_api:matplotlib.tight_layout.get_renderer}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.tight\_layout.}}\sphinxbfcode{\sphinxupquote{get\_renderer}}}{\emph{fig}}{}~ \end{fulllineitems} \index{get\_subplotspec\_list() (in module matplotlib.tight\_layout)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tight_layout_api:matplotlib.tight_layout.get_subplotspec_list}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.tight\_layout.}}\sphinxbfcode{\sphinxupquote{get\_subplotspec\_list}}}{\emph{axes\_list}, \emph{grid\_spec=None}}{} Return a list of subplotspec from the given list of axes. For an instance of axes that does not support subplotspec, None is inserted in the list. If grid\_spec is given, None is inserted for those not from the given grid\_spec. \end{fulllineitems} \index{get\_tight\_layout\_figure() (in module matplotlib.tight\_layout)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tight_layout_api:matplotlib.tight_layout.get_tight_layout_figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.tight\_layout.}}\sphinxbfcode{\sphinxupquote{get\_tight\_layout\_figure}}}{\emph{fig}, \emph{axes\_list}, \emph{subplotspec\_list}, \emph{renderer}, \emph{pad=1.08}, \emph{h\_pad=None}, \emph{w\_pad=None}, \emph{rect=None}}{} Return subplot parameters for tight-layouted-figure with specified padding. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}Figure{]} \item[{\sphinxstylestrong{axes\_list}}] \leavevmode{[}list of Axes{]} \item[{\sphinxstylestrong{subplotspec\_list}}] \leavevmode{[}list of {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.SubplotSpec:matplotlib.gridspec.SubplotSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SubplotSpec}}}}}{]} The subplotspecs of each axes. \item[{\sphinxstylestrong{renderer}}] \leavevmode{[}renderer{]} \item[{\sphinxstylestrong{pad}}] \leavevmode{[}float{]} Padding between the figure edge and the edges of subplots, as a fraction of the font size. \item[{\sphinxstylestrong{h\_pad, w\_pad}}] \leavevmode{[}float{]} Padding (height/width) between edges of adjacent subplots. Defaults to \sphinxstyleemphasis{pad\_inches}. \item[{\sphinxstylestrong{rect}}] \leavevmode{[}Tuple{[}float, float, float, float{]}, optional{]} (left, bottom, right, top) rectangle in normalized figure coordinates that the whole subplots area (including labels) will fit into. Defaults to using the entire figure. \end{description} \end{description}\end{quote} \end{fulllineitems} \chapter{Working with transformations} \label{\detokenize{api/transformations:working-with-transformations}}\label{\detokenize{api/transformations::doc}} \sphinxincludegraphics[]{inheritance-b12c31436c04593cda1514d7dc55ca653c06932e.pdf} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.transforms}}} \label{\detokenize{api/transformations:module-matplotlib.transforms}}\label{\detokenize{api/transformations:matplotlib-transforms}}\index{matplotlib.transforms (module)} matplotlib includes a framework for arbitrary geometric transformations that is used determine the final position of all elements drawn on the canvas. Transforms are composed into trees of {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformNode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformNode}}}}} objects whose actual value depends on their children. When the contents of children change, their parents are automatically invalidated. The next time an invalidated transform is accessed, it is recomputed to reflect those changes. This invalidation/caching approach prevents unnecessary recomputations of transforms, and contributes to better interactive performance. For example, here is a graph of the transform tree used to plot data to the graph: \noindent\sphinxincludegraphics{{transforms}.png} The framework can be used for both affine and non-affine transformations. However, for speed, we want use the backend renderers to perform affine transformations whenever possible. Therefore, it is possible to perform just the affine or non-affine part of a transformation on a set of data. The affine is always assumed to occur after the non-affine. For any transform: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{full} \PYG{n}{transform} \PYG{o}{==} \PYG{n}{non}\PYG{o}{\PYGZhy{}}\PYG{n}{affine} \PYG{n}{part} \PYG{o}{+} \PYG{n}{affine} \PYG{n}{part} \end{sphinxVerbatim} The backends are not expected to handle non-affine transformations themselves. \index{Affine2D (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2D}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{Affine2D}}}{\emph{matrix=None}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Affine2DBase}}}}} A mutable 2D affine transformation. Initialize an Affine transform from a 3x3 numpy float array: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{a} \PYG{n}{c} \PYG{n}{e} \PYG{n}{b} \PYG{n}{d} \PYG{n}{f} \PYG{l+m+mi}{0} \PYG{l+m+mi}{0} \PYG{l+m+mi}{1} \end{sphinxVerbatim} If \sphinxstyleemphasis{matrix} is None, initialize with the identity transform. \index{clear() (matplotlib.transforms.Affine2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2D.clear}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{clear}}}{}{} Reset the underlying matrix to the identity transform. \end{fulllineitems} \index{from\_values() (matplotlib.transforms.Affine2D static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2D.from_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{from\_values}}}{\emph{a}, \emph{b}, \emph{c}, \emph{d}, \emph{e}, \emph{f}}{} (staticmethod) Create a new Affine2D instance from the given values: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{a} \PYG{n}{c} \PYG{n}{e} \PYG{n}{b} \PYG{n}{d} \PYG{n}{f} \PYG{l+m+mi}{0} \PYG{l+m+mi}{0} \PYG{l+m+mi}{1} \end{sphinxVerbatim} . \end{fulllineitems} \index{get\_matrix() (matplotlib.transforms.Affine2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2D.get_matrix}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_matrix}}}{}{} Get the underlying transformation matrix as a 3x3 numpy array: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{a} \PYG{n}{c} \PYG{n}{e} \PYG{n}{b} \PYG{n}{d} \PYG{n}{f} \PYG{l+m+mi}{0} \PYG{l+m+mi}{0} \PYG{l+m+mi}{1} \end{sphinxVerbatim} . \end{fulllineitems} \index{identity() (matplotlib.transforms.Affine2D static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2D.identity}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{identity}}}{}{} (staticmethod) Return a new {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Affine2D}}}}} object that is the identity transform. Unless this transform will be mutated later on, consider using the faster {\hyperref[\detokenize{api/transformations:matplotlib.transforms.IdentityTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{IdentityTransform}}}}} class instead. \end{fulllineitems} \index{is\_separable (matplotlib.transforms.Affine2D attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2D.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}}~ \end{fulllineitems} \index{rotate() (matplotlib.transforms.Affine2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{rotate}}}{\emph{theta}}{} Add a rotation (in radians) to this transform in place. Returns \sphinxstyleemphasis{self}, so this method can easily be chained with more calls to {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate()}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate_deg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate\_deg()}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.translate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{translate()}}}}} and {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scale()}}}}}. \end{fulllineitems} \index{rotate\_around() (matplotlib.transforms.Affine2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate_around}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{rotate\_around}}}{\emph{x}, \emph{y}, \emph{theta}}{} Add a rotation (in radians) around the point (x, y) in place. Returns \sphinxstyleemphasis{self}, so this method can easily be chained with more calls to {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate()}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate_deg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate\_deg()}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.translate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{translate()}}}}} and {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scale()}}}}}. \end{fulllineitems} \index{rotate\_deg() (matplotlib.transforms.Affine2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate_deg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{rotate\_deg}}}{\emph{degrees}}{} Add a rotation (in degrees) to this transform in place. Returns \sphinxstyleemphasis{self}, so this method can easily be chained with more calls to {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate()}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate_deg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate\_deg()}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.translate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{translate()}}}}} and {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scale()}}}}}. \end{fulllineitems} \index{rotate\_deg\_around() (matplotlib.transforms.Affine2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate_deg_around}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{rotate\_deg\_around}}}{\emph{x}, \emph{y}, \emph{degrees}}{} Add a rotation (in degrees) around the point (x, y) in place. Returns \sphinxstyleemphasis{self}, so this method can easily be chained with more calls to {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate()}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate_deg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate\_deg()}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.translate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{translate()}}}}} and {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scale()}}}}}. \end{fulllineitems} \index{scale() (matplotlib.transforms.Affine2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2D.scale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{scale}}}{\emph{sx}, \emph{sy=None}}{} Adds a scale in place. If \sphinxstyleemphasis{sy} is None, the same scale is applied in both the \sphinxstyleemphasis{x}- and \sphinxstyleemphasis{y}-directions. Returns \sphinxstyleemphasis{self}, so this method can easily be chained with more calls to {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate()}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate_deg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate\_deg()}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.translate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{translate()}}}}} and {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scale()}}}}}. \end{fulllineitems} \index{set() (matplotlib.transforms.Affine2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2D.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{other}}{} Set this transformation from the frozen copy of another {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Affine2DBase}}}}} object. \end{fulllineitems} \index{set\_matrix() (matplotlib.transforms.Affine2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2D.set_matrix}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_matrix}}}{\emph{mtx}}{} Set the underlying transformation matrix from a 3x3 numpy array: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{a} \PYG{n}{c} \PYG{n}{e} \PYG{n}{b} \PYG{n}{d} \PYG{n}{f} \PYG{l+m+mi}{0} \PYG{l+m+mi}{0} \PYG{l+m+mi}{1} \end{sphinxVerbatim} . \end{fulllineitems} \index{skew() (matplotlib.transforms.Affine2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2D.skew}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{skew}}}{\emph{xShear}, \emph{yShear}}{} Adds a skew in place. \sphinxstyleemphasis{xShear} and \sphinxstyleemphasis{yShear} are the shear angles along the \sphinxstyleemphasis{x}- and \sphinxstyleemphasis{y}-axes, respectively, in radians. Returns \sphinxstyleemphasis{self}, so this method can easily be chained with more calls to {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate()}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate_deg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate\_deg()}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.translate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{translate()}}}}} and {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scale()}}}}}. \end{fulllineitems} \index{skew\_deg() (matplotlib.transforms.Affine2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2D.skew_deg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{skew\_deg}}}{\emph{xShear}, \emph{yShear}}{} Adds a skew in place. \sphinxstyleemphasis{xShear} and \sphinxstyleemphasis{yShear} are the shear angles along the \sphinxstyleemphasis{x}- and \sphinxstyleemphasis{y}-axes, respectively, in degrees. Returns \sphinxstyleemphasis{self}, so this method can easily be chained with more calls to {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate()}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate_deg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate\_deg()}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.translate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{translate()}}}}} and {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scale()}}}}}. \end{fulllineitems} \index{translate() (matplotlib.transforms.Affine2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2D.translate}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{translate}}}{\emph{tx}, \emph{ty}}{} Adds a translation in place. Returns \sphinxstyleemphasis{self}, so this method can easily be chained with more calls to {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate()}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.rotate_deg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotate\_deg()}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.translate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{translate()}}}}} and {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D.scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scale()}}}}}. \end{fulllineitems} \end{fulllineitems} \index{Affine2DBase (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{Affine2DBase}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.AffineBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.AffineBase}}}}} The base class of all 2D affine transformations. 2D affine transformations are performed using a 3x3 numpy array: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{a} \PYG{n}{c} \PYG{n}{e} \PYG{n}{b} \PYG{n}{d} \PYG{n}{f} \PYG{l+m+mi}{0} \PYG{l+m+mi}{0} \PYG{l+m+mi}{1} \end{sphinxVerbatim} This class provides the read-only interface. For a mutable 2D affine transformation, use {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Affine2D}}}}}. Subclasses of this class will generally only need to override a constructor and \sphinxcode{\sphinxupquote{get\_matrix()}} that generates a custom 3x3 matrix. \index{frozen() (matplotlib.transforms.Affine2DBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2DBase.frozen}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{frozen}}}{}{} Returns a frozen copy of this transform node. The frozen copy will not update when its children change. Useful for storing a previously known state of a transform where \sphinxcode{\sphinxupquote{copy.deepcopy()}} might normally be used. \end{fulllineitems} \index{has\_inverse (matplotlib.transforms.Affine2DBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2DBase.has_inverse}}\pysigline{\sphinxbfcode{\sphinxupquote{has\_inverse}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{input\_dims (matplotlib.transforms.Affine2DBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2DBase.input_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{input\_dims}}\sphinxbfcode{\sphinxupquote{ = 2}}} \end{fulllineitems} \index{inverted() (matplotlib.transforms.Affine2DBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2DBase.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \index{is\_separable (matplotlib.transforms.Affine2DBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2DBase.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}}~ \end{fulllineitems} \index{matrix\_from\_values() (matplotlib.transforms.Affine2DBase static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2DBase.matrix_from_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{matrix\_from\_values}}}{\emph{a}, \emph{b}, \emph{c}, \emph{d}, \emph{e}, \emph{f}}{} (staticmethod) Create a new transformation matrix as a 3x3 numpy array of the form: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{a} \PYG{n}{c} \PYG{n}{e} \PYG{n}{b} \PYG{n}{d} \PYG{n}{f} \PYG{l+m+mi}{0} \PYG{l+m+mi}{0} \PYG{l+m+mi}{1} \end{sphinxVerbatim} \end{fulllineitems} \index{output\_dims (matplotlib.transforms.Affine2DBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2DBase.output_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_dims}}\sphinxbfcode{\sphinxupquote{ = 2}}} \end{fulllineitems} \index{to\_values() (matplotlib.transforms.Affine2DBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2DBase.to_values}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{to\_values}}}{}{} Return the values of the matrix as a sequence (a,b,c,d,e,f) \end{fulllineitems} \index{transform\_affine() (matplotlib.transforms.Affine2DBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2DBase.transform_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_affine}}}{\emph{points}}{} Performs only the affine part of this transformation on the given array of values. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally a no-op. In affine transformations, this is equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. Accepts a numpy array of shape (N x {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}) and returns a numpy array of shape (N x {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}). Alternatively, accepts a numpy array of length {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}} and returns a numpy array of length {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \index{transform\_point() (matplotlib.transforms.Affine2DBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Affine2DBase.transform_point}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_point}}}{\emph{point}}{} A convenience function that returns the transformed copy of a single point. The point is given as a sequence of length {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}. The transformed point is returned as a sequence of length {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \end{fulllineitems} \index{AffineBase (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.AffineBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{AffineBase}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} The base class of all affine transformations of any number of dimensions. \index{get\_affine() (matplotlib.transforms.AffineBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.AffineBase.get_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_affine}}}{}{} Get the affine part of this transform. \end{fulllineitems} \index{is\_affine (matplotlib.transforms.AffineBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.AffineBase.is_affine}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_affine}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{transform() (matplotlib.transforms.AffineBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.AffineBase.transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform}}}{\emph{values}}{} Performs the transformation on the given array of values. Accepts a numpy array of shape (N x \sphinxcode{\sphinxupquote{input\_dims}}) and returns a numpy array of shape (N x \sphinxcode{\sphinxupquote{output\_dims}}). Alternatively, accepts a numpy array of length \sphinxcode{\sphinxupquote{input\_dims}} and returns a numpy array of length \sphinxcode{\sphinxupquote{output\_dims}}. \end{fulllineitems} \index{transform\_affine() (matplotlib.transforms.AffineBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.AffineBase.transform_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_affine}}}{\emph{values}}{} Performs only the affine part of this transformation on the given array of values. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally a no-op. In affine transformations, this is equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. Accepts a numpy array of shape (N x \sphinxcode{\sphinxupquote{input\_dims}}) and returns a numpy array of shape (N x \sphinxcode{\sphinxupquote{output\_dims}}). Alternatively, accepts a numpy array of length \sphinxcode{\sphinxupquote{input\_dims}} and returns a numpy array of length \sphinxcode{\sphinxupquote{output\_dims}}. \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.transforms.AffineBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.AffineBase.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{points}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x \sphinxcode{\sphinxupquote{input\_dims}}) and returns a numpy array of shape (N x \sphinxcode{\sphinxupquote{output\_dims}}). Alternatively, accepts a numpy array of length \sphinxcode{\sphinxupquote{input\_dims}} and returns a numpy array of length \sphinxcode{\sphinxupquote{output\_dims}}. \end{fulllineitems} \index{transform\_path() (matplotlib.transforms.AffineBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.AffineBase.transform_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_path}}}{\emph{path}}{} Returns a transformed path. \sphinxstyleemphasis{path}: a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. In some cases, this transform may insert curves into the path that began as line segments. \end{fulllineitems} \index{transform\_path\_affine() (matplotlib.transforms.AffineBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.AffineBase.transform_path_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_path\_affine}}}{\emph{path}}{} Returns a path, transformed only by the affine part of this transform. \sphinxstyleemphasis{path}: a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \sphinxcode{\sphinxupquote{transform\_path(path)}} is equivalent to \sphinxcode{\sphinxupquote{transform\_path\_affine(transform\_path\_non\_affine(values))}}. \end{fulllineitems} \index{transform\_path\_non\_affine() (matplotlib.transforms.AffineBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.AffineBase.transform_path_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_path\_non\_affine}}}{\emph{path}}{} Returns a path, transformed only by the non-affine part of this transform. \sphinxstyleemphasis{path}: a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \sphinxcode{\sphinxupquote{transform\_path(path)}} is equivalent to \sphinxcode{\sphinxupquote{transform\_path\_affine(transform\_path\_non\_affine(values))}}. \end{fulllineitems} \end{fulllineitems} \index{Bbox (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{Bbox}}}{\emph{points}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.BboxBase}}}}} A mutable bounding box. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{points}}] \leavevmode{[}ndarray{]} A 2x2 numpy array of the form \sphinxcode{\sphinxupquote{{[}{[}x0, y0{]}, {[}x1, y1{]}{]}}}. \end{description} \end{description}\end{quote} \paragraph{Notes} If you need to create a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} object from another form of data, consider the static methods {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.unit}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{unit()}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.from_bounds}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{from\_bounds()}}}}} and {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.from_extents}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{from\_extents()}}}}}. \index{bounds (matplotlib.transforms.Bbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.bounds}}\pysigline{\sphinxbfcode{\sphinxupquote{bounds}}} Returns ({\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.x0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x0}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.y0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y0}}}}}, \sphinxcode{\sphinxupquote{width}}, \sphinxcode{\sphinxupquote{height}}). \end{fulllineitems} \index{from\_bounds() (matplotlib.transforms.Bbox static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.from_bounds}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{from\_bounds}}}{\emph{x0}, \emph{y0}, \emph{width}, \emph{height}}{} (staticmethod) Create a new {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} from \sphinxstyleemphasis{x0}, \sphinxstyleemphasis{y0}, \sphinxstyleemphasis{width} and \sphinxstyleemphasis{height}. \sphinxstyleemphasis{width} and \sphinxstyleemphasis{height} may be negative. \end{fulllineitems} \index{from\_extents() (matplotlib.transforms.Bbox static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.from_extents}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{from\_extents}}}{\emph{*args}}{} (staticmethod) Create a new Bbox from \sphinxstyleemphasis{left}, \sphinxstyleemphasis{bottom}, \sphinxstyleemphasis{right} and \sphinxstyleemphasis{top}. The \sphinxstyleemphasis{y}-axis increases upwards. \end{fulllineitems} \index{get\_points() (matplotlib.transforms.Bbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.get_points}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_points}}}{}{} Get the points of the bounding box directly as a numpy array of the form: \sphinxcode{\sphinxupquote{{[}{[}x0, y0{]}, {[}x1, y1{]}{]}}}. \end{fulllineitems} \index{ignore() (matplotlib.transforms.Bbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.ignore}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{ignore}}}{\emph{value}}{} Set whether the existing bounds of the box should be ignored by subsequent calls to {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.update_from_data_xy}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{update\_from\_data\_xy()}}}}}. \begin{description} \item[{value}] \leavevmode{[}bool{]}\begin{itemize} \item {} When \sphinxcode{\sphinxupquote{True}}, subsequent calls to {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.update_from_data_xy}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{update\_from\_data\_xy()}}}}} will ignore the existing bounds of the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \item {} When \sphinxcode{\sphinxupquote{False}}, subsequent calls to {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.update_from_data_xy}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{update\_from\_data\_xy()}}}}} will include the existing bounds of the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \end{itemize} \end{description} \end{fulllineitems} \index{intervalx (matplotlib.transforms.Bbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.intervalx}}\pysigline{\sphinxbfcode{\sphinxupquote{intervalx}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.intervalx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{intervalx}}}}} is the pair of \sphinxstyleemphasis{x} coordinates that define the bounding box. It is not guaranteed to be sorted from left to right. \end{fulllineitems} \index{intervaly (matplotlib.transforms.Bbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.intervaly}}\pysigline{\sphinxbfcode{\sphinxupquote{intervaly}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.intervaly}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{intervaly}}}}} is the pair of \sphinxstyleemphasis{y} coordinates that define the bounding box. It is not guaranteed to be sorted from bottom to top. \end{fulllineitems} \index{minpos (matplotlib.transforms.Bbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.minpos}}\pysigline{\sphinxbfcode{\sphinxupquote{minpos}}}~ \end{fulllineitems} \index{minposx (matplotlib.transforms.Bbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.minposx}}\pysigline{\sphinxbfcode{\sphinxupquote{minposx}}}~ \end{fulllineitems} \index{minposy (matplotlib.transforms.Bbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.minposy}}\pysigline{\sphinxbfcode{\sphinxupquote{minposy}}}~ \end{fulllineitems} \index{mutated() (matplotlib.transforms.Bbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.mutated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{mutated}}}{}{} Return whether the bbox has changed since init. \end{fulllineitems} \index{mutatedx() (matplotlib.transforms.Bbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.mutatedx}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{mutatedx}}}{}{} Return whether the x-limits have changed since init. \end{fulllineitems} \index{mutatedy() (matplotlib.transforms.Bbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.mutatedy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{mutatedy}}}{}{} Return whether the y-limits have changed since init. \end{fulllineitems} \index{null() (matplotlib.transforms.Bbox static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.null}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{null}}}{}{} (staticmethod) Create a new null {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} from (inf, inf) to (-inf, -inf). \end{fulllineitems} \index{p0 (matplotlib.transforms.Bbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.p0}}\pysigline{\sphinxbfcode{\sphinxupquote{p0}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.p0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{p0}}}}} is the first pair of (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) coordinates that define the bounding box. It is not guaranteed to be the bottom-left corner. For that, use \sphinxcode{\sphinxupquote{min}}. \end{fulllineitems} \index{p1 (matplotlib.transforms.Bbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.p1}}\pysigline{\sphinxbfcode{\sphinxupquote{p1}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.p1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{p1}}}}} is the second pair of (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) coordinates that define the bounding box. It is not guaranteed to be the top-right corner. For that, use \sphinxcode{\sphinxupquote{max}}. \end{fulllineitems} \index{set() (matplotlib.transforms.Bbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{other}}{} Set this bounding box from the “frozen” bounds of another {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \end{fulllineitems} \index{set\_points() (matplotlib.transforms.Bbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.set_points}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_points}}}{\emph{points}}{} Set the points of the bounding box directly from a numpy array of the form: \sphinxcode{\sphinxupquote{{[}{[}x0, y0{]}, {[}x1, y1{]}{]}}}. No error checking is performed, as this method is mainly for internal use. \end{fulllineitems} \index{unit() (matplotlib.transforms.Bbox static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.unit}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{unit}}}{}{} (staticmethod) Create a new unit {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} from (0, 0) to (1, 1). \end{fulllineitems} \index{update\_from\_data\_xy() (matplotlib.transforms.Bbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.update_from_data_xy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from\_data\_xy}}}{\emph{xy}, \emph{ignore=None}, \emph{updatex=True}, \emph{updatey=True}}{} Update the bounds of the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} based on the passed in data. After updating, the bounds will have positive \sphinxstyleemphasis{width} and \sphinxstyleemphasis{height}; \sphinxstyleemphasis{x0} and \sphinxstyleemphasis{y0} will be the minimal values. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{xy}}] \leavevmode{[}ndarray{]} A numpy array of 2D points. \item[{\sphinxstylestrong{ignore}}] \leavevmode{[}bool, optional{]}\begin{itemize} \item {} When \sphinxcode{\sphinxupquote{True}}, ignore the existing bounds of the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \item {} When \sphinxcode{\sphinxupquote{False}}, include the existing bounds of the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \item {} When \sphinxcode{\sphinxupquote{None}}, use the last value passed to {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.ignore}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ignore()}}}}}. \end{itemize} \item[{\sphinxstylestrong{updatex, updatey}}] \leavevmode{[}bool, optional{]} When \sphinxcode{\sphinxupquote{True}}, update the x/y values. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{update\_from\_path() (matplotlib.transforms.Bbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.update_from_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_from\_path}}}{\emph{path}, \emph{ignore=None}, \emph{updatex=True}, \emph{updatey=True}}{} Update the bounds of the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} based on the passed in data. After updating, the bounds will have positive \sphinxstyleemphasis{width} and \sphinxstyleemphasis{height}; \sphinxstyleemphasis{x0} and \sphinxstyleemphasis{y0} will be the minimal values. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{path}}] \leavevmode{[}{\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}{]} \item[{\sphinxstylestrong{ignore}}] \leavevmode{[}bool, optional{]}\begin{itemize} \item {} when \sphinxcode{\sphinxupquote{True}}, ignore the existing bounds of the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \item {} when \sphinxcode{\sphinxupquote{False}}, include the existing bounds of the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \item {} when \sphinxcode{\sphinxupquote{None}}, use the last value passed to {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.ignore}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ignore()}}}}}. \end{itemize} \item[{\sphinxstylestrong{updatex, updatey}}] \leavevmode{[}bool, optional{]} When \sphinxcode{\sphinxupquote{True}}, update the x/y values. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{x0 (matplotlib.transforms.Bbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.x0}}\pysigline{\sphinxbfcode{\sphinxupquote{x0}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.x0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x0}}}}} is the first of the pair of \sphinxstyleemphasis{x} coordinates that define the bounding box. {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.x0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x0}}}}} is not guaranteed to be less than {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.x1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x1}}}}}. If you require that, use \sphinxcode{\sphinxupquote{xmin}}. \end{fulllineitems} \index{x1 (matplotlib.transforms.Bbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.x1}}\pysigline{\sphinxbfcode{\sphinxupquote{x1}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.x1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x1}}}}} is the second of the pair of \sphinxstyleemphasis{x} coordinates that define the bounding box. {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.x1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x1}}}}} is not guaranteed to be greater than {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.x0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x0}}}}}. If you require that, use \sphinxcode{\sphinxupquote{xmax}}. \end{fulllineitems} \index{y0 (matplotlib.transforms.Bbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.y0}}\pysigline{\sphinxbfcode{\sphinxupquote{y0}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.y0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y0}}}}} is the first of the pair of \sphinxstyleemphasis{y} coordinates that define the bounding box. {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.y0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y0}}}}} is not guaranteed to be less than {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.y1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y1}}}}}. If you require that, use \sphinxcode{\sphinxupquote{ymin}}. \end{fulllineitems} \index{y1 (matplotlib.transforms.Bbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Bbox.y1}}\pysigline{\sphinxbfcode{\sphinxupquote{y1}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.y1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y1}}}}} is the second of the pair of \sphinxstyleemphasis{y} coordinates that define the bounding box. {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.y1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y1}}}}} is not guaranteed to be greater than {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox.y0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y0}}}}}. If you require that, use \sphinxcode{\sphinxupquote{ymax}}. \end{fulllineitems} \end{fulllineitems} \index{BboxBase (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{BboxBase}}}{\emph{shorthand\_name=None}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformNode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.TransformNode}}}}} This is the base class of all bounding boxes, and provides read-only access to its data. A mutable bounding box is provided by the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} class. The canonical representation is as two points, with no restrictions on their ordering. Convenience properties are provided to get the left, bottom, right and top edges and width and height, but these are not stored explicitly. Creates a new {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformNode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformNode}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{shorthand\_name}}] \leavevmode{[}str{]} A string representing the “name” of the transform. The name carries no significance other than to improve the readability of \sphinxcode{\sphinxupquote{str(transform)}} when DEBUG=True. \end{description} \end{description}\end{quote} \index{anchored() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.anchored}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{anchored}}}{\emph{c}, \emph{container=None}}{} Return a copy of the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}, shifted to position \sphinxstyleemphasis{c} within a container. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{c :}}] \leavevmode May be either: \begin{itemize} \item {} A sequence (\sphinxstyleemphasis{cx}, \sphinxstyleemphasis{cy}) where \sphinxstyleemphasis{cx} and \sphinxstyleemphasis{cy} range from 0 to 1, where 0 is left or bottom and 1 is right or top \item {} a string: - ‘C’ for centered - ‘S’ for bottom-center - ‘SE’ for bottom-left - ‘E’ for left - etc. \end{itemize} \item[{\sphinxstylestrong{container}}] \leavevmode{[}Bbox, optional{]} The box within which the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} is positioned; it defaults to the initial {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{bounds (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.bounds}}\pysigline{\sphinxbfcode{\sphinxupquote{bounds}}} Returns ({\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.x0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x0}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.y0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y0}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.width}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{width}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.height}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{height}}}}}). \end{fulllineitems} \index{coefs (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.coefs}}\pysigline{\sphinxbfcode{\sphinxupquote{coefs}}\sphinxbfcode{\sphinxupquote{ = \{'C': (0.5, 0.5), 'E': (1.0, 0.5), 'N': (0.5, 1.0), 'NE': (1.0, 1.0), 'NW': (0, 1.0), 'S': (0.5, 0), 'SE': (1.0, 0), 'SW': (0, 0), 'W': (0, 0.5)\}}}} \end{fulllineitems} \index{contains() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains}}}{\emph{x}, \emph{y}}{} Returns whether \sphinxcode{\sphinxupquote{(x, y)}} is in the bounding box or on its edge. \end{fulllineitems} \index{containsx() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.containsx}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{containsx}}}{\emph{x}}{} Returns whether \sphinxstyleemphasis{x} is in the closed ({\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.x0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x0}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.x1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x1}}}}}) interval. \end{fulllineitems} \index{containsy() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.containsy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{containsy}}}{\emph{y}}{} Returns whether \sphinxstyleemphasis{y} is in the closed ({\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.y0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y0}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.y1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y1}}}}}) interval. \end{fulllineitems} \index{corners() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.corners}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{corners}}}{}{} Return an array of points which are the four corners of this rectangle. For example, if this {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} is defined by the points (\sphinxstyleemphasis{a}, \sphinxstyleemphasis{b}) and (\sphinxstyleemphasis{c}, \sphinxstyleemphasis{d}), {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.corners}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{corners()}}}}} returns (\sphinxstyleemphasis{a}, \sphinxstyleemphasis{b}), (\sphinxstyleemphasis{a}, \sphinxstyleemphasis{d}), (\sphinxstyleemphasis{c}, \sphinxstyleemphasis{b}) and (\sphinxstyleemphasis{c}, \sphinxstyleemphasis{d}). \end{fulllineitems} \index{count\_contains() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.count_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{count\_contains}}}{\emph{vertices}}{} Count the number of vertices contained in the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. Any vertices with a non-finite x or y value are ignored. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{vertices}}] \leavevmode{[}Nx2 Numpy array.{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{count\_overlaps() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.count_overlaps}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{count\_overlaps}}}{\emph{bboxes}}{} Count the number of bounding boxes that overlap this one. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{bboxes}}] \leavevmode{[}sequence of {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BboxBase}}}}} objects{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{expanded() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.expanded}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{expanded}}}{\emph{sw}, \emph{sh}}{} Return a new {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} which is this {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} expanded around its center by the given factors \sphinxstyleemphasis{sw} and \sphinxstyleemphasis{sh}. \end{fulllineitems} \index{extents (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.extents}}\pysigline{\sphinxbfcode{\sphinxupquote{extents}}} Returns ({\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.x0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x0}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.y0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y0}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.x1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x1}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.y1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y1}}}}}). \end{fulllineitems} \index{frozen() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.frozen}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{frozen}}}{}{} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformNode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformNode}}}}} is the base class for anything that participates in the transform tree and needs to invalidate its parents or be invalidated. This includes classes that are not really transforms, such as bounding boxes, since some transforms depend on bounding boxes to compute their values. \end{fulllineitems} \index{fully\_contains() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.fully_contains}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{fully\_contains}}}{\emph{x}, \emph{y}}{} Returns whether \sphinxcode{\sphinxupquote{x, y}} is in the bounding box, but not on its edge. \end{fulllineitems} \index{fully\_containsx() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.fully_containsx}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{fully\_containsx}}}{\emph{x}}{} Returns whether \sphinxstyleemphasis{x} is in the open ({\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.x0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x0}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.x1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x1}}}}}) interval. \end{fulllineitems} \index{fully\_containsy() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.fully_containsy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{fully\_containsy}}}{\emph{y}}{} Returns whether \sphinxstyleemphasis{y} is in the open ({\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.y0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y0}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.y1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y1}}}}}) interval. \end{fulllineitems} \index{fully\_overlaps() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.fully_overlaps}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{fully\_overlaps}}}{\emph{other}}{} Returns whether this bounding box overlaps with the other bounding box, not including the edges. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{other}}] \leavevmode{[}BboxBase{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_points() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.get_points}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_points}}}{}{}~ \end{fulllineitems} \index{height (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.height}}\pysigline{\sphinxbfcode{\sphinxupquote{height}}} The height of the bounding box. It may be negative if {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.y1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y1}}}}} \textless{} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.y0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y0}}}}}. \end{fulllineitems} \index{intersection() (matplotlib.transforms.BboxBase static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.intersection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{intersection}}}{\emph{bbox1}, \emph{bbox2}}{} Return the intersection of the two bboxes or None if they do not intersect. \end{fulllineitems} \index{intervalx (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.intervalx}}\pysigline{\sphinxbfcode{\sphinxupquote{intervalx}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.intervalx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{intervalx}}}}} is the pair of \sphinxstyleemphasis{x} coordinates that define the bounding box. It is not guaranteed to be sorted from left to right. \end{fulllineitems} \index{intervaly (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.intervaly}}\pysigline{\sphinxbfcode{\sphinxupquote{intervaly}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.intervaly}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{intervaly}}}}} is the pair of \sphinxstyleemphasis{y} coordinates that define the bounding box. It is not guaranteed to be sorted from bottom to top. \end{fulllineitems} \index{inverse\_transformed() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.inverse_transformed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverse\_transformed}}}{\emph{transform}}{} Return a new {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} object, statically transformed by the inverse of the given transform. \end{fulllineitems} \index{is\_affine (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.is_affine}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_affine}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{is\_bbox (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.is_bbox}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_bbox}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{is\_unit() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.is_unit}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{is\_unit}}}{}{} Returns True if the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} is the unit bounding box from (0, 0) to (1, 1). \end{fulllineitems} \index{max (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.max}}\pysigline{\sphinxbfcode{\sphinxupquote{max}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.max}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{max}}}}} is the top-right corner of the bounding box. \end{fulllineitems} \index{min (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.min}}\pysigline{\sphinxbfcode{\sphinxupquote{min}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.min}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{min}}}}} is the bottom-left corner of the bounding box. \end{fulllineitems} \index{overlaps() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.overlaps}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{overlaps}}}{\emph{other}}{} Returns whether this bounding box overlaps with the other bounding box. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{other}}] \leavevmode{[}BboxBase{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{p0 (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.p0}}\pysigline{\sphinxbfcode{\sphinxupquote{p0}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.p0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{p0}}}}} is the first pair of (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) coordinates that define the bounding box. It is not guaranteed to be the bottom-left corner. For that, use {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.min}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{min}}}}}. \end{fulllineitems} \index{p1 (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.p1}}\pysigline{\sphinxbfcode{\sphinxupquote{p1}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.p1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{p1}}}}} is the second pair of (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}) coordinates that define the bounding box. It is not guaranteed to be the top-right corner. For that, use {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.max}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{max}}}}}. \end{fulllineitems} \index{padded() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.padded}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{padded}}}{\emph{p}}{} Return a new {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} that is padded on all four sides by the given value. \end{fulllineitems} \index{rotated() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.rotated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{rotated}}}{\emph{radians}}{} Return a new bounding box that bounds a rotated version of this bounding box by the given radians. The new bounding box is still aligned with the axes, of course. \end{fulllineitems} \index{shrunk() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.shrunk}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{shrunk}}}{\emph{mx}, \emph{my}}{} Return a copy of the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}, shrunk by the factor \sphinxstyleemphasis{mx} in the \sphinxstyleemphasis{x} direction and the factor \sphinxstyleemphasis{my} in the \sphinxstyleemphasis{y} direction. The lower left corner of the box remains unchanged. Normally \sphinxstyleemphasis{mx} and \sphinxstyleemphasis{my} will be less than 1, but this is not enforced. \end{fulllineitems} \index{shrunk\_to\_aspect() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.shrunk_to_aspect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{shrunk\_to\_aspect}}}{\emph{box\_aspect}, \emph{container=None}, \emph{fig\_aspect=1.0}}{} Return a copy of the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}, shrunk so that it is as large as it can be while having the desired aspect ratio, \sphinxstyleemphasis{box\_aspect}. If the box coordinates are relative—that is, fractions of a larger box such as a figure—then the physical aspect ratio of that figure is specified with \sphinxstyleemphasis{fig\_aspect}, so that \sphinxstyleemphasis{box\_aspect} can also be given as a ratio of the absolute dimensions, not the relative dimensions. \end{fulllineitems} \index{size (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.size}}\pysigline{\sphinxbfcode{\sphinxupquote{size}}} The width and height of the bounding box. May be negative, in the same way as {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.width}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{width}}}}} and {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.height}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{height}}}}}. \end{fulllineitems} \index{splitx() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.splitx}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{splitx}}}{\emph{*args}}{} e.g., \sphinxcode{\sphinxupquote{bbox.splitx(f1, f2, ...)}} Returns a list of new {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} objects formed by splitting the original one with vertical lines at fractional positions \sphinxstyleemphasis{f1}, \sphinxstyleemphasis{f2}, … \end{fulllineitems} \index{splity() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.splity}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{splity}}}{\emph{*args}}{} e.g., \sphinxcode{\sphinxupquote{bbox.splitx(f1, f2, ...)}} Returns a list of new {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} objects formed by splitting the original one with horizontal lines at fractional positions \sphinxstyleemphasis{f1}, \sphinxstyleemphasis{f2}, … \end{fulllineitems} \index{transformed() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.transformed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transformed}}}{\emph{transform}}{} Return a new {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} object, statically transformed by the given transform. \end{fulllineitems} \index{translated() (matplotlib.transforms.BboxBase method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.translated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{translated}}}{\emph{tx}, \emph{ty}}{} Return a copy of the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}, statically translated by \sphinxstyleemphasis{tx} and \sphinxstyleemphasis{ty}. \end{fulllineitems} \index{union() (matplotlib.transforms.BboxBase static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.union}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{union}}}{\emph{bboxes}}{} Return a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} that contains all of the given bboxes. \end{fulllineitems} \index{width (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.width}}\pysigline{\sphinxbfcode{\sphinxupquote{width}}} The width of the bounding box. It may be negative if {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.x1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x1}}}}} \textless{} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.x0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x0}}}}}. \end{fulllineitems} \index{x0 (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.x0}}\pysigline{\sphinxbfcode{\sphinxupquote{x0}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.x0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x0}}}}} is the first of the pair of \sphinxstyleemphasis{x} coordinates that define the bounding box. {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.x0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x0}}}}} is not guaranteed to be less than {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.x1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x1}}}}}. If you require that, use {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.xmin}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xmin}}}}}. \end{fulllineitems} \index{x1 (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.x1}}\pysigline{\sphinxbfcode{\sphinxupquote{x1}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.x1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x1}}}}} is the second of the pair of \sphinxstyleemphasis{x} coordinates that define the bounding box. {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.x1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x1}}}}} is not guaranteed to be greater than {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.x0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x0}}}}}. If you require that, use {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.xmax}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xmax}}}}}. \end{fulllineitems} \index{xmax (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.xmax}}\pysigline{\sphinxbfcode{\sphinxupquote{xmax}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.xmax}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xmax}}}}} is the right edge of the bounding box. \end{fulllineitems} \index{xmin (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.xmin}}\pysigline{\sphinxbfcode{\sphinxupquote{xmin}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.xmin}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xmin}}}}} is the left edge of the bounding box. \end{fulllineitems} \index{y0 (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.y0}}\pysigline{\sphinxbfcode{\sphinxupquote{y0}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.y0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y0}}}}} is the first of the pair of \sphinxstyleemphasis{y} coordinates that define the bounding box. {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.y0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y0}}}}} is not guaranteed to be less than {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.y1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y1}}}}}. If you require that, use {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.ymin}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ymin}}}}}. \end{fulllineitems} \index{y1 (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.y1}}\pysigline{\sphinxbfcode{\sphinxupquote{y1}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.y1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y1}}}}} is the second of the pair of \sphinxstyleemphasis{y} coordinates that define the bounding box. {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.y1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y1}}}}} is not guaranteed to be greater than {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.y0}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y0}}}}}. If you require that, use {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.ymax}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ymax}}}}}. \end{fulllineitems} \index{ymax (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.ymax}}\pysigline{\sphinxbfcode{\sphinxupquote{ymax}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.ymax}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ymax}}}}} is the top edge of the bounding box. \end{fulllineitems} \index{ymin (matplotlib.transforms.BboxBase attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxBase.ymin}}\pysigline{\sphinxbfcode{\sphinxupquote{ymin}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase.ymin}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ymin}}}}} is the bottom edge of the bounding box. \end{fulllineitems} \end{fulllineitems} \index{BboxTransform (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{BboxTransform}}}{\emph{boxin}, \emph{boxout}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Affine2DBase}}}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BboxTransform}}}}} linearly transforms points from one {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} to another {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. Create a new {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BboxTransform}}}}} that linearly transforms points from \sphinxstyleemphasis{boxin} to \sphinxstyleemphasis{boxout}. \index{get\_matrix() (matplotlib.transforms.BboxTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxTransform.get_matrix}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_matrix}}}{}{} Get the Affine transformation array for the affine part of this transform. \end{fulllineitems} \index{is\_separable (matplotlib.transforms.BboxTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxTransform.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \end{fulllineitems} \index{BboxTransformFrom (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxTransformFrom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{BboxTransformFrom}}}{\emph{boxin}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Affine2DBase}}}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxTransformFrom}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BboxTransformFrom}}}}} linearly transforms points from a given {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} to the unit bounding box. \index{get\_matrix() (matplotlib.transforms.BboxTransformFrom method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxTransformFrom.get_matrix}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_matrix}}}{}{} Get the Affine transformation array for the affine part of this transform. \end{fulllineitems} \index{is\_separable (matplotlib.transforms.BboxTransformFrom attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxTransformFrom.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \end{fulllineitems} \index{BboxTransformTo (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxTransformTo}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{BboxTransformTo}}}{\emph{boxout}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Affine2DBase}}}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxTransformTo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BboxTransformTo}}}}} is a transformation that linearly transforms points from the unit bounding box to a given {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}. Create a new {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxTransformTo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BboxTransformTo}}}}} that linearly transforms points from the unit bounding box to \sphinxstyleemphasis{boxout}. \index{get\_matrix() (matplotlib.transforms.BboxTransformTo method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxTransformTo.get_matrix}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_matrix}}}{}{} Get the Affine transformation array for the affine part of this transform. \end{fulllineitems} \index{is\_separable (matplotlib.transforms.BboxTransformTo attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxTransformTo.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \end{fulllineitems} \index{BboxTransformToMaxOnly (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxTransformToMaxOnly}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{BboxTransformToMaxOnly}}}{\emph{boxout}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxTransformTo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.BboxTransformTo}}}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxTransformTo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BboxTransformTo}}}}} is a transformation that linearly transforms points from the unit bounding box to a given {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} with a fixed upper left of (0, 0). Create a new {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxTransformTo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BboxTransformTo}}}}} that linearly transforms points from the unit bounding box to \sphinxstyleemphasis{boxout}. \index{get\_matrix() (matplotlib.transforms.BboxTransformToMaxOnly method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BboxTransformToMaxOnly.get_matrix}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_matrix}}}{}{} Get the Affine transformation array for the affine part of this transform. \end{fulllineitems} \end{fulllineitems} \index{BlendedAffine2D (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedAffine2D}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{BlendedAffine2D}}}{\emph{x\_transform}, \emph{y\_transform}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Affine2DBase}}}}} A “blended” transform uses one transform for the \sphinxstyleemphasis{x}-direction, and another transform for the \sphinxstyleemphasis{y}-direction. This version is an optimization for the case where both child transforms are of type {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Affine2DBase}}}}}. Create a new “blended” transform using \sphinxstyleemphasis{x\_transform} to transform the \sphinxstyleemphasis{x}-axis and \sphinxstyleemphasis{y\_transform} to transform the \sphinxstyleemphasis{y}-axis. Both \sphinxstyleemphasis{x\_transform} and \sphinxstyleemphasis{y\_transform} must be 2D affine transforms. You will generally not call this constructor directly but use the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.blended_transform_factory}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{blended\_transform\_factory()}}}}} function instead, which can determine automatically which kind of blended transform to create. \index{contains\_branch\_seperately() (matplotlib.transforms.BlendedAffine2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedAffine2D.contains_branch_seperately}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains\_branch\_seperately}}}{\emph{transform}}{} Returns whether the given branch is a sub-tree of this transform on each separate dimension. A common use for this method is to identify if a transform is a blended transform containing an axes’ data transform. e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{x\PYGZus{}isdata}\PYG{p}{,} \PYG{n}{y\PYGZus{}isdata} \PYG{o}{=} \PYG{n}{trans}\PYG{o}{.}\PYG{n}{contains\PYGZus{}branch\PYGZus{}seperately}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{get\_matrix() (matplotlib.transforms.BlendedAffine2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedAffine2D.get_matrix}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_matrix}}}{}{} Get the Affine transformation array for the affine part of this transform. \end{fulllineitems} \index{is\_separable (matplotlib.transforms.BlendedAffine2D attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedAffine2D.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \end{fulllineitems} \index{BlendedGenericTransform (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{BlendedGenericTransform}}}{\emph{x\_transform}, \emph{y\_transform}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} A “blended” transform uses one transform for the \sphinxstyleemphasis{x}-direction, and another transform for the \sphinxstyleemphasis{y}-direction. This “generic” version can handle any given child transform in the \sphinxstyleemphasis{x}- and \sphinxstyleemphasis{y}-directions. Create a new “blended” transform using \sphinxstyleemphasis{x\_transform} to transform the \sphinxstyleemphasis{x}-axis and \sphinxstyleemphasis{y\_transform} to transform the \sphinxstyleemphasis{y}-axis. You will generally not call this constructor directly but use the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.blended_transform_factory}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{blended\_transform\_factory()}}}}} function instead, which can determine automatically which kind of blended transform to create. \index{contains\_branch() (matplotlib.transforms.BlendedGenericTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform.contains_branch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains\_branch}}}{\emph{other}}{} Return whether the given transform is a sub-tree of this transform. This routine uses transform equality to identify sub-trees, therefore in many situations it is object id which will be used. For the case where the given transform represents the whole of this transform, returns True. \end{fulllineitems} \index{contains\_branch\_seperately() (matplotlib.transforms.BlendedGenericTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform.contains_branch_seperately}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains\_branch\_seperately}}}{\emph{transform}}{} Returns whether the given branch is a sub-tree of this transform on each separate dimension. A common use for this method is to identify if a transform is a blended transform containing an axes’ data transform. e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{x\PYGZus{}isdata}\PYG{p}{,} \PYG{n}{y\PYGZus{}isdata} \PYG{o}{=} \PYG{n}{trans}\PYG{o}{.}\PYG{n}{contains\PYGZus{}branch\PYGZus{}seperately}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{depth (matplotlib.transforms.BlendedGenericTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform.depth}}\pysigline{\sphinxbfcode{\sphinxupquote{depth}}} Returns the number of transforms which have been chained together to form this Transform instance. \begin{sphinxadmonition}{note}{Note:} For the special case of a Composite transform, the maximum depth of the two is returned. \end{sphinxadmonition} \end{fulllineitems} \index{frozen() (matplotlib.transforms.BlendedGenericTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform.frozen}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{frozen}}}{}{} Returns a frozen copy of this transform node. The frozen copy will not update when its children change. Useful for storing a previously known state of a transform where \sphinxcode{\sphinxupquote{copy.deepcopy()}} might normally be used. \end{fulllineitems} \index{get\_affine() (matplotlib.transforms.BlendedGenericTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform.get_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_affine}}}{}{} Get the affine part of this transform. \end{fulllineitems} \index{has\_inverse (matplotlib.transforms.BlendedGenericTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform.has_inverse}}\pysigline{\sphinxbfcode{\sphinxupquote{has\_inverse}}}~ \end{fulllineitems} \index{input\_dims (matplotlib.transforms.BlendedGenericTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform.input_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{input\_dims}}\sphinxbfcode{\sphinxupquote{ = 2}}} \end{fulllineitems} \index{inverted() (matplotlib.transforms.BlendedGenericTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \index{is\_affine (matplotlib.transforms.BlendedGenericTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform.is_affine}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_affine}}}~ \end{fulllineitems} \index{is\_separable (matplotlib.transforms.BlendedGenericTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{output\_dims (matplotlib.transforms.BlendedGenericTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform.output_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_dims}}\sphinxbfcode{\sphinxupquote{ = 2}}} \end{fulllineitems} \index{pass\_through (matplotlib.transforms.BlendedGenericTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform.pass_through}}\pysigline{\sphinxbfcode{\sphinxupquote{pass\_through}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.transforms.BlendedGenericTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{points}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}) and returns a numpy array of shape (N x {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}). Alternatively, accepts a numpy array of length {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}} and returns a numpy array of length {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BlendedGenericTransform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \end{fulllineitems} \index{CompositeAffine2D (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.CompositeAffine2D}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{CompositeAffine2D}}}{\emph{a}, \emph{b}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Affine2DBase}}}}} A composite transform formed by applying transform \sphinxstyleemphasis{a} then transform \sphinxstyleemphasis{b}. This version is an optimization that handles the case where both \sphinxstyleemphasis{a} and \sphinxstyleemphasis{b} are 2D affines. Create a new composite transform that is the result of applying transform \sphinxstyleemphasis{a} then transform \sphinxstyleemphasis{b}. Both \sphinxstyleemphasis{a} and \sphinxstyleemphasis{b} must be instances of {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Affine2DBase}}}}}. You will generally not call this constructor directly but use the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.composite_transform_factory}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{composite\_transform\_factory()}}}}} function instead, which can automatically choose the best kind of composite transform instance to create. \index{depth (matplotlib.transforms.CompositeAffine2D attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.CompositeAffine2D.depth}}\pysigline{\sphinxbfcode{\sphinxupquote{depth}}} Returns the number of transforms which have been chained together to form this Transform instance. \begin{sphinxadmonition}{note}{Note:} For the special case of a Composite transform, the maximum depth of the two is returned. \end{sphinxadmonition} \end{fulllineitems} \index{get\_matrix() (matplotlib.transforms.CompositeAffine2D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.CompositeAffine2D.get_matrix}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_matrix}}}{}{} Get the Affine transformation array for the affine part of this transform. \end{fulllineitems} \end{fulllineitems} \index{CompositeGenericTransform (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.CompositeGenericTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{CompositeGenericTransform}}}{\emph{a}, \emph{b}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} A composite transform formed by applying transform \sphinxstyleemphasis{a} then transform \sphinxstyleemphasis{b}. This “generic” version can handle any two arbitrary transformations. Create a new composite transform that is the result of applying transform \sphinxstyleemphasis{a} then transform \sphinxstyleemphasis{b}. You will generally not call this constructor directly but use the {\hyperref[\detokenize{api/transformations:matplotlib.transforms.composite_transform_factory}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{composite\_transform\_factory()}}}}} function instead, which can automatically choose the best kind of composite transform instance to create. \index{depth (matplotlib.transforms.CompositeGenericTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.CompositeGenericTransform.depth}}\pysigline{\sphinxbfcode{\sphinxupquote{depth}}} Returns the number of transforms which have been chained together to form this Transform instance. \begin{sphinxadmonition}{note}{Note:} For the special case of a Composite transform, the maximum depth of the two is returned. \end{sphinxadmonition} \end{fulllineitems} \index{frozen() (matplotlib.transforms.CompositeGenericTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.CompositeGenericTransform.frozen}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{frozen}}}{}{} Returns a frozen copy of this transform node. The frozen copy will not update when its children change. Useful for storing a previously known state of a transform where \sphinxcode{\sphinxupquote{copy.deepcopy()}} might normally be used. \end{fulllineitems} \index{get\_affine() (matplotlib.transforms.CompositeGenericTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.CompositeGenericTransform.get_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_affine}}}{}{} Get the affine part of this transform. \end{fulllineitems} \index{has\_inverse (matplotlib.transforms.CompositeGenericTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.CompositeGenericTransform.has_inverse}}\pysigline{\sphinxbfcode{\sphinxupquote{has\_inverse}}}~ \end{fulllineitems} \index{inverted() (matplotlib.transforms.CompositeGenericTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.CompositeGenericTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \index{is\_affine (matplotlib.transforms.CompositeGenericTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.CompositeGenericTransform.is_affine}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_affine}}}~ \end{fulllineitems} \index{is\_separable (matplotlib.transforms.CompositeGenericTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.CompositeGenericTransform.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}}~ \end{fulllineitems} \index{pass\_through (matplotlib.transforms.CompositeGenericTransform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.CompositeGenericTransform.pass_through}}\pysigline{\sphinxbfcode{\sphinxupquote{pass\_through}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{transform\_affine() (matplotlib.transforms.CompositeGenericTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.CompositeGenericTransform.transform_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_affine}}}{\emph{points}}{} Performs only the affine part of this transformation on the given array of values. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally a no-op. In affine transformations, this is equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. Accepts a numpy array of shape (N x \sphinxcode{\sphinxupquote{input\_dims}}) and returns a numpy array of shape (N x \sphinxcode{\sphinxupquote{output\_dims}}). Alternatively, accepts a numpy array of length \sphinxcode{\sphinxupquote{input\_dims}} and returns a numpy array of length \sphinxcode{\sphinxupquote{output\_dims}}. \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.transforms.CompositeGenericTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.CompositeGenericTransform.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{points}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x \sphinxcode{\sphinxupquote{input\_dims}}) and returns a numpy array of shape (N x \sphinxcode{\sphinxupquote{output\_dims}}). Alternatively, accepts a numpy array of length \sphinxcode{\sphinxupquote{input\_dims}} and returns a numpy array of length \sphinxcode{\sphinxupquote{output\_dims}}. \end{fulllineitems} \index{transform\_path\_non\_affine() (matplotlib.transforms.CompositeGenericTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.CompositeGenericTransform.transform_path_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_path\_non\_affine}}}{\emph{path}}{} Returns a path, transformed only by the non-affine part of this transform. \sphinxstyleemphasis{path}: a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \sphinxcode{\sphinxupquote{transform\_path(path)}} is equivalent to \sphinxcode{\sphinxupquote{transform\_path\_affine(transform\_path\_non\_affine(values))}}. \end{fulllineitems} \end{fulllineitems} \index{IdentityTransform (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.IdentityTransform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{IdentityTransform}}}{\emph{*args}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Affine2DBase}}}}} A special class that does one thing, the identity transform, in a fast way. \index{frozen() (matplotlib.transforms.IdentityTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.IdentityTransform.frozen}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{frozen}}}{}{} Returns a frozen copy of this transform node. The frozen copy will not update when its children change. Useful for storing a previously known state of a transform where \sphinxcode{\sphinxupquote{copy.deepcopy()}} might normally be used. \end{fulllineitems} \index{get\_affine() (matplotlib.transforms.IdentityTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.IdentityTransform.get_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_affine}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \index{get\_matrix() (matplotlib.transforms.IdentityTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.IdentityTransform.get_matrix}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_matrix}}}{}{} Get the Affine transformation array for the affine part of this transform. \end{fulllineitems} \index{inverted() (matplotlib.transforms.IdentityTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.IdentityTransform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \index{transform() (matplotlib.transforms.IdentityTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.IdentityTransform.transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform}}}{\emph{points}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x \sphinxcode{\sphinxupquote{input\_dims}}) and returns a numpy array of shape (N x \sphinxcode{\sphinxupquote{output\_dims}}). Alternatively, accepts a numpy array of length \sphinxcode{\sphinxupquote{input\_dims}} and returns a numpy array of length \sphinxcode{\sphinxupquote{output\_dims}}. \end{fulllineitems} \index{transform\_affine() (matplotlib.transforms.IdentityTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.IdentityTransform.transform_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_affine}}}{\emph{points}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x \sphinxcode{\sphinxupquote{input\_dims}}) and returns a numpy array of shape (N x \sphinxcode{\sphinxupquote{output\_dims}}). Alternatively, accepts a numpy array of length \sphinxcode{\sphinxupquote{input\_dims}} and returns a numpy array of length \sphinxcode{\sphinxupquote{output\_dims}}. \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.transforms.IdentityTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.IdentityTransform.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{points}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x \sphinxcode{\sphinxupquote{input\_dims}}) and returns a numpy array of shape (N x \sphinxcode{\sphinxupquote{output\_dims}}). Alternatively, accepts a numpy array of length \sphinxcode{\sphinxupquote{input\_dims}} and returns a numpy array of length \sphinxcode{\sphinxupquote{output\_dims}}. \end{fulllineitems} \index{transform\_path() (matplotlib.transforms.IdentityTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.IdentityTransform.transform_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_path}}}{\emph{path}}{} Returns a path, transformed only by the non-affine part of this transform. \sphinxstyleemphasis{path}: a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \sphinxcode{\sphinxupquote{transform\_path(path)}} is equivalent to \sphinxcode{\sphinxupquote{transform\_path\_affine(transform\_path\_non\_affine(values))}}. \end{fulllineitems} \index{transform\_path\_affine() (matplotlib.transforms.IdentityTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.IdentityTransform.transform_path_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_path\_affine}}}{\emph{path}}{} Returns a path, transformed only by the non-affine part of this transform. \sphinxstyleemphasis{path}: a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \sphinxcode{\sphinxupquote{transform\_path(path)}} is equivalent to \sphinxcode{\sphinxupquote{transform\_path\_affine(transform\_path\_non\_affine(values))}}. \end{fulllineitems} \index{transform\_path\_non\_affine() (matplotlib.transforms.IdentityTransform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.IdentityTransform.transform_path_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_path\_non\_affine}}}{\emph{path}}{} Returns a path, transformed only by the non-affine part of this transform. \sphinxstyleemphasis{path}: a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \sphinxcode{\sphinxupquote{transform\_path(path)}} is equivalent to \sphinxcode{\sphinxupquote{transform\_path\_affine(transform\_path\_non\_affine(values))}}. \end{fulllineitems} \end{fulllineitems} \index{LockableBbox (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.LockableBbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{LockableBbox}}}{\emph{bbox}, \emph{x0=None}, \emph{y0=None}, \emph{x1=None}, \emph{y1=None}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.BboxBase}}}}} A {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} where some elements may be locked at certain values. When the child bounding box changes, the bounds of this bbox will update accordingly with the exception of the locked elements. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{bbox}}] \leavevmode{[}Bbox{]} The child bounding box to wrap. \item[{\sphinxstylestrong{x0}}] \leavevmode{[}float or None{]} The locked value for x0, or None to leave unlocked. \item[{\sphinxstylestrong{y0}}] \leavevmode{[}float or None{]} The locked value for y0, or None to leave unlocked. \item[{\sphinxstylestrong{x1}}] \leavevmode{[}float or None{]} The locked value for x1, or None to leave unlocked. \item[{\sphinxstylestrong{y1}}] \leavevmode{[}float or None{]} The locked value for y1, or None to leave unlocked. \end{description} \end{description}\end{quote} \index{get\_points() (matplotlib.transforms.LockableBbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.LockableBbox.get_points}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_points}}}{}{} Get the points of the bounding box directly as a numpy array of the form: \sphinxcode{\sphinxupquote{{[}{[}x0, y0{]}, {[}x1, y1{]}{]}}}. \end{fulllineitems} \index{locked\_x0 (matplotlib.transforms.LockableBbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.LockableBbox.locked_x0}}\pysigline{\sphinxbfcode{\sphinxupquote{locked\_x0}}} float or None: The value used for the locked x0. \end{fulllineitems} \index{locked\_x1 (matplotlib.transforms.LockableBbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.LockableBbox.locked_x1}}\pysigline{\sphinxbfcode{\sphinxupquote{locked\_x1}}} float or None: The value used for the locked x1. \end{fulllineitems} \index{locked\_y0 (matplotlib.transforms.LockableBbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.LockableBbox.locked_y0}}\pysigline{\sphinxbfcode{\sphinxupquote{locked\_y0}}} float or None: The value used for the locked y0. \end{fulllineitems} \index{locked\_y1 (matplotlib.transforms.LockableBbox attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.LockableBbox.locked_y1}}\pysigline{\sphinxbfcode{\sphinxupquote{locked\_y1}}} float or None: The value used for the locked y1. \end{fulllineitems} \end{fulllineitems} \index{ScaledTranslation (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.ScaledTranslation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{ScaledTranslation}}}{\emph{xt}, \emph{yt}, \emph{scale\_trans}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2DBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Affine2DBase}}}}} A transformation that translates by \sphinxstyleemphasis{xt} and \sphinxstyleemphasis{yt}, after \sphinxstyleemphasis{xt} and \sphinxstyleemphasis{yt} have been transformad by the given transform \sphinxstyleemphasis{scale\_trans}. \index{get\_matrix() (matplotlib.transforms.ScaledTranslation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.ScaledTranslation.get_matrix}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_matrix}}}{}{} Get the Affine transformation array for the affine part of this transform. \end{fulllineitems} \end{fulllineitems} \index{Transform (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{Transform}}}{\emph{shorthand\_name=None}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformNode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.TransformNode}}}}} The base class of all {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformNode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformNode}}}}} instances that actually perform a transformation. All non-affine transformations should be subclasses of this class. New affine transformations should be subclasses of {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Affine2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Affine2D}}}}}. Subclasses of this class should override the following members (at minimum): \begin{itemize} \item {} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}} \item {} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}} \item {} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform()}}}}} \item {} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.is_separable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{is\_separable}}}}} \item {} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.has_inverse}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{has\_inverse}}}}} \item {} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.inverted}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{inverted()}}}}} (if {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.has_inverse}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{has\_inverse}}}}} is True) \end{itemize} If the transform needs to do something non-standard with {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.path.Path}}}}} objects, such as adding curves where there were once line segments, it should override: \begin{itemize} \item {} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.transform_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform\_path()}}}}} \end{itemize} Creates a new {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformNode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformNode}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{shorthand\_name}}] \leavevmode{[}str{]} A string representing the “name” of the transform. The name carries no significance other than to improve the readability of \sphinxcode{\sphinxupquote{str(transform)}} when DEBUG=True. \end{description} \end{description}\end{quote} \index{contains\_branch() (matplotlib.transforms.Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.contains_branch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains\_branch}}}{\emph{other}}{} Return whether the given transform is a sub-tree of this transform. This routine uses transform equality to identify sub-trees, therefore in many situations it is object id which will be used. For the case where the given transform represents the whole of this transform, returns True. \end{fulllineitems} \index{contains\_branch\_seperately() (matplotlib.transforms.Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.contains_branch_seperately}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contains\_branch\_seperately}}}{\emph{other\_transform}}{} Returns whether the given branch is a sub-tree of this transform on each separate dimension. A common use for this method is to identify if a transform is a blended transform containing an axes’ data transform. e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{x\PYGZus{}isdata}\PYG{p}{,} \PYG{n}{y\PYGZus{}isdata} \PYG{o}{=} \PYG{n}{trans}\PYG{o}{.}\PYG{n}{contains\PYGZus{}branch\PYGZus{}seperately}\PYG{p}{(}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transData}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{depth (matplotlib.transforms.Transform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.depth}}\pysigline{\sphinxbfcode{\sphinxupquote{depth}}} Returns the number of transforms which have been chained together to form this Transform instance. \begin{sphinxadmonition}{note}{Note:} For the special case of a Composite transform, the maximum depth of the two is returned. \end{sphinxadmonition} \end{fulllineitems} \index{get\_affine() (matplotlib.transforms.Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.get_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_affine}}}{}{} Get the affine part of this transform. \end{fulllineitems} \index{get\_matrix() (matplotlib.transforms.Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.get_matrix}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_matrix}}}{}{} Get the Affine transformation array for the affine part of this transform. \end{fulllineitems} \index{has\_inverse (matplotlib.transforms.Transform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.has_inverse}}\pysigline{\sphinxbfcode{\sphinxupquote{has\_inverse}}\sphinxbfcode{\sphinxupquote{ = False}}} True if this transform has a corresponding inverse transform. \end{fulllineitems} \index{input\_dims (matplotlib.transforms.Transform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.input_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{input\_dims}}\sphinxbfcode{\sphinxupquote{ = None}}} The number of input dimensions of this transform. Must be overridden (with integers) in the subclass. \end{fulllineitems} \index{inverted() (matplotlib.transforms.Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{inverted}}}{}{} Return the corresponding inverse transformation. The return value of this method should be treated as temporary. An update to \sphinxstyleemphasis{self} does not cause a corresponding update to its inverted copy. \sphinxcode{\sphinxupquote{x === self.inverted().transform(self.transform(x))}} \end{fulllineitems} \index{is\_separable (matplotlib.transforms.Transform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}\sphinxbfcode{\sphinxupquote{ = False}}} True if this transform is separable in the x- and y- dimensions. \end{fulllineitems} \index{output\_dims (matplotlib.transforms.Transform attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.output_dims}}\pysigline{\sphinxbfcode{\sphinxupquote{output\_dims}}\sphinxbfcode{\sphinxupquote{ = None}}} The number of output dimensions of this transform. Must be overridden (with integers) in the subclass. \end{fulllineitems} \index{transform() (matplotlib.transforms.Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform}}}{\emph{values}}{} Performs the transformation on the given array of values. Accepts a numpy array of shape (N x {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}) and returns a numpy array of shape (N x {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}). Alternatively, accepts a numpy array of length {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}} and returns a numpy array of length {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \index{transform\_affine() (matplotlib.transforms.Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.transform_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_affine}}}{\emph{values}}{} Performs only the affine part of this transformation on the given array of values. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally a no-op. In affine transformations, this is equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. Accepts a numpy array of shape (N x {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}) and returns a numpy array of shape (N x {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}). Alternatively, accepts a numpy array of length {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}} and returns a numpy array of length {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \index{transform\_angles() (matplotlib.transforms.Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.transform_angles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_angles}}}{\emph{angles}, \emph{pts}, \emph{radians=False}, \emph{pushoff=1e-05}}{} Performs transformation on a set of angles anchored at specific locations. The \sphinxstyleemphasis{angles} must be a column vector (i.e., numpy array). The \sphinxstyleemphasis{pts} must be a two-column numpy array of x,y positions (angle transforms currently only work in 2D). This array must have the same number of rows as \sphinxstyleemphasis{angles}. \begin{description} \item[{\sphinxstyleemphasis{radians} indicates whether or not input angles are given in}] \leavevmode radians (True) or degrees (False; the default). \item[{\sphinxstyleemphasis{pushoff} is the distance to move away from \sphinxstyleemphasis{pts} for}] \leavevmode determining transformed angles (see discussion of method below). \end{description} The transformed angles are returned in an array with the same size as \sphinxstyleemphasis{angles}. The generic version of this method uses a very generic algorithm that transforms \sphinxstyleemphasis{pts}, as well as locations very close to \sphinxstyleemphasis{pts}, to find the angle in the transformed system. \end{fulllineitems} \index{transform\_bbox() (matplotlib.transforms.Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.transform_bbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_bbox}}}{\emph{bbox}}{} Transform the given bounding box. Note, for smarter transforms including caching (a common requirement for matplotlib figures), see {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformedBbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformedBbox}}}}}. \end{fulllineitems} \index{transform\_non\_affine() (matplotlib.transforms.Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.transform_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_non\_affine}}}{\emph{values}}{} Performs only the non-affine part of the transformation. \sphinxcode{\sphinxupquote{transform(values)}} is always equivalent to \sphinxcode{\sphinxupquote{transform\_affine(transform\_non\_affine(values))}}. In non-affine transformations, this is generally equivalent to \sphinxcode{\sphinxupquote{transform(values)}}. In affine transformations, this is always a no-op. Accepts a numpy array of shape (N x {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}) and returns a numpy array of shape (N x {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}). Alternatively, accepts a numpy array of length {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}} and returns a numpy array of length {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \index{transform\_path() (matplotlib.transforms.Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.transform_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_path}}}{\emph{path}}{} Returns a transformed path. \sphinxstyleemphasis{path}: a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. In some cases, this transform may insert curves into the path that began as line segments. \end{fulllineitems} \index{transform\_path\_affine() (matplotlib.transforms.Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.transform_path_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_path\_affine}}}{\emph{path}}{} Returns a path, transformed only by the affine part of this transform. \sphinxstyleemphasis{path}: a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \sphinxcode{\sphinxupquote{transform\_path(path)}} is equivalent to \sphinxcode{\sphinxupquote{transform\_path\_affine(transform\_path\_non\_affine(values))}}. \end{fulllineitems} \index{transform\_path\_non\_affine() (matplotlib.transforms.Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.transform_path_non_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_path\_non\_affine}}}{\emph{path}}{} Returns a path, transformed only by the non-affine part of this transform. \sphinxstyleemphasis{path}: a {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} instance. \sphinxcode{\sphinxupquote{transform\_path(path)}} is equivalent to \sphinxcode{\sphinxupquote{transform\_path\_affine(transform\_path\_non\_affine(values))}}. \end{fulllineitems} \index{transform\_point() (matplotlib.transforms.Transform method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.Transform.transform_point}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform\_point}}}{\emph{point}}{} A convenience function that returns the transformed copy of a single point. The point is given as a sequence of length {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.input_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{input\_dims}}}}}. The transformed point is returned as a sequence of length {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform.output_dims}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_dims}}}}}. \end{fulllineitems} \end{fulllineitems} \index{TransformNode (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformNode}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{TransformNode}}}{\emph{shorthand\_name=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformNode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformNode}}}}} is the base class for anything that participates in the transform tree and needs to invalidate its parents or be invalidated. This includes classes that are not really transforms, such as bounding boxes, since some transforms depend on bounding boxes to compute their values. Creates a new {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformNode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformNode}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{shorthand\_name}}] \leavevmode{[}str{]} A string representing the “name” of the transform. The name carries no significance other than to improve the readability of \sphinxcode{\sphinxupquote{str(transform)}} when DEBUG=True. \end{description} \end{description}\end{quote} \index{INVALID (matplotlib.transforms.TransformNode attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformNode.INVALID}}\pysigline{\sphinxbfcode{\sphinxupquote{INVALID}}\sphinxbfcode{\sphinxupquote{ = 3}}} \end{fulllineitems} \index{INVALID\_AFFINE (matplotlib.transforms.TransformNode attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformNode.INVALID_AFFINE}}\pysigline{\sphinxbfcode{\sphinxupquote{INVALID\_AFFINE}}\sphinxbfcode{\sphinxupquote{ = 2}}} \end{fulllineitems} \index{INVALID\_NON\_AFFINE (matplotlib.transforms.TransformNode attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformNode.INVALID_NON_AFFINE}}\pysigline{\sphinxbfcode{\sphinxupquote{INVALID\_NON\_AFFINE}}\sphinxbfcode{\sphinxupquote{ = 1}}} \end{fulllineitems} \index{frozen() (matplotlib.transforms.TransformNode method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformNode.frozen}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{frozen}}}{}{} Returns a frozen copy of this transform node. The frozen copy will not update when its children change. Useful for storing a previously known state of a transform where \sphinxcode{\sphinxupquote{copy.deepcopy()}} might normally be used. \end{fulllineitems} \index{invalidate() (matplotlib.transforms.TransformNode method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformNode.invalidate}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{invalidate}}}{}{} Invalidate this {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformNode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformNode}}}}} and triggers an invalidation of its ancestors. Should be called any time the transform changes. \end{fulllineitems} \index{is\_affine (matplotlib.transforms.TransformNode attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformNode.is_affine}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_affine}}\sphinxbfcode{\sphinxupquote{ = False}}} \end{fulllineitems} \index{is\_bbox (matplotlib.transforms.TransformNode attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformNode.is_bbox}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_bbox}}\sphinxbfcode{\sphinxupquote{ = False}}} \end{fulllineitems} \index{pass\_through (matplotlib.transforms.TransformNode attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformNode.pass_through}}\pysigline{\sphinxbfcode{\sphinxupquote{pass\_through}}\sphinxbfcode{\sphinxupquote{ = False}}} If pass\_through is True, all ancestors will always be invalidated, even if ‘self’ is already invalid. \end{fulllineitems} \index{set\_children() (matplotlib.transforms.TransformNode method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformNode.set_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_children}}}{\emph{*children}}{} Set the children of the transform, to let the invalidation system know which transforms can invalidate this transform. Should be called from the constructor of any transforms that depend on other transforms. \end{fulllineitems} \end{fulllineitems} \index{TransformWrapper (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformWrapper}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{TransformWrapper}}}{\emph{child}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} A helper class that holds a single child transform and acts equivalently to it. This is useful if a node of the transform tree must be replaced at run time with a transform of a different type. This class allows that replacement to correctly trigger invalidation. Note that {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformWrapper}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformWrapper}}}}} instances must have the same input and output dimensions during their entire lifetime, so the child transform may only be replaced with another child transform of the same dimensions. \sphinxstyleemphasis{child}: A class:{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance. This child may later be replaced with {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformWrapper.set}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set()}}}}}. \index{frozen() (matplotlib.transforms.TransformWrapper method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformWrapper.frozen}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{frozen}}}{}{} Returns a frozen copy of this transform node. The frozen copy will not update when its children change. Useful for storing a previously known state of a transform where \sphinxcode{\sphinxupquote{copy.deepcopy()}} might normally be used. \end{fulllineitems} \index{has\_inverse (matplotlib.transforms.TransformWrapper attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformWrapper.has_inverse}}\pysigline{\sphinxbfcode{\sphinxupquote{has\_inverse}}}~ \end{fulllineitems} \index{is\_affine (matplotlib.transforms.TransformWrapper attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformWrapper.is_affine}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_affine}}}~ \end{fulllineitems} \index{is\_separable (matplotlib.transforms.TransformWrapper attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformWrapper.is_separable}}\pysigline{\sphinxbfcode{\sphinxupquote{is\_separable}}}~ \end{fulllineitems} \index{pass\_through (matplotlib.transforms.TransformWrapper attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformWrapper.pass_through}}\pysigline{\sphinxbfcode{\sphinxupquote{pass\_through}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{set() (matplotlib.transforms.TransformWrapper method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformWrapper.set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set}}}{\emph{child}}{} Replace the current child of this transform with another one. The new child must have the same number of input and output dimensions as the current child. \end{fulllineitems} \end{fulllineitems} \index{TransformedBbox (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformedBbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{TransformedBbox}}}{\emph{bbox}, \emph{transform}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.BboxBase}}}}} A {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} that is automatically transformed by a given transform. When either the child bounding box or transform changes, the bounds of this bbox will update accordingly. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{bbox}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}{]} \item[{\sphinxstylestrong{transform}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}{]} \end{description} \end{description}\end{quote} \index{get\_points() (matplotlib.transforms.TransformedBbox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformedBbox.get_points}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_points}}}{}{} Get the points of the bounding box directly as a numpy array of the form: \sphinxcode{\sphinxupquote{{[}{[}x0, y0{]}, {[}x1, y1{]}{]}}}. \end{fulllineitems} \end{fulllineitems} \index{TransformedPatchPath (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformedPatchPath}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{TransformedPatchPath}}}{\emph{patch}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformedPath}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.TransformedPath}}}}} A {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformedPatchPath}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformedPatchPath}}}}} caches a non-affine transformed copy of the \sphinxcode{\sphinxupquote{Patch}}. This cached copy is automatically updated when the non-affine part of the transform or the patch changes. Create a new {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformedPatchPath}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformedPatchPath}}}}} from the given \sphinxcode{\sphinxupquote{Patch}}. \end{fulllineitems} \index{TransformedPath (class in matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformedPath}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{TransformedPath}}}{\emph{path}, \emph{transform}}{} Bases: {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformNode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.TransformNode}}}}} A {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformedPath}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformedPath}}}}} caches a non-affine transformed copy of the {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}. This cached copy is automatically updated when the non-affine part of the transform changes. \begin{sphinxadmonition}{note}{Note:} Paths are considered immutable by this class. Any update to the path’s vertices/codes will not trigger a transform recomputation. \end{sphinxadmonition} Create a new {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformedPath}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TransformedPath}}}}} from the given {\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}} and {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}. \index{get\_affine() (matplotlib.transforms.TransformedPath method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformedPath.get_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_affine}}}{}{}~ \end{fulllineitems} \index{get\_fully\_transformed\_path() (matplotlib.transforms.TransformedPath method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformedPath.get_fully_transformed_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_fully\_transformed\_path}}}{}{} Return a fully-transformed copy of the child path. \end{fulllineitems} \index{get\_transformed\_path\_and\_affine() (matplotlib.transforms.TransformedPath method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformedPath.get_transformed_path_and_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transformed\_path\_and\_affine}}}{}{} Return a copy of the child path, with the non-affine part of the transform already applied, along with the affine part of the path necessary to complete the transformation. \end{fulllineitems} \index{get\_transformed\_points\_and\_affine() (matplotlib.transforms.TransformedPath method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.TransformedPath.get_transformed_points_and_affine}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_transformed\_points\_and\_affine}}}{}{} Return a copy of the child path, with the non-affine part of the transform already applied, along with the affine part of the path necessary to complete the transformation. Unlike {\hyperref[\detokenize{api/transformations:matplotlib.transforms.TransformedPath.get_transformed_path_and_affine}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_transformed\_path\_and\_affine()}}}}}, no interpolation will be performed. \end{fulllineitems} \end{fulllineitems} \index{blended\_transform\_factory() (in module matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.blended_transform_factory}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{blended\_transform\_factory}}}{\emph{x\_transform}, \emph{y\_transform}}{} Create a new “blended” transform using \sphinxstyleemphasis{x\_transform} to transform the \sphinxstyleemphasis{x}-axis and \sphinxstyleemphasis{y\_transform} to transform the \sphinxstyleemphasis{y}-axis. A faster version of the blended transform is returned for the case where both child transforms are affine. \end{fulllineitems} \index{composite\_transform\_factory() (in module matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.composite_transform_factory}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{composite\_transform\_factory}}}{\emph{a}, \emph{b}}{} Create a new composite transform that is the result of applying transform a then transform b. Shortcut versions of the blended transform are provided for the case where both child transforms are affine, or one or the other is the identity transform. Composite transforms may also be created using the ‘+’ operator, e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{c} \PYG{o}{=} \PYG{n}{a} \PYG{o}{+} \PYG{n}{b} \end{sphinxVerbatim} \end{fulllineitems} \index{interval\_contains() (in module matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.interval_contains}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{interval\_contains}}}{\emph{interval}, \emph{val}}{} Check, inclusively, whether an interval includes a given value. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{interval}}] \leavevmode{[}sequence of scalar{]} A 2-length sequence, endpoints that define the interval. \item[{\sphinxstylestrong{val}}] \leavevmode{[}scalar{]} Value to check is within interval. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{bool}}] \leavevmode Returns true if given val is within the interval. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{interval\_contains\_open() (in module matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.interval_contains_open}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{interval\_contains\_open}}}{\emph{interval}, \emph{val}}{} Check, excluding endpoints, whether an interval includes a given value. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{interval}}] \leavevmode{[}sequence of scalar{]} A 2-length sequence, endpoints that define the interval. \item[{\sphinxstylestrong{val}}] \leavevmode{[}scalar{]} Value to check is within interval. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{bool}}] \leavevmode Returns true if given val is within the interval. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{nonsingular() (in module matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.nonsingular}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{nonsingular}}}{\emph{vmin}, \emph{vmax}, \emph{expander=0.001}, \emph{tiny=1e-15}, \emph{increasing=True}}{} Modify the endpoints of a range as needed to avoid singularities. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{vmin, vmax}}] \leavevmode{[}float{]} The initial endpoints. \item[{\sphinxstylestrong{expander}}] \leavevmode{[}float, optional, default: 0.001{]} Fractional amount by which \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} are expanded if the original interval is too small, based on \sphinxstyleemphasis{tiny}. \item[{\sphinxstylestrong{tiny}}] \leavevmode{[}float, optional, default: 1e-15{]} Threshold for the ratio of the interval to the maximum absolute value of its endpoints. If the interval is smaller than this, it will be expanded. This value should be around 1e-15 or larger; otherwise the interval will be approaching the double precision resolution limit. \item[{\sphinxstylestrong{increasing}}] \leavevmode{[}bool, optional, default: True{]} If True, swap \sphinxstyleemphasis{vmin}, \sphinxstyleemphasis{vmax} if \sphinxstyleemphasis{vmin} \textgreater{} \sphinxstyleemphasis{vmax}. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{vmin, vmax}}] \leavevmode{[}float{]} Endpoints, expanded and/or swapped if necessary. If either input is inf or NaN, or if both inputs are 0 or very close to zero, it returns -\sphinxstyleemphasis{expander}, \sphinxstyleemphasis{expander}. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{offset\_copy() (in module matplotlib.transforms)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/transformations:matplotlib.transforms.offset_copy}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.transforms.}}\sphinxbfcode{\sphinxupquote{offset\_copy}}}{\emph{trans}, \emph{fig=None}, \emph{x=0.0}, \emph{y=0.0}, \emph{units='inches'}}{} Return a new transform with an added offset. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{trans}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance{]} Any transform, to which offset will be applied. \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}}, optional, default: None{]} Current figure. It can be None if \sphinxstyleemphasis{units} are ‘dots’. \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}float, optional, default: 0.0{]} Specifies the offset to apply. \item[{\sphinxstylestrong{units}}] \leavevmode{[}\{‘inches’, ‘points’, ‘dots’\}, optional{]} Units of the offset. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{trans}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} instance{]} Transform with applied offset. \end{description} \end{description}\end{quote} \end{fulllineitems} \chapter{triangular grids} \label{\detokenize{api/tri_api:triangular-grids}}\label{\detokenize{api/tri_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.tri}}} \label{\detokenize{api/tri_api:module-matplotlib.tri}}\label{\detokenize{api/tri_api:matplotlib-tri}}\index{matplotlib.tri (module)} Unstructured triangular grid functions. \index{Triangulation (class in matplotlib.tri)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.Triangulation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.tri.}}\sphinxbfcode{\sphinxupquote{Triangulation}}}{\emph{x}, \emph{y}, \emph{triangles=None}, \emph{mask=None}}{} An unstructured triangular grid consisting of npoints points and ntri triangles. The triangles can either be specified by the user or automatically generated using a Delaunay triangulation. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}array\_like of shape (npoints){]} Coordinates of grid points. \item[{\sphinxstylestrong{triangles}}] \leavevmode{[}integer array\_like of shape (ntri, 3), optional{]} For each triangle, the indices of the three points that make up the triangle, ordered in an anticlockwise manner. If not specified, the Delaunay triangulation is calculated. \item[{\sphinxstylestrong{mask}}] \leavevmode{[}boolean array\_like of shape (ntri), optional{]} Which triangles are masked out. \end{description} \end{description}\end{quote} \paragraph{Notes} For a Triangulation to be valid it must not have duplicate points, triangles formed from colinear points, or overlapping triangles. \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{{}`edges{}`}}] \leavevmode \item[{\sphinxstylestrong{{}`neighbors{}`}}] \leavevmode \item[{\sphinxstylestrong{is\_delaunay}}] \leavevmode{[}bool{]} Whether the Triangulation is a calculated Delaunay triangulation (where \sphinxcode{\sphinxupquote{triangles}} was not specified) or not. \end{description} \end{description}\end{quote} \index{calculate\_plane\_coefficients() (matplotlib.tri.Triangulation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.Triangulation.calculate_plane_coefficients}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{calculate\_plane\_coefficients}}}{\emph{z}}{} Calculate plane equation coefficients for all unmasked triangles from the point (x,y) coordinates and specified z-array of shape (npoints). Returned array has shape (npoints,3) and allows z-value at (x,y) position in triangle tri to be calculated using z = array{[}tri,0{]}*x + array{[}tri,1{]}*y + array{[}tri,2{]}. \end{fulllineitems} \index{edges (matplotlib.tri.Triangulation attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.Triangulation.edges}}\pysigline{\sphinxbfcode{\sphinxupquote{edges}}} Return integer array of shape (nedges,2) containing all edges of non-masked triangles. Each edge is the start point index and end point index. Each edge (start,end and end,start) appears only once. \end{fulllineitems} \index{get\_cpp\_triangulation() (matplotlib.tri.Triangulation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.Triangulation.get_cpp_triangulation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_cpp\_triangulation}}}{}{}~ \end{fulllineitems} \index{get\_from\_args\_and\_kwargs() (matplotlib.tri.Triangulation static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.Triangulation.get_from_args_and_kwargs}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{get\_from\_args\_and\_kwargs}}}{\emph{*args}, \emph{**kwargs}}{} Return a Triangulation object from the args and kwargs, and the remaining args and kwargs with the consumed values removed. There are two alternatives: either the first argument is a Triangulation object, in which case it is returned, or the args and kwargs are sufficient to create a new Triangulation to return. In the latter case, see Triangulation.\_\_init\_\_ for the possible args and kwargs. \end{fulllineitems} \index{get\_masked\_triangles() (matplotlib.tri.Triangulation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.Triangulation.get_masked_triangles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_masked\_triangles}}}{}{} Return an array of triangles that are not masked. \end{fulllineitems} \index{get\_trifinder() (matplotlib.tri.Triangulation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.Triangulation.get_trifinder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_trifinder}}}{}{} Return the default {\hyperref[\detokenize{api/tri_api:matplotlib.tri.TriFinder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.tri.TriFinder}}}}} of this triangulation, creating it if necessary. This allows the same TriFinder object to be easily shared. \end{fulllineitems} \index{neighbors (matplotlib.tri.Triangulation attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.Triangulation.neighbors}}\pysigline{\sphinxbfcode{\sphinxupquote{neighbors}}} Return integer array of shape (ntri,3) containing neighbor triangles. For each triangle, the indices of the three triangles that share the same edges, or -1 if there is no such neighboring triangle. neighbors{[}i,j{]} is the triangle that is the neighbor to the edge from point index triangles{[}i,j{]} to point index triangles{[}i,(j+1)\%3{]}. \end{fulllineitems} \index{set\_mask() (matplotlib.tri.Triangulation method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.Triangulation.set_mask}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_mask}}}{\emph{mask}}{} Set or clear the mask array. This is either None, or a boolean array of shape (ntri). \end{fulllineitems} \end{fulllineitems} \index{TriFinder (class in matplotlib.tri)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.TriFinder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.tri.}}\sphinxbfcode{\sphinxupquote{TriFinder}}}{\emph{triangulation}}{} Abstract base class for classes used to find the triangles of a Triangulation in which (x,y) points lie. Rather than instantiate an object of a class derived from TriFinder, it is usually better to use the function {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation.get_trifinder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.tri.Triangulation.get\_trifinder()}}}}}. Derived classes implement \_\_call\_\_(x,y) where x,y are array\_like point coordinates of the same shape. \end{fulllineitems} \index{TrapezoidMapTriFinder (class in matplotlib.tri)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.TrapezoidMapTriFinder}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.tri.}}\sphinxbfcode{\sphinxupquote{TrapezoidMapTriFinder}}}{\emph{triangulation}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.tri.trifinder.TriFinder}} {\hyperref[\detokenize{api/tri_api:matplotlib.tri.TriFinder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TriFinder}}}}} class implemented using the trapezoid map algorithm from the book “Computational Geometry, Algorithms and Applications”, second edition, by M. de Berg, M. van Kreveld, M. Overmars and O. Schwarzkopf. The triangulation must be valid, i.e. it must not have duplicate points, triangles formed from colinear points, or overlapping triangles. The algorithm has some tolerance to triangles formed from colinear points, but this should not be relied upon. \end{fulllineitems} \index{TriInterpolator (class in matplotlib.tri)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.TriInterpolator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.tri.}}\sphinxbfcode{\sphinxupquote{TriInterpolator}}}{\emph{triangulation}, \emph{z}, \emph{trifinder=None}}{} Abstract base class for classes used to perform interpolation on triangular grids. Derived classes implement the following methods: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{\_\_call\_\_(x, y)}} , where x, y are array\_like point coordinates of the same shape, and that returns a masked array of the same shape containing the interpolated z-values. \item {} \sphinxcode{\sphinxupquote{gradient(x, y)}} , where x, y are array\_like point coordinates of the same shape, and that returns a list of 2 masked arrays of the same shape containing the 2 derivatives of the interpolator (derivatives of interpolated z values with respect to x and y). \end{itemize} \end{fulllineitems} \index{LinearTriInterpolator (class in matplotlib.tri)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.LinearTriInterpolator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.tri.}}\sphinxbfcode{\sphinxupquote{LinearTriInterpolator}}}{\emph{triangulation}, \emph{z}, \emph{trifinder=None}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.tri.triinterpolate.TriInterpolator}} A LinearTriInterpolator performs linear interpolation on a triangular grid. Each triangle is represented by a plane so that an interpolated value at point (x,y) lies on the plane of the triangle containing (x,y). Interpolated values are therefore continuous across the triangulation, but their first derivatives are discontinuous at edges between triangles. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{triangulation}}] \leavevmode{[}{\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} object{]} The triangulation to interpolate over. \item[{\sphinxstylestrong{z}}] \leavevmode{[}array\_like of shape (npoints,){]} Array of values, defined at grid points, to interpolate between. \item[{\sphinxstylestrong{trifinder}}] \leavevmode{[}{\hyperref[\detokenize{api/tri_api:matplotlib.tri.TriFinder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TriFinder}}}}} object, optional{]} If this is not specified, the Triangulation’s default TriFinder will be used by calling {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation.get_trifinder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.tri.Triangulation.get\_trifinder()}}}}}. \end{description} \end{description}\end{quote} \paragraph{Methods} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstylestrong{{}`\_\_call\_\_{}` (x, y)} & ( Returns interpolated values at x,y points) \\ \hline \sphinxstylestrong{{}`gradient{}` (x, y)} & (Returns interpolated derivatives at x,y points) \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \index{gradient() (matplotlib.tri.LinearTriInterpolator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.LinearTriInterpolator.gradient}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{gradient}}}{\emph{x}, \emph{y}}{} Returns a list of 2 masked arrays containing interpolated derivatives at the specified x,y points. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}array-like{]} x and y coordinates of the same shape and any number of dimensions. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{dzdx, dzdy}}] \leavevmode{[}np.ma.array{]} 2 masked arrays of the same shape as \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} ; values corresponding to (x,y) points outside of the triangulation are masked out. The first returned array contains the values of $\frac{\partial z}{\partial x}$ and the second those of $\frac{\partial z}{\partial y}$. \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{CubicTriInterpolator (class in matplotlib.tri)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.CubicTriInterpolator}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.tri.}}\sphinxbfcode{\sphinxupquote{CubicTriInterpolator}}}{\emph{triangulation}, \emph{z}, \emph{kind='min\_E'}, \emph{trifinder=None}, \emph{dz=None}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.tri.triinterpolate.TriInterpolator}} A CubicTriInterpolator performs cubic interpolation on triangular grids. In one-dimension - on a segment - a cubic interpolating function is defined by the values of the function and its derivative at both ends. This is almost the same in 2-d inside a triangle, except that the values of the function and its 2 derivatives have to be defined at each triangle node. The CubicTriInterpolator takes the value of the function at each node - provided by the user - and internally computes the value of the derivatives, resulting in a smooth interpolation. (As a special feature, the user can also impose the value of the derivatives at each node, but this is not supposed to be the common usage.) \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{triangulation}}] \leavevmode{[}{\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} object{]} The triangulation to interpolate over. \item[{\sphinxstylestrong{z}}] \leavevmode{[}array\_like of shape (npoints,){]} Array of values, defined at grid points, to interpolate between. \item[{\sphinxstylestrong{kind}}] \leavevmode{[}\{‘min\_E’, ‘geom’, ‘user’\}, optional{]} Choice of the smoothing algorithm, in order to compute the interpolant derivatives (defaults to ‘min\_E’): \begin{itemize} \item {} if ‘min\_E’: (default) The derivatives at each node is computed to minimize a bending energy. \item {} if ‘geom’: The derivatives at each node is computed as a weighted average of relevant triangle normals. To be used for speed optimization (large grids). \item {} if ‘user’: The user provides the argument \sphinxcode{\sphinxupquote{dz}}, no computation is hence needed. \end{itemize} \item[{\sphinxstylestrong{trifinder}}] \leavevmode{[}{\hyperref[\detokenize{api/tri_api:matplotlib.tri.TriFinder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TriFinder}}}}} object, optional{]} If not specified, the Triangulation’s default TriFinder will be used by calling {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation.get_trifinder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.tri.Triangulation.get\_trifinder()}}}}}. \item[{\sphinxstylestrong{dz}}] \leavevmode{[}tuple of array\_likes (dzdx, dzdy), optional{]} Used only if \sphinxstyleemphasis{kind} =’user’. In this case \sphinxstyleemphasis{dz} must be provided as (dzdx, dzdy) where dzdx, dzdy are arrays of the same shape as \sphinxstyleemphasis{z} and are the interpolant first derivatives at the \sphinxstyleemphasis{triangulation} points. \end{description} \end{description}\end{quote} \paragraph{Notes} This note is a bit technical and details the way a {\hyperref[\detokenize{api/tri_api:matplotlib.tri.CubicTriInterpolator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CubicTriInterpolator}}}}} computes a cubic interpolation. The interpolation is based on a Clough-Tocher subdivision scheme of the \sphinxstyleemphasis{triangulation} mesh (to make it clearer, each triangle of the grid will be divided in 3 child-triangles, and on each child triangle the interpolated function is a cubic polynomial of the 2 coordinates). This technique originates from FEM (Finite Element Method) analysis; the element used is a reduced Hsieh-Clough-Tocher (HCT) element. Its shape functions are described in \phantomsection\label{\detokenize{api/tri_api:id1}}{\hyperref[\detokenize{api/tri_api:r0be0c58fd53f-1}]{\sphinxcrossref{{[}1{]}}}}. The assembled function is guaranteed to be C1-smooth, i.e. it is continuous and its first derivatives are also continuous (this is easy to show inside the triangles but is also true when crossing the edges). In the default case (\sphinxstyleemphasis{kind} =’min\_E’), the interpolant minimizes a curvature energy on the functional space generated by the HCT element shape functions - with imposed values but arbitrary derivatives at each node. The minimized functional is the integral of the so-called total curvature (implementation based on an algorithm from \phantomsection\label{\detokenize{api/tri_api:id2}}{\hyperref[\detokenize{api/tri_api:r0be0c58fd53f-2}]{\sphinxcrossref{{[}2{]}}}} - PCG sparse solver): \begin{quote} \begin{equation}E(z) = \ \frac{1}{2} \int_{\Omega} \left(\left( \frac{\partial^2{z}}{\partial{x}^2} \right)^2 +\left( \frac{\partial^2{z}}{\partial{y}^2} \right)^2 +2\left( \frac{\partial^2{z}}{\partial{y}\partial{x}}\right)^2 \right) dx\,dy\end{equation}\end{quote} If the case \sphinxstyleemphasis{kind} =’geom’ is chosen by the user, a simple geometric approximation is used (weighted average of the triangle normal vectors), which could improve speed on very large grids. \paragraph{References} \phantomsection\label{\detokenize{api/tri_api:id3}}{\hyperref[\detokenize{api/tri_api:r0be0c58fd53f-1}]{\sphinxcrossref{{[}1{]}}}}, \phantomsection\label{\detokenize{api/tri_api:id4}}{\hyperref[\detokenize{api/tri_api:r0be0c58fd53f-2}]{\sphinxcrossref{{[}2{]}}}} \paragraph{Methods} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstylestrong{{}`\_\_call\_\_{}` (x, y)} & ( Returns interpolated values at x,y points) \\ \hline \sphinxstylestrong{{}`gradient{}` (x, y)} & (Returns interpolated derivatives at x,y points) \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \index{gradient() (matplotlib.tri.CubicTriInterpolator method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.CubicTriInterpolator.gradient}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{gradient}}}{\emph{x}, \emph{y}}{} Returns a list of 2 masked arrays containing interpolated derivatives at the specified x,y points. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}array-like{]} x and y coordinates of the same shape and any number of dimensions. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{dzdx, dzdy}}] \leavevmode{[}np.ma.array{]} 2 masked arrays of the same shape as \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} ; values corresponding to (x,y) points outside of the triangulation are masked out. The first returned array contains the values of $\frac{\partial z}{\partial x}$ and the second those of $\frac{\partial z}{\partial y}$. \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{TriRefiner (class in matplotlib.tri)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.TriRefiner}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.tri.}}\sphinxbfcode{\sphinxupquote{TriRefiner}}}{\emph{triangulation}}{} Abstract base class for classes implementing mesh refinement. A TriRefiner encapsulates a Triangulation object and provides tools for mesh refinement and interpolation. Derived classes must implements: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{refine\_triangulation(return\_tri\_index=False, **kwargs)}} , where the optional keyword arguments \sphinxstyleemphasis{kwargs} are defined in each TriRefiner concrete implementation, and which returns : \begin{itemize} \item {} a refined triangulation \item {} optionally (depending on \sphinxstyleemphasis{return\_tri\_index}), for each point of the refined triangulation: the index of the initial triangulation triangle to which it belongs. \end{itemize} \item {} \sphinxcode{\sphinxupquote{refine\_field(z, triinterpolator=None, **kwargs)}} , where: \begin{itemize} \item {} \sphinxstyleemphasis{z} array of field values (to refine) defined at the base triangulation nodes \item {} \sphinxstyleemphasis{triinterpolator} is a {\hyperref[\detokenize{api/tri_api:matplotlib.tri.TriInterpolator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TriInterpolator}}}}} (optional) \item {} the other optional keyword arguments \sphinxstyleemphasis{kwargs} are defined in each TriRefiner concrete implementation \end{itemize} and which returns (as a tuple) a refined triangular mesh and the interpolated values of the field at the refined triangulation nodes. \end{itemize} \end{fulllineitems} \index{UniformTriRefiner (class in matplotlib.tri)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.UniformTriRefiner}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.tri.}}\sphinxbfcode{\sphinxupquote{UniformTriRefiner}}}{\emph{triangulation}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.tri.trirefine.TriRefiner}} Uniform mesh refinement by recursive subdivisions. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{triangulation}}] \leavevmode{[}{\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}}{]} The encapsulated triangulation (to be refined) \end{description} \end{description}\end{quote} \index{refine\_field() (matplotlib.tri.UniformTriRefiner method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.UniformTriRefiner.refine_field}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{refine\_field}}}{\emph{z}, \emph{triinterpolator=None}, \emph{subdiv=3}}{} Refines a field defined on the encapsulated triangulation. Returns \sphinxstyleemphasis{refi\_tri} (refined triangulation), \sphinxstyleemphasis{refi\_z} (interpolated values of the field at the node of the refined triangulation). \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{z}}] \leavevmode{[}1d-array-like of length \sphinxcode{\sphinxupquote{n\_points}}{]} Values of the field to refine, defined at the nodes of the encapsulated triangulation. (\sphinxcode{\sphinxupquote{n\_points}} is the number of points in the initial triangulation) \item[{\sphinxstylestrong{triinterpolator}}] \leavevmode{[}{\hyperref[\detokenize{api/tri_api:matplotlib.tri.TriInterpolator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TriInterpolator}}}}}, optional{]} Interpolator used for field interpolation. If not specified, a {\hyperref[\detokenize{api/tri_api:matplotlib.tri.CubicTriInterpolator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{CubicTriInterpolator}}}}} will be used. \item[{\sphinxstylestrong{subdiv}}] \leavevmode{[}integer, optional{]} Recursion level for the subdivision. Defaults to 3. Each triangle will be divided into \sphinxcode{\sphinxupquote{4**subdiv}} child triangles. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{refi\_tri}}] \leavevmode{[}{\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} object{]} The returned refined triangulation \item[{\sphinxstylestrong{refi\_z}}] \leavevmode{[}1d array of length: \sphinxstyleemphasis{refi\_tri} node count.{]} The returned interpolated field (at \sphinxstyleemphasis{refi\_tri} nodes) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{refine\_triangulation() (matplotlib.tri.UniformTriRefiner method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.UniformTriRefiner.refine_triangulation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{refine\_triangulation}}}{\emph{return\_tri\_index=False}, \emph{subdiv=3}}{} Computes an uniformly refined triangulation \sphinxstyleemphasis{refi\_triangulation} of the encapsulated \sphinxcode{\sphinxupquote{triangulation}}. This function refines the encapsulated triangulation by splitting each father triangle into 4 child sub-triangles built on the edges midside nodes, recursively (level of recursion \sphinxstyleemphasis{subdiv}). In the end, each triangle is hence divided into \sphinxcode{\sphinxupquote{4**subdiv}} child triangles. The default value for \sphinxstyleemphasis{subdiv} is 3 resulting in 64 refined subtriangles for each triangle of the initial triangulation. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{return\_tri\_index}}] \leavevmode{[}boolean, optional{]} Boolean indicating whether an index table indicating the father triangle index of each point will be returned. Default value False. \item[{\sphinxstylestrong{subdiv}}] \leavevmode{[}integer, optional{]} Recursion level for the subdivision. Defaults value 3. Each triangle will be divided into \sphinxcode{\sphinxupquote{4**subdiv}} child triangles. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{refi\_triangulation}}] \leavevmode{[}{\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}}{]} The returned refined triangulation \item[{\sphinxstylestrong{found\_index}}] \leavevmode{[}array-like of integers{]} Index of the initial triangulation containing triangle, for each point of \sphinxstyleemphasis{refi\_triangulation}. Returned only if \sphinxstyleemphasis{return\_tri\_index} is set to True. \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{TriAnalyzer (class in matplotlib.tri)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.TriAnalyzer}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.tri.}}\sphinxbfcode{\sphinxupquote{TriAnalyzer}}}{\emph{triangulation}}{} Define basic tools for triangular mesh analysis and improvement. A TriAnalizer encapsulates a {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} object and provides basic tools for mesh analysis and mesh improvement. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{triangulation}}] \leavevmode{[}{\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} object{]} The encapsulated triangulation to analyze. \end{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{{}`scale\_factors{}`}}] \leavevmode \end{description} \end{description}\end{quote} \index{circle\_ratios() (matplotlib.tri.TriAnalyzer method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.TriAnalyzer.circle_ratios}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{circle\_ratios}}}{\emph{rescale=True}}{} Returns a measure of the triangulation triangles flatness. The ratio of the incircle radius over the circumcircle radius is a widely used indicator of a triangle flatness. It is always \sphinxcode{\sphinxupquote{\textless{}= 0.5}} and \sphinxcode{\sphinxupquote{== 0.5}} only for equilateral triangles. Circle ratios below 0.01 denote very flat triangles. To avoid unduly low values due to a difference of scale between the 2 axis, the triangular mesh can first be rescaled to fit inside a unit square with {\hyperref[\detokenize{api/tri_api:matplotlib.tri.TriAnalyzer.scale_factors}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scale\_factors}}}}} (Only if \sphinxstyleemphasis{rescale} is True, which is its default value). \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rescale}}] \leavevmode{[}boolean, optional{]} If True, a rescaling will be internally performed (based on {\hyperref[\detokenize{api/tri_api:matplotlib.tri.TriAnalyzer.scale_factors}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scale\_factors}}}}}, so that the (unmasked) triangles fit exactly inside a unit square mesh. Default is True. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{circle\_ratios}}] \leavevmode{[}masked array{]} Ratio of the incircle radius over the circumcircle radius, for each ‘rescaled’ triangle of the encapsulated triangulation. Values corresponding to masked triangles are masked out. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{get\_flat\_tri\_mask() (matplotlib.tri.TriAnalyzer method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.TriAnalyzer.get_flat_tri_mask}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_flat\_tri\_mask}}}{\emph{min\_circle\_ratio=0.01}, \emph{rescale=True}}{} Eliminates excessively flat border triangles from the triangulation. Returns a mask \sphinxstyleemphasis{new\_mask} which allows to clean the encapsulated triangulation from its border-located flat triangles (according to their {\hyperref[\detokenize{api/tri_api:matplotlib.tri.TriAnalyzer.circle_ratios}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{circle\_ratios()}}}}}). This mask is meant to be subsequently applied to the triangulation using {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation.set_mask}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.tri.Triangulation.set\_mask()}}}}} . \sphinxstyleemphasis{new\_mask} is an extension of the initial triangulation mask in the sense that an initially masked triangle will remain masked. The \sphinxstyleemphasis{new\_mask} array is computed recursively ; at each step flat triangles are removed only if they share a side with the current mesh border. Thus no new holes in the triangulated domain will be created. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{min\_circle\_ratio}}] \leavevmode{[}float, optional{]} Border triangles with incircle/circumcircle radii ratio r/R will be removed if r/R \textless{} \sphinxstyleemphasis{min\_circle\_ratio}. Default value: 0.01 \item[{\sphinxstylestrong{rescale}}] \leavevmode{[}boolean, optional{]} If True, a rescaling will first be internally performed (based on {\hyperref[\detokenize{api/tri_api:matplotlib.tri.TriAnalyzer.scale_factors}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scale\_factors}}}}} ), so that the (unmasked) triangles fit exactly inside a unit square mesh. This rescaling accounts for the difference of scale which might exist between the 2 axis. Default (and recommended) value is True. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{new\_mask}}] \leavevmode{[}array-like of booleans{]} Mask to apply to encapsulated triangulation. All the initially masked triangles remain masked in the \sphinxstyleemphasis{new\_mask}. \end{description} \end{description}\end{quote} \paragraph{Notes} The rationale behind this function is that a Delaunay triangulation - of an unstructured set of points - sometimes contains almost flat triangles at its border, leading to artifacts in plots (especially for high-resolution contouring). Masked with computed \sphinxstyleemphasis{new\_mask}, the encapsulated triangulation would contain no more unmasked border triangles with a circle ratio below \sphinxstyleemphasis{min\_circle\_ratio}, thus improving the mesh quality for subsequent plots or interpolation. \end{fulllineitems} \index{scale\_factors (matplotlib.tri.TriAnalyzer attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/tri_api:matplotlib.tri.TriAnalyzer.scale_factors}}\pysigline{\sphinxbfcode{\sphinxupquote{scale\_factors}}} Factors to rescale the triangulation into a unit square. Returns \sphinxstyleemphasis{k}, tuple of 2 scale factors. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{k}}] \leavevmode{[}tuple of 2 floats (kx, ky){]} Tuple of floats that would rescale the triangulation : \sphinxcode{\sphinxupquote{{[}triangulation.x * kx, triangulation.y * ky{]}}} fits exactly inside a unit square. \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \chapter{type1font} \label{\detokenize{api/type1font:type1font}}\label{\detokenize{api/type1font::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.type1font}}} \label{\detokenize{api/type1font:module-matplotlib.type1font}}\label{\detokenize{api/type1font:matplotlib-type1font}}\index{matplotlib.type1font (module)} This module contains a class representing a Type 1 font. This version reads pfa and pfb files and splits them for embedding in pdf files. It also supports SlantFont and ExtendFont transformations, similarly to pdfTeX and friends. There is no support yet for subsetting. Usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{font} \PYG{o}{=} \PYG{n}{Type1Font}\PYG{p}{(}\PYG{n}{filename}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{clear\PYGZus{}part}\PYG{p}{,} \PYG{n}{encrypted\PYGZus{}part}\PYG{p}{,} \PYG{n}{finale} \PYG{o}{=} \PYG{n}{font}\PYG{o}{.}\PYG{n}{parts} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{slanted\PYGZus{}font} \PYG{o}{=} \PYG{n}{font}\PYG{o}{.}\PYG{n}{transform}\PYG{p}{(}\PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{slant}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{0.167}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{extended\PYGZus{}font} \PYG{o}{=} \PYG{n}{font}\PYG{o}{.}\PYG{n}{transform}\PYG{p}{(}\PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{extend}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+m+mf}{1.2}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \end{sphinxVerbatim} Sources: \begin{itemize} \item {} Adobe Technical Note \#5040, Supporting Downloadable PostScript Language Fonts. \item {} Adobe Type 1 Font Format, Adobe Systems Incorporated, third printing, v1.1, 1993. ISBN 0-201-57044-0. \end{itemize} \index{Type1Font (class in matplotlib.type1font)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/type1font:matplotlib.type1font.Type1Font}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.type1font.}}\sphinxbfcode{\sphinxupquote{Type1Font}}}{\emph{input}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} A class representing a Type-1 font, for use by backends. \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{parts}}] \leavevmode{[}tuple{]} A 3-tuple of the cleartext part, the encrypted part, and the finale of zeros. \item[{\sphinxstylestrong{prop}}] \leavevmode{[}Dict{[}str, Any{]}{]} A dictionary of font properties. \end{description} \end{description}\end{quote} Initialize a Type-1 font. \sphinxstyleemphasis{input} can be either the file name of a pfb file or a 3-tuple of already-decoded Type-1 font parts. \index{parts (matplotlib.type1font.Type1Font attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/type1font:matplotlib.type1font.Type1Font.parts}}\pysigline{\sphinxbfcode{\sphinxupquote{parts}}}~ \end{fulllineitems} \index{prop (matplotlib.type1font.Type1Font attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/type1font:matplotlib.type1font.Type1Font.prop}}\pysigline{\sphinxbfcode{\sphinxupquote{prop}}}~ \end{fulllineitems} \index{transform() (matplotlib.type1font.Type1Font method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/type1font:matplotlib.type1font.Type1Font.transform}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{transform}}}{\emph{effects}}{} Transform the font by slanting or extending. \sphinxstyleemphasis{effects} should be a dict where \sphinxcode{\sphinxupquote{effects{[}'slant'{]}}} is the tangent of the angle that the font is to be slanted to the right (so negative values slant to the left) and \sphinxcode{\sphinxupquote{effects{[}'extend'{]}}} is the multiplier by which the font is to be extended (so values less than 1.0 condense). Returns a new {\hyperref[\detokenize{api/type1font:matplotlib.type1font.Type1Font}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Type1Font}}}}} object. \end{fulllineitems} \end{fulllineitems} \index{ord() (in module matplotlib.type1font)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/type1font:matplotlib.type1font.ord}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.type1font.}}\sphinxbfcode{\sphinxupquote{ord}}}{\emph{x}}{}~ \end{fulllineitems} \chapter{units} \label{\detokenize{api/units_api:units}}\label{\detokenize{api/units_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.units}}} \label{\detokenize{api/units_api:module-matplotlib.units}}\label{\detokenize{api/units_api:matplotlib-units}}\index{matplotlib.units (module)} The classes here provide support for using custom classes with Matplotlib, e.g., those that do not expose the array interface but know how to convert themselves to arrays. It also supports classes with units and units conversion. Use cases include converters for custom objects, e.g., a list of datetime objects, as well as for objects that are unit aware. We don’t assume any particular units implementation; rather a units implementation must provide the register with the Registry converter dictionary and a {\hyperref[\detokenize{api/units_api:matplotlib.units.ConversionInterface}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ConversionInterface}}}}}. For example, here is a complete implementation which supports plotting with native datetime objects: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{units} \PYG{k}{as} \PYG{n+nn}{units} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{dates} \PYG{k}{as} \PYG{n+nn}{dates} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{ticker} \PYG{k}{as} \PYG{n+nn}{ticker} \PYG{k+kn}{import} \PYG{n+nn}{datetime} \PYG{k}{class} \PYG{n+nc}{DateConverter}\PYG{p}{(}\PYG{n}{units}\PYG{o}{.}\PYG{n}{ConversionInterface}\PYG{p}{)}\PYG{p}{:} \PYG{n+nd}{@staticmethod} \PYG{k}{def} \PYG{n+nf}{convert}\PYG{p}{(}\PYG{n}{value}\PYG{p}{,} \PYG{n}{unit}\PYG{p}{,} \PYG{n}{axis}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Convert a datetime value to a scalar or array}\PYG{l+s+s1}{\PYGZsq{}} \PYG{k}{return} \PYG{n}{dates}\PYG{o}{.}\PYG{n}{date2num}\PYG{p}{(}\PYG{n}{value}\PYG{p}{)} \PYG{n+nd}{@staticmethod} \PYG{k}{def} \PYG{n+nf}{axisinfo}\PYG{p}{(}\PYG{n}{unit}\PYG{p}{,} \PYG{n}{axis}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Return major and minor tick locators and formatters}\PYG{l+s+s1}{\PYGZsq{}} \PYG{k}{if} \PYG{n}{unit}\PYG{o}{!=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{k}{return} \PYG{k+kc}{None} \PYG{n}{majloc} \PYG{o}{=} \PYG{n}{dates}\PYG{o}{.}\PYG{n}{AutoDateLocator}\PYG{p}{(}\PYG{p}{)} \PYG{n}{majfmt} \PYG{o}{=} \PYG{n}{dates}\PYG{o}{.}\PYG{n}{AutoDateFormatter}\PYG{p}{(}\PYG{n}{majloc}\PYG{p}{)} \PYG{k}{return} \PYG{n}{AxisInfo}\PYG{p}{(}\PYG{n}{majloc}\PYG{o}{=}\PYG{n}{majloc}\PYG{p}{,} \PYG{n}{majfmt}\PYG{o}{=}\PYG{n}{majfmt}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n+nd}{@staticmethod} \PYG{k}{def} \PYG{n+nf}{default\PYGZus{}units}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{axis}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Return the default unit for x or None}\PYG{l+s+s1}{\PYGZsq{}} \PYG{k}{return} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date}\PYG{l+s+s1}{\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} Finally we register our object type with the Matplotlib units registry.} \PYG{n}{units}\PYG{o}{.}\PYG{n}{registry}\PYG{p}{[}\PYG{n}{datetime}\PYG{o}{.}\PYG{n}{date}\PYG{p}{]} \PYG{o}{=} \PYG{n}{DateConverter}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \index{AxisInfo (class in matplotlib.units)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/units_api:matplotlib.units.AxisInfo}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.units.}}\sphinxbfcode{\sphinxupquote{AxisInfo}}}{\emph{majloc=None}, \emph{minloc=None}, \emph{majfmt=None}, \emph{minfmt=None}, \emph{label=None}, \emph{default\_limits=None}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Information to support default axis labeling, tick labeling, and default limits. An instance of this class must be returned by {\hyperref[\detokenize{api/units_api:matplotlib.units.ConversionInterface.axisinfo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ConversionInterface.axisinfo()}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{majloc, minloc}}] \leavevmode{[}Locator, optional{]} Tick locators for the major and minor ticks. \item[{\sphinxstylestrong{majfmt, minfmt}}] \leavevmode{[}Formatter, optional{]} Tick formatters for the major and minor ticks. \item[{\sphinxstylestrong{label}}] \leavevmode{[}str, optional{]} The default axis label. \item[{\sphinxstylestrong{default\_limits}}] \leavevmode{[}optional{]} The default min and max limits of the axis if no data has been plotted. \end{description} \end{description}\end{quote} \paragraph{Notes} If any of the above are \sphinxcode{\sphinxupquote{None}}, the axis will simply use the default value. \end{fulllineitems} \index{ConversionInterface (class in matplotlib.units)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/units_api:matplotlib.units.ConversionInterface}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.units.}}\sphinxbfcode{\sphinxupquote{ConversionInterface}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} The minimal interface for a converter to take custom data types (or sequences) and convert them to values Matplotlib can use. \index{axisinfo() (matplotlib.units.ConversionInterface static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/units_api:matplotlib.units.ConversionInterface.axisinfo}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{axisinfo}}}{\emph{unit}, \emph{axis}}{} Return an \sphinxcode{\sphinxupquote{AxisInfo}} instance for the axis with the specified units. \end{fulllineitems} \index{convert() (matplotlib.units.ConversionInterface static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/units_api:matplotlib.units.ConversionInterface.convert}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{convert}}}{\emph{obj}, \emph{unit}, \emph{axis}}{} Convert \sphinxstyleemphasis{obj} using \sphinxstyleemphasis{unit} for the specified \sphinxstyleemphasis{axis}. If \sphinxstyleemphasis{obj} is a sequence, return the converted sequence. The output must be a sequence of scalars that can be used by the numpy array layer. \end{fulllineitems} \index{default\_units() (matplotlib.units.ConversionInterface static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/units_api:matplotlib.units.ConversionInterface.default_units}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{default\_units}}}{\emph{x}, \emph{axis}}{} Return the default unit for \sphinxstyleemphasis{x} or \sphinxcode{\sphinxupquote{None}} for the given axis. \end{fulllineitems} \index{is\_numlike() (matplotlib.units.ConversionInterface static method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/units_api:matplotlib.units.ConversionInterface.is_numlike}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{static }}\sphinxbfcode{\sphinxupquote{is\_numlike}}}{\emph{x}}{} The Matplotlib datalim, autoscaling, locators etc work with scalars which are the units converted to floats given the current unit. The converter may be passed these floats, or arrays of them, even when units are set. \end{fulllineitems} \end{fulllineitems} \index{Registry (class in matplotlib.units)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/units_api:matplotlib.units.Registry}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.units.}}\sphinxbfcode{\sphinxupquote{Registry}}} Bases: \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#dict}{\sphinxcode{\sphinxupquote{dict}}} A register that maps types to conversion interfaces. \index{get\_converter() (matplotlib.units.Registry method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/units_api:matplotlib.units.Registry.get_converter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_converter}}}{\emph{x}}{} Get the converter for data that has the same type as \sphinxstyleemphasis{x}. If no converters are registered for \sphinxstyleemphasis{x}, returns \sphinxcode{\sphinxupquote{None}}. \end{fulllineitems} \end{fulllineitems} \chapter{widgets} \label{\detokenize{api/widgets_api:widgets}}\label{\detokenize{api/widgets_api::doc}} \section{\sphinxstyleliteralintitle{\sphinxupquote{matplotlib.widgets}}} \label{\detokenize{api/widgets_api:module-matplotlib.widgets}}\label{\detokenize{api/widgets_api:matplotlib-widgets}}\index{matplotlib.widgets (module)} \subsection{GUI neutral widgets} \label{\detokenize{api/widgets_api:gui-neutral-widgets}} Widgets that are designed to work for any of the GUI backends. All of these widgets require you to predefine a {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} instance and pass that as the first arg. matplotlib doesn’t try to be too smart with respect to layout \textendash{} you will have to figure out how wide and tall you want your Axes to be to accommodate your widget. \index{AxesWidget (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.AxesWidget}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{AxesWidget}}}{\emph{ax}}{} Bases: {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.Widget}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.widgets.Widget}}}}} Widget that is connected to a single {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}. To guarantee that the widget remains responsive and not garbage-collected, a reference to the object should be maintained by the user. This is necessary because the callback registry maintains only weak-refs to the functions, which are member functions of the widget. If there are no references to the widget object it may be garbage collected which will disconnect the callbacks. Attributes: \begin{description} \item[{\sphinxstyleemphasis{ax}}] \leavevmode{[}{\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}{]} The parent axes for the widget \item[{\sphinxstyleemphasis{canvas}}] \leavevmode{[}{\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.FigureCanvasBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FigureCanvasBase}}}}} subclass{]} The parent figure canvas for the widget. \item[{\sphinxstyleemphasis{active}}] \leavevmode{[}bool{]} If False, the widget does not respond to events. \end{description} \index{connect\_event() (matplotlib.widgets.AxesWidget method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.AxesWidget.connect_event}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{connect\_event}}}{\emph{event}, \emph{callback}}{} Connect callback with an event. This should be used in lieu of \sphinxcode{\sphinxupquote{figure.canvas.mpl\_connect}} since this function stores callback ids for later clean up. \end{fulllineitems} \index{disconnect\_events() (matplotlib.widgets.AxesWidget method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.AxesWidget.disconnect_events}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{disconnect\_events}}}{}{} Disconnect all events created by this widget. \end{fulllineitems} \end{fulllineitems} \index{Button (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Button}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{Button}}}{\emph{ax}, \emph{label}, \emph{image=None}, \emph{color='0.85'}, \emph{hovercolor='0.95'}}{} Bases: {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.AxesWidget}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.widgets.AxesWidget}}}}} A GUI neutral button. For the button to remain responsive you must keep a reference to it. Call {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.Button.on_clicked}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{on\_clicked()}}}}} to connect to the button. \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ax :}}] \leavevmode The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} the button renders into. \item[{\sphinxstylestrong{label :}}] \leavevmode A {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}} instance. \item[{\sphinxstylestrong{color :}}] \leavevmode The color of the button when not hovering. \item[{\sphinxstylestrong{hovercolor :}}] \leavevmode The color of the button when hovering. \end{description} \end{description}\end{quote} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ax}}] \leavevmode{[}matplotlib.axes.Axes{]} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} instance the button will be placed into. \item[{\sphinxstylestrong{label}}] \leavevmode{[}str{]} The button text. Accepts string. \item[{\sphinxstylestrong{image}}] \leavevmode{[}array, mpl image, Pillow Image{]} The image to place in the button, if not \sphinxstyleemphasis{None}. Can be any legal arg to imshow (numpy array, matplotlib Image instance, or Pillow Image). \item[{\sphinxstylestrong{color}}] \leavevmode{[}color{]} The color of the button when not activated \item[{\sphinxstylestrong{hovercolor}}] \leavevmode{[}color{]} The color of the button when the mouse is over it \end{description} \end{description}\end{quote} \index{disconnect() (matplotlib.widgets.Button method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Button.disconnect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{disconnect}}}{\emph{cid}}{} remove the observer with connection id \sphinxstyleemphasis{cid} \end{fulllineitems} \index{on\_clicked() (matplotlib.widgets.Button method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Button.on_clicked}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{on\_clicked}}}{\emph{func}}{} When the button is clicked, call this \sphinxstyleemphasis{func} with event. A connection id is returned. It can be used to disconnect the button from its callback. \end{fulllineitems} \end{fulllineitems} \index{CheckButtons (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.CheckButtons}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{CheckButtons}}}{\emph{ax}, \emph{labels}, \emph{actives}}{} Bases: {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.AxesWidget}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.widgets.AxesWidget}}}}} A GUI neutral set of check buttons. For the check buttons to remain responsive you must keep a reference to this object. The following attributes are exposed \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{ax}}] \leavevmode The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} instance the buttons are located in \item[{\sphinxstyleemphasis{labels}}] \leavevmode List of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}} instances \item[{\sphinxstyleemphasis{lines}}] \leavevmode List of (line1, line2) tuples for the x’s in the check boxes. These lines exist for each box, but have \sphinxcode{\sphinxupquote{set\_visible(False)}} when its box is not checked. \item[{\sphinxstyleemphasis{rectangles}}] \leavevmode List of {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.Rectangle}}}}} instances \end{description} \end{quote} Connect to the CheckButtons with the {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.CheckButtons.on_clicked}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{on\_clicked()}}}}} method Add check buttons to {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} instance \sphinxstyleemphasis{ax} \begin{description} \item[{\sphinxstyleemphasis{labels}}] \leavevmode A len(buttons) list of labels as strings \item[{\sphinxstyleemphasis{actives}}] \leavevmode\begin{description} \item[{A len(buttons) list of booleans indicating whether}] \leavevmode the button is active \end{description} \end{description} \index{disconnect() (matplotlib.widgets.CheckButtons method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.CheckButtons.disconnect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{disconnect}}}{\emph{cid}}{} remove the observer with connection id \sphinxstyleemphasis{cid} \end{fulllineitems} \index{get\_status() (matplotlib.widgets.CheckButtons method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.CheckButtons.get_status}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_status}}}{}{} returns a tuple of the status (True/False) of all of the check buttons \end{fulllineitems} \index{on\_clicked() (matplotlib.widgets.CheckButtons method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.CheckButtons.on_clicked}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{on\_clicked}}}{\emph{func}}{} When the button is clicked, call \sphinxstyleemphasis{func} with button label A connection id is returned which can be used to disconnect \end{fulllineitems} \index{set\_active() (matplotlib.widgets.CheckButtons method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.CheckButtons.set_active}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_active}}}{\emph{index}}{} Directly (de)activate a check button by index. \begin{description} \item[{\sphinxstyleemphasis{index} is an index into the original label list}] \leavevmode that this object was constructed with. Raises ValueError if \sphinxstyleemphasis{index} is invalid. \end{description} Callbacks will be triggered if \sphinxcode{\sphinxupquote{eventson}} is True. \end{fulllineitems} \end{fulllineitems} \index{Cursor (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Cursor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{Cursor}}}{\emph{ax}, \emph{horizOn=True}, \emph{vertOn=True}, \emph{useblit=False}, \emph{**lineprops}}{} Bases: {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.AxesWidget}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.widgets.AxesWidget}}}}} A horizontal and vertical line that spans the axes and moves with the pointer. You can turn off the hline or vline respectively with the following attributes: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{horizOn}}] \leavevmode Controls the visibility of the horizontal line \item[{\sphinxstyleemphasis{vertOn}}] \leavevmode Controls the visibility of the horizontal line \end{description} \end{quote} and the visibility of the cursor itself with the \sphinxstyleemphasis{visible} attribute. For the cursor to remain responsive you must keep a reference to it. Add a cursor to \sphinxstyleemphasis{ax}. If \sphinxcode{\sphinxupquote{useblit=True}}, use the backend-dependent blitting features for faster updates. \sphinxstyleemphasis{lineprops} is a dictionary of line properties. \index{clear() (matplotlib.widgets.Cursor method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Cursor.clear}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{clear}}}{\emph{event}}{} clear the cursor \end{fulllineitems} \index{onmove() (matplotlib.widgets.Cursor method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Cursor.onmove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{onmove}}}{\emph{event}}{} on mouse motion draw the cursor if visible \end{fulllineitems} \end{fulllineitems} \index{EllipseSelector (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.EllipseSelector}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{EllipseSelector}}}{\emph{ax}, \emph{onselect}, \emph{drawtype='box'}, \emph{minspanx=None}, \emph{minspany=None}, \emph{useblit=False}, \emph{lineprops=None}, \emph{rectprops=None}, \emph{spancoords='data'}, \emph{button=None}, \emph{maxdist=10}, \emph{marker\_props=None}, \emph{interactive=False}, \emph{state\_modifier\_keys=None}}{} Bases: {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.RectangleSelector}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.widgets.RectangleSelector}}}}} Select an elliptical region of an axes. For the cursor to remain responsive you must keep a reference to it. Example usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{widgets} \PYG{k}{import} \PYG{n}{EllipseSelector} \PYG{k+kn}{from} \PYG{n+nn}{pylab} \PYG{k}{import} \PYG{o}{*} \PYG{k}{def} \PYG{n+nf}{onselect}\PYG{p}{(}\PYG{n}{eclick}\PYG{p}{,} \PYG{n}{erelease}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{eclick and erelease are matplotlib events at press and release}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ startposition : (}\PYG{l+s+si}{\PYGZpc{}f}\PYG{l+s+s1}{, }\PYG{l+s+si}{\PYGZpc{}f}\PYG{l+s+s1}{)}\PYG{l+s+s1}{\PYGZsq{}} \PYG{o}{\PYGZpc{}} \PYG{p}{(}\PYG{n}{eclick}\PYG{o}{.}\PYG{n}{xdata}\PYG{p}{,} \PYG{n}{eclick}\PYG{o}{.}\PYG{n}{ydata}\PYG{p}{)}\PYG{p}{)} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ endposition : (}\PYG{l+s+si}{\PYGZpc{}f}\PYG{l+s+s1}{, }\PYG{l+s+si}{\PYGZpc{}f}\PYG{l+s+s1}{)}\PYG{l+s+s1}{\PYGZsq{}} \PYG{o}{\PYGZpc{}} \PYG{p}{(}\PYG{n}{erelease}\PYG{o}{.}\PYG{n}{xdata}\PYG{p}{,} \PYG{n}{erelease}\PYG{o}{.}\PYG{n}{ydata}\PYG{p}{)}\PYG{p}{)} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ used button : }\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{eclick}\PYG{o}{.}\PYG{n}{button}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{toggle\PYGZus{}selector}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ Key pressed.}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k}{if} \PYG{n}{event}\PYG{o}{.}\PYG{n}{key} \PYG{o+ow}{in} \PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Q}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{q}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o+ow}{and} \PYG{n}{toggle\PYGZus{}selector}\PYG{o}{.}\PYG{n}{ES}\PYG{o}{.}\PYG{n}{active}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ EllipseSelector deactivated.}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{toggle\PYGZus{}selector}\PYG{o}{.}\PYG{n}{RS}\PYG{o}{.}\PYG{n}{set\PYGZus{}active}\PYG{p}{(}\PYG{k+kc}{False}\PYG{p}{)} \PYG{k}{if} \PYG{n}{event}\PYG{o}{.}\PYG{n}{key} \PYG{o+ow}{in} \PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{A}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{a}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o+ow}{and} \PYG{o+ow}{not} \PYG{n}{toggle\PYGZus{}selector}\PYG{o}{.}\PYG{n}{ES}\PYG{o}{.}\PYG{n}{active}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ EllipseSelector activated.}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{toggle\PYGZus{}selector}\PYG{o}{.}\PYG{n}{ES}\PYG{o}{.}\PYG{n}{set\PYGZus{}active}\PYG{p}{(}\PYG{k+kc}{True}\PYG{p}{)} \PYG{n}{x} \PYG{o}{=} \PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{)}\PYG{o}{/}\PYG{p}{(}\PYG{l+m+mf}{99.0}\PYG{p}{)} \PYG{n}{y} \PYG{o}{=} \PYG{n}{sin}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{figure} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,}\PYG{n}{y}\PYG{p}{)} \PYG{n}{toggle\PYGZus{}selector}\PYG{o}{.}\PYG{n}{ES} \PYG{o}{=} \PYG{n}{EllipseSelector}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{onselect}\PYG{p}{,} \PYG{n}{drawtype}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{line}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{key\PYGZus{}press\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{toggle\PYGZus{}selector}\PYG{p}{)} \PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} Create a selector in \sphinxstyleemphasis{ax}. When a selection is made, clear the span and call onselect with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{onselect}\PYG{p}{(}\PYG{n}{pos\PYGZus{}1}\PYG{p}{,} \PYG{n}{pos\PYGZus{}2}\PYG{p}{)} \end{sphinxVerbatim} and clear the drawn box/line. The \sphinxcode{\sphinxupquote{pos\_1}} and \sphinxcode{\sphinxupquote{pos\_2}} are arrays of length 2 containing the x- and y-coordinate. If \sphinxstyleemphasis{minspanx} is not \sphinxstyleemphasis{None} then events smaller than \sphinxstyleemphasis{minspanx} in x direction are ignored (it’s the same for y). The rectangle is drawn with \sphinxstyleemphasis{rectprops}; default: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{rectprops} \PYG{o}{=} \PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{edgecolor} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{black}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{n}{fill}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)} \end{sphinxVerbatim} The line is drawn with \sphinxstyleemphasis{lineprops}; default: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{lineprops} \PYG{o}{=} \PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{black}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linestyle}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linewidth} \PYG{o}{=} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \end{sphinxVerbatim} Use \sphinxstyleemphasis{drawtype} if you want the mouse to draw a line, a box or nothing between click and actual position by setting \sphinxcode{\sphinxupquote{drawtype = 'line'}}, \sphinxcode{\sphinxupquote{drawtype='box'}} or \sphinxcode{\sphinxupquote{drawtype = 'none'}}. Drawing a line would result in a line from vertex A to vertex C in a rectangle ABCD. \sphinxstyleemphasis{spancoords} is one of ‘data’ or ‘pixels’. If ‘data’, \sphinxstyleemphasis{minspanx} and \sphinxstyleemphasis{minspanx} will be interpreted in the same coordinates as the x and y axis. If ‘pixels’, they are in pixels. \sphinxstyleemphasis{button} is a list of integers indicating which mouse buttons should be used for rectangle selection. You can also specify a single integer if only a single button is desired. Default is \sphinxstyleemphasis{None}, which does not limit which button can be used. \begin{description} \item[{Note, typically:}] \leavevmode 1 = left mouse button 2 = center mouse button (scroll wheel) 3 = right mouse button \end{description} \sphinxstyleemphasis{interactive} will draw a set of handles and allow you interact with the widget after it is drawn. \sphinxstyleemphasis{state\_modifier\_keys} are keyboard modifiers that affect the behavior of the widget. The defaults are: dict(move=’ ‘, clear=’escape’, square=’shift’, center=’ctrl’) Keyboard modifiers, which: ‘move’: Move the existing shape. ‘clear’: Clear the current shape. ‘square’: Makes the shape square. ‘center’: Make the initial point the center of the shape. ‘square’ and ‘center’ can be combined. \index{draw\_shape() (matplotlib.widgets.EllipseSelector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.EllipseSelector.draw_shape}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_shape}}}{\emph{extents}}{}~ \end{fulllineitems} \end{fulllineitems} \index{Lasso (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Lasso}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{Lasso}}}{\emph{ax}, \emph{xy}, \emph{callback=None}, \emph{useblit=True}}{} Bases: {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.AxesWidget}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.widgets.AxesWidget}}}}} Selection curve of an arbitrary shape. The selected path can be used in conjunction with {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.contains_point}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains\_point()}}}}} to select data points from an image. Unlike {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.LassoSelector}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LassoSelector}}}}}, this must be initialized with a starting point \sphinxcode{\sphinxupquote{xy}}, and the {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.Lasso}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Lasso}}}}} events are destroyed upon release. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ax}}] \leavevmode{[}{\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}{]} The parent axes for the widget. \item[{\sphinxstylestrong{xy}}] \leavevmode{[}array{]} Coordinates of the start of the lasso. \item[{\sphinxstylestrong{callback}}] \leavevmode{[}callable{]} Whenever the lasso is released, the \sphinxcode{\sphinxupquote{callback}} function is called and passed the vertices of the selected path. \end{description} \end{description}\end{quote} \index{onmove() (matplotlib.widgets.Lasso method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Lasso.onmove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{onmove}}}{\emph{event}}{}~ \end{fulllineitems} \index{onrelease() (matplotlib.widgets.Lasso method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Lasso.onrelease}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{onrelease}}}{\emph{event}}{}~ \end{fulllineitems} \end{fulllineitems} \index{LassoSelector (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.LassoSelector}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{LassoSelector}}}{\emph{ax}, \emph{onselect=None}, \emph{useblit=True}, \emph{lineprops=None}, \emph{button=None}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.widgets.\_SelectorWidget}} Selection curve of an arbitrary shape. For the selector to remain responsive you must keep a reference to it. The selected path can be used in conjunction with {\hyperref[\detokenize{api/path_api:matplotlib.path.Path.contains_point}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains\_point}}}}} to select data points from an image. In contrast to {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.Lasso}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Lasso}}}}}, {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.LassoSelector}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LassoSelector}}}}} is written with an interface similar to {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.RectangleSelector}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RectangleSelector}}}}} and {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.SpanSelector}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{SpanSelector}}}}}, and will continue to interact with the axes until disconnected. Example usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax} \PYG{o}{=} \PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,}\PYG{n}{y}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{onselect}\PYG{p}{(}\PYG{n}{verts}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{verts}\PYG{p}{)} \PYG{n}{lasso} \PYG{o}{=} \PYG{n}{LassoSelector}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{onselect}\PYG{p}{)} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ax}}] \leavevmode{[}{\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}{]} The parent axes for the widget. \item[{\sphinxstylestrong{onselect}}] \leavevmode{[}function{]} Whenever the lasso is released, the \sphinxstyleemphasis{onselect} function is called and passed the vertices of the selected path. \item[{\sphinxstylestrong{button}}] \leavevmode{[}List{[}Int{]}, optional{]} A list of integers indicating which mouse buttons should be used for rectangle selection. You can also specify a single integer if only a single button is desired. Default is \sphinxcode{\sphinxupquote{None}}, which does not limit which button can be used. Note, typically: \begin{itemize} \item {} 1 = left mouse button \item {} 2 = center mouse button (scroll wheel) \item {} 3 = right mouse button \end{itemize} \end{description} \end{description}\end{quote} \index{onpress() (matplotlib.widgets.LassoSelector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.LassoSelector.onpress}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{onpress}}}{\emph{event}}{}~ \end{fulllineitems} \index{onrelease() (matplotlib.widgets.LassoSelector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.LassoSelector.onrelease}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{onrelease}}}{\emph{event}}{}~ \end{fulllineitems} \end{fulllineitems} \index{LockDraw (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.LockDraw}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{LockDraw}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Some widgets, like the cursor, draw onto the canvas, and this is not desirable under all circumstances, like when the toolbar is in zoom-to-rect mode and drawing a rectangle. The module level “lock” allows someone to grab the lock and prevent other widgets from drawing. Use \sphinxcode{\sphinxupquote{matplotlib.widgets.lock(someobj)}} to prevent other widgets from drawing while you’re interacting with the canvas. \index{available() (matplotlib.widgets.LockDraw method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.LockDraw.available}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{available}}}{\emph{o}}{} drawing is available to \sphinxstyleemphasis{o} \end{fulllineitems} \index{isowner() (matplotlib.widgets.LockDraw method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.LockDraw.isowner}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{isowner}}}{\emph{o}}{} Return True if \sphinxstyleemphasis{o} owns this lock \end{fulllineitems} \index{locked() (matplotlib.widgets.LockDraw method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.LockDraw.locked}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{locked}}}{}{} Return True if the lock is currently held by an owner \end{fulllineitems} \index{release() (matplotlib.widgets.LockDraw method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.LockDraw.release}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{release}}}{\emph{o}}{} release the lock \end{fulllineitems} \end{fulllineitems} \index{MultiCursor (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.MultiCursor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{MultiCursor}}}{\emph{canvas}, \emph{axes}, \emph{useblit=True}, \emph{horizOn=False}, \emph{vertOn=True}, \emph{**lineprops}}{} Bases: {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.Widget}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.widgets.Widget}}}}} Provide a vertical (default) and/or horizontal line cursor shared between multiple axes. For the cursor to remain responsive you must keep a reference to it. Example usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{widgets} \PYG{k}{import} \PYG{n}{MultiCursor} \PYG{k+kn}{from} \PYG{n+nn}{pylab} \PYG{k}{import} \PYG{n}{figure}\PYG{p}{,} \PYG{n}{show}\PYG{p}{,} \PYG{n}{np} \PYG{n}{t} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{2.0}\PYG{p}{,} \PYG{l+m+mf}{0.01}\PYG{p}{)} \PYG{n}{s1} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{t}\PYG{p}{)} \PYG{n}{s2} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{l+m+mi}{4}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{t}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{211}\PYG{p}{)} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{t}\PYG{p}{,} \PYG{n}{s1}\PYG{p}{)} \PYG{n}{ax2} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{212}\PYG{p}{,} \PYG{n}{sharex}\PYG{o}{=}\PYG{n}{ax1}\PYG{p}{)} \PYG{n}{ax2}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{t}\PYG{p}{,} \PYG{n}{s2}\PYG{p}{)} \PYG{n}{multi} \PYG{o}{=} \PYG{n}{MultiCursor}\PYG{p}{(}\PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{p}{,} \PYG{p}{(}\PYG{n}{ax1}\PYG{p}{,} \PYG{n}{ax2}\PYG{p}{)}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{horizOn}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{,} \PYG{n}{vertOn}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)} \PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \index{clear() (matplotlib.widgets.MultiCursor method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.MultiCursor.clear}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{clear}}}{\emph{event}}{} clear the cursor \end{fulllineitems} \index{connect() (matplotlib.widgets.MultiCursor method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.MultiCursor.connect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{connect}}}{}{} connect events \end{fulllineitems} \index{disconnect() (matplotlib.widgets.MultiCursor method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.MultiCursor.disconnect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{disconnect}}}{}{} disconnect events \end{fulllineitems} \index{onmove() (matplotlib.widgets.MultiCursor method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.MultiCursor.onmove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{onmove}}}{\emph{event}}{}~ \end{fulllineitems} \end{fulllineitems} \index{PolygonSelector (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.PolygonSelector}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{PolygonSelector}}}{\emph{ax}, \emph{onselect}, \emph{useblit=False}, \emph{lineprops=None}, \emph{markerprops=None}, \emph{vertex\_select\_radius=15}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.widgets.\_SelectorWidget}} Select a polygon region of an axes. Place vertices with each mouse click, and make the selection by completing the polygon (clicking on the first vertex). Hold the \sphinxstyleemphasis{ctrl} key and click and drag a vertex to reposition it (the \sphinxstyleemphasis{ctrl} key is not necessary if the polygon has already been completed). Hold the \sphinxstyleemphasis{shift} key and click and drag anywhere in the axes to move all vertices. Press the \sphinxstyleemphasis{esc} key to start a new polygon. For the selector to remain responsive you must keep a reference to it. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ax}}] \leavevmode{[}{\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}{]} The parent axes for the widget. \item[{\sphinxstylestrong{onselect}}] \leavevmode{[}function{]} When a polygon is completed or modified after completion, the \sphinxcode{\sphinxupquote{onselect}} function is called and passed a list of the vertices as \sphinxcode{\sphinxupquote{(xdata, ydata)}} tuples. \item[{\sphinxstylestrong{useblit}}] \leavevmode{[}bool, optional{]} \item[{\sphinxstylestrong{lineprops}}] \leavevmode{[}dict, optional{]} The line for the sides of the polygon is drawn with the properties given by \sphinxcode{\sphinxupquote{lineprops}}. The default is \sphinxcode{\sphinxupquote{dict(color='k', linestyle='-', linewidth=2, alpha=0.5)}}. \item[{\sphinxstylestrong{markerprops}}] \leavevmode{[}dict, optional{]} The markers for the vertices of the polygon are drawn with the properties given by \sphinxcode{\sphinxupquote{markerprops}}. The default is \sphinxcode{\sphinxupquote{dict(marker='o', markersize=7, mec='k', mfc='k', alpha=0.5)}}. \item[{\sphinxstylestrong{vertex\_select\_radius}}] \leavevmode{[}float, optional{]} A vertex is selected (to complete the polygon or to move a vertex) if the mouse click is within \sphinxcode{\sphinxupquote{vertex\_select\_radius}} pixels of the vertex. The default radius is 15 pixels. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_polygon\_selector\_demo.py} \index{onmove() (matplotlib.widgets.PolygonSelector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.PolygonSelector.onmove}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{onmove}}}{\emph{event}}{} Cursor move event handler and validator \end{fulllineitems} \index{verts (matplotlib.widgets.PolygonSelector attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.PolygonSelector.verts}}\pysigline{\sphinxbfcode{\sphinxupquote{verts}}} Get the polygon vertices. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{list}}] \leavevmode A list of the vertices of the polygon as \sphinxcode{\sphinxupquote{(xdata, ydata)}} tuples. \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{RadioButtons (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.RadioButtons}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{RadioButtons}}}{\emph{ax}, \emph{labels}, \emph{active=0}, \emph{activecolor='blue'}}{} Bases: {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.AxesWidget}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.widgets.AxesWidget}}}}} A GUI neutral radio button. For the buttons to remain responsive you must keep a reference to this object. The following attributes are exposed: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{ax}}] \leavevmode The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} instance the buttons are in \item[{\sphinxstyleemphasis{activecolor}}] \leavevmode The color of the button when clicked \item[{\sphinxstyleemphasis{labels}}] \leavevmode A list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}} instances \item[{\sphinxstyleemphasis{circles}}] \leavevmode A list of {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Circle:matplotlib.patches.Circle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.Circle}}}}} instances \item[{\sphinxstyleemphasis{value\_selected}}] \leavevmode A string listing the current value selected \end{description} \end{quote} Connect to the RadioButtons with the {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.RadioButtons.on_clicked}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{on\_clicked()}}}}} method Add radio buttons to {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} instance \sphinxstyleemphasis{ax} \begin{description} \item[{\sphinxstyleemphasis{labels}}] \leavevmode A len(buttons) list of labels as strings \item[{\sphinxstyleemphasis{active}}] \leavevmode The index into labels for the button that is active \item[{\sphinxstyleemphasis{activecolor}}] \leavevmode The color of the button when clicked \end{description} \index{disconnect() (matplotlib.widgets.RadioButtons method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.RadioButtons.disconnect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{disconnect}}}{\emph{cid}}{} remove the observer with connection id \sphinxstyleemphasis{cid} \end{fulllineitems} \index{on\_clicked() (matplotlib.widgets.RadioButtons method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.RadioButtons.on_clicked}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{on\_clicked}}}{\emph{func}}{} When the button is clicked, call \sphinxstyleemphasis{func} with button label A connection id is returned which can be used to disconnect \end{fulllineitems} \index{set\_active() (matplotlib.widgets.RadioButtons method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.RadioButtons.set_active}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_active}}}{\emph{index}}{} Trigger which radio button to make active. \begin{description} \item[{\sphinxstyleemphasis{index} is an index into the original label list}] \leavevmode that this object was constructed with. Raise ValueError if the index is invalid. \end{description} Callbacks will be triggered if \sphinxcode{\sphinxupquote{eventson}} is True. \end{fulllineitems} \end{fulllineitems} \index{RectangleSelector (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.RectangleSelector}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{RectangleSelector}}}{\emph{ax}, \emph{onselect}, \emph{drawtype='box'}, \emph{minspanx=None}, \emph{minspany=None}, \emph{useblit=False}, \emph{lineprops=None}, \emph{rectprops=None}, \emph{spancoords='data'}, \emph{button=None}, \emph{maxdist=10}, \emph{marker\_props=None}, \emph{interactive=False}, \emph{state\_modifier\_keys=None}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.widgets.\_SelectorWidget}} Select a rectangular region of an axes. For the cursor to remain responsive you must keep a reference to it. Example usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{widgets} \PYG{k}{import} \PYG{n}{RectangleSelector} \PYG{k+kn}{from} \PYG{n+nn}{pylab} \PYG{k}{import} \PYG{o}{*} \PYG{k}{def} \PYG{n+nf}{onselect}\PYG{p}{(}\PYG{n}{eclick}\PYG{p}{,} \PYG{n}{erelease}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{eclick and erelease are matplotlib events at press and release}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ startposition : (}\PYG{l+s+si}{\PYGZpc{}f}\PYG{l+s+s1}{, }\PYG{l+s+si}{\PYGZpc{}f}\PYG{l+s+s1}{)}\PYG{l+s+s1}{\PYGZsq{}} \PYG{o}{\PYGZpc{}} \PYG{p}{(}\PYG{n}{eclick}\PYG{o}{.}\PYG{n}{xdata}\PYG{p}{,} \PYG{n}{eclick}\PYG{o}{.}\PYG{n}{ydata}\PYG{p}{)}\PYG{p}{)} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ endposition : (}\PYG{l+s+si}{\PYGZpc{}f}\PYG{l+s+s1}{, }\PYG{l+s+si}{\PYGZpc{}f}\PYG{l+s+s1}{)}\PYG{l+s+s1}{\PYGZsq{}} \PYG{o}{\PYGZpc{}} \PYG{p}{(}\PYG{n}{erelease}\PYG{o}{.}\PYG{n}{xdata}\PYG{p}{,} \PYG{n}{erelease}\PYG{o}{.}\PYG{n}{ydata}\PYG{p}{)}\PYG{p}{)} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ used button : }\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{eclick}\PYG{o}{.}\PYG{n}{button}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{toggle\PYGZus{}selector}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ Key pressed.}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k}{if} \PYG{n}{event}\PYG{o}{.}\PYG{n}{key} \PYG{o+ow}{in} \PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Q}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{q}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o+ow}{and} \PYG{n}{toggle\PYGZus{}selector}\PYG{o}{.}\PYG{n}{RS}\PYG{o}{.}\PYG{n}{active}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ RectangleSelector deactivated.}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{toggle\PYGZus{}selector}\PYG{o}{.}\PYG{n}{RS}\PYG{o}{.}\PYG{n}{set\PYGZus{}active}\PYG{p}{(}\PYG{k+kc}{False}\PYG{p}{)} \PYG{k}{if} \PYG{n}{event}\PYG{o}{.}\PYG{n}{key} \PYG{o+ow}{in} \PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{A}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{a}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o+ow}{and} \PYG{o+ow}{not} \PYG{n}{toggle\PYGZus{}selector}\PYG{o}{.}\PYG{n}{RS}\PYG{o}{.}\PYG{n}{active}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ RectangleSelector activated.}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{toggle\PYGZus{}selector}\PYG{o}{.}\PYG{n}{RS}\PYG{o}{.}\PYG{n}{set\PYGZus{}active}\PYG{p}{(}\PYG{k+kc}{True}\PYG{p}{)} \PYG{n}{x} \PYG{o}{=} \PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{100}\PYG{p}{)}\PYG{o}{/}\PYG{p}{(}\PYG{l+m+mf}{99.0}\PYG{p}{)} \PYG{n}{y} \PYG{o}{=} \PYG{n}{sin}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{figure} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,}\PYG{n}{y}\PYG{p}{)} \PYG{n}{toggle\PYGZus{}selector}\PYG{o}{.}\PYG{n}{RS} \PYG{o}{=} \PYG{n}{RectangleSelector}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{onselect}\PYG{p}{,} \PYG{n}{drawtype}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{line}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{key\PYGZus{}press\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{toggle\PYGZus{}selector}\PYG{p}{)} \PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} Create a selector in \sphinxstyleemphasis{ax}. When a selection is made, clear the span and call onselect with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{onselect}\PYG{p}{(}\PYG{n}{pos\PYGZus{}1}\PYG{p}{,} \PYG{n}{pos\PYGZus{}2}\PYG{p}{)} \end{sphinxVerbatim} and clear the drawn box/line. The \sphinxcode{\sphinxupquote{pos\_1}} and \sphinxcode{\sphinxupquote{pos\_2}} are arrays of length 2 containing the x- and y-coordinate. If \sphinxstyleemphasis{minspanx} is not \sphinxstyleemphasis{None} then events smaller than \sphinxstyleemphasis{minspanx} in x direction are ignored (it’s the same for y). The rectangle is drawn with \sphinxstyleemphasis{rectprops}; default: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{rectprops} \PYG{o}{=} \PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{edgecolor} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{black}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{n}{fill}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)} \end{sphinxVerbatim} The line is drawn with \sphinxstyleemphasis{lineprops}; default: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{lineprops} \PYG{o}{=} \PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{black}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linestyle}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linewidth} \PYG{o}{=} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \end{sphinxVerbatim} Use \sphinxstyleemphasis{drawtype} if you want the mouse to draw a line, a box or nothing between click and actual position by setting \sphinxcode{\sphinxupquote{drawtype = 'line'}}, \sphinxcode{\sphinxupquote{drawtype='box'}} or \sphinxcode{\sphinxupquote{drawtype = 'none'}}. Drawing a line would result in a line from vertex A to vertex C in a rectangle ABCD. \sphinxstyleemphasis{spancoords} is one of ‘data’ or ‘pixels’. If ‘data’, \sphinxstyleemphasis{minspanx} and \sphinxstyleemphasis{minspanx} will be interpreted in the same coordinates as the x and y axis. If ‘pixels’, they are in pixels. \sphinxstyleemphasis{button} is a list of integers indicating which mouse buttons should be used for rectangle selection. You can also specify a single integer if only a single button is desired. Default is \sphinxstyleemphasis{None}, which does not limit which button can be used. \begin{description} \item[{Note, typically:}] \leavevmode 1 = left mouse button 2 = center mouse button (scroll wheel) 3 = right mouse button \end{description} \sphinxstyleemphasis{interactive} will draw a set of handles and allow you interact with the widget after it is drawn. \sphinxstyleemphasis{state\_modifier\_keys} are keyboard modifiers that affect the behavior of the widget. The defaults are: dict(move=’ ‘, clear=’escape’, square=’shift’, center=’ctrl’) Keyboard modifiers, which: ‘move’: Move the existing shape. ‘clear’: Clear the current shape. ‘square’: Makes the shape square. ‘center’: Make the initial point the center of the shape. ‘square’ and ‘center’ can be combined. \index{center (matplotlib.widgets.RectangleSelector attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.RectangleSelector.center}}\pysigline{\sphinxbfcode{\sphinxupquote{center}}} Center of rectangle \end{fulllineitems} \index{corners (matplotlib.widgets.RectangleSelector attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.RectangleSelector.corners}}\pysigline{\sphinxbfcode{\sphinxupquote{corners}}} Corners of rectangle from lower left, moving clockwise. \end{fulllineitems} \index{draw\_shape() (matplotlib.widgets.RectangleSelector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.RectangleSelector.draw_shape}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_shape}}}{\emph{extents}}{}~ \end{fulllineitems} \index{edge\_centers (matplotlib.widgets.RectangleSelector attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.RectangleSelector.edge_centers}}\pysigline{\sphinxbfcode{\sphinxupquote{edge\_centers}}} Midpoint of rectangle edges from left, moving clockwise. \end{fulllineitems} \index{extents (matplotlib.widgets.RectangleSelector attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.RectangleSelector.extents}}\pysigline{\sphinxbfcode{\sphinxupquote{extents}}} Return (xmin, xmax, ymin, ymax). \end{fulllineitems} \index{geometry (matplotlib.widgets.RectangleSelector attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.RectangleSelector.geometry}}\pysigline{\sphinxbfcode{\sphinxupquote{geometry}}} Returns numpy.ndarray of shape (2,5) containing x (\sphinxcode{\sphinxupquote{RectangleSelector.geometry{[}1,:{]}}}) and y (\sphinxcode{\sphinxupquote{RectangleSelector.geometry{[}0,:{]}}}) coordinates of the four corners of the rectangle starting and ending in the top left corner. \end{fulllineitems} \end{fulllineitems} \index{Slider (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Slider}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{Slider}}}{\emph{ax}, \emph{label}, \emph{valmin}, \emph{valmax}, \emph{valinit=0.5}, \emph{valfmt='\%1.2f'}, \emph{closedmin=True}, \emph{closedmax=True}, \emph{slidermin=None}, \emph{slidermax=None}, \emph{dragging=True}, \emph{valstep=None}, \emph{**kwargs}}{} Bases: {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.AxesWidget}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.widgets.AxesWidget}}}}} A slider representing a floating point range. Create a slider from \sphinxstyleemphasis{valmin} to \sphinxstyleemphasis{valmax} in axes \sphinxstyleemphasis{ax}. For the slider to remain responsive you must maintain a reference to it. Call {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.Slider.on_changed}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{on\_changed()}}}}} to connect to the slider event. \begin{quote}\begin{description} \item[{Attributes}] \leavevmode\begin{description} \item[{\sphinxstylestrong{val}}] \leavevmode{[}float{]} Slider value. \end{description} \end{description}\end{quote} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ax}}] \leavevmode{[}Axes{]} The Axes to put the slider in. \item[{\sphinxstylestrong{label}}] \leavevmode{[}str{]} Slider label. \item[{\sphinxstylestrong{valmin}}] \leavevmode{[}float{]} The minimum value of the slider. \item[{\sphinxstylestrong{valmax}}] \leavevmode{[}float{]} The maximum value of the slider. \item[{\sphinxstylestrong{valinit}}] \leavevmode{[}float, optional, default: 0.5{]} The slider initial position. \item[{\sphinxstylestrong{valfmt}}] \leavevmode{[}str, optional, default: “\%1.2f”{]} Used to format the slider value, fprint format string. \item[{\sphinxstylestrong{closedmin}}] \leavevmode{[}bool, optional, default: True{]} Indicate whether the slider interval is closed on the bottom. \item[{\sphinxstylestrong{closedmax}}] \leavevmode{[}bool, optional, default: True{]} Indicate whether the slider interval is closed on the top. \item[{\sphinxstylestrong{slidermin}}] \leavevmode{[}Slider, optional, default: None{]} Do not allow the current slider to have a value less than the value of the Slider \sphinxcode{\sphinxupquote{slidermin}}. \item[{\sphinxstylestrong{slidermax}}] \leavevmode{[}Slider, optional, default: None{]} Do not allow the current slider to have a value greater than the value of the Slider \sphinxcode{\sphinxupquote{slidermax}}. \item[{\sphinxstylestrong{dragging}}] \leavevmode{[}bool, optional, default: True{]} If True the slider can be dragged by the mouse. \item[{\sphinxstylestrong{valstep}}] \leavevmode{[}float, optional, default: None{]} If given, the slider will snap to multiples of \sphinxcode{\sphinxupquote{valstep}}. \end{description} \end{description}\end{quote} \paragraph{Notes} Additional kwargs are passed on to \sphinxcode{\sphinxupquote{self.poly}} which is the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}} that draws the slider knob. See the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}} documentation for valid property names (e.g., \sphinxcode{\sphinxupquote{facecolor}}, \sphinxcode{\sphinxupquote{edgecolor}}, \sphinxcode{\sphinxupquote{alpha}}). \index{disconnect() (matplotlib.widgets.Slider method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Slider.disconnect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{disconnect}}}{\emph{cid}}{} Remove the observer with connection id \sphinxstyleemphasis{cid} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cid}}] \leavevmode{[}int{]} Connection id of the observer to be removed \end{description} \end{description}\end{quote} \end{fulllineitems} \index{on\_changed() (matplotlib.widgets.Slider method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Slider.on_changed}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{on\_changed}}}{\emph{func}}{} When the slider value is changed call \sphinxstyleemphasis{func} with the new slider value \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{func}}] \leavevmode{[}callable{]} Function to call when slider is changed. The function must accept a single float as its arguments. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cid}}] \leavevmode{[}int{]} Connection id (which can be used to disconnect \sphinxstyleemphasis{func}) \end{description} \end{description}\end{quote} \end{fulllineitems} \index{reset() (matplotlib.widgets.Slider method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Slider.reset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{reset}}}{}{} Reset the slider to the initial value \end{fulllineitems} \index{set\_val() (matplotlib.widgets.Slider method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Slider.set_val}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_val}}}{\emph{val}}{} Set slider value to \sphinxstyleemphasis{val} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{val}}] \leavevmode{[}float{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \end{fulllineitems} \index{SpanSelector (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.SpanSelector}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{SpanSelector}}}{\emph{ax}, \emph{onselect}, \emph{direction}, \emph{minspan=None}, \emph{useblit=False}, \emph{rectprops=None}, \emph{onmove\_callback=None}, \emph{span\_stays=False}, \emph{button=None}}{} Bases: \sphinxcode{\sphinxupquote{matplotlib.widgets.\_SelectorWidget}} Visually select a min/max range on a single axis and call a function with those values. To guarantee that the selector remains responsive, keep a reference to it. In order to turn off the SpanSelector, set \sphinxcode{\sphinxupquote{span\_selector.active=False}}. To turn it back on, set \sphinxcode{\sphinxupquote{span\_selector.active=True}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ax}}] \leavevmode{[}{\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} object{]} \item[{\sphinxstylestrong{onselect}}] \leavevmode{[}func(min, max), min/max are floats{]} \item[{\sphinxstylestrong{direction}}] \leavevmode{[}“horizontal” or “vertical”{]} The axis along which to draw the span selector \item[{\sphinxstylestrong{minspan}}] \leavevmode{[}float, default is None{]} If selection is less than \sphinxstyleemphasis{minspan}, do not call \sphinxstyleemphasis{onselect} \item[{\sphinxstylestrong{useblit}}] \leavevmode{[}bool, default is False{]} If True, use the backend-dependent blitting features for faster canvas updates. \item[{\sphinxstylestrong{rectprops}}] \leavevmode{[}dict, default is None{]} Dictionary of {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.Patch}}}}} properties \item[{\sphinxstylestrong{onmove\_callback}}] \leavevmode{[}func(min, max), min/max are floats, default is None{]} Called on mouse move while the span is being selected \item[{\sphinxstylestrong{span\_stays}}] \leavevmode{[}bool, default is False{]} If True, the span stays visible after the mouse is released \item[{\sphinxstylestrong{button}}] \leavevmode{[}int or list of ints{]}\begin{description} \item[{Determines which mouse buttons activate the span selector}] \leavevmode 1 = left mouse button 2 = center mouse button (scroll wheel) 3 = right mouse button \end{description} \end{description} \end{description}\end{quote} \paragraph{Examples} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{widgets} \PYG{k}{as} \PYG{n+nn}{mwidgets} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{10}\PYG{p}{,} \PYG{l+m+mi}{50}\PYG{p}{,} \PYG{l+m+mi}{100}\PYG{p}{]}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k}{def} \PYG{n+nf}{onselect}\PYG{p}{(}\PYG{n}{vmin}\PYG{p}{,} \PYG{n}{vmax}\PYG{p}{)}\PYG{p}{:} \PYG{g+go}{ print(vmin, vmax)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{rectprops} \PYG{o}{=} \PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{blue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{span} \PYG{o}{=} \PYG{n}{mwidgets}\PYG{o}{.}\PYG{n}{SpanSelector}\PYG{p}{(}\PYG{n}{ax}\PYG{p}{,} \PYG{n}{onselect}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{horizontal}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{g+go}{ rectprops=rectprops)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{fig}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} See also: \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_span\_selector.py} \index{ignore() (matplotlib.widgets.SpanSelector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.SpanSelector.ignore}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{ignore}}}{\emph{event}}{} return \sphinxstyleemphasis{True} if \sphinxstyleemphasis{event} should be ignored \end{fulllineitems} \index{new\_axes() (matplotlib.widgets.SpanSelector method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.SpanSelector.new_axes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{new\_axes}}}{\emph{ax}}{} Set SpanSelector to operate on a new Axes \end{fulllineitems} \end{fulllineitems} \index{SubplotTool (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.SubplotTool}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{SubplotTool}}}{\emph{targetfig}, \emph{toolfig}}{} Bases: {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.Widget}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.widgets.Widget}}}}} A tool to adjust the subplot params of a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure}}}}}. \begin{description} \item[{\sphinxstyleemphasis{targetfig}}] \leavevmode The figure instance to adjust. \item[{\sphinxstyleemphasis{toolfig}}] \leavevmode The figure instance to embed the subplot tool into. If \sphinxstyleemphasis{None}, a default figure will be created. If you are using this from the GUI \end{description} \index{funcbottom() (matplotlib.widgets.SubplotTool method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.SubplotTool.funcbottom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{funcbottom}}}{\emph{val}}{}~ \end{fulllineitems} \index{funchspace() (matplotlib.widgets.SubplotTool method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.SubplotTool.funchspace}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{funchspace}}}{\emph{val}}{}~ \end{fulllineitems} \index{funcleft() (matplotlib.widgets.SubplotTool method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.SubplotTool.funcleft}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{funcleft}}}{\emph{val}}{}~ \end{fulllineitems} \index{funcright() (matplotlib.widgets.SubplotTool method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.SubplotTool.funcright}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{funcright}}}{\emph{val}}{}~ \end{fulllineitems} \index{functop() (matplotlib.widgets.SubplotTool method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.SubplotTool.functop}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{functop}}}{\emph{val}}{}~ \end{fulllineitems} \index{funcwspace() (matplotlib.widgets.SubplotTool method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.SubplotTool.funcwspace}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{funcwspace}}}{\emph{val}}{}~ \end{fulllineitems} \end{fulllineitems} \index{TextBox (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.TextBox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{TextBox}}}{\emph{ax}, \emph{label}, \emph{initial=''}, \emph{color='.95'}, \emph{hovercolor='1'}, \emph{label\_pad=0.01}}{} Bases: {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.AxesWidget}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.widgets.AxesWidget}}}}} A GUI neutral text input box. For the text box to remain responsive you must keep a reference to it. The following attributes are accessible: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{ax}}] \leavevmode The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} the button renders into. \item[{\sphinxstyleemphasis{label}}] \leavevmode A {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}} instance. \item[{\sphinxstyleemphasis{color}}] \leavevmode The color of the text box when not hovering. \item[{\sphinxstyleemphasis{hovercolor}}] \leavevmode The color of the text box when hovering. \end{description} \end{quote} Call {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.TextBox.on_text_change}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{on\_text\_change()}}}}} to be updated whenever the text changes. Call {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.TextBox.on_submit}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{on\_submit()}}}}} to be updated whenever the user hits enter or leaves the text entry field. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ax}}] \leavevmode{[}matplotlib.axes.Axes{]} The {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} instance the button will be placed into. \item[{\sphinxstylestrong{label}}] \leavevmode{[}str{]} Label for this text box. Accepts string. \item[{\sphinxstylestrong{initial}}] \leavevmode{[}str{]} Initial value in the text box \item[{\sphinxstylestrong{color}}] \leavevmode{[}color{]} The color of the box \item[{\sphinxstylestrong{hovercolor}}] \leavevmode{[}color{]} The color of the box when the mouse is over it \item[{\sphinxstylestrong{label\_pad}}] \leavevmode{[}float{]} the distance between the label and the right side of the textbox \end{description} \end{description}\end{quote} \index{begin\_typing() (matplotlib.widgets.TextBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.TextBox.begin_typing}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{begin\_typing}}}{\emph{x}}{}~ \end{fulllineitems} \index{disconnect() (matplotlib.widgets.TextBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.TextBox.disconnect}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{disconnect}}}{\emph{cid}}{} remove the observer with connection id \sphinxstyleemphasis{cid} \end{fulllineitems} \index{on\_submit() (matplotlib.widgets.TextBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.TextBox.on_submit}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{on\_submit}}}{\emph{func}}{} When the user hits enter or leaves the submision box, call this \sphinxstyleemphasis{func} with event. A connection id is returned which can be used to disconnect. \end{fulllineitems} \index{on\_text\_change() (matplotlib.widgets.TextBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.TextBox.on_text_change}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{on\_text\_change}}}{\emph{func}}{} When the text changes, call this \sphinxstyleemphasis{func} with event. A connection id is returned which can be used to disconnect. \end{fulllineitems} \index{position\_cursor() (matplotlib.widgets.TextBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.TextBox.position_cursor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{position\_cursor}}}{\emph{x}}{}~ \end{fulllineitems} \index{set\_val() (matplotlib.widgets.TextBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.TextBox.set_val}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_val}}}{\emph{val}}{}~ \end{fulllineitems} \index{stop\_typing() (matplotlib.widgets.TextBox method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.TextBox.stop_typing}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{stop\_typing}}}{}{}~ \end{fulllineitems} \end{fulllineitems} \index{ToolHandles (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.ToolHandles}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{ToolHandles}}}{\emph{ax}, \emph{x}, \emph{y}, \emph{marker='o'}, \emph{marker\_props=None}, \emph{useblit=True}}{} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Control handles for canvas tools. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ax}}] \leavevmode{[}{\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}}{]} Matplotlib axes where tool handles are displayed. \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}1D arrays{]} Coordinates of control handles. \item[{\sphinxstylestrong{marker}}] \leavevmode{[}str{]} Shape of marker used to display handle. See {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.plot}}}}}. \item[{\sphinxstylestrong{marker\_props}}] \leavevmode{[}dict{]} Additional marker properties. See {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.lines.Line2D}}}}}. \end{description} \end{description}\end{quote} \index{closest() (matplotlib.widgets.ToolHandles method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.ToolHandles.closest}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{closest}}}{\emph{x}, \emph{y}}{} Return index and pixel distance to closest index. \end{fulllineitems} \index{set\_animated() (matplotlib.widgets.ToolHandles method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.ToolHandles.set_animated}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_animated}}}{\emph{val}}{}~ \end{fulllineitems} \index{set\_data() (matplotlib.widgets.ToolHandles method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.ToolHandles.set_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_data}}}{\emph{pts}, \emph{y=None}}{} Set x and y positions of handles \end{fulllineitems} \index{set\_visible() (matplotlib.widgets.ToolHandles method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.ToolHandles.set_visible}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_visible}}}{\emph{val}}{}~ \end{fulllineitems} \index{x (matplotlib.widgets.ToolHandles attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.ToolHandles.x}}\pysigline{\sphinxbfcode{\sphinxupquote{x}}}~ \end{fulllineitems} \index{y (matplotlib.widgets.ToolHandles attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.ToolHandles.y}}\pysigline{\sphinxbfcode{\sphinxupquote{y}}}~ \end{fulllineitems} \end{fulllineitems} \index{Widget (class in matplotlib.widgets)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Widget}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{matplotlib.widgets.}}\sphinxbfcode{\sphinxupquote{Widget}}} Bases: \sphinxhref{https://docs.python.org/3/library/functions.html\#object}{\sphinxcode{\sphinxupquote{object}}} Abstract base class for GUI neutral widgets \index{active (matplotlib.widgets.Widget attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Widget.active}}\pysigline{\sphinxbfcode{\sphinxupquote{active}}} Is the widget active? \end{fulllineitems} \index{drawon (matplotlib.widgets.Widget attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Widget.drawon}}\pysigline{\sphinxbfcode{\sphinxupquote{drawon}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{eventson (matplotlib.widgets.Widget attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Widget.eventson}}\pysigline{\sphinxbfcode{\sphinxupquote{eventson}}\sphinxbfcode{\sphinxupquote{ = True}}} \end{fulllineitems} \index{get\_active() (matplotlib.widgets.Widget method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Widget.get_active}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_active}}}{}{} Get whether the widget is active. \end{fulllineitems} \index{ignore() (matplotlib.widgets.Widget method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Widget.ignore}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{ignore}}}{\emph{event}}{} Return True if event should be ignored. This method (or a version of it) should be called at the beginning of any event callback. \end{fulllineitems} \index{set\_active() (matplotlib.widgets.Widget method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/widgets_api:matplotlib.widgets.Widget.set_active}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_active}}}{\emph{active}}{} Set whether the widget is active. \end{fulllineitems} \end{fulllineitems} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pyplot}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot}}}}} is a state-based interface to matplotlib. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \chapter{matplotlib.pyplot} \label{\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}}\label{\detokenize{api/_as_gen/matplotlib.pyplot:matplotlib-pyplot}}\label{\detokenize{api/_as_gen/matplotlib.pyplot::doc}}\index{matplotlib.pyplot (module)} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot}}}}} is a state-based interface to matplotlib. It provides a MATLAB-like way of plotting. pyplot is mainly intended for interactive plots and simple cases of programmatic plot generation: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{l+m+mf}{0.1}\PYG{p}{)} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \end{sphinxVerbatim} The object-oriented API is recommended for more complex plots. \section{Functions} \label{\detokenize{api/_as_gen/matplotlib.pyplot:functions}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.acorr:matplotlib.pyplot.acorr}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{acorr}}}}}(x{[}, hold, data{]}) & Plot the autocorrelation of \sphinxstyleemphasis{x}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.angle_spectrum:matplotlib.pyplot.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum}}}}}(x{[}, Fs, Fc, window, pad\_to, …{]}) & Plot the angle spectrum. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.annotate:matplotlib.pyplot.annotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{annotate}}}}}(*args, **kwargs) & Annotate the point \sphinxcode{\sphinxupquote{xy}} with text \sphinxcode{\sphinxupquote{s}}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.arrow:matplotlib.pyplot.arrow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{arrow}}}}}(x, y, dx, dy{[}, hold{]}) & Add an arrow to the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.autoscale:matplotlib.pyplot.autoscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{autoscale}}}}}({[}enable, axis, tight{]}) & Autoscale the axis view to the data (toggle). \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.autumn:matplotlib.pyplot.autumn}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{autumn}}}}}() & Set the colormap to “autumn”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axes:matplotlib.pyplot.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axes}}}}}({[}arg{]}) & Add an axes to the current figure and make it the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axhline:matplotlib.pyplot.axhline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axhline}}}}}({[}y, xmin, xmax, hold{]}) & Add a horizontal line across the axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axhspan:matplotlib.pyplot.axhspan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axhspan}}}}}(ymin, ymax{[}, xmin, xmax, hold{]}) & Add a horizontal span (rectangle) across the axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axis:matplotlib.pyplot.axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axis}}}}}(*v, **kwargs) & Convenience method to get or set axis properties. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axvline:matplotlib.pyplot.axvline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axvline}}}}}({[}x, ymin, ymax, hold{]}) & Add a vertical line across the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axvspan:matplotlib.pyplot.axvspan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axvspan}}}}}(xmin, xmax{[}, ymin, ymax, hold{]}) & Add a vertical span (rectangle) across the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.bar:matplotlib.pyplot.bar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bar}}}}}(*args, **kwargs) & Make a bar plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.barbs:matplotlib.pyplot.barbs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{barbs}}}}}(*args, **kw) & Plot a 2-D field of barbs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.barh:matplotlib.pyplot.barh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{barh}}}}}(*args, **kwargs) & Make a horizontal bar plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.bone:matplotlib.pyplot.bone}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bone}}}}}() & Set the colormap to “bone”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.box:matplotlib.pyplot.box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{box}}}}}({[}on{]}) & Turn the axes box on or off. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.boxplot:matplotlib.pyplot.boxplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{boxplot}}}}}(x{[}, notch, sym, vert, whis, …{]}) & Make a box and whisker plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.broken_barh:matplotlib.pyplot.broken_barh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{broken\_barh}}}}}(xranges, yrange{[}, hold, data{]}) & Plot a horizontal sequence of rectangles. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.cla:matplotlib.pyplot.cla}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cla}}}}}() & Clear the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.clabel:matplotlib.pyplot.clabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clabel}}}}}(CS, *args, **kwargs) & Label a contour plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.clf:matplotlib.pyplot.clf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clf}}}}}() & Clear the current figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.clim:matplotlib.pyplot.clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}}({[}vmin, vmax{]}) & Set the color limits of the current image. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.close:matplotlib.pyplot.close}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{close}}}}}(*args) & Close a figure window. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.cohere:matplotlib.pyplot.cohere}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cohere}}}}}(x, y{[}, NFFT, Fs, Fc, detrend, …{]}) & Plot the coherence between \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.colorbar:matplotlib.pyplot.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar}}}}}({[}mappable, cax, ax{]}) & Add a colorbar to a plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.colors:matplotlib.pyplot.colors}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colors}}}}}() & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.connect:matplotlib.pyplot.connect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{connect}}}}}(s, func) & Connect event with string \sphinxstyleemphasis{s} to \sphinxstyleemphasis{func}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour}}}}}(*args, **kwargs) & Plot contours. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf}}}}}(*args, **kwargs) & Plot contours. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.cool:matplotlib.pyplot.cool}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cool}}}}}() & Set the colormap to “cool”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.copper:matplotlib.pyplot.copper}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{copper}}}}}() & Set the colormap to “copper”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.csd:matplotlib.pyplot.csd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{csd}}}}}(x, y{[}, NFFT, Fs, Fc, detrend, window, …{]}) & Plot the cross-spectral density. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.delaxes:matplotlib.pyplot.delaxes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{delaxes}}}}}({[}ax{]}) & Remove the given \sphinxcode{\sphinxupquote{Axes}} \sphinxstyleemphasis{ax} from the current figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.disconnect:matplotlib.pyplot.disconnect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{disconnect}}}}}(cid) & Disconnect callback id cid \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.draw:matplotlib.pyplot.draw}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{draw}}}}}() & Redraw the current figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.errorbar:matplotlib.pyplot.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar}}}}}(x, y{[}, yerr, xerr, fmt, ecolor, …{]}) & Plot y versus x as lines and/or markers with attached errorbars. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.eventplot:matplotlib.pyplot.eventplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{eventplot}}}}}(positions{[}, orientation, …{]}) & Plot identical parallel lines at the given positions. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figimage:matplotlib.pyplot.figimage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figimage}}}}}(*args, **kwargs) & Adds a non-resampled image to the figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figlegend:matplotlib.pyplot.figlegend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figlegend}}}}}(*args, **kwargs) & Place a legend in the figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.fignum_exists:matplotlib.pyplot.fignum_exists}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fignum\_exists}}}}}(num) & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figtext:matplotlib.pyplot.figtext}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figtext}}}}}(*args, **kwargs) & Add text to figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figure:matplotlib.pyplot.figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}}({[}num, figsize, dpi, facecolor, …{]}) & Creates a new figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.fill:matplotlib.pyplot.fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}}(*args, **kwargs) & Plot filled polygons. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.fill_between:matplotlib.pyplot.fill_between}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill\_between}}}}}(x, y1{[}, y2, where, …{]}) & Fill the area between two horizontal curves. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.fill_betweenx:matplotlib.pyplot.fill_betweenx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill\_betweenx}}}}}(y, x1{[}, x2, where, step, …{]}) & Fill the area between two vertical curves. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.findobj:matplotlib.pyplot.findobj}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{findobj}}}}}({[}o, match, include\_self{]}) & Find artist objects. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.flag:matplotlib.pyplot.flag}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{flag}}}}}() & Set the colormap to “flag”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.gca:matplotlib.pyplot.gca}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gca}}}}}(**kwargs) & Get the current {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance on the current figure matching the given keyword args, or create one. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.gcf:matplotlib.pyplot.gcf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gcf}}}}}() & Get a reference to the current figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.gci:matplotlib.pyplot.gci}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gci}}}}}() & Get the current colorable artist. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.get_current_fig_manager:matplotlib.pyplot.get_current_fig_manager}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_current\_fig\_manager}}}}}() & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.get_figlabels:matplotlib.pyplot.get_figlabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_figlabels}}}}}() & Return a list of existing figure labels. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.get_fignums:matplotlib.pyplot.get_fignums}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_fignums}}}}}() & Return a list of existing figure numbers. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.get_plot_commands:matplotlib.pyplot.get_plot_commands}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_plot\_commands}}}}}() & Get a sorted list of all of the plotting commands. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ginput:matplotlib.pyplot.ginput}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ginput}}}}}(*args, **kwargs) & Blocking call to interact with a figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.gray:matplotlib.pyplot.gray}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gray}}}}}() & Set the colormap to “gray”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.grid:matplotlib.pyplot.grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{grid}}}}}({[}b, which, axis{]}) & Turn the axes grids on or off. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hexbin:matplotlib.pyplot.hexbin}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hexbin}}}}}(x, y{[}, C, gridsize, bins, xscale, …{]}) & Make a hexagonal binning plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hist:matplotlib.pyplot.hist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hist}}}}}(x{[}, bins, range, density, weights, …{]}) & Plot a histogram. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hist2d:matplotlib.pyplot.hist2d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hist2d}}}}}(x, y{[}, bins, range, normed, weights, …{]}) & Make a 2D histogram plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hlines:matplotlib.pyplot.hlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hlines}}}}}(y, xmin, xmax{[}, colors, linestyles, …{]}) & Plot horizontal lines at each \sphinxstyleemphasis{y} from \sphinxstyleemphasis{xmin} to \sphinxstyleemphasis{xmax}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hold:matplotlib.pyplot.hold}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hold}}}}}({[}b{]}) & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hot:matplotlib.pyplot.hot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hot}}}}}() & Set the colormap to “hot”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hsv:matplotlib.pyplot.hsv}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hsv}}}}}() & Set the colormap to “hsv”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imread:matplotlib.pyplot.imread}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imread}}}}}(*args, **kwargs) & Read an image from a file into an array. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imsave:matplotlib.pyplot.imsave}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imsave}}}}}(*args, **kwargs) & Save an array as in image file. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow}}}}}(X{[}, cmap, norm, aspect, …{]}) & Display an image on the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.inferno:matplotlib.pyplot.inferno}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{inferno}}}}}() & Set the colormap to “inferno”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.install_repl_displayhook:matplotlib.pyplot.install_repl_displayhook}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{install\_repl\_displayhook}}}}}() & Install a repl display hook so that any stale figure are automatically redrawn when control is returned to the repl. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ioff:matplotlib.pyplot.ioff}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ioff}}}}}() & Turn interactive mode off. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ion:matplotlib.pyplot.ion}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ion}}}}}() & Turn interactive mode on. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ishold:matplotlib.pyplot.ishold}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ishold}}}}}() & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.isinteractive:matplotlib.pyplot.isinteractive}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{isinteractive}}}}}() & Return status of interactive mode. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.jet:matplotlib.pyplot.jet}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{jet}}}}}() & Set the colormap to “jet”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.legend:matplotlib.pyplot.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend}}}}}(*args, **kwargs) & Places a legend on the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.locator_params:matplotlib.pyplot.locator_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{locator\_params}}}}}({[}axis, tight{]}) & Control behavior of tick locators. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.loglog:matplotlib.pyplot.loglog}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{loglog}}}}}(*args, **kwargs) & Make a plot with log scaling on both the x and y axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.magma:matplotlib.pyplot.magma}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magma}}}}}() & Set the colormap to “magma”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.magnitude_spectrum:matplotlib.pyplot.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum}}}}}(x{[}, Fs, Fc, window, …{]}) & Plot the magnitude spectrum. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.margins:matplotlib.pyplot.margins}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{margins}}}}}(*args, **kw) & Set or retrieve autoscaling margins. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.matshow:matplotlib.pyplot.matshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matshow}}}}}(A{[}, fignum{]}) & Display an array as a matrix in a new figure window. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.minorticks_off:matplotlib.pyplot.minorticks_off}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{minorticks\_off}}}}}() & Remove minor ticks from the current plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.minorticks_on:matplotlib.pyplot.minorticks_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{minorticks\_on}}}}}() & Display minor ticks on the current plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.nipy_spectral:matplotlib.pyplot.nipy_spectral}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{nipy\_spectral}}}}}() & Set the colormap to “nipy\_spectral”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.over:matplotlib.pyplot.over}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{over}}}}}(func, *args, **kwargs) & \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pause:matplotlib.pyplot.pause}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pause}}}}}(interval) & Pause for \sphinxstyleemphasis{interval} seconds. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:matplotlib.pyplot.pcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolor}}}}}(*args, **kwargs) & Create a pseudocolor plot of a 2-D array. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolormesh:matplotlib.pyplot.pcolormesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolormesh}}}}}(*args, **kwargs) & Plot a quadrilateral mesh. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.phase_spectrum:matplotlib.pyplot.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum}}}}}(x{[}, Fs, Fc, window, pad\_to, …{]}) & Plot the phase spectrum. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pie:matplotlib.pyplot.pie}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pie}}}}}(x{[}, explode, labels, colors, autopct, …{]}) & Plot a pie chart. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pink:matplotlib.pyplot.pink}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pink}}}}}() & Set the colormap to “pink”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plasma:matplotlib.pyplot.plasma}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plasma}}}}}() & Set the colormap to “plasma”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}(*args, **kwargs) & Plot y versus x as lines and/or markers. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot_date:matplotlib.pyplot.plot_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot\_date}}}}}(x, y{[}, fmt, tz, xdate, ydate, …{]}) & Plot data that contains dates. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plotfile:matplotlib.pyplot.plotfile}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plotfile}}}}}(fname{[}, cols, plotfuncs, comments, …{]}) & Plot the data in a file. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.polar:matplotlib.pyplot.polar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{polar}}}}}(*args, **kwargs) & Make a polar plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.prism:matplotlib.pyplot.prism}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{prism}}}}}() & Set the colormap to “prism”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.psd:matplotlib.pyplot.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd}}}}}(x{[}, NFFT, Fs, Fc, detrend, window, …{]}) & Plot the power spectral density. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.quiver:matplotlib.pyplot.quiver}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{quiver}}}}}(*args, **kw) & Plot a 2-D field of arrows. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.quiverkey:matplotlib.pyplot.quiverkey}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{quiverkey}}}}}(*args, **kw) & Add a key to a quiver plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.rc:matplotlib.pyplot.rc}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rc}}}}}(*args, **kwargs) & Set the current rc params. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.rc_context:matplotlib.pyplot.rc_context}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rc\_context}}}}}({[}rc, fname{]}) & Return a context manager for managing rc settings. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.rcdefaults:matplotlib.pyplot.rcdefaults}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rcdefaults}}}}}() & Restore the rc params from Matplotlib’s internal defaults. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.rgrids:matplotlib.pyplot.rgrids}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rgrids}}}}}(*args, **kwargs) & Get or set the radial gridlines on a polar plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.savefig:matplotlib.pyplot.savefig}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{savefig}}}}}(*args, **kwargs) & Save the current figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.sca:matplotlib.pyplot.sca}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sca}}}}}(ax) & Set the current Axes instance to \sphinxstyleemphasis{ax}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.scatter:matplotlib.pyplot.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter}}}}}(x, y{[}, s, c, marker, cmap, norm, …{]}) & A scatter plot of \sphinxstyleemphasis{y} vs \sphinxstyleemphasis{x} with varying marker size and/or color. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.sci:matplotlib.pyplot.sci}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sci}}}}}(im) & Set the current image. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.semilogx:matplotlib.pyplot.semilogx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{semilogx}}}}}(*args, **kwargs) & Make a plot with log scaling on the x axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.semilogy:matplotlib.pyplot.semilogy}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{semilogy}}}}}(*args, **kwargs) & Make a plot with log scaling on the y axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.set_cmap:matplotlib.pyplot.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_cmap}}}}}(cmap) & Set the default colormap. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.setp:matplotlib.pyplot.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setp}}}}}(*args, **kwargs) & Set a property on an artist object. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.show:matplotlib.pyplot.show}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{show}}}}}(*args, **kw) & Display a figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.specgram:matplotlib.pyplot.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram}}}}}(x{[}, NFFT, Fs, Fc, detrend, window, …{]}) & Plot a spectrogram. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.spectral:matplotlib.pyplot.spectral}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{spectral}}}}}() & Set the colormap to “spectral”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.spring:matplotlib.pyplot.spring}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{spring}}}}}() & Set the colormap to “spring”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.spy:matplotlib.pyplot.spy}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{spy}}}}}(Z{[}, precision, marker, markersize, aspect{]}) & Plot the sparsity pattern on a 2-D array. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.stackplot:matplotlib.pyplot.stackplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stackplot}}}}}(x, *args, **kwargs) & Draws a stacked area plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.stem:matplotlib.pyplot.stem}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stem}}}}}(*args, **kwargs) & Create a stem plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.step:matplotlib.pyplot.step}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step}}}}}(x, y, *args, **kwargs) & Make a step plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.streamplot:matplotlib.pyplot.streamplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{streamplot}}}}}(x, y, u, v{[}, density, linewidth, …{]}) & Draws streamlines of a vector flow. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot:matplotlib.pyplot.subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot}}}}}(*args, **kwargs) & Return a subplot axes at the given grid position. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot2grid:matplotlib.pyplot.subplot2grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot2grid}}}}}(shape, loc{[}, rowspan, colspan, fig{]}) & Create an axis at specific location inside a regular grid. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot_tool:matplotlib.pyplot.subplot_tool}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot\_tool}}}}}({[}targetfig{]}) & Launch a subplot tool window for a figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots:matplotlib.pyplot.subplots}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots}}}}}({[}nrows, ncols, sharex, sharey, …{]}) & Create a figure and a set of subplots \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplots_adjust:matplotlib.pyplot.subplots_adjust}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplots\_adjust}}}}}(*args, **kwargs) & Tune the subplot layout. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.summer:matplotlib.pyplot.summer}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{summer}}}}}() & Set the colormap to “summer”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.suptitle:matplotlib.pyplot.suptitle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{suptitle}}}}}(*args, **kwargs) & Add a centered title to the figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.switch_backend:matplotlib.pyplot.switch_backend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{switch\_backend}}}}}(newbackend) & Switch the default backend. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.table:matplotlib.pyplot.table}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{table}}}}}(**kwargs) & Add a table to the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.text:matplotlib.pyplot.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text}}}}}(x, y, s{[}, fontdict, withdash{]}) & Add text to the axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.thetagrids:matplotlib.pyplot.thetagrids}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{thetagrids}}}}}(*args, **kwargs) & Get or set the theta locations of the gridlines in a polar plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tick_params:matplotlib.pyplot.tick_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tick\_params}}}}}({[}axis{]}) & Change the appearance of ticks, tick labels, and gridlines. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ticklabel_format:matplotlib.pyplot.ticklabel_format}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ticklabel\_format}}}}}(**kwargs) & Change the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarFormatter}}}}} used by default for linear axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tight_layout:matplotlib.pyplot.tight_layout}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tight\_layout}}}}}({[}pad, h\_pad, w\_pad, rect{]}) & Automatically adjust subplot parameters to give specified padding. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.title:matplotlib.pyplot.title}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{title}}}}}(s, *args, **kwargs) & Set a title of the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tricontour:matplotlib.pyplot.tricontour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tricontour}}}}}(*args, **kwargs) & Draw contours on an unstructured triangular grid. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tricontourf:matplotlib.pyplot.tricontourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tricontourf}}}}}(*args, **kwargs) & Draw contours on an unstructured triangular grid. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tripcolor:matplotlib.pyplot.tripcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tripcolor}}}}}(*args, **kwargs) & Create a pseudocolor plot of an unstructured triangular grid. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.triplot:matplotlib.pyplot.triplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{triplot}}}}}(*args, **kwargs) & Draw a unstructured triangular grid as lines and/or markers. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.twinx:matplotlib.pyplot.twinx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{twinx}}}}}({[}ax{]}) & Make a second axes that shares the \sphinxstyleemphasis{x}-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.twiny:matplotlib.pyplot.twiny}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{twiny}}}}}({[}ax{]}) & Make a second axes that shares the \sphinxstyleemphasis{y}-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.uninstall_repl_displayhook:matplotlib.pyplot.uninstall_repl_displayhook}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{uninstall\_repl\_displayhook}}}}}() & Uninstalls the matplotlib display hook. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.violinplot:matplotlib.pyplot.violinplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{violinplot}}}}}(dataset{[}, positions, vert, …{]}) & Make a violin plot. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.viridis:matplotlib.pyplot.viridis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{viridis}}}}}() & Set the colormap to “viridis”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.vlines:matplotlib.pyplot.vlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{vlines}}}}}(x, ymin, ymax{[}, colors, linestyles, …{]}) & Plot vertical lines. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.waitforbuttonpress:matplotlib.pyplot.waitforbuttonpress}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{waitforbuttonpress}}}}}(*args, **kwargs) & Blocking call to interact with the figure. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.winter:matplotlib.pyplot.winter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{winter}}}}}() & Set the colormap to “winter”. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xcorr:matplotlib.pyplot.xcorr}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xcorr}}}}}(x, y{[}, normed, detrend, usevlines, …{]}) & Plot the cross correlation between \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xkcd:matplotlib.pyplot.xkcd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xkcd}}}}}({[}scale, length, randomness{]}) & Turns on \sphinxhref{https://xkcd.com/}{xkcd} sketch-style drawing mode. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xlabel:matplotlib.pyplot.xlabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xlabel}}}}}(s, *args, **kwargs) & Set the x-axis label of the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xlim:matplotlib.pyplot.xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xlim}}}}}(*args, **kwargs) & Get or set the x limits of the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xscale:matplotlib.pyplot.xscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xscale}}}}}(*args, **kwargs) & Set the scaling of the x-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xticks:matplotlib.pyplot.xticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xticks}}}}}(*args, **kwargs) & Get or set the current tick locations and labels of the x-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ylabel:matplotlib.pyplot.ylabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ylabel}}}}}(s, *args, **kwargs) & Set the y-axis label of the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ylim:matplotlib.pyplot.ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ylim}}}}}(*args, **kwargs) & Get or set the y-limits of the current axes. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.yscale:matplotlib.pyplot.yscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{yscale}}}}}(*args, **kwargs) & Set the scaling of the y-axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.yticks:matplotlib.pyplot.yticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{yticks}}}}}(*args, **kwargs) & Get or set the current tick locations and labels of the y-axis. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsection{matplotlib.pyplot.acorr} \label{\detokenize{api/_as_gen/matplotlib.pyplot.acorr:matplotlib-pyplot-acorr}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.acorr::doc}}\index{acorr() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.acorr:matplotlib.pyplot.acorr}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{acorr}}}{\emph{x}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Plot the autocorrelation of \sphinxstyleemphasis{x}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}sequence of scalar{]} \item[{\sphinxstylestrong{hold}}] \leavevmode{[}bool, optional, \sphinxstyleemphasis{deprecated}, default: True{]} \item[{\sphinxstylestrong{detrend}}] \leavevmode{[}callable, optional, default: \sphinxcode{\sphinxupquote{mlab.detrend\_none}}{]} \sphinxstyleemphasis{x} is detrended by the \sphinxstyleemphasis{detrend} callable. Default is no normalization. \item[{\sphinxstylestrong{normed}}] \leavevmode{[}bool, optional, default: True{]} If \sphinxcode{\sphinxupquote{True}}, input vectors are normalised to unit length. \item[{\sphinxstylestrong{usevlines}}] \leavevmode{[}bool, optional, default: True{]} If \sphinxcode{\sphinxupquote{True}}, \sphinxcode{\sphinxupquote{Axes.vlines}} is used to plot the vertical lines from the origin to the acorr. Otherwise, \sphinxcode{\sphinxupquote{Axes.plot}} is used. \item[{\sphinxstylestrong{maxlags}}] \leavevmode{[}integer, optional, default: 10{]} Number of lags to show. If \sphinxcode{\sphinxupquote{None}}, will return all \sphinxcode{\sphinxupquote{2 * len(x) - 1}} lags. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lags}}] \leavevmode{[}array (lenth \sphinxcode{\sphinxupquote{2*maxlags+1}}){]} lag vector. \item[{\sphinxstylestrong{c}}] \leavevmode{[}array (length \sphinxcode{\sphinxupquote{2*maxlags+1}}){]} auto correlation vector. \item[{\sphinxstylestrong{line}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}}{]} {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} added to the axes of the correlation. \begin{quote} {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} if \sphinxstyleemphasis{usevlines} is True {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} if \sphinxstyleemphasis{usevlines} is False \end{quote} \item[{\sphinxstylestrong{b}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} or None{]} Horizontal line at 0 if \sphinxstyleemphasis{usevlines} is True None \sphinxstyleemphasis{usevlines} is False \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{linestyle}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} prop, optional, default: None{]} Only used if usevlines is \sphinxcode{\sphinxupquote{False}}. \item[{\sphinxstylestrong{marker}}] \leavevmode{[}string, optional, default: ‘o’{]} \end{description} \end{description}\end{quote} \paragraph{Notes} The cross correlation is performed with \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.correlate.html\#numpy.correlate}{\sphinxcode{\sphinxupquote{numpy.correlate()}}} with \sphinxcode{\sphinxupquote{mode = 2}}. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.pyplot.angle\_spectrum} \label{\detokenize{api/_as_gen/matplotlib.pyplot.angle_spectrum:matplotlib-pyplot-angle-spectrum}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.angle_spectrum::doc}}\index{angle\_spectrum() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.angle_spectrum:matplotlib.pyplot.angle_spectrum}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{angle\_spectrum}}}{\emph{x}, \emph{Fs=None}, \emph{Fc=None}, \emph{window=None}, \emph{pad\_to=None}, \emph{sides=None}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Plot the angle spectrum. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{angle\PYGZus{}spectrum}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{Fs}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{Fc}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{window}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{window\PYGZus{}hanning}\PYG{p}{,} \PYG{n}{pad\PYGZus{}to}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{sides}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Compute the angle spectrum (wrapped phase spectrum) of \sphinxstyleemphasis{x}. Data is padded to a length of \sphinxstyleemphasis{pad\_to} and the windowing function \sphinxstyleemphasis{window} is applied to the signal. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1-D array or sequence{]} Array or sequence containing the data \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see \sphinxcode{\sphinxupquote{window\_hanning()}}, \sphinxcode{\sphinxupquote{window\_none()}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is \sphinxcode{\sphinxupquote{window\_hanning()}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to the length of the input signal (i.e. no padding). \item[{\sphinxstylestrong{Fc}}] \leavevmode{[}integer{]} The center frequency of \sphinxstyleemphasis{x} (defaults to 0), which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{spectrum}}] \leavevmode{[}1-D array{]} The values for the angle spectrum in radians (real valued) \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the elements in \sphinxstyleemphasis{spectrum} \item[{\sphinxstylestrong{line}}] \leavevmode{[}a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instance{]} The line created by this function \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Keyword arguments control the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.magnitude_spectrum:matplotlib.pyplot.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.angle_spectrum:matplotlib.pyplot.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}} plots the magnitudes of the corresponding frequencies. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.phase_spectrum:matplotlib.pyplot.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.phase_spectrum:matplotlib.pyplot.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}} plots the unwrapped version of this function. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.specgram:matplotlib.pyplot.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.specgram:matplotlib.pyplot.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}} can plot the angle spectrum of segments within the signal in a colormap. \end{description} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.pyplot.annotate} \label{\detokenize{api/_as_gen/matplotlib.pyplot.annotate:matplotlib-pyplot-annotate}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.annotate::doc}}\index{annotate() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.annotate:matplotlib.pyplot.annotate}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{annotate}}}{\emph{*args}, \emph{**kwargs}}{} Annotate the point \sphinxcode{\sphinxupquote{xy}} with text \sphinxcode{\sphinxupquote{s}}. Additional kwargs are passed to {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{s}}] \leavevmode{[}str{]} The text of the annotation \item[{\sphinxstylestrong{xy}}] \leavevmode{[}iterable{]} Length 2 sequence specifying the \sphinxstyleemphasis{(x,y)} point to annotate \item[{\sphinxstylestrong{xytext}}] \leavevmode{[}iterable, optional{]} Length 2 sequence specifying the \sphinxstyleemphasis{(x,y)} to place the text at. If None, defaults to \sphinxcode{\sphinxupquote{xy}}. \item[{\sphinxstylestrong{xycoords}}] \leavevmode{[}str, Artist, Transform, callable or tuple, optional{]} The coordinate system that \sphinxcode{\sphinxupquote{xy}} is given in. For a \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}} the allowed values are: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline ‘figure points’ & points from the lower left of the figure \\ \hline ‘figure pixels’ & pixels from the lower left of the figure \\ \hline ‘figure fraction’ & fraction of figure from lower left \\ \hline ‘axes points’ & points from lower left corner of axes \\ \hline ‘axes pixels’ & pixels from lower left corner of axes \\ \hline ‘axes fraction’ & fraction of axes from lower left \\ \hline ‘data’ & use the coordinate system of the object being annotated (default) \\ \hline ‘polar’ & \sphinxstyleemphasis{(theta,r)} if not native ‘data’ coordinates \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} If a {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} object is passed in the units are fraction if it’s bounding box. If a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} object is passed in use that to transform \sphinxcode{\sphinxupquote{xy}} to screen coordinates If a callable it must take a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.RendererBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RendererBase}}}}} object as input and return a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} or {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} object If a \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#tuple}{\sphinxcode{\sphinxupquote{tuple}}} must be length 2 tuple of str, \sphinxcode{\sphinxupquote{Artist}}, \sphinxcode{\sphinxupquote{Transform}} or callable objects. The first transform is used for the \sphinxstyleemphasis{x} coordinate and the second for \sphinxstyleemphasis{y}. See {\hyperref[\detokenize{tutorials/text/annotations:plotting-guide-annotation}]{\sphinxcrossref{\DUrole{std,std-ref}{Advanced Annotation}}}} for more details. Defaults to \sphinxcode{\sphinxupquote{'data'}} \item[{\sphinxstylestrong{textcoords}}] \leavevmode{[}str, \sphinxcode{\sphinxupquote{Artist}}, \sphinxcode{\sphinxupquote{Transform}}, callable or tuple, optional{]} The coordinate system that \sphinxcode{\sphinxupquote{xytext}} is given, which may be different than the coordinate system used for \sphinxcode{\sphinxupquote{xy}}. All \sphinxcode{\sphinxupquote{xycoords}} values are valid as well as the following strings: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline ‘offset points’ & offset (in points) from the \sphinxstyleemphasis{xy} value \\ \hline ‘offset pixels’ & offset (in pixels) from the \sphinxstyleemphasis{xy} value \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} defaults to the input of \sphinxcode{\sphinxupquote{xycoords}} \item[{\sphinxstylestrong{arrowprops}}] \leavevmode{[}dict, optional{]} If not None, properties used to draw a {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrowPatch}}}}} arrow between \sphinxcode{\sphinxupquote{xy}} and \sphinxcode{\sphinxupquote{xytext}}. If \sphinxcode{\sphinxupquote{arrowprops}} does not contain the key \sphinxcode{\sphinxupquote{'arrowstyle'}} the allowed keys are: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Key &\sphinxstyletheadfamily Description \\ \hline width & the width of the arrow in points \\ \hline headwidth & the width of the base of the arrow head in points \\ \hline headlength & the length of the arrow head in points \\ \hline shrink & fraction of total length to ‘shrink’ from both ends \\ \hline ? & any key to {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.FancyArrowPatch}}}}} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} If the \sphinxcode{\sphinxupquote{arrowprops}} contains the key \sphinxcode{\sphinxupquote{'arrowstyle'}} the above keys are forbidden. The allowed values of \sphinxcode{\sphinxupquote{'arrowstyle'}} are: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Name &\sphinxstyletheadfamily Attrs \\ \hline \sphinxcode{\sphinxupquote{'-'}} & None \\ \hline \sphinxcode{\sphinxupquote{'-\textgreater{}'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'-{[}'}} & widthB=1.0,lengthB=0.2,angleB=None \\ \hline \sphinxcode{\sphinxupquote{'\textbar{}-\textbar{}'}} & widthA=1.0,widthB=1.0 \\ \hline \sphinxcode{\sphinxupquote{'-\textbar{}\textgreater{}'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'\textless{}-'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'\textless{}-\textgreater{}'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'\textless{}\textbar{}-'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'\textless{}\textbar{}-\textbar{}\textgreater{}'}} & head\_length=0.4,head\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'fancy'}} & head\_length=0.4,head\_width=0.4,tail\_width=0.4 \\ \hline \sphinxcode{\sphinxupquote{'simple'}} & head\_length=0.5,head\_width=0.5,tail\_width=0.2 \\ \hline \sphinxcode{\sphinxupquote{'wedge'}} & tail\_width=0.3,shrink\_factor=0.5 \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Valid keys for {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrowPatch}}}}} are: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Key &\sphinxstyletheadfamily Description \\ \hline arrowstyle & the arrow style \\ \hline connectionstyle & the connection style \\ \hline relpos & default is (0.5, 0.5) \\ \hline patchA & default is bounding box of the text \\ \hline patchB & default is None \\ \hline shrinkA & default is 2 points \\ \hline shrinkB & default is 2 points \\ \hline mutation\_scale & default is text size (in points) \\ \hline mutation\_aspect & default is 1. \\ \hline ? & any key for {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.PathPatch:matplotlib.patches.PathPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.PathPatch}}}}} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Defaults to None \item[{\sphinxstylestrong{annotation\_clip}}] \leavevmode{[}bool, optional{]} Controls the visibility of the annotation when it goes outside the axes area. If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, the annotation will only be drawn when the \sphinxcode{\sphinxupquote{xy}} is inside the axes. If \sphinxhref{https://docs.python.org/3/library/constants.html\#False}{\sphinxcode{\sphinxupquote{False}}}, the annotation will always be drawn regardless of its position. The default is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, which behave as \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} only if \sphinxstyleemphasis{xycoords} is “data”. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Annotation}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.annotate}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.annotate:examples-using-matplotlib-pyplot-annotate}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_mathtext\_examples.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_xkcd.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \subsection{matplotlib.pyplot.arrow} \label{\detokenize{api/_as_gen/matplotlib.pyplot.arrow:matplotlib-pyplot-arrow}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.arrow::doc}}\index{arrow() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.arrow:matplotlib.pyplot.arrow}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{arrow}}}{\emph{x}, \emph{y}, \emph{dx}, \emph{dy}, \emph{hold=None}, \emph{**kwargs}}{} Add an arrow to the axes. This draws an arrow from \sphinxcode{\sphinxupquote{(x, y)}} to \sphinxcode{\sphinxupquote{(x+dx, y+dy)}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}float{]} The x/y-coordinate of the arrow base. \item[{\sphinxstylestrong{dx, dy}}] \leavevmode{[}float{]} The length of the arrow along x/y-direction. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{arrow}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrow:matplotlib.patches.FancyArrow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrow}}}}}{]} The created {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrow:matplotlib.patches.FancyArrow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrow}}}}} object. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode Optional kwargs (inherited from {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrow:matplotlib.patches.FancyArrow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrow}}}}} patch) control the arrow construction and properties: \item[{\sphinxstylestrong{Constructor arguments}}] \leavevmode\begin{description} \item[{\sphinxstyleemphasis{width}: float (default: 0.001)}] \leavevmode width of full arrow tail \item[{\sphinxstyleemphasis{length\_includes\_head}: bool (default: False)}] \leavevmode True if head is to be counted in calculating the length. \item[{\sphinxstyleemphasis{head\_width}: float or None (default: 3*width)}] \leavevmode total width of the full arrow head \item[{\sphinxstyleemphasis{head\_length}: float or None (default: 1.5 * head\_width)}] \leavevmode length of arrow head \item[{\sphinxstyleemphasis{shape}: {[}‘full’, ‘left’, ‘right’{]} (default: ‘full’)}] \leavevmode draw the left-half, right-half, or full arrow \item[{\sphinxstyleemphasis{overhang}: float (default: 0)}] \leavevmode fraction that the arrow is swept back (0 overhang means triangular shape). Can be negative or greater than one. \item[{\sphinxstyleemphasis{head\_starts\_at\_zero}: bool (default: False)}] \leavevmode if True, the head starts being drawn at coordinate 0 instead of ending at coordinate 0. \end{description} \item[{\sphinxstylestrong{Other valid kwargs (inherited from :class:{}`Patch{}`) are:}}] \leavevmode \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{description} \end{description}\end{quote} \paragraph{Notes} The resulting arrow is affected by the axes aspect ratio and limits. This may produce an arrow whose head is not square with its stem. To create an arrow whose head is square with its stem, use {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.annotate:matplotlib.pyplot.annotate}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{annotate()}}}}} for example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{annotate}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{xy}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{,} \PYG{n}{xytext}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)}\PYG{p}{,} \PYG{g+gp}{... } \PYG{n}{arrowprops}\PYG{o}{=}\PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{arrowstyle}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZhy{}\PYGZgt{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.arrow}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.arrow:examples-using-matplotlib-pyplot-arrow}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_arrow\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.autoscale} \label{\detokenize{api/_as_gen/matplotlib.pyplot.autoscale:matplotlib-pyplot-autoscale}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.autoscale::doc}}\index{autoscale() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.autoscale:matplotlib.pyplot.autoscale}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{autoscale}}}{\emph{enable=True}, \emph{axis='both'}, \emph{tight=None}}{} Autoscale the axis view to the data (toggle). Convenience method for simple axis view autoscaling. It turns autoscaling on or off, and then, if autoscaling for either axis is on, it performs the autoscaling on the specified axis or axes. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{enable}}] \leavevmode{[}bool or None, optional{]} True (default) turns autoscaling on, False turns it off. None leaves the autoscaling state unchanged. \item[{\sphinxstylestrong{axis}}] \leavevmode{[}{[}‘both’ \textbar{} ‘x’ \textbar{} ‘y’{]}, optional{]} which axis to operate on; default is ‘both’ \item[{\sphinxstylestrong{tight: bool or None, optional}}] \leavevmode If True, set view limits to data limits; if False, let the locator and margins expand the view limits; if None, use tight scaling if the only artist is an image, otherwise treat \sphinxstyleemphasis{tight} as False. The \sphinxstyleemphasis{tight} setting is retained for future autoscaling until it is explicitly changed. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.pyplot.autumn} \label{\detokenize{api/_as_gen/matplotlib.pyplot.autumn:matplotlib-pyplot-autumn}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.autumn::doc}}\index{autumn() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.autumn:matplotlib.pyplot.autumn}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{autumn}}}{}{} Set the colormap to “autumn”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.axes} \label{\detokenize{api/_as_gen/matplotlib.pyplot.axes:matplotlib-pyplot-axes}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.axes::doc}}\index{axes() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.axes:matplotlib.pyplot.axes}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{axes}}}{\emph{arg=None}, \emph{**kwargs}}{} Add an axes to the current figure and make it the current axes. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{arg}}] \leavevmode{[}None or 4-tuple or Axes{]} The exact behavior of this function depends on the type: \begin{itemize} \item {} \sphinxstyleemphasis{None}: A new full window axes is added using \sphinxcode{\sphinxupquote{subplot(111, **kwargs)}} \item {} 4-tuple of floats \sphinxstyleemphasis{rect} = \sphinxcode{\sphinxupquote{{[}left, bottom, width, height{]}}}. A new axes is added with dimensions \sphinxstyleemphasis{rect} in normalized (0, 1) units using {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_axes}}}}} on the current figure. \item {} {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}: This is equivalent to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.sca:matplotlib.pyplot.sca}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pyplot.sca}}}}}. It sets the current axes to \sphinxstyleemphasis{arg}. Note: This implicitly changes the current figure to the parent of \sphinxstyleemphasis{arg}. \begin{sphinxadmonition}{note}{Note:} The use of an Axes as an argument is deprecated and will be removed in v3.0. Please use {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.sca:matplotlib.pyplot.sca}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pyplot.sca}}}}} instead. \end{sphinxadmonition} \end{itemize} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{axes}}] \leavevmode{[}Axes{]} The created or activated axes. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode For allowed keyword arguments see {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot:matplotlib.pyplot.subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pyplot.subplot}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure.add\_axes}}}}} respectively. Some common keyword arguments are listed below: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily kwarg &\sphinxstyletheadfamily Accepts &\sphinxstyletheadfamily Description \\ \hline facecolor & color & the axes background color \\ \hline frameon & bool & whether to display the frame \\ \hline sharex & otherax & share x-axis with \sphinxstyleemphasis{otherax} \\ \hline sharey & otherax & share y-axis with \sphinxstyleemphasis{otherax} \\ \hline polar & bool & whether to use polar axes \\ \hline aspect & {[}str \textbar{} num{]} & {[}‘equal’, ‘auto’{]} or a number. If a number, the ratio of y-unit/x-unit in screen-space. See also {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_aspect:matplotlib.axes.Axes.set_aspect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_aspect}}}}}. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{description} \end{description}\end{quote} \paragraph{Examples} Creating a new full window axes: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plt}\PYG{o}{.}\PYG{n}{axes}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} Creating a new axes with specified dimensions and some kwargs: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plt}\PYG{o}{.}\PYG{n}{axes}\PYG{p}{(}\PYG{p}{(}\PYG{n}{left}\PYG{p}{,} \PYG{n}{bottom}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{n}{height}\PYG{p}{)}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{w}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.axes}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.axes:examples-using-matplotlib-pyplot-axes}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplots\_adjust.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_hist.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_arrow\_simple\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_mathtext\_examples.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_axes\_hbox\_divider.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_make\_room\_for\_ylabel\_using\_axesgrid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_lasso\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_tight\_bbox\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_textbox.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_check\_buttons.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_buttons.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_radio\_buttons.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_slider\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.axhline} \label{\detokenize{api/_as_gen/matplotlib.pyplot.axhline:matplotlib-pyplot-axhline}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.axhline::doc}}\index{axhline() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.axhline:matplotlib.pyplot.axhline}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{axhline}}}{\emph{y=0}, \emph{xmin=0}, \emph{xmax=1}, \emph{hold=None}, \emph{**kwargs}}{} Add a horizontal line across the axis. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar, optional, default: 0{]} y position in data coordinates of the horizontal line. \item[{\sphinxstylestrong{xmin}}] \leavevmode{[}scalar, optional, default: 0{]} Should be between 0 and 1, 0 being the far left of the plot, 1 the far right of the plot. \item[{\sphinxstylestrong{xmax}}] \leavevmode{[}scalar, optional, default: 1{]} Should be between 0 and 1, 0 being the far left of the plot, 1 the far right of the plot. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{:class:{}`\textasciitilde{}matplotlib.lines.Line2D{}`}}] \leavevmode \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Valid kwargs are {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties, with the exception of ‘transform’: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hlines:matplotlib.pyplot.hlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hlines}}}}}}] \leavevmode Add horizontal lines in data coordinates. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axhspan:matplotlib.pyplot.axhspan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axhspan}}}}}}] \leavevmode Add a horizontal span (rectangle) across the axis. \end{description} \paragraph{Examples} \begin{itemize} \item {} draw a thick red hline at ‘y’ = 0 that spans the xrange: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axhline}\PYG{p}{(}\PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \item {} draw a default hline at ‘y’ = 1 that spans the xrange: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axhline}\PYG{p}{(}\PYG{n}{y}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{)} \end{sphinxVerbatim} \item {} draw a default hline at ‘y’ = .5 that spans the middle half of the xrange: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axhline}\PYG{p}{(}\PYG{n}{y}\PYG{o}{=}\PYG{o}{.}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{n}{xmin}\PYG{o}{=}\PYG{l+m+mf}{0.25}\PYG{p}{,} \PYG{n}{xmax}\PYG{o}{=}\PYG{l+m+mf}{0.75}\PYG{p}{)} \end{sphinxVerbatim} \end{itemize} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.axhline}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.axhline:examples-using-matplotlib-pyplot-axhline}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axhspan\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_multiline.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_zorder\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.axhspan} \label{\detokenize{api/_as_gen/matplotlib.pyplot.axhspan:matplotlib-pyplot-axhspan}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.axhspan::doc}}\index{axhspan() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.axhspan:matplotlib.pyplot.axhspan}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{axhspan}}}{\emph{ymin}, \emph{ymax}, \emph{xmin=0}, \emph{xmax=1}, \emph{hold=None}, \emph{**kwargs}}{} Add a horizontal span (rectangle) across the axis. Draw a horizontal span (rectangle) from \sphinxstyleemphasis{ymin} to \sphinxstyleemphasis{ymax}. With the default values of \sphinxstyleemphasis{xmin} = 0 and \sphinxstyleemphasis{xmax} = 1, this always spans the xrange, regardless of the xlim settings, even if you change them, e.g., with the \sphinxcode{\sphinxupquote{set\_xlim()}} command. That is, the horizontal extent is in axes coords: 0=left, 0.5=middle, 1.0=right but the \sphinxstyleemphasis{y} location is in data coordinates. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ymin}}] \leavevmode{[}float{]} Lower limit of the horizontal span in data units. \item[{\sphinxstylestrong{ymax}}] \leavevmode{[}float{]} Upper limit of the horizontal span in data units. \item[{\sphinxstylestrong{xmin}}] \leavevmode{[}float, optional, default: 0{]} Lower limit of the vertical span in axes (relative 0-1) units. \item[{\sphinxstylestrong{xmax}}] \leavevmode{[}float, optional, default: 1{]} Upper limit of the vertical span in axes (relative 0-1) units. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Polygon}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Polygon}}}}}{]} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Polygon}}}}} properties.{]} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axvspan:matplotlib.pyplot.axvspan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axvspan}}}}}}] \leavevmode Add a vertical span across the axes. \end{description} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.axhspan}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.axhspan:examples-using-matplotlib-pyplot-axhspan}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axhspan\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.axis} \label{\detokenize{api/_as_gen/matplotlib.pyplot.axis:matplotlib-pyplot-axis}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.axis::doc}}\index{axis() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.axis:matplotlib.pyplot.axis}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{axis}}}{\emph{*v}, \emph{**kwargs}}{} Convenience method to get or set axis properties. Calling with no arguments: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axis}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} returns the current axes limits \sphinxcode{\sphinxupquote{{[}xmin, xmax, ymin, ymax{]}}}.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axis}\PYG{p}{(}\PYG{n}{v}\PYG{p}{)} \end{sphinxVerbatim} sets the min and max of the x and y axes, with \sphinxcode{\sphinxupquote{v = {[}xmin, xmax, ymin, ymax{]}}}.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axis}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{off}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} turns off the axis lines and labels.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axis}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{equal}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} changes limits of \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} axis so that equal increments of \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} have the same length; a circle is circular.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axis}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{scaled}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} achieves the same result by changing the dimensions of the plot box instead of the axis data limits.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axis}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{tight}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} changes \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} axis limits such that all data is shown. If all data is already shown, it will move it to the center of the figure without modifying (\sphinxstyleemphasis{xmax} - \sphinxstyleemphasis{xmin}) or (\sphinxstyleemphasis{ymax} - \sphinxstyleemphasis{ymin}). Note this is slightly different than in MATLAB.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axis}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{image}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} is ‘scaled’ with the axis limits equal to the data limits.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axis}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{auto}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} and: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axis}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{normal}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} are deprecated. They restore default behavior; axis limits are automatically scaled to make the data fit comfortably within the plot box. if \sphinxcode{\sphinxupquote{len(*v)==0}}, you can pass in \sphinxstyleemphasis{xmin}, \sphinxstyleemphasis{xmax}, \sphinxstyleemphasis{ymin}, \sphinxstyleemphasis{ymax} as kwargs selectively to alter just those limits without changing the others. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axis}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{square}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} changes the limit ranges (\sphinxstyleemphasis{xmax}-\sphinxstyleemphasis{xmin}) and (\sphinxstyleemphasis{ymax}-\sphinxstyleemphasis{ymin}) of the \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} axes to be the same, and have the same scaling, resulting in a square plot. The xmin, xmax, ymin, ymax tuple is returned \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.xlim:matplotlib.pyplot.xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xlim()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ylim:matplotlib.pyplot.ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ylim()}}}}}}] \leavevmode For setting the x- and y-limits individually. \end{description} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.axis}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.axis:examples-using-matplotlib-pyplot-axis}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_formatstr.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_text.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axhspan\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_artist\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_autowrap.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_stix\_fonts\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_font\_table\_ttf\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_fonts\_demo\_kw.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_text\_alignment.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_fonts\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_ginput\_manual\_clabel\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_contour\_manual.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_cursor\_demo\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_anscombe.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_slider\_demo.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \subsection{matplotlib.pyplot.axvline} \label{\detokenize{api/_as_gen/matplotlib.pyplot.axvline:matplotlib-pyplot-axvline}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.axvline::doc}}\index{axvline() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.axvline:matplotlib.pyplot.axvline}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{axvline}}}{\emph{x=0}, \emph{ymin=0}, \emph{ymax=1}, \emph{hold=None}, \emph{**kwargs}}{} Add a vertical line across the axes. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar, optional, default: 0{]} x position in data coordinates of the vertical line. \item[{\sphinxstylestrong{ymin}}] \leavevmode{[}scalar, optional, default: 0{]} Should be between 0 and 1, 0 being the bottom of the plot, 1 the top of the plot. \item[{\sphinxstylestrong{ymax}}] \leavevmode{[}scalar, optional, default: 1{]} Should be between 0 and 1, 0 being the bottom of the plot, 1 the top of the plot. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{:class:{}`\textasciitilde{}matplotlib.lines.Line2D{}`}}] \leavevmode \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Valid kwargs are {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties, with the exception of ‘transform’: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.vlines:matplotlib.pyplot.vlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{vlines}}}}}}] \leavevmode Add vertical lines in data coordinates. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axvspan:matplotlib.pyplot.axvspan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axvspan}}}}}}] \leavevmode Add a vertical span (rectangle) across the axis. \end{description} \paragraph{Examples} \begin{itemize} \item {} draw a thick red vline at \sphinxstyleemphasis{x} = 0 that spans the yrange: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axvline}\PYG{p}{(}\PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \item {} draw a default vline at \sphinxstyleemphasis{x} = 1 that spans the yrange: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axvline}\PYG{p}{(}\PYG{n}{x}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{)} \end{sphinxVerbatim} \item {} draw a default vline at \sphinxstyleemphasis{x} = .5 that spans the middle half of the yrange: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axvline}\PYG{p}{(}\PYG{n}{x}\PYG{o}{=}\PYG{o}{.}\PYG{l+m+mi}{5}\PYG{p}{,} \PYG{n}{ymin}\PYG{o}{=}\PYG{l+m+mf}{0.25}\PYG{p}{,} \PYG{n}{ymax}\PYG{o}{=}\PYG{l+m+mf}{0.75}\PYG{p}{)} \end{sphinxVerbatim} \end{itemize} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.axvline}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.axvline:examples-using-matplotlib-pyplot-axvline}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axhspan\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.axvspan} \label{\detokenize{api/_as_gen/matplotlib.pyplot.axvspan:matplotlib-pyplot-axvspan}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.axvspan::doc}}\index{axvspan() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.axvspan:matplotlib.pyplot.axvspan}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{axvspan}}}{\emph{xmin}, \emph{xmax}, \emph{ymin=0}, \emph{ymax=1}, \emph{hold=None}, \emph{**kwargs}}{} Add a vertical span (rectangle) across the axes. Draw a vertical span (rectangle) from \sphinxcode{\sphinxupquote{xmin}} to \sphinxcode{\sphinxupquote{xmax}}. With the default values of \sphinxcode{\sphinxupquote{ymin}} = 0 and \sphinxcode{\sphinxupquote{ymax}} = 1. This always spans the yrange, regardless of the ylim settings, even if you change them, e.g., with the \sphinxcode{\sphinxupquote{set\_ylim()}} command. That is, the vertical extent is in axes coords: 0=bottom, 0.5=middle, 1.0=top but the y location is in data coordinates. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{xmin}}] \leavevmode{[}scalar{]} Number indicating the first X-axis coordinate of the vertical span rectangle in data units. \item[{\sphinxstylestrong{xmax}}] \leavevmode{[}scalar{]} Number indicating the second X-axis coordinate of the vertical span rectangle in data units. \item[{\sphinxstylestrong{ymin}}] \leavevmode{[}scalar, optional{]} Number indicating the first Y-axis coordinate of the vertical span rectangle in relative Y-axis units (0-1). Default to 0. \item[{\sphinxstylestrong{ymax}}] \leavevmode{[}scalar, optional{]} Number indicating the second Y-axis coordinate of the vertical span rectangle in relative Y-axis units (0-1). Default to 1. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{rectangle}}] \leavevmode{[}matplotlib.patches.Polygon{]} Vertical span (rectangle) from (xmin, ymin) to (xmax, ymax). \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode Optional parameters are properties of the class matplotlib.patches.Polygon. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axhspan:matplotlib.pyplot.axhspan}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axhspan}}}}}}] \leavevmode Add a horizontal span across the axes. \end{description} \paragraph{Examples} Draw a vertical, green, translucent rectangle from x = 1.25 to x = 1.55 that spans the yrange of the axes. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axvspan}\PYG{p}{(}\PYG{l+m+mf}{1.25}\PYG{p}{,} \PYG{l+m+mf}{1.55}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.axvspan}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.axvspan:examples-using-matplotlib-pyplot-axvspan}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axhspan\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.bar} \label{\detokenize{api/_as_gen/matplotlib.pyplot.bar:matplotlib-pyplot-bar}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.bar::doc}}\index{bar() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.bar:matplotlib.pyplot.bar}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{bar}}}{\emph{*args}, \emph{**kwargs}}{} Make a bar plot. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{bar}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{align}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{bar}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{align}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{bar}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{n}{bottom}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{align}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} The bars are positioned at \sphinxstyleemphasis{x} with the given \sphinxstyleemphasis{align} ment. Their dimensions are given by \sphinxstyleemphasis{width} and \sphinxstyleemphasis{height}. The vertical baseline is \sphinxstyleemphasis{bottom} (default 0). Each of \sphinxstyleemphasis{x}, \sphinxstyleemphasis{height}, \sphinxstyleemphasis{width}, and \sphinxstyleemphasis{bottom} may either be a scalar applying to all bars, or it may be a sequence of length N providing a separate value for each bar. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}sequence of scalars{]} The x coordinates of the bars. See also \sphinxstyleemphasis{align} for the alignment of the bars to the coordinates. \item[{\sphinxstylestrong{height}}] \leavevmode{[}scalar or sequence of scalars{]} The height(s) of the bars. \item[{\sphinxstylestrong{width}}] \leavevmode{[}scalar or array-like, optional{]} The width(s) of the bars (default: 0.8). \item[{\sphinxstylestrong{bottom}}] \leavevmode{[}scalar or array-like, optional{]} The y coordinate(s) of the bars bases (default: 0). \item[{\sphinxstylestrong{align}}] \leavevmode{[}\{‘center’, ‘edge’\}, optional, default: ‘center’{]} Alignment of the bars to the \sphinxstyleemphasis{x} coordinates: \begin{itemize} \item {} ‘center’: Center the base on the \sphinxstyleemphasis{x} positions. \item {} ‘edge’: Align the left edges of the bars with the \sphinxstyleemphasis{x} positions. \end{itemize} To align the bars on the right edge pass a negative \sphinxstyleemphasis{width} and \sphinxcode{\sphinxupquote{align='edge'}}. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{{}`.BarContainer{}`}}] \leavevmode Container with all the bars and optionally errorbars. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{color}}] \leavevmode{[}scalar or array-like, optional{]} The colors of the bar faces. \item[{\sphinxstylestrong{edgecolor}}] \leavevmode{[}scalar or array-like, optional{]} The colors of the bar edges. \item[{\sphinxstylestrong{linewidth}}] \leavevmode{[}scalar or array-like, optional{]} Width of the bar edge(s). If 0, don’t draw edges. \item[{\sphinxstylestrong{tick\_label}}] \leavevmode{[}string or array-like, optional{]} The tick labels of the bars. Default: None (Use default numeric labels.) \item[{\sphinxstylestrong{xerr, yerr}}] \leavevmode{[}scalar or array-like of shape(N,) or shape(2,N), optional{]} If not \sphinxstyleemphasis{None}, add horizontal / vertical errorbars to the bar tips. The values are +/- sizes relative to the data: \begin{itemize} \item {} scalar: symmetric +/- values for all bars \item {} shape(N,): symmetric +/- values for each bar \item {} shape(2,N): separate + and - values for each bar \end{itemize} Default: None \item[{\sphinxstylestrong{ecolor}}] \leavevmode{[}scalar or array-like, optional, default: ‘black’{]} The line color of the errorbars. \item[{\sphinxstylestrong{capsize}}] \leavevmode{[}scalar, optional{]} The length of the error bar caps in points. Default: None, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"errorbar.capsize"{]}}}. \item[{\sphinxstylestrong{error\_kw}}] \leavevmode{[}dict, optional{]} Dictionary of kwargs to be passed to the {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.errorbar:matplotlib.axes.Axes.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar}}}}} method. Values of \sphinxstyleemphasis{ecolor} or \sphinxstyleemphasis{capsize} defined here take precedence over the independent kwargs. \item[{\sphinxstylestrong{log}}] \leavevmode{[}bool, optional, default: False{]} If \sphinxstyleemphasis{True}, set the y-axis to be log scale. \item[{\sphinxstylestrong{orientation}}] \leavevmode{[}\{‘vertical’, ‘horizontal’\}, optional{]} \sphinxstyleemphasis{This is for internal use only.} Please use {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.barh:matplotlib.pyplot.barh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{barh}}}}} for horizontal bar plots. Default: ‘vertical’. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.barh:matplotlib.pyplot.barh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{barh}}}}}}] \leavevmode Plot a horizontal bar plot. \end{description} \paragraph{Notes} The optional arguments \sphinxstyleemphasis{color}, \sphinxstyleemphasis{edgecolor}, \sphinxstyleemphasis{linewidth}, \sphinxstyleemphasis{xerr}, and \sphinxstyleemphasis{yerr} can be either scalars or sequences of length equal to the number of bars. This enables you to use bar as the basis for stacked bar charts, or candlestick plots. Detail: \sphinxstyleemphasis{xerr} and \sphinxstyleemphasis{yerr} are passed directly to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.errorbar:matplotlib.pyplot.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar()}}}}}, so they can also have shape 2xN for independent specification of lower and upper errors. Other optional kwargs: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘bottom’, ‘color’, ‘ecolor’, ‘edgecolor’, ‘height’, ‘left’, ‘linewidth’, ‘tick\_label’, ‘width’, ‘x’, ‘xerr’, ‘y’, ‘yerr’. \item {} All positional arguments. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.bar}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.bar:examples-using-matplotlib-pyplot-bar}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_bar\_stacked.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_table\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_system\_monitor.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_custom\_ticker1.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \subsection{matplotlib.pyplot.barbs} \label{\detokenize{api/_as_gen/matplotlib.pyplot.barbs:matplotlib-pyplot-barbs}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.barbs::doc}}\index{barbs() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.barbs:matplotlib.pyplot.barbs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{barbs}}}{\emph{*args}, \emph{**kw}}{} Plot a 2-D field of barbs. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{barb}\PYG{p}{(}\PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \PYG{n}{barb}\PYG{p}{(}\PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \PYG{n}{barb}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \PYG{n}{barb}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \end{sphinxVerbatim} Arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}:}] \leavevmode The x and y coordinates of the barb locations (default is head of barb; see \sphinxstyleemphasis{pivot} kwarg) \item[{\sphinxstyleemphasis{U}, \sphinxstyleemphasis{V}:}] \leavevmode Give the x and y components of the barb shaft \item[{\sphinxstyleemphasis{C}:}] \leavevmode An optional array used to map colors to the barbs \end{description} \end{quote} All arguments may be 1-D or 2-D arrays or sequences. If \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are absent, they will be generated as a uniform grid. If \sphinxstyleemphasis{U} and \sphinxstyleemphasis{V} are 2-D arrays but \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are 1-D, and if \sphinxcode{\sphinxupquote{len(X)}} and \sphinxcode{\sphinxupquote{len(Y)}} match the column and row dimensions of \sphinxstyleemphasis{U}, then \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} will be expanded with \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.meshgrid.html\#numpy.meshgrid}{\sphinxcode{\sphinxupquote{numpy.meshgrid()}}}. \sphinxstyleemphasis{U}, \sphinxstyleemphasis{V}, \sphinxstyleemphasis{C} may be masked arrays, but masked \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y} are not supported at present. Keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{length}:}] \leavevmode Length of the barb in points; the other parts of the barb are scaled against this. Default is 7. \item[{\sphinxstyleemphasis{pivot}: {[} ‘tip’ \textbar{} ‘middle’ \textbar{} float {]}}] \leavevmode The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name \sphinxstyleemphasis{pivot}. Default is ‘tip’. Can also be a number, which shifts the start of the barb that many points from the origin. \item[{\sphinxstyleemphasis{barbcolor}: {[} color \textbar{} color sequence {]}}] \leavevmode Specifies the color all parts of the barb except any flags. This parameter is analogous to the \sphinxstyleemphasis{edgecolor} parameter for polygons, which can be used instead. However this parameter will override facecolor. \item[{\sphinxstyleemphasis{flagcolor}: {[} color \textbar{} color sequence {]}}] \leavevmode Specifies the color of any flags on the barb. This parameter is analogous to the \sphinxstyleemphasis{facecolor} parameter for polygons, which can be used instead. However this parameter will override facecolor. If this is not set (and \sphinxstyleemphasis{C} has not either) then \sphinxstyleemphasis{flagcolor} will be set to match \sphinxstyleemphasis{barbcolor} so that the barb has a uniform color. If \sphinxstyleemphasis{C} has been set, \sphinxstyleemphasis{flagcolor} has no effect. \item[{\sphinxstyleemphasis{sizes}:}] \leavevmode A dictionary of coefficients specifying the ratio of a given feature to the length of the barb. Only those values one wishes to override need to be included. These features include: \begin{itemize} \item {} ‘spacing’ - space between features (flags, full/half barbs) \item {} ‘height’ - height (distance from shaft to top) of a flag or full barb \item {} ‘width’ - width of a flag, twice the width of a full barb \item {} ‘emptybarb’ - radius of the circle used for low magnitudes \end{itemize} \item[{\sphinxstyleemphasis{fill\_empty}:}] \leavevmode A flag on whether the empty barbs (circles) that are drawn should be filled with the flag color. If they are not filled, they will be drawn such that no color is applied to the center. Default is False \item[{\sphinxstyleemphasis{rounding}:}] \leavevmode A flag to indicate whether the vector magnitude should be rounded when allocating barb components. If True, the magnitude is rounded to the nearest multiple of the half-barb increment. If False, the magnitude is simply truncated to the next lowest multiple. Default is True \item[{\sphinxstyleemphasis{barb\_increments}:}] \leavevmode A dictionary of increments specifying values to associate with different parts of the barb. Only those values one wishes to override need to be included. \begin{itemize} \item {} ‘half’ - half barbs (Default is 5) \item {} ‘full’ - full barbs (Default is 10) \item {} ‘flag’ - flags (default is 50) \end{itemize} \item[{\sphinxstyleemphasis{flip\_barb}:}] \leavevmode Either a single boolean flag or an array of booleans. Single boolean indicates whether the lines and flags should point opposite to normal for all barbs. An array (which should be the same size as the other data arrays) indicates whether to flip for each individual barb. Normal behavior is for the barbs and lines to point right (comes from wind barbs having these features point towards low pressure in the Northern Hemisphere.) Default is False \end{description} \end{quote} Barbs are traditionally used in meteorology as a way to plot the speed and direction of wind observations, but can technically be used to plot any two dimensional vector quantity. As opposed to arrows, which give vector magnitude by the length of the arrow, the barbs give more quantitative information about the vector magnitude by putting slanted lines or a triangle for various increments in magnitude, as show schematically below: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{:} \PYG{o}{/}\PYGZbs{} \PYGZbs{}\PYGZbs{} \PYG{p}{:} \PYG{o}{/} \PYGZbs{} \PYGZbs{}\PYGZbs{} \PYG{p}{:} \PYG{o}{/} \PYGZbs{} \PYGZbs{} \PYGZbs{}\PYGZbs{} \PYG{p}{:} \PYG{o}{/} \PYGZbs{} \PYGZbs{} \PYGZbs{}\PYGZbs{} \PYG{p}{:} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}} \end{sphinxVerbatim} The largest increment is given by a triangle (or “flag”). After those come full lines (barbs). The smallest increment is a half line. There is only, of course, ever at most 1 half line. If the magnitude is small and only needs a single half-line and no full lines or triangles, the half-line is offset from the end of the barb so that it can be easily distinguished from barbs with a single full line. The magnitude for the barb shown above would nominally be 65, using the standard increments of 50, 10, and 5. linewidths and edgecolors can be used to customize the barb. Additional {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} keyword arguments: \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or antialiaseds & Boolean or sequence of booleans \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{array}}}}} & ndarray \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}} & a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cmap}}}}} & a colormap or registered colormap name \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color arg or sequence of rgba tuples \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or edgecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or facecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or dashes or linestyles & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or linewidths or lw & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_norm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{norm}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offset\_position}}}}} & {[} ‘screen’ \textbar{} ‘data’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offsets}}}}} & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_urls}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{urls}}}}} & List{[}str{]} or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All positional and all keyword arguments. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.pyplot.barh} \label{\detokenize{api/_as_gen/matplotlib.pyplot.barh:matplotlib-pyplot-barh}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.barh::doc}}\index{barh() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.barh:matplotlib.pyplot.barh}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{barh}}}{\emph{*args}, \emph{**kwargs}}{} Make a horizontal bar plot. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{bar}\PYG{p}{(}\PYG{n}{y}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{align}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{bar}\PYG{p}{(}\PYG{n}{y}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{align}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{bar}\PYG{p}{(}\PYG{n}{y}\PYG{p}{,} \PYG{n}{width}\PYG{p}{,} \PYG{n}{height}\PYG{p}{,} \PYG{n}{left}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{align}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} The bars are positioned at \sphinxstyleemphasis{y} with the given \sphinxstyleemphasis{align}. Their dimensions are given by \sphinxstyleemphasis{width} and \sphinxstyleemphasis{height}. The horizontal baseline is \sphinxstyleemphasis{left} (default 0). Each of \sphinxstyleemphasis{y}, \sphinxstyleemphasis{width}, \sphinxstyleemphasis{height}, and \sphinxstyleemphasis{left} may either be a scalar applying to all bars, or it may be a sequence of length N providing a separate value for each bar. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar or array-like{]} The y coordinates of the bars. See also \sphinxstyleemphasis{align} for the alignment of the bars to the coordinates. \item[{\sphinxstylestrong{width}}] \leavevmode{[}scalar or array-like{]} The width(s) of the bars. \item[{\sphinxstylestrong{height}}] \leavevmode{[}sequence of scalars, optional, default: 0.8{]} The heights of the bars. \item[{\sphinxstylestrong{left}}] \leavevmode{[}sequence of scalars{]} The x coordinates of the left sides of the bars (default: 0). \item[{\sphinxstylestrong{align}}] \leavevmode{[}\{‘center’, ‘edge’\}, optional, default: ‘center’{]} Alignment of the base to the \sphinxstyleemphasis{y} coordinates*: \begin{itemize} \item {} ‘center’: Center the bars on the \sphinxstyleemphasis{y} positions. \item {} ‘edge’: Align the bottom edges of the bars with the \sphinxstyleemphasis{y} positions. \end{itemize} To align the bars on the top edge pass a negative \sphinxstyleemphasis{height} and \sphinxcode{\sphinxupquote{align='edge'}}. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{{}`.BarContainer{}`}}] \leavevmode Container with all the bars and optionally errorbars. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{color}}] \leavevmode{[}scalar or array-like, optional{]} The colors of the bar faces. \item[{\sphinxstylestrong{edgecolor}}] \leavevmode{[}scalar or array-like, optional{]} The colors of the bar edges. \item[{\sphinxstylestrong{linewidth}}] \leavevmode{[}scalar or array-like, optional{]} Width of the bar edge(s). If 0, don’t draw edges. \item[{\sphinxstylestrong{tick\_label}}] \leavevmode{[}string or array-like, optional{]} The tick labels of the bars. Default: None (Use default numeric labels.) \item[{\sphinxstylestrong{xerr, yerr}}] \leavevmode{[}scalar or array-like of shape(N,) or shape(2,N), optional{]} If not \sphinxcode{\sphinxupquote{None}}, add horizontal / vertical errorbars to the bar tips. The values are +/- sizes relative to the data: \begin{itemize} \item {} scalar: symmetric +/- values for all bars \item {} shape(N,): symmetric +/- values for each bar \item {} shape(2,N): separate + and - values for each bar \end{itemize} Default: None \item[{\sphinxstylestrong{ecolor}}] \leavevmode{[}scalar or array-like, optional, default: ‘black’{]} The line color of the errorbars. \item[{\sphinxstylestrong{capsize}}] \leavevmode{[}scalar, optional{]} The length of the error bar caps in points. Default: None, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"errorbar.capsize"{]}}}. \item[{\sphinxstylestrong{error\_kw}}] \leavevmode{[}dict, optional{]} Dictionary of kwargs to be passed to the {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.errorbar:matplotlib.axes.Axes.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar}}}}} method. Values of \sphinxstyleemphasis{ecolor} or \sphinxstyleemphasis{capsize} defined here take precedence over the independent kwargs. \item[{\sphinxstylestrong{log}}] \leavevmode{[}bool, optional, default: False{]} If \sphinxcode{\sphinxupquote{True}}, set the x-axis to be log scale. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.bar:matplotlib.pyplot.bar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bar}}}}}}] \leavevmode Plot a vertical bar plot. \end{description} \paragraph{Notes} The optional arguments \sphinxstyleemphasis{color}, \sphinxstyleemphasis{edgecolor}, \sphinxstyleemphasis{linewidth}, \sphinxstyleemphasis{xerr}, and \sphinxstyleemphasis{yerr} can be either scalars or sequences of length equal to the number of bars. This enables you to use bar as the basis for stacked bar charts, or candlestick plots. Detail: \sphinxstyleemphasis{xerr} and \sphinxstyleemphasis{yerr} are passed directly to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.errorbar:matplotlib.pyplot.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar()}}}}}, so they can also have shape 2xN for independent specification of lower and upper errors. Other optional kwargs: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color spec \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or ec & mpl color spec, None, ‘none’, or ‘auto’ \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or fc & mpl color spec, or None for default, or ‘none’ for no color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_fill}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[}‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float or None for default \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \end{fulllineitems} \subsection{matplotlib.pyplot.bone} \label{\detokenize{api/_as_gen/matplotlib.pyplot.bone:matplotlib-pyplot-bone}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.bone::doc}}\index{bone() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.bone:matplotlib.pyplot.bone}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{bone}}}{}{} Set the colormap to “bone”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.box} \label{\detokenize{api/_as_gen/matplotlib.pyplot.box:matplotlib-pyplot-box}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.box::doc}}\index{box() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.box:matplotlib.pyplot.box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{box}}}{\emph{on=None}}{} Turn the axes box on or off. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{on}}] \leavevmode{[}bool or None{]} The new axes box state. If \sphinxcode{\sphinxupquote{None}}, toggle the state. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.pyplot.boxplot} \label{\detokenize{api/_as_gen/matplotlib.pyplot.boxplot:matplotlib-pyplot-boxplot}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.boxplot::doc}}\index{boxplot() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.boxplot:matplotlib.pyplot.boxplot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{boxplot}}}{\emph{x}, \emph{notch=None}, \emph{sym=None}, \emph{vert=None}, \emph{whis=None}, \emph{positions=None}, \emph{widths=None}, \emph{patch\_artist=None}, \emph{bootstrap=None}, \emph{usermedians=None}, \emph{conf\_intervals=None}, \emph{meanline=None}, \emph{showmeans=None}, \emph{showcaps=None}, \emph{showbox=None}, \emph{showfliers=None}, \emph{boxprops=None}, \emph{labels=None}, \emph{flierprops=None}, \emph{medianprops=None}, \emph{meanprops=None}, \emph{capprops=None}, \emph{whiskerprops=None}, \emph{manage\_xticks=True}, \emph{autorange=False}, \emph{zorder=None}, \emph{hold=None}, \emph{data=None}}{} Make a box and whisker plot. Make a box and whisker plot for each column of \sphinxcode{\sphinxupquote{x}} or each vector in sequence \sphinxcode{\sphinxupquote{x}}. The box extends from the lower to upper quartile values of the data, with a line at the median. The whiskers extend from the box to show the range of the data. Flier points are those past the end of the whiskers. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}Array or a sequence of vectors.{]} The input data. \item[{\sphinxstylestrong{notch}}] \leavevmode{[}bool, optional (False){]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, will produce a notched box plot. Otherwise, a rectangular boxplot is produced. The notches represent the confidence interval (CI) around the median. See the entry for the \sphinxcode{\sphinxupquote{bootstrap}} parameter for information regarding how the locations of the notches are computed. \begin{sphinxadmonition}{note}{Note:} In cases where the values of the CI are less than the lower quartile or greater than the upper quartile, the notches will extend beyond the box, giving it a distinctive “flipped” appearance. This is expected behavior and consistent with other statistical visualization packages. \end{sphinxadmonition} \item[{\sphinxstylestrong{sym}}] \leavevmode{[}str, optional{]} The default symbol for flier points. Enter an empty string (‘’) if you don’t want to show fliers. If \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, then the fliers default to ‘b+’ If you want more control use the flierprops kwarg. \item[{\sphinxstylestrong{vert}}] \leavevmode{[}bool, optional (True){]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} (default), makes the boxes vertical. If \sphinxhref{https://docs.python.org/3/library/constants.html\#False}{\sphinxcode{\sphinxupquote{False}}}, everything is drawn horizontally. \item[{\sphinxstylestrong{whis}}] \leavevmode{[}float, sequence, or string (default = 1.5){]} As a float, determines the reach of the whiskers to the beyond the first and third quartiles. In other words, where IQR is the interquartile range (\sphinxcode{\sphinxupquote{Q3-Q1}}), the upper whisker will extend to last datum less than \sphinxcode{\sphinxupquote{Q3 + whis*IQR}}). Similarly, the lower whisker will extend to the first datum greater than \sphinxcode{\sphinxupquote{Q1 - whis*IQR}}. Beyond the whiskers, data are considered outliers and are plotted as individual points. Set this to an unreasonably high value to force the whiskers to show the min and max values. Alternatively, set this to an ascending sequence of percentile (e.g., {[}5, 95{]}) to set the whiskers at specific percentiles of the data. Finally, \sphinxcode{\sphinxupquote{whis}} can be the string \sphinxcode{\sphinxupquote{'range'}} to force the whiskers to the min and max of the data. \item[{\sphinxstylestrong{bootstrap}}] \leavevmode{[}int, optional{]} Specifies whether to bootstrap the confidence intervals around the median for notched boxplots. If \sphinxcode{\sphinxupquote{bootstrap}} is None, no bootstrapping is performed, and notches are calculated using a Gaussian-based asymptotic approximation (see McGill, R., Tukey, J.W., and Larsen, W.A., 1978, and Kendall and Stuart, 1967). Otherwise, bootstrap specifies the number of times to bootstrap the median to determine its 95\% confidence intervals. Values between 1000 and 10000 are recommended. \item[{\sphinxstylestrong{usermedians}}] \leavevmode{[}array-like, optional{]} An array or sequence whose first dimension (or length) is compatible with \sphinxcode{\sphinxupquote{x}}. This overrides the medians computed by matplotlib for each element of \sphinxcode{\sphinxupquote{usermedians}} that is not \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}. When an element of \sphinxcode{\sphinxupquote{usermedians}} is None, the median will be computed by matplotlib as normal. \item[{\sphinxstylestrong{conf\_intervals}}] \leavevmode{[}array-like, optional{]} Array or sequence whose first dimension (or length) is compatible with \sphinxcode{\sphinxupquote{x}} and whose second dimension is 2. When the an element of \sphinxcode{\sphinxupquote{conf\_intervals}} is not None, the notch locations computed by matplotlib are overridden (provided \sphinxcode{\sphinxupquote{notch}} is \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}). When an element of \sphinxcode{\sphinxupquote{conf\_intervals}} is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, the notches are computed by the method specified by the other kwargs (e.g., \sphinxcode{\sphinxupquote{bootstrap}}). \item[{\sphinxstylestrong{positions}}] \leavevmode{[}array-like, optional{]} Sets the positions of the boxes. The ticks and limits are automatically set to match the positions. Defaults to \sphinxcode{\sphinxupquote{range(1, N+1)}} where N is the number of boxes to be drawn. \item[{\sphinxstylestrong{widths}}] \leavevmode{[}scalar or array-like{]} Sets the width of each box either with a scalar or a sequence. The default is 0.5, or \sphinxcode{\sphinxupquote{0.15*(distance between extreme positions)}}, if that is smaller. \item[{\sphinxstylestrong{patch\_artist}}] \leavevmode{[}bool, optional (False){]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#False}{\sphinxcode{\sphinxupquote{False}}} produces boxes with the Line2D artist. Otherwise, boxes and drawn with Patch artists. \item[{\sphinxstylestrong{labels}}] \leavevmode{[}sequence, optional{]} Labels for each dataset. Length must be compatible with dimensions of \sphinxcode{\sphinxupquote{x}}. \item[{\sphinxstylestrong{manage\_xticks}}] \leavevmode{[}bool, optional (True){]} If the function should adjust the xlim and xtick locations. \item[{\sphinxstylestrong{autorange}}] \leavevmode{[}bool, optional (False){]} When \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} and the data are distributed such that the 25th and 75th percentiles are equal, \sphinxcode{\sphinxupquote{whis}} is set to \sphinxcode{\sphinxupquote{'range'}} such that the whisker ends are at the minimum and maximum of the data. \item[{\sphinxstylestrong{meanline}}] \leavevmode{[}bool, optional (False){]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}} (and \sphinxcode{\sphinxupquote{showmeans}} is \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}), will try to render the mean as a line spanning the full width of the box according to \sphinxcode{\sphinxupquote{meanprops}} (see below). Not recommended if \sphinxcode{\sphinxupquote{shownotches}} is also True. Otherwise, means will be shown as points. \item[{\sphinxstylestrong{zorder}}] \leavevmode{[}scalar, optional (None){]} Sets the zorder of the boxplot. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{result}}] \leavevmode{[}dict{]} A dictionary mapping each component of the boxplot to a list of the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.lines.Line2D}}}}} instances created. That dictionary has the following keys (assuming vertical boxplots): \begin{itemize} \item {} \sphinxcode{\sphinxupquote{boxes}}: the main body of the boxplot showing the quartiles and the median’s confidence intervals if enabled. \item {} \sphinxcode{\sphinxupquote{medians}}: horizontal lines at the median of each box. \item {} \sphinxcode{\sphinxupquote{whiskers}}: the vertical lines extending to the most extreme, non-outlier data points. \item {} \sphinxcode{\sphinxupquote{caps}}: the horizontal lines at the ends of the whiskers. \item {} \sphinxcode{\sphinxupquote{fliers}}: points representing data that extend beyond the whiskers (fliers). \item {} \sphinxcode{\sphinxupquote{means}}: points or lines representing the means. \end{itemize} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{showcaps}}] \leavevmode{[}bool, optional (True){]} Show the caps on the ends of whiskers. \item[{\sphinxstylestrong{showbox}}] \leavevmode{[}bool, optional (True){]} Show the central box. \item[{\sphinxstylestrong{showfliers}}] \leavevmode{[}bool, optional (True){]} Show the outliers beyond the caps. \item[{\sphinxstylestrong{showmeans}}] \leavevmode{[}bool, optional (False){]} Show the arithmetic means. \item[{\sphinxstylestrong{capprops}}] \leavevmode{[}dict, optional (None){]} Specifies the style of the caps. \item[{\sphinxstylestrong{boxprops}}] \leavevmode{[}dict, optional (None){]} Specifies the style of the box. \item[{\sphinxstylestrong{whiskerprops}}] \leavevmode{[}dict, optional (None){]} Specifies the style of the whiskers. \item[{\sphinxstylestrong{flierprops}}] \leavevmode{[}dict, optional (None){]} Specifies the style of the fliers. \item[{\sphinxstylestrong{medianprops}}] \leavevmode{[}dict, optional (None){]} Specifies the style of the median. \item[{\sphinxstylestrong{meanprops}}] \leavevmode{[}dict, optional (None){]} Specifies the style of the mean. \end{description} \end{description}\end{quote} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All positional and all keyword arguments. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.pyplot.broken\_barh} \label{\detokenize{api/_as_gen/matplotlib.pyplot.broken_barh:matplotlib-pyplot-broken-barh}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.broken_barh::doc}}\index{broken\_barh() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.broken_barh:matplotlib.pyplot.broken_barh}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{broken\_barh}}}{\emph{xranges}, \emph{yrange}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Plot a horizontal sequence of rectangles. A rectangle is drawn for each element of \sphinxstyleemphasis{xranges}. All rectangles have the same vertical position and size defined by \sphinxstyleemphasis{yrange}. This is a convenience function for instantiating a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BrokenBarHCollection}}}}}, adding it to the axes and autoscaling the view. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{xranges}}] \leavevmode{[}sequence of tuples (\sphinxstyleemphasis{xmin}, \sphinxstyleemphasis{xwidth}){]} The x-positions and extends of the rectangles. For each tuple (\sphinxstyleemphasis{xmin}, \sphinxstyleemphasis{xwidth}) a rectangle is drawn from \sphinxstyleemphasis{xmin} to \sphinxstyleemphasis{xmin} + \sphinxstyleemphasis{xwidth}. \item[{\sphinxstylestrong{yranges}}] \leavevmode{[}(\sphinxstyleemphasis{ymin}, \sphinxstyleemphasis{ymax}){]} The y-position and extend for all the rectangles. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{:class:{}`matplotlib.collections.BrokenBarHCollection{}`}}] \leavevmode \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.BrokenBarHCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BrokenBarHCollection}}}}} properties{]} Each \sphinxstyleemphasis{kwarg} can be either a single argument applying to all rectangles, e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{facecolors}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{black}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} or a sequence of arguments over which is cycled, e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{facecolors}\PYG{o}{=}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{black}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{blue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} would create interleaving black and blue rectangles. Supported keywords: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or antialiaseds & Boolean or sequence of booleans \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{array}}}}} & ndarray \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}} & a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cmap}}}}} & a colormap or registered colormap name \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color arg or sequence of rgba tuples \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or edgecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or facecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or dashes or linestyles & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or linewidths or lw & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_norm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{norm}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offset\_position}}}}} & {[} ‘screen’ \textbar{} ‘data’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offsets}}}}} & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_urls}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{urls}}}}} & List{[}str{]} or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All positional and all keyword arguments. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.pyplot.cla} \label{\detokenize{api/_as_gen/matplotlib.pyplot.cla:matplotlib-pyplot-cla}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.cla::doc}}\index{cla() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.cla:matplotlib.pyplot.cla}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{cla}}}{}{} Clear the current axes. \end{fulllineitems} \subsection{matplotlib.pyplot.clabel} \label{\detokenize{api/_as_gen/matplotlib.pyplot.clabel:matplotlib-pyplot-clabel}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.clabel::doc}}\index{clabel() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.clabel:matplotlib.pyplot.clabel}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{clabel}}}{\emph{CS}, \emph{*args}, \emph{**kwargs}}{} Label a contour plot. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{clabel}\PYG{p}{(}\PYG{n}{cs}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Adds labels to line contours in \sphinxstyleemphasis{cs}, where \sphinxstyleemphasis{cs} is a {\hyperref[\detokenize{api/contour_api:matplotlib.contour.ContourSet}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ContourSet}}}}} object returned by contour. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{clabel}\PYG{p}{(}\PYG{n}{cs}\PYG{p}{,} \PYG{n}{v}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} only labels contours listed in \sphinxstyleemphasis{v}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fontsize}}] \leavevmode{[}string or float, optional{]} Size in points or relative size e.g., ‘smaller’, ‘x-large’. See \sphinxcode{\sphinxupquote{Text.set\_size}} for accepted string values. \item[{\sphinxstylestrong{colors :}}] \leavevmode Color of each label \begin{itemize} \item {} if \sphinxstyleemphasis{None}, the color of each label matches the color of the corresponding contour \item {} if one string color, e.g., \sphinxstyleemphasis{colors} = ‘r’ or \sphinxstyleemphasis{colors} = ‘red’, all labels will be plotted in this color \item {} if a tuple of matplotlib color args (string, float, rgb, etc), different labels will be plotted in different colors in the order specified \end{itemize} \item[{\sphinxstylestrong{inline}}] \leavevmode{[}bool, optional{]} If \sphinxcode{\sphinxupquote{True}} the underlying contour is removed where the label is placed. Default is \sphinxcode{\sphinxupquote{True}}. \item[{\sphinxstylestrong{inline\_spacing}}] \leavevmode{[}float, optional{]} Space in pixels to leave on each side of label when placing inline. Defaults to 5. This spacing will be exact for labels at locations where the contour is straight, less so for labels on curved contours. \item[{\sphinxstylestrong{fmt}}] \leavevmode{[}string or dict, optional{]} A format string for the label. Default is ‘\%1.3f’ Alternatively, this can be a dictionary matching contour levels with arbitrary strings to use for each contour level (i.e., fmt{[}level{]}=string), or it can be any callable, such as a {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Formatter}}}}} instance, that returns a string when called with a numeric contour level. \item[{\sphinxstylestrong{manual}}] \leavevmode{[}bool or iterable, optional{]} If \sphinxcode{\sphinxupquote{True}}, contour labels will be placed manually using mouse clicks. Click the first button near a contour to add a label, click the second button (or potentially both mouse buttons at once) to finish adding labels. The third button can be used to remove the last label added, but only if labels are not inline. Alternatively, the keyboard can be used to select label locations (enter to end label placement, delete or backspace act like the third mouse button, and any other key will select a label location). \sphinxstyleemphasis{manual} can also be an iterable object of x,y tuples. Contour labels will be created as if mouse is clicked at each x,y positions. \item[{\sphinxstylestrong{rightside\_up}}] \leavevmode{[}bool, optional{]} If \sphinxcode{\sphinxupquote{True}}, label rotations will always be plus or minus 90 degrees from level. Default is \sphinxcode{\sphinxupquote{True}}. \item[{\sphinxstylestrong{use\_clabeltext}}] \leavevmode{[}bool, optional{]} If \sphinxcode{\sphinxupquote{True}}, \sphinxcode{\sphinxupquote{ClabelText}} class (instead of \sphinxcode{\sphinxupquote{Text}}) is used to create labels. \sphinxcode{\sphinxupquote{ClabelText}} recalculates rotation angles of texts during the drawing time, therefore this can be used if aspect of the axes changes. Default is \sphinxcode{\sphinxupquote{False}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.clabel}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.clabel:examples-using-matplotlib-pyplot-clabel}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_label\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_ginput\_manual\_clabel\_sgskip.py} \end{itemize} \subsection{matplotlib.pyplot.clf} \label{\detokenize{api/_as_gen/matplotlib.pyplot.clf:matplotlib-pyplot-clf}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.clf::doc}}\index{clf() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.clf:matplotlib.pyplot.clf}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{clf}}}{}{} Clear the current figure. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.clf}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.clf:examples-using-matplotlib-pyplot-clf}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_fancybox\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_ginput\_manual\_clabel\_sgskip.py} \end{itemize} \subsection{matplotlib.pyplot.clim} \label{\detokenize{api/_as_gen/matplotlib.pyplot.clim:matplotlib-pyplot-clim}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.clim::doc}}\index{clim() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.clim:matplotlib.pyplot.clim}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{clim}}}{\emph{vmin=None}, \emph{vmax=None}}{} Set the color limits of the current image. To apply clim to all axes images do: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{clim}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)} \end{sphinxVerbatim} If either \sphinxstyleemphasis{vmin} or \sphinxstyleemphasis{vmax} is None, the image min/max respectively will be used for color scaling. If you want to set the clim of multiple images, use, for example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{for} \PYG{n}{im} \PYG{o+ow}{in} \PYG{n}{gca}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{get\PYGZus{}images}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{n}{im}\PYG{o}{.}\PYG{n}{set\PYGZus{}clim}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mf}{0.05}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsection{matplotlib.pyplot.close} \label{\detokenize{api/_as_gen/matplotlib.pyplot.close:matplotlib-pyplot-close}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.close::doc}}\index{close() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.close:matplotlib.pyplot.close}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{close}}}{\emph{*args}}{} Close a figure window. \sphinxcode{\sphinxupquote{close()}} by itself closes the current figure \sphinxcode{\sphinxupquote{close(fig)}} closes the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \sphinxstyleemphasis{fig} \sphinxcode{\sphinxupquote{close(num)}} closes the figure number \sphinxstyleemphasis{num} \sphinxcode{\sphinxupquote{close(name)}} where \sphinxstyleemphasis{name} is a string, closes figure with that label \sphinxcode{\sphinxupquote{close('all')}} closes all the figure windows \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.close}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.close:examples-using-matplotlib-pyplot-close}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplots\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_pipong.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_multipage\_pdf.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_multiprocess\_sgskip.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-tutorials-intermediate-tight-layout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Tight Layout guide}}}} \end{itemize} \subsection{matplotlib.pyplot.cohere} \label{\detokenize{api/_as_gen/matplotlib.pyplot.cohere:matplotlib-pyplot-cohere}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.cohere::doc}}\index{cohere() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.cohere:matplotlib.pyplot.cohere}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{cohere}}}{\emph{x}, \emph{y}, \emph{NFFT=256}, \emph{Fs=2}, \emph{Fc=0}, \emph{detrend=\textless{}function detrend\_none\textgreater{}}, \emph{window=\textless{}function window\_hanning\textgreater{}}, \emph{noverlap=0}, \emph{pad\_to=None}, \emph{sides='default'}, \emph{scale\_by\_freq=None}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Plot the coherence between \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. Plot the coherence between \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. Coherence is the normalized cross spectral density: \begin{equation}C_{xy} = \frac{|P_{xy}|^2}{P_{xx}P_{yy}}\end{equation}\begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see \sphinxcode{\sphinxupquote{window\_hanning()}}, \sphinxcode{\sphinxupquote{window\_none()}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is \sphinxcode{\sphinxupquote{window\_hanning()}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. This can be different from \sphinxstyleemphasis{NFFT}, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to \sphinxstyleemphasis{NFFT} \item[{\sphinxstylestrong{NFFT}}] \leavevmode{[}integer{]} The number of data points used in each block for the FFT. A power 2 is most efficient. The default value is 256. This should \sphinxstyleemphasis{NOT} be used to get zero padding, or the scaling of the result will be incorrect. Use \sphinxstyleemphasis{pad\_to} for this instead. \item[{\sphinxstylestrong{detrend}}] \leavevmode{[}\{‘default’, ‘constant’, ‘mean’, ‘linear’, ‘none’\} or callable{]} The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the \sphinxstyleemphasis{detrend} parameter is a vector, in matplotlib is it a function. The \sphinxcode{\sphinxupquote{pylab}} module defines \sphinxcode{\sphinxupquote{detrend\_none()}}, \sphinxcode{\sphinxupquote{detrend\_mean()}}, and \sphinxcode{\sphinxupquote{detrend\_linear()}}, but you can use a custom function as well. You can also use a string to choose one of the functions. ‘default’, ‘constant’, and ‘mean’ call \sphinxcode{\sphinxupquote{detrend\_mean()}}. ‘linear’ calls \sphinxcode{\sphinxupquote{detrend\_linear()}}. ‘none’ calls \sphinxcode{\sphinxupquote{detrend\_none()}}. \item[{\sphinxstylestrong{scale\_by\_freq}}] \leavevmode{[}boolean, optional{]} Specifies whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz\textasciicircum{}-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. \item[{\sphinxstylestrong{noverlap}}] \leavevmode{[}integer{]} The number of points of overlap between blocks. The default value is 0 (no overlap). \item[{\sphinxstylestrong{Fc}}] \leavevmode{[}integer{]} The center frequency of \sphinxstyleemphasis{x} (defaults to 0), which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{The return value is a tuple (*Cxy*, *f*), where *f* are the}}] \leavevmode \item[{\sphinxstylestrong{frequencies of the coherence vector.}}] \leavevmode \item[{\sphinxstylestrong{kwargs are applied to the lines.}}] \leavevmode \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Keyword arguments control the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \paragraph{References} Bendat \& Piersol \textendash{} Random Data: Analysis and Measurement Procedures, John Wiley \& Sons (1986) \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.pyplot.colorbar} \label{\detokenize{api/_as_gen/matplotlib.pyplot.colorbar:matplotlib-pyplot-colorbar}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.colorbar::doc}}\index{colorbar() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.colorbar:matplotlib.pyplot.colorbar}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{colorbar}}}{\emph{mappable=None}, \emph{cax=None}, \emph{ax=None}, \emph{**kw}}{} Add a colorbar to a plot. Function signatures for the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pyplot}}}}} interface; all but the first are also method signatures for the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} method: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{colorbar}\PYG{p}{(}\PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{mappable}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{mappable}\PYG{p}{,} \PYG{n}{cax}\PYG{o}{=}\PYG{n}{cax}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{colorbar}\PYG{p}{(}\PYG{n}{mappable}\PYG{p}{,} \PYG{n}{ax}\PYG{o}{=}\PYG{n}{ax}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{mappable :}}] \leavevmode The \sphinxcode{\sphinxupquote{Image}}, {\hyperref[\detokenize{api/contour_api:matplotlib.contour.ContourSet}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ContourSet}}}}}, etc. to which the colorbar applies; this argument is mandatory for the Figure {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} method but optional for the pyplot {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.colorbar:matplotlib.pyplot.colorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colorbar()}}}}} function, which sets the default to the current image. \item[{\sphinxstylestrong{cax}}] \leavevmode{[}{\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} object, optional{]} Axis into which the colorbar will be drawn \item[{\sphinxstylestrong{ax}}] \leavevmode{[}{\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}, list of Axes, optional{]} Parent axes from which space for a new colorbar axes will be stolen. If a list of axes is given they will all be resized to make room for the colorbar axes. \item[{\sphinxstylestrong{use\_gridspec}}] \leavevmode{[}bool, optional{]} If \sphinxstyleemphasis{cax} is \sphinxcode{\sphinxupquote{None}}, a new \sphinxstyleemphasis{cax} is created as an instance of Axes. If \sphinxstyleemphasis{ax} is an instance of Subplot and \sphinxstyleemphasis{use\_gridspec} is \sphinxcode{\sphinxupquote{True}}, \sphinxstyleemphasis{cax} is created as an instance of Subplot using the grid\_spec module. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{:class:{}`\textasciitilde{}matplotlib.colorbar.Colorbar{}` instance}}] \leavevmode See also its base class, {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ColorbarBase}}}}}. Call the {\hyperref[\detokenize{api/colorbar_api:matplotlib.colorbar.ColorbarBase.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_label()}}}}} method to label the colorbar. \end{description} \end{description}\end{quote} \paragraph{Notes} Additional keyword arguments are of two kinds: \begin{quote} axes properties: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{orientation} & vertical or horizontal \\ \hline \sphinxstyleemphasis{fraction} & 0.15; fraction of original axes to use for colorbar \\ \hline \sphinxstyleemphasis{pad} & 0.05 if vertical, 0.15 if horizontal; fraction of original axes between colorbar and new image axes \\ \hline \sphinxstyleemphasis{shrink} & 1.0; fraction by which to multiply the size of the colorbar \\ \hline \sphinxstyleemphasis{aspect} & 20; ratio of long to short dimensions \\ \hline \sphinxstyleemphasis{anchor} & (0.0, 0.5) if vertical; (0.5, 1.0) if horizontal; the anchor point of the colorbar axes \\ \hline \sphinxstyleemphasis{panchor} & (1.0, 0.5) if vertical; (0.5, 0.0) if horizontal; the anchor point of the colorbar parent axes. If False, the parent axes’ anchor will be unchanged \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} colorbar properties: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{extend} & {[} ‘neither’ \textbar{} ‘both’ \textbar{} ‘min’ \textbar{} ‘max’ {]} If not ‘neither’, make pointed end(s) for out-of- range values. These are set for a given colormap using the colormap set\_under and set\_over methods. \\ \hline \sphinxstyleemphasis{extendfrac} & {[} \sphinxstyleemphasis{None} \textbar{} ‘auto’ \textbar{} length \textbar{} lengths {]} If set to \sphinxstyleemphasis{None}, both the minimum and maximum triangular colorbar extensions with have a length of 5\% of the interior colorbar length (this is the default setting). If set to ‘auto’, makes the triangular colorbar extensions the same lengths as the interior boxes (when \sphinxstyleemphasis{spacing} is set to ‘uniform’) or the same lengths as the respective adjacent interior boxes (when \sphinxstyleemphasis{spacing} is set to ‘proportional’). If a scalar, indicates the length of both the minimum and maximum triangular colorbar extensions as a fraction of the interior colorbar length. A two-element sequence of fractions may also be given, indicating the lengths of the minimum and maximum colorbar extensions respectively as a fraction of the interior colorbar length. \\ \hline \sphinxstyleemphasis{extendrect} & bool If \sphinxstyleemphasis{False} the minimum and maximum colorbar extensions will be triangular (the default). If \sphinxstyleemphasis{True} the extensions will be rectangular. \\ \hline \sphinxstyleemphasis{spacing} & {[} ‘uniform’ \textbar{} ‘proportional’ {]} Uniform spacing gives each discrete color the same space; proportional makes the space proportional to the data interval. \\ \hline \sphinxstyleemphasis{ticks} & {[} None \textbar{} list of ticks \textbar{} Locator object {]} If None, ticks are determined automatically from the input. \\ \hline \sphinxstyleemphasis{format} & {[} None \textbar{} format string \textbar{} Formatter object {]} If None, the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarFormatter}}}}} is used. If a format string is given, e.g., ‘\%.3f’, that is used. An alternative {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Formatter}}}}} object may be given instead. \\ \hline \sphinxstyleemphasis{drawedges} & bool Whether to draw lines at color boundaries. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} The following will probably be useful only in the context of indexed colors (that is, when the mappable has norm=NoNorm()), or other unusual circumstances. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{boundaries} & None or a sequence \\ \hline \sphinxstyleemphasis{values} & None or a sequence which must be of length 1 less than the sequence of \sphinxstyleemphasis{boundaries}. For each region delimited by adjacent entries in \sphinxstyleemphasis{boundaries}, the color mapped to the corresponding value in values will be used. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \end{quote} If \sphinxstyleemphasis{mappable} is a \sphinxcode{\sphinxupquote{ContourSet}}, its \sphinxstyleemphasis{extend} kwarg is included automatically. The \sphinxstyleemphasis{shrink} kwarg provides a simple way to scale the colorbar with respect to the axes. Note that if \sphinxstyleemphasis{cax} is specified it determines the size of the colorbar and \sphinxstyleemphasis{shrink} and \sphinxstyleemphasis{aspect} kwargs are ignored. For more precise control, you can manually specify the positions of the axes objects in which the mappable and the colorbar are drawn. In this case, do not use any of the axes properties kwargs. It is known that some vector graphics viewer (svg and pdf) renders white gaps between segments of the colorbar. This is due to bugs in the viewers not matplotlib. As a workaround the colorbar can be rendered with overlapping segments: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{cbar} \PYG{o}{=} \PYG{n}{colorbar}\PYG{p}{(}\PYG{p}{)} \PYG{n}{cbar}\PYG{o}{.}\PYG{n}{solids}\PYG{o}{.}\PYG{n}{set\PYGZus{}edgecolor}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{face}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{n}{draw}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} However this has negative consequences in other circumstances. Particularly with semi transparent images (alpha \textless{} 1) and colorbar extensions and is not enabled by default see (issue \#1188). \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.colorbar}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.colorbar:examples-using-matplotlib-pyplot-colorbar}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplots\_adjust.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_hatching.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tripcolor\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_annotated\_heatmap.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_ellipse\_collection.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_colorbar.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_colorbar\_with\_inset\_locator.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_axes\_divider.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_contour\_manual.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/images:sphx-glr-tutorials-introductory-images-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Image tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-tutorials-intermediate-tight-layout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Tight Layout guide}}}} \end{itemize} \subsection{matplotlib.pyplot.colors} \label{\detokenize{api/_as_gen/matplotlib.pyplot.colors:matplotlib-pyplot-colors}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.colors::doc}}\index{colors() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.colors:matplotlib.pyplot.colors}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{colors}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.1: }The colors function was deprecated in version 2.1. This is a do-nothing function to provide you with help on how matplotlib handles colors. Commands which take color arguments can use several formats to specify the colors. For the basic built-in colors, you can use a single letter \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Alias &\sphinxstyletheadfamily Color \\ \hline ‘b’ & blue \\ \hline ‘g’ & green \\ \hline ‘r’ & red \\ \hline ‘c’ & cyan \\ \hline ‘m’ & magenta \\ \hline ‘y’ & yellow \\ \hline ‘k’ & black \\ \hline ‘w’ & white \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} For a greater range of colors, you have two options. You can specify the color using an html hex string, as in: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{color} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsh{}eeefff}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} or you can pass an R,G,B tuple, where each of R,G,B are in the range {[}0,1{]}. You can also use any legal html name for a color, for example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{color} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{color} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{burlywood}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{color} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{chartreuse}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} The example below creates a subplot with a dark slate gray background: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{111}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.1843}\PYG{p}{,} \PYG{l+m+mf}{0.3098}\PYG{p}{,} \PYG{l+m+mf}{0.3098}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} Here is an example that creates a pale turquoise title: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Is this the best color?}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsh{}afeeee}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsection{matplotlib.pyplot.connect} \label{\detokenize{api/_as_gen/matplotlib.pyplot.connect:matplotlib-pyplot-connect}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.connect::doc}}\index{connect() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.connect:matplotlib.pyplot.connect}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{connect}}}{\emph{s}, \emph{func}}{} Connect event with string \sphinxstyleemphasis{s} to \sphinxstyleemphasis{func}. The signature of \sphinxstyleemphasis{func} is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{func}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)} \end{sphinxVerbatim} where event is a {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.Event}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.backend\_bases.Event}}}}}. The following events are recognized \begin{itemize} \item {} ‘button\_press\_event’ \item {} ‘button\_release\_event’ \item {} ‘draw\_event’ \item {} ‘key\_press\_event’ \item {} ‘key\_release\_event’ \item {} ‘motion\_notify\_event’ \item {} ‘pick\_event’ \item {} ‘resize\_event’ \item {} ‘scroll\_event’ \item {} ‘figure\_enter\_event’, \item {} ‘figure\_leave\_event’, \item {} ‘axes\_enter\_event’, \item {} ‘axes\_leave\_event’ \item {} ‘close\_event’ \end{itemize} For the location events (button and key press/release), if the mouse is over the axes, the variable \sphinxcode{\sphinxupquote{event.inaxes}} will be set to the {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} the event occurs is over, and additionally, the variables \sphinxcode{\sphinxupquote{event.xdata}} and \sphinxcode{\sphinxupquote{event.ydata}} will be defined. This is the mouse location in data coords. See {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.KeyEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{KeyEvent}}}}} and {\hyperref[\detokenize{api/backend_bases_api:matplotlib.backend_bases.MouseEvent}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MouseEvent}}}}} for more info. Return value is a connection id that can be used with \sphinxcode{\sphinxupquote{mpl\_disconnect()}}. \paragraph{Examples} Usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{on\PYGZus{}press}\PYG{p}{(}\PYG{n}{event}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{you pressed}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{button}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{xdata}\PYG{p}{,} \PYG{n}{event}\PYG{o}{.}\PYG{n}{ydata}\PYG{p}{)} \PYG{n}{cid} \PYG{o}{=} \PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{button\PYGZus{}press\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{on\PYGZus{}press}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.connect}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.connect:examples-using-matplotlib-pyplot-connect}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_coords\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_cursor\_demo\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_pylab\_with\_gtk\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_rectangle\_selector.py} \end{itemize} \subsection{matplotlib.pyplot.contour} \label{\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib-pyplot-contour}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.contour::doc}}\index{contour() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{contour}}}{\emph{*args}, \emph{**kwargs}}{} Plot contours. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}} draw contour lines and filled contours, respectively. Except as noted, function signatures and return values are the same for both versions. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}} differs from the MATLAB version in that it does not draw the polygon edges. To draw edges, add line contours with calls to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}}. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{)} \end{sphinxVerbatim} make a contour plot of an array \sphinxstyleemphasis{Z}. The level values are chosen automatically. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{Y}\PYG{p}{,}\PYG{n}{Z}\PYG{p}{)} \end{sphinxVerbatim} \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y} specify the (x, y) coordinates of the surface \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{,}\PYG{n}{N}\PYG{p}{)} \PYG{n}{contour}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{Y}\PYG{p}{,}\PYG{n}{Z}\PYG{p}{,}\PYG{n}{N}\PYG{p}{)} \end{sphinxVerbatim} contour up to \sphinxstyleemphasis{N+1} automatically chosen contour levels (\sphinxstyleemphasis{N} intervals). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{,}\PYG{n}{V}\PYG{p}{)} \PYG{n}{contour}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{Y}\PYG{p}{,}\PYG{n}{Z}\PYG{p}{,}\PYG{n}{V}\PYG{p}{)} \end{sphinxVerbatim} draw contour lines at the values specified in sequence \sphinxstyleemphasis{V}, which must be in increasing order. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contourf}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{V}\PYG{p}{)} \end{sphinxVerbatim} fill the \sphinxcode{\sphinxupquote{len(V)-1}} regions between the values in \sphinxstyleemphasis{V}, which must be in increasing order. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Use keyword args to control colors, linewidth, origin, cmap … see below for more details. \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} must both be 2-D with the same shape as \sphinxstyleemphasis{Z}, or they must both be 1-D such that \sphinxcode{\sphinxupquote{len(X)}} is the number of columns in \sphinxstyleemphasis{Z} and \sphinxcode{\sphinxupquote{len(Y)}} is the number of rows in \sphinxstyleemphasis{Z}. \sphinxcode{\sphinxupquote{C = contour(...)}} returns a {\hyperref[\detokenize{api/contour_api:matplotlib.contour.QuadContourSet}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{QuadContourSet}}}}} object. Optional keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{corner\_mask}: bool, optional}] \leavevmode Enable/disable corner masking, which only has an effect if \sphinxstyleemphasis{Z} is a masked array. If \sphinxcode{\sphinxupquote{False}}, any quad touching a masked point is masked out. If \sphinxcode{\sphinxupquote{True}}, only the triangular corners of quads nearest those points are always masked out, other triangular corners comprising three unmasked points are contoured as usual. Defaults to \sphinxcode{\sphinxupquote{rcParams{[}'contour.corner\_mask'{]}}}, which defaults to \sphinxcode{\sphinxupquote{True}}. \item[{\sphinxstyleemphasis{colors}: {[} \sphinxstyleemphasis{None} \textbar{} string \textbar{} (mpl\_colors) {]}}] \leavevmode If \sphinxstyleemphasis{None}, the colormap specified by cmap will be used. If a string, like ‘r’ or ‘red’, all levels will be plotted in this color. If a tuple of matplotlib color args (string, float, rgb, etc), different levels will be plotted in different colors in the order specified. \item[{\sphinxstyleemphasis{alpha}: float}] \leavevmode The alpha blending value \item[{\sphinxstyleemphasis{cmap}: {[} \sphinxstyleemphasis{None} \textbar{} Colormap {]}}] \leavevmode A cm {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}} instance or \sphinxstyleemphasis{None}. If \sphinxstyleemphasis{cmap} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{colors} is \sphinxstyleemphasis{None}, a default Colormap is used. \item[{\sphinxstyleemphasis{norm}: {[} \sphinxstyleemphasis{None} \textbar{} Normalize {]}}] \leavevmode A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance for scaling data values to colors. If \sphinxstyleemphasis{norm} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{colors} is \sphinxstyleemphasis{None}, the default linear scaling is used. \item[{\sphinxstyleemphasis{vmin}, \sphinxstyleemphasis{vmax}: {[} \sphinxstyleemphasis{None} \textbar{} scalar {]}}] \leavevmode If not \sphinxstyleemphasis{None}, either or both of these values will be supplied to the {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance, overriding the default color scaling based on \sphinxstyleemphasis{levels}. \item[{\sphinxstyleemphasis{levels}: {[}level0, level1, …, leveln{]}}] \leavevmode A list of floating point numbers indicating the level curves to draw, in increasing order; e.g., to draw just the zero contour pass \sphinxcode{\sphinxupquote{levels={[}0{]}}} \item[{\sphinxstyleemphasis{origin}: {[} \sphinxstyleemphasis{None} \textbar{} ‘upper’ \textbar{} ‘lower’ \textbar{} ‘image’ {]}}] \leavevmode If \sphinxstyleemphasis{None}, the first value of \sphinxstyleemphasis{Z} will correspond to the lower left corner, location (0,0). If ‘image’, the rc value for \sphinxcode{\sphinxupquote{image.origin}} will be used. This keyword is not active if \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are specified in the call to contour. \end{description} \sphinxstyleemphasis{extent}: {[} \sphinxstyleemphasis{None} \textbar{} (x0,x1,y0,y1) {]} \begin{quote} If \sphinxstyleemphasis{origin} is not \sphinxstyleemphasis{None}, then \sphinxstyleemphasis{extent} is interpreted as in {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.imshow()}}}}}: it gives the outer pixel boundaries. In this case, the position of Z{[}0,0{]} is the center of the pixel, not a corner. If \sphinxstyleemphasis{origin} is \sphinxstyleemphasis{None}, then (\sphinxstyleemphasis{x0}, \sphinxstyleemphasis{y0}) is the position of Z{[}0,0{]}, and (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) is the position of Z{[}-1,-1{]}. This keyword is not active if \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are specified in the call to contour. \end{quote} \begin{description} \item[{\sphinxstyleemphasis{locator}: {[} \sphinxstyleemphasis{None} \textbar{} ticker.Locator subclass {]}}] \leavevmode If \sphinxstyleemphasis{locator} is \sphinxstyleemphasis{None}, the default {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MaxNLocator}}}}} is used. The locator is used to determine the contour levels if they are not given explicitly via the \sphinxstyleemphasis{V} argument. \item[{\sphinxstyleemphasis{extend}: {[} ‘neither’ \textbar{} ‘both’ \textbar{} ‘min’ \textbar{} ‘max’ {]}}] \leavevmode Unless this is ‘neither’, contour levels are automatically added to one or both ends of the range so that all data are included. These added ranges are then mapped to the special colormap values which default to the ends of the colormap range, but can be set via {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_under}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap.set\_under()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_over}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap.set\_over()}}}}} methods. \item[{\sphinxstyleemphasis{xunits}, \sphinxstyleemphasis{yunits}: {[} \sphinxstyleemphasis{None} \textbar{} registered units {]}}] \leavevmode Override axis units by specifying an instance of a {\hyperref[\detokenize{api/units_api:matplotlib.units.ConversionInterface}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.units.ConversionInterface}}}}}. \item[{\sphinxstyleemphasis{antialiased}: bool}] \leavevmode enable antialiasing, overriding the defaults. For filled contours, the default is \sphinxstyleemphasis{True}. For line contours, it is taken from rcParams{[}‘lines.antialiased’{]}. \item[{\sphinxstyleemphasis{nchunk}: {[} 0 \textbar{} integer {]}}] \leavevmode If 0, no subdivision of the domain. Specify a positive integer to divide the domain into subdomains of \sphinxstyleemphasis{nchunk} by \sphinxstyleemphasis{nchunk} quads. Chunking reduces the maximum length of polygons generated by the contouring algorithm which reduces the rendering workload passed on to the backend and also requires slightly less RAM. It can however introduce rendering artifacts at chunk boundaries depending on the backend, the \sphinxstyleemphasis{antialiased} flag and value of \sphinxstyleemphasis{alpha}. \end{description} \end{quote} contour-only keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{linewidths}: {[} \sphinxstyleemphasis{None} \textbar{} number \textbar{} tuple of numbers {]}}] \leavevmode If \sphinxstyleemphasis{linewidths} is \sphinxstyleemphasis{None}, the default width in \sphinxcode{\sphinxupquote{lines.linewidth}} in \sphinxcode{\sphinxupquote{matplotlibrc}} is used. If a number, all levels will be plotted with this linewidth. If a tuple, different levels will be plotted with different linewidths in the order specified. \item[{\sphinxstyleemphasis{linestyles}: {[} \sphinxstyleemphasis{None} \textbar{} ‘solid’ \textbar{} ‘dashed’ \textbar{} ‘dashdot’ \textbar{} ‘dotted’ {]}}] \leavevmode If \sphinxstyleemphasis{linestyles} is \sphinxstyleemphasis{None}, the default is ‘solid’ unless the lines are monochrome. In that case, negative contours will take their linestyle from the \sphinxcode{\sphinxupquote{matplotlibrc}} \sphinxcode{\sphinxupquote{contour.negative\_linestyle}} setting. \sphinxstyleemphasis{linestyles} can also be an iterable of the above strings specifying a set of linestyles to be used. If this iterable is shorter than the number of contour levels it will be repeated as necessary. \end{description} \end{quote} contourf-only keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{hatches}:}] \leavevmode A list of cross hatch patterns to use on the filled areas. If None, no hatching will be added to the contour. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. \end{description} \end{quote} Note: contourf fills intervals that are closed at the top; that is, for boundaries \sphinxstyleemphasis{z1} and \sphinxstyleemphasis{z2}, the filled region is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{z1} \PYG{o}{\PYGZlt{}} \PYG{n}{z} \PYG{o}{\PYGZlt{}}\PYG{o}{=} \PYG{n}{z2} \end{sphinxVerbatim} There is one exception: if the lowest boundary coincides with the minimum value of the \sphinxstyleemphasis{z} array, then that minimum value will be included in the lowest interval. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.contour}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.contour:examples-using-matplotlib-pyplot-contour}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_corner\_mask.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_hatching.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_label\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_irregulardatagrid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_ginput\_manual\_clabel\_sgskip.py} \end{itemize} \subsection{matplotlib.pyplot.contourf} \label{\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib-pyplot-contourf}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.contourf::doc}}\index{contourf() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{contourf}}}{\emph{*args}, \emph{**kwargs}}{} Plot contours. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}} draw contour lines and filled contours, respectively. Except as noted, function signatures and return values are the same for both versions. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contourf:matplotlib.pyplot.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}} differs from the MATLAB version in that it does not draw the polygon edges. To draw edges, add line contours with calls to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.contour:matplotlib.pyplot.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}}. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{)} \end{sphinxVerbatim} make a contour plot of an array \sphinxstyleemphasis{Z}. The level values are chosen automatically. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{Y}\PYG{p}{,}\PYG{n}{Z}\PYG{p}{)} \end{sphinxVerbatim} \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y} specify the (x, y) coordinates of the surface \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{,}\PYG{n}{N}\PYG{p}{)} \PYG{n}{contour}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{Y}\PYG{p}{,}\PYG{n}{Z}\PYG{p}{,}\PYG{n}{N}\PYG{p}{)} \end{sphinxVerbatim} contour up to \sphinxstyleemphasis{N+1} automatically chosen contour levels (\sphinxstyleemphasis{N} intervals). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{,}\PYG{n}{V}\PYG{p}{)} \PYG{n}{contour}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,}\PYG{n}{Y}\PYG{p}{,}\PYG{n}{Z}\PYG{p}{,}\PYG{n}{V}\PYG{p}{)} \end{sphinxVerbatim} draw contour lines at the values specified in sequence \sphinxstyleemphasis{V}, which must be in increasing order. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contourf}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{V}\PYG{p}{)} \end{sphinxVerbatim} fill the \sphinxcode{\sphinxupquote{len(V)-1}} regions between the values in \sphinxstyleemphasis{V}, which must be in increasing order. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{contour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Use keyword args to control colors, linewidth, origin, cmap … see below for more details. \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} must both be 2-D with the same shape as \sphinxstyleemphasis{Z}, or they must both be 1-D such that \sphinxcode{\sphinxupquote{len(X)}} is the number of columns in \sphinxstyleemphasis{Z} and \sphinxcode{\sphinxupquote{len(Y)}} is the number of rows in \sphinxstyleemphasis{Z}. \sphinxcode{\sphinxupquote{C = contour(...)}} returns a {\hyperref[\detokenize{api/contour_api:matplotlib.contour.QuadContourSet}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{QuadContourSet}}}}} object. Optional keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{corner\_mask}: bool, optional}] \leavevmode Enable/disable corner masking, which only has an effect if \sphinxstyleemphasis{Z} is a masked array. If \sphinxcode{\sphinxupquote{False}}, any quad touching a masked point is masked out. If \sphinxcode{\sphinxupquote{True}}, only the triangular corners of quads nearest those points are always masked out, other triangular corners comprising three unmasked points are contoured as usual. Defaults to \sphinxcode{\sphinxupquote{rcParams{[}'contour.corner\_mask'{]}}}, which defaults to \sphinxcode{\sphinxupquote{True}}. \item[{\sphinxstyleemphasis{colors}: {[} \sphinxstyleemphasis{None} \textbar{} string \textbar{} (mpl\_colors) {]}}] \leavevmode If \sphinxstyleemphasis{None}, the colormap specified by cmap will be used. If a string, like ‘r’ or ‘red’, all levels will be plotted in this color. If a tuple of matplotlib color args (string, float, rgb, etc), different levels will be plotted in different colors in the order specified. \item[{\sphinxstyleemphasis{alpha}: float}] \leavevmode The alpha blending value \item[{\sphinxstyleemphasis{cmap}: {[} \sphinxstyleemphasis{None} \textbar{} Colormap {]}}] \leavevmode A cm {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}} instance or \sphinxstyleemphasis{None}. If \sphinxstyleemphasis{cmap} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{colors} is \sphinxstyleemphasis{None}, a default Colormap is used. \item[{\sphinxstyleemphasis{norm}: {[} \sphinxstyleemphasis{None} \textbar{} Normalize {]}}] \leavevmode A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance for scaling data values to colors. If \sphinxstyleemphasis{norm} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{colors} is \sphinxstyleemphasis{None}, the default linear scaling is used. \item[{\sphinxstyleemphasis{vmin}, \sphinxstyleemphasis{vmax}: {[} \sphinxstyleemphasis{None} \textbar{} scalar {]}}] \leavevmode If not \sphinxstyleemphasis{None}, either or both of these values will be supplied to the {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance, overriding the default color scaling based on \sphinxstyleemphasis{levels}. \item[{\sphinxstyleemphasis{levels}: {[}level0, level1, …, leveln{]}}] \leavevmode A list of floating point numbers indicating the level curves to draw, in increasing order; e.g., to draw just the zero contour pass \sphinxcode{\sphinxupquote{levels={[}0{]}}} \item[{\sphinxstyleemphasis{origin}: {[} \sphinxstyleemphasis{None} \textbar{} ‘upper’ \textbar{} ‘lower’ \textbar{} ‘image’ {]}}] \leavevmode If \sphinxstyleemphasis{None}, the first value of \sphinxstyleemphasis{Z} will correspond to the lower left corner, location (0,0). If ‘image’, the rc value for \sphinxcode{\sphinxupquote{image.origin}} will be used. This keyword is not active if \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are specified in the call to contour. \end{description} \sphinxstyleemphasis{extent}: {[} \sphinxstyleemphasis{None} \textbar{} (x0,x1,y0,y1) {]} \begin{quote} If \sphinxstyleemphasis{origin} is not \sphinxstyleemphasis{None}, then \sphinxstyleemphasis{extent} is interpreted as in {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.imshow()}}}}}: it gives the outer pixel boundaries. In this case, the position of Z{[}0,0{]} is the center of the pixel, not a corner. If \sphinxstyleemphasis{origin} is \sphinxstyleemphasis{None}, then (\sphinxstyleemphasis{x0}, \sphinxstyleemphasis{y0}) is the position of Z{[}0,0{]}, and (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) is the position of Z{[}-1,-1{]}. This keyword is not active if \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are specified in the call to contour. \end{quote} \begin{description} \item[{\sphinxstyleemphasis{locator}: {[} \sphinxstyleemphasis{None} \textbar{} ticker.Locator subclass {]}}] \leavevmode If \sphinxstyleemphasis{locator} is \sphinxstyleemphasis{None}, the default {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MaxNLocator}}}}} is used. The locator is used to determine the contour levels if they are not given explicitly via the \sphinxstyleemphasis{V} argument. \item[{\sphinxstyleemphasis{extend}: {[} ‘neither’ \textbar{} ‘both’ \textbar{} ‘min’ \textbar{} ‘max’ {]}}] \leavevmode Unless this is ‘neither’, contour levels are automatically added to one or both ends of the range so that all data are included. These added ranges are then mapped to the special colormap values which default to the ends of the colormap range, but can be set via {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_under}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap.set\_under()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_over}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap.set\_over()}}}}} methods. \item[{\sphinxstyleemphasis{xunits}, \sphinxstyleemphasis{yunits}: {[} \sphinxstyleemphasis{None} \textbar{} registered units {]}}] \leavevmode Override axis units by specifying an instance of a {\hyperref[\detokenize{api/units_api:matplotlib.units.ConversionInterface}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.units.ConversionInterface}}}}}. \item[{\sphinxstyleemphasis{antialiased}: bool}] \leavevmode enable antialiasing, overriding the defaults. For filled contours, the default is \sphinxstyleemphasis{True}. For line contours, it is taken from rcParams{[}‘lines.antialiased’{]}. \item[{\sphinxstyleemphasis{nchunk}: {[} 0 \textbar{} integer {]}}] \leavevmode If 0, no subdivision of the domain. Specify a positive integer to divide the domain into subdomains of \sphinxstyleemphasis{nchunk} by \sphinxstyleemphasis{nchunk} quads. Chunking reduces the maximum length of polygons generated by the contouring algorithm which reduces the rendering workload passed on to the backend and also requires slightly less RAM. It can however introduce rendering artifacts at chunk boundaries depending on the backend, the \sphinxstyleemphasis{antialiased} flag and value of \sphinxstyleemphasis{alpha}. \end{description} \end{quote} contour-only keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{linewidths}: {[} \sphinxstyleemphasis{None} \textbar{} number \textbar{} tuple of numbers {]}}] \leavevmode If \sphinxstyleemphasis{linewidths} is \sphinxstyleemphasis{None}, the default width in \sphinxcode{\sphinxupquote{lines.linewidth}} in \sphinxcode{\sphinxupquote{matplotlibrc}} is used. If a number, all levels will be plotted with this linewidth. If a tuple, different levels will be plotted with different linewidths in the order specified. \item[{\sphinxstyleemphasis{linestyles}: {[} \sphinxstyleemphasis{None} \textbar{} ‘solid’ \textbar{} ‘dashed’ \textbar{} ‘dashdot’ \textbar{} ‘dotted’ {]}}] \leavevmode If \sphinxstyleemphasis{linestyles} is \sphinxstyleemphasis{None}, the default is ‘solid’ unless the lines are monochrome. In that case, negative contours will take their linestyle from the \sphinxcode{\sphinxupquote{matplotlibrc}} \sphinxcode{\sphinxupquote{contour.negative\_linestyle}} setting. \sphinxstyleemphasis{linestyles} can also be an iterable of the above strings specifying a set of linestyles to be used. If this iterable is shorter than the number of contour levels it will be repeated as necessary. \end{description} \end{quote} contourf-only keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{hatches}:}] \leavevmode A list of cross hatch patterns to use on the filled areas. If None, no hatching will be added to the contour. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. \end{description} \end{quote} Note: contourf fills intervals that are closed at the top; that is, for boundaries \sphinxstyleemphasis{z1} and \sphinxstyleemphasis{z2}, the filled region is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{z1} \PYG{o}{\PYGZlt{}} \PYG{n}{z} \PYG{o}{\PYGZlt{}}\PYG{o}{=} \PYG{n}{z2} \end{sphinxVerbatim} There is one exception: if the lowest boundary coincides with the minimum value of the \sphinxstyleemphasis{z} array, then that minimum value will be included in the lowest interval. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.contourf}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.contourf:examples-using-matplotlib-pyplot-contourf}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_corner\_mask.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_hatching.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_triinterp\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_irregulardatagrid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.cool} \label{\detokenize{api/_as_gen/matplotlib.pyplot.cool:matplotlib-pyplot-cool}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.cool::doc}}\index{cool() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.cool:matplotlib.pyplot.cool}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{cool}}}{}{} Set the colormap to “cool”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.copper} \label{\detokenize{api/_as_gen/matplotlib.pyplot.copper:matplotlib-pyplot-copper}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.copper::doc}}\index{copper() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.copper:matplotlib.pyplot.copper}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{copper}}}{}{} Set the colormap to “copper”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.csd} \label{\detokenize{api/_as_gen/matplotlib.pyplot.csd:matplotlib-pyplot-csd}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.csd::doc}}\index{csd() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.csd:matplotlib.pyplot.csd}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{csd}}}{\emph{x}, \emph{y}, \emph{NFFT=None}, \emph{Fs=None}, \emph{Fc=None}, \emph{detrend=None}, \emph{window=None}, \emph{noverlap=None}, \emph{pad\_to=None}, \emph{sides=None}, \emph{scale\_by\_freq=None}, \emph{return\_line=None}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Plot the cross-spectral density. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{csd}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{NFFT}\PYG{o}{=}\PYG{l+m+mi}{256}\PYG{p}{,} \PYG{n}{Fs}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{Fc}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{detrend}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{detrend\PYGZus{}none}\PYG{p}{,} \PYG{n}{window}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{window\PYGZus{}hanning}\PYG{p}{,} \PYG{n}{noverlap}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{pad\PYGZus{}to}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{sides}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{scale\PYGZus{}by\PYGZus{}freq}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{return\PYGZus{}line}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} The cross spectral density $P_{xy}$ by Welch’s average periodogram method. The vectors \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} are divided into \sphinxstyleemphasis{NFFT} length segments. Each segment is detrended by function \sphinxstyleemphasis{detrend} and windowed by function \sphinxstyleemphasis{window}. \sphinxstyleemphasis{noverlap} gives the length of the overlap between segments. The product of the direct FFTs of \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} are averaged over each segment to compute $P_{xy}$, with a scaling to correct for power loss due to windowing. If len(\sphinxstyleemphasis{x}) \textless{} \sphinxstyleemphasis{NFFT} or len(\sphinxstyleemphasis{y}) \textless{} \sphinxstyleemphasis{NFFT}, they will be zero padded to \sphinxstyleemphasis{NFFT}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}1-D arrays or sequences{]} Arrays or sequences containing the data \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see \sphinxcode{\sphinxupquote{window\_hanning()}}, \sphinxcode{\sphinxupquote{window\_none()}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is \sphinxcode{\sphinxupquote{window\_hanning()}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. This can be different from \sphinxstyleemphasis{NFFT}, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to \sphinxstyleemphasis{NFFT} \item[{\sphinxstylestrong{NFFT}}] \leavevmode{[}integer{]} The number of data points used in each block for the FFT. A power 2 is most efficient. The default value is 256. This should \sphinxstyleemphasis{NOT} be used to get zero padding, or the scaling of the result will be incorrect. Use \sphinxstyleemphasis{pad\_to} for this instead. \item[{\sphinxstylestrong{detrend}}] \leavevmode{[}\{‘default’, ‘constant’, ‘mean’, ‘linear’, ‘none’\} or callable{]} The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the \sphinxstyleemphasis{detrend} parameter is a vector, in matplotlib is it a function. The \sphinxcode{\sphinxupquote{pylab}} module defines \sphinxcode{\sphinxupquote{detrend\_none()}}, \sphinxcode{\sphinxupquote{detrend\_mean()}}, and \sphinxcode{\sphinxupquote{detrend\_linear()}}, but you can use a custom function as well. You can also use a string to choose one of the functions. ‘default’, ‘constant’, and ‘mean’ call \sphinxcode{\sphinxupquote{detrend\_mean()}}. ‘linear’ calls \sphinxcode{\sphinxupquote{detrend\_linear()}}. ‘none’ calls \sphinxcode{\sphinxupquote{detrend\_none()}}. \item[{\sphinxstylestrong{scale\_by\_freq}}] \leavevmode{[}boolean, optional{]} Specifies whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz\textasciicircum{}-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. \item[{\sphinxstylestrong{noverlap}}] \leavevmode{[}integer{]} The number of points of overlap between segments. The default value is 0 (no overlap). \item[{\sphinxstylestrong{Fc}}] \leavevmode{[}integer{]} The center frequency of \sphinxstyleemphasis{x} (defaults to 0), which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband. \item[{\sphinxstylestrong{return\_line}}] \leavevmode{[}bool{]} Whether to include the line object plotted in the returned values. Default is False. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Pxy}}] \leavevmode{[}1-D array{]} The values for the cross spectrum \sphinxcode{\sphinxupquote{P\_\{xy\}}} before scaling (complex valued) \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the elements in \sphinxstyleemphasis{Pxy} \item[{\sphinxstylestrong{line}}] \leavevmode{[}a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instance{]} The line created by this function. Only returned if \sphinxstyleemphasis{return\_line} is True. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Keyword arguments control the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.psd:matplotlib.pyplot.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.psd:matplotlib.pyplot.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}} is the equivalent to setting y=x. \end{description} \paragraph{Notes} For plotting, the power is plotted as $10\log_{10}(P_{xy})$ for decibels, though \sphinxcode{\sphinxupquote{P\_\{xy\}}} itself is returned. \paragraph{References} Bendat \& Piersol \textendash{} Random Data: Analysis and Measurement Procedures, John Wiley \& Sons (1986) \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.pyplot.delaxes} \label{\detokenize{api/_as_gen/matplotlib.pyplot.delaxes:matplotlib-pyplot-delaxes}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.delaxes::doc}}\index{delaxes() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.delaxes:matplotlib.pyplot.delaxes}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{delaxes}}}{\emph{ax=None}}{} Remove the given \sphinxcode{\sphinxupquote{Axes}} \sphinxstyleemphasis{ax} from the current figure. If \sphinxstyleemphasis{ax} is \sphinxstyleemphasis{None}, the current axes is removed. A KeyError is raised if the axes doesn’t exist. \end{fulllineitems} \subsection{matplotlib.pyplot.disconnect} \label{\detokenize{api/_as_gen/matplotlib.pyplot.disconnect:matplotlib-pyplot-disconnect}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.disconnect::doc}}\index{disconnect() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.disconnect:matplotlib.pyplot.disconnect}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{disconnect}}}{\emph{cid}}{} Disconnect callback id cid \paragraph{Examples} Usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{cid} \PYG{o}{=} \PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}connect}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{button\PYGZus{}press\PYGZus{}event}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{on\PYGZus{}press}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{}...later} \PYG{n}{canvas}\PYG{o}{.}\PYG{n}{mpl\PYGZus{}disconnect}\PYG{p}{(}\PYG{n}{cid}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.disconnect}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.disconnect:examples-using-matplotlib-pyplot-disconnect}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_coords\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.draw} \label{\detokenize{api/_as_gen/matplotlib.pyplot.draw:matplotlib-pyplot-draw}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.draw::doc}}\index{draw() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.draw:matplotlib.pyplot.draw}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{draw}}}{}{} Redraw the current figure. This is used to update a figure that has been altered, but not automatically re-drawn. If interactive mode is on ({\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.ion:matplotlib.pyplot.ion}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ion()}}}}}), this should be only rarely needed, but there may be ways to modify the state of a figure without marking it as \sphinxcode{\sphinxupquote{stale}}. Please report these cases as bugs. A more object-oriented alternative, given any {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance, \sphinxcode{\sphinxupquote{fig}}, that was created using a {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot:module-matplotlib.pyplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pyplot}}}}} function, is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{o}{.}\PYG{n}{canvas}\PYG{o}{.}\PYG{n}{draw\PYGZus{}idle}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.draw}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.draw:examples-using-matplotlib-pyplot-draw}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_99\_axes\_grid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_demo\_bboximage.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_fancybox\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_fancytextbox\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_multiline.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_fancyarrow\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_baseline\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_demo\_text\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_arrow\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_axisline4.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_axesgrid2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_colorbar\_with\_inset\_locator.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_inset\_locator\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_parasite\_simple2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_scatter\_hist\_locatable\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_inset\_locator\_demo2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_edge\_colorbar.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_axes\_divider.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_axes\_grid2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_axes\_grid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_parasite\_axes2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_curvelinear\_grid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_ginput\_manual\_clabel\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_cursor\_demo\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_anchored\_artists.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_rotate\_axes3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_aspect\_loglog.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_textbox.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_check\_buttons.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_buttons.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_radio\_buttons.py} \end{itemize} \subsection{matplotlib.pyplot.errorbar} \label{\detokenize{api/_as_gen/matplotlib.pyplot.errorbar:matplotlib-pyplot-errorbar}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.errorbar::doc}}\index{errorbar() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.errorbar:matplotlib.pyplot.errorbar}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{errorbar}}}{\emph{x}, \emph{y}, \emph{yerr=None}, \emph{xerr=None}, \emph{fmt=''}, \emph{ecolor=None}, \emph{elinewidth=None}, \emph{capsize=None}, \emph{barsabove=False}, \emph{lolims=False}, \emph{uplims=False}, \emph{xlolims=False}, \emph{xuplims=False}, \emph{errorevery=1}, \emph{capthick=None}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Plot y versus x as lines and/or markers with attached errorbars. \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} define the data locations, \sphinxstyleemphasis{xerr}, \sphinxstyleemphasis{yerr} define the errorbar sizes. By default, this draws the data markers/lines as well the errorbars. Use fmt=’none’ to draw errorbars without any data markers. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}scalar or array-like{]} The data positions. \item[{\sphinxstylestrong{xerr, yerr}}] \leavevmode{[}scalar or array-like, shape(N,) or shape(2,N), optional{]} The errorbar sizes: \begin{itemize} \item {} scalar: Symmetric +/- values for all data points. \item {} shape(N,): Symmetric +/-values for each data point. \item {} shape(2,N): Separate + and - values for each data point. \item {} \sphinxstyleemphasis{None}: No errorbar. \end{itemize} \item[{\sphinxstylestrong{fmt}}] \leavevmode{[}plot format string, optional, default: ‘’{]} The format for the data points / data lines. See {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} for details. Use ‘none’ (case insensitive) to plot errorbars without any data markers. \item[{\sphinxstylestrong{ecolor}}] \leavevmode{[}mpl color, optional, default: None{]} A matplotlib color arg which gives the color the errorbar lines. If None, use the color of the line connecting the markers. \item[{\sphinxstylestrong{elinewidth}}] \leavevmode{[}scalar, optional, default: None{]} The linewidth of the errorbar lines. If None, the linewidth of the current style is used. \item[{\sphinxstylestrong{capsize}}] \leavevmode{[}scalar, optional, default: None{]} The length of the error bar caps in points. If None, it will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"errorbar.capsize"{]}}}. \item[{\sphinxstylestrong{capthick}}] \leavevmode{[}scalar, optional, default: None{]} An alias to the keyword argument \sphinxstyleemphasis{markeredgewidth} (a.k.a. \sphinxstyleemphasis{mew}). This setting is a more sensible name for the property that controls the thickness of the error bar cap in points. For backwards compatibility, if \sphinxstyleemphasis{mew} or \sphinxstyleemphasis{markeredgewidth} are given, then they will over-ride \sphinxstyleemphasis{capthick}. This may change in future releases. \item[{\sphinxstylestrong{barsabove}}] \leavevmode{[}bool, optional, default: False{]} If True, will plot the errorbars above the plot symbols. Default is below. \item[{\sphinxstylestrong{lolims, uplims, xlolims, xuplims}}] \leavevmode{[}bool, optional, default: None{]} These arguments can be used to indicate that a value gives only upper/lower limits. In that case a caret symbol is used to indicate this. \sphinxstyleemphasis{lims}-arguments may be of the same type as \sphinxstyleemphasis{xerr} and \sphinxstyleemphasis{yerr}. To use limits with inverted axes, \sphinxcode{\sphinxupquote{set\_xlim()}} or \sphinxcode{\sphinxupquote{set\_ylim()}} must be called before {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.errorbar:matplotlib.pyplot.errorbar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{errorbar()}}}}}. \item[{\sphinxstylestrong{errorevery}}] \leavevmode{[}positive integer, optional, default: 1{]} Subsamples the errorbars. e.g., if errorevery=5, errorbars for every 5-th datapoint will be plotted. The data plot itself still shows all data points. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{:class:{}`\textasciitilde{}.container.ErrorbarContainer{}`}}] \leavevmode The container contains: \begin{itemize} \item {} plotline: {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instance of x, y plot markers and/or line. \item {} caplines: A tuple of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instances of the error bar caps. \item {} barlinecols: A tuple of {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} with the horizontal and vertical error ranges. \end{itemize} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode All other keyword arguments are passed on to the plot command for the markers. For example, this code makes big red squares with thick green edges: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{x}\PYG{p}{,}\PYG{n}{y}\PYG{p}{,}\PYG{n}{yerr} \PYG{o}{=} \PYG{n}{rand}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{,}\PYG{l+m+mi}{10}\PYG{p}{)} \PYG{n}{errorbar}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{yerr}\PYG{p}{,} \PYG{n}{marker}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{s}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{mfc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{mec}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{green}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ms}\PYG{o}{=}\PYG{l+m+mi}{20}\PYG{p}{,} \PYG{n}{mew}\PYG{o}{=}\PYG{l+m+mi}{4}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxstyleemphasis{mfc}, \sphinxstyleemphasis{mec}, \sphinxstyleemphasis{ms} and \sphinxstyleemphasis{mew} are aliases for the longer property names, \sphinxstyleemphasis{markerfacecolor}, \sphinxstyleemphasis{markeredgecolor}, \sphinxstyleemphasis{markersize} and \sphinxstyleemphasis{markeredgewidth}. Valid kwargs for the marker properties are \sphinxcode{\sphinxupquote{Lines2D}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘xerr’, ‘y’, ‘yerr’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.errorbar}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.errorbar:examples-using-matplotlib-pyplot-errorbar}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_errorbar\_limits\_simple.py} \end{itemize} \subsection{matplotlib.pyplot.eventplot} \label{\detokenize{api/_as_gen/matplotlib.pyplot.eventplot:matplotlib-pyplot-eventplot}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.eventplot::doc}}\index{eventplot() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.eventplot:matplotlib.pyplot.eventplot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{eventplot}}}{\emph{positions}, \emph{orientation='horizontal'}, \emph{lineoffsets=1}, \emph{linelengths=1}, \emph{linewidths=None}, \emph{colors=None}, \emph{linestyles='solid'}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Plot identical parallel lines at the given positions. \sphinxstyleemphasis{positions} should be a 1D or 2D array-like object, with each row corresponding to a row or column of lines. This type of plot is commonly used in neuroscience for representing neural events, where it is usually called a spike raster, dot raster, or raster plot. However, it is useful in any situation where you wish to show the timing or position of multiple sets of discrete events, such as the arrival times of people to a business on each day of the month or the date of hurricanes each year of the last century. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{positions}}] \leavevmode{[}1D or 2D array-like object{]} Each value is an event. If \sphinxstyleemphasis{positions} is a 2D array-like, each row corresponds to a row or a column of lines (depending on the \sphinxstyleemphasis{orientation} parameter). \item[{\sphinxstylestrong{orientation}}] \leavevmode{[}\{‘horizontal’, ‘vertical’\}, optional{]} Controls the direction of the event collections: \begin{itemize} \item {} ‘horizontal’ : the lines are arranged horizontally in rows, and are vertical. \item {} ‘vertical’ : the lines are arranged vertically in columns, and are horizontal. \end{itemize} \item[{\sphinxstylestrong{lineoffsets}}] \leavevmode{[}scalar or sequence of scalars, optional, default: 1{]} The offset of the center of the lines from the origin, in the direction orthogonal to \sphinxstyleemphasis{orientation}. \item[{\sphinxstylestrong{linelengths}}] \leavevmode{[}scalar or sequence of scalars, optional, default: 1{]} The total height of the lines (i.e. the lines stretches from \sphinxcode{\sphinxupquote{lineoffset - linelength/2}} to \sphinxcode{\sphinxupquote{lineoffset + linelength/2}}). \item[{\sphinxstylestrong{linewidths}}] \leavevmode{[}scalar, scalar sequence or None, optional, default: None{]} The line width(s) of the event lines, in points. If it is None, defaults to its rcParams setting. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}color, sequence of colors or None, optional, default: None{]} The color(s) of the event lines. If it is None, defaults to its rcParams setting. \item[{\sphinxstylestrong{linestyles}}] \leavevmode{[}str or tuple or a sequence of such values, optional{]} Default is ‘solid’. Valid strings are {[}‘solid’, ‘dashed’, ‘dashdot’, ‘dotted’, ‘-‘, ‘\textendash{}’, ‘-.’, ‘:’{]}. Dash tuples should be of the form: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{offset}\PYG{p}{,} \PYG{n}{onoffseq}\PYG{p}{)}\PYG{p}{,} \end{sphinxVerbatim} where \sphinxstyleemphasis{onoffseq} is an even length tuple of on and off ink in points. \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}optional{]} Other keyword arguments are line collection properties. See {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} for a list of the valid properties. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{A list of :class:{}`matplotlib.collections.EventCollection{}` objects that}}] \leavevmode \item[{\sphinxstylestrong{were added.}}] \leavevmode \end{description} \end{description}\end{quote} \paragraph{Notes} For \sphinxstyleemphasis{linelengths}, \sphinxstyleemphasis{linewidths}, \sphinxstyleemphasis{colors}, and \sphinxstyleemphasis{linestyles}, if only a single value is given, that value is applied to all lines. If an array-like is given, it must have the same length as \sphinxstyleemphasis{positions}, and each value will be applied to the corresponding row of the array. \paragraph{Examples} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{eventplot_demo}.pdf} \end{figure} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘colors’, ‘linelengths’, ‘lineoffsets’, ‘linestyles’, ‘linewidths’, ‘positions’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.pyplot.figimage} \label{\detokenize{api/_as_gen/matplotlib.pyplot.figimage:matplotlib-pyplot-figimage}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.figimage::doc}}\index{figimage() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.figimage:matplotlib.pyplot.figimage}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{figimage}}}{\emph{*args}, \emph{**kwargs}}{} Adds a non-resampled image to the figure. call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{figimage}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} adds a non-resampled array \sphinxstyleemphasis{X} to the figure. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{figimage}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{xo}\PYG{p}{,} \PYG{n}{yo}\PYG{p}{)} \end{sphinxVerbatim} with pixel offsets \sphinxstyleemphasis{xo}, \sphinxstyleemphasis{yo}, \sphinxstyleemphasis{X} must be a float array: \begin{itemize} \item {} If \sphinxstyleemphasis{X} is MxN, assume luminance (grayscale) \item {} If \sphinxstyleemphasis{X} is MxNx3, assume RGB \item {} If \sphinxstyleemphasis{X} is MxNx4, assume RGBA \end{itemize} Optional keyword arguments: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Keyword &\sphinxstyletheadfamily Description \\ \hline resize & a boolean, True or False. If “True”, then re-size the Figure to match the given image size. \\ \hline xo or yo & An integer, the \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} image offset in pixels \\ \hline cmap & a {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap}}}}} instance, e.g., cm.jet. If \sphinxstyleemphasis{None}, default to the rc \sphinxcode{\sphinxupquote{image.cmap}} value \\ \hline norm & a {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance. The default is normalization(). This scales luminance -\textgreater{} 0-1 \\ \hline vmin\textbar{}vmax & are used to scale a luminance image to 0-1. If either is \sphinxstyleemphasis{None}, the min and max of the luminance values will be used. Note if you pass a norm instance, the settings for \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} will be ignored. \\ \hline alpha & the alpha blending value, default is \sphinxstyleemphasis{None} \\ \hline origin & {[} ‘upper’ \textbar{} ‘lower’ {]} Indicates where the {[}0,0{]} index of the array is in the upper left or lower left corner of the axes. Defaults to the rc image.origin value \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} figimage complements the axes image ({\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.imshow:matplotlib.axes.Axes.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow()}}}}}) which will be resampled to fit the current axes. If you want a resampled image to fill the entire figure, you can define an {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} with extent {[}0,0,1,1{]}. An {\hyperref[\detokenize{api/image_api:matplotlib.image.FigureImage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.image.FigureImage}}}}} instance is returned. Additional kwargs are Artist kwargs passed on to {\hyperref[\detokenize{api/image_api:matplotlib.image.FigureImage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FigureImage}}}}} \end{fulllineitems} \subsection{matplotlib.pyplot.figlegend} \label{\detokenize{api/_as_gen/matplotlib.pyplot.figlegend:matplotlib-pyplot-figlegend}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.figlegend::doc}}\index{figlegend() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.figlegend:matplotlib.pyplot.figlegend}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{figlegend}}}{\emph{*args}, \emph{**kwargs}}{} Place a legend in the figure. \begin{description} \item[{\sphinxstyleemphasis{labels}}] \leavevmode a sequence of strings \item[{\sphinxstyleemphasis{handles}}] \leavevmode a sequence of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} instances \item[{\sphinxstyleemphasis{loc}}] \leavevmode can be a string or an integer specifying the legend location \end{description} A {\hyperref[\detokenize{api/legend_api:matplotlib.legend.Legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.legend.Legend}}}}} instance is returned. \paragraph{Examples} To make a legend from existing artists on every axes: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{figlegend}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} To make a legend for a list of lines and labels: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{figlegend}\PYG{p}{(} \PYG{p}{(}\PYG{n}{line1}\PYG{p}{,} \PYG{n}{line2}\PYG{p}{,} \PYG{n}{line3}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label3}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{upper right}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{)} \end{sphinxVerbatim} \sphinxstrong{See also:} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.legend:matplotlib.pyplot.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend()}}}}} \end{fulllineitems} \subsection{matplotlib.pyplot.fignum\_exists} \label{\detokenize{api/_as_gen/matplotlib.pyplot.fignum_exists:matplotlib-pyplot-fignum-exists}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.fignum_exists::doc}}\index{fignum\_exists() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.fignum_exists:matplotlib.pyplot.fignum_exists}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{fignum\_exists}}}{\emph{num}}{}~ \end{fulllineitems} \subsection{matplotlib.pyplot.figtext} \label{\detokenize{api/_as_gen/matplotlib.pyplot.figtext:matplotlib-pyplot-figtext}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.figtext::doc}}\index{figtext() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.figtext:matplotlib.pyplot.figtext}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{figtext}}}{\emph{*args}, \emph{**kwargs}}{} Add text to figure. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{text}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{s}\PYG{p}{,} \PYG{n}{fontdict}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Add text to figure at location \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} (relative 0-1 coords). See {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.text:matplotlib.pyplot.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text()}}}}} for the meaning of the other arguments. kwargs control the {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} properties: \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_backgroundcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{backgroundcolor}}}}} & any matplotlib color \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bbox}}}}} & FancyBboxPatch prop dict \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[} ({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_family}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{family}}}}} or fontfamily or fontname or name & {[}FONTNAME \textbar{} ‘serif’ \textbar{} ‘sans-serif’ \textbar{} ‘cursive’ \textbar{} ‘fantasy’ \textbar{} ‘monospace’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_fontproperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fontproperties}}}}} or font\_properties & a {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_horizontalalignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{horizontalalignment}}}}} or ha & {[} ‘center’ \textbar{} ‘right’ \textbar{} ‘left’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_linespacing}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linespacing}}}}} & float (multiple of font size) \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_multialignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{multialignment}}}}} or ma & {[}‘left’ \textbar{} ‘right’ \textbar{} ‘center’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{position}}}}} & (x,y) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_rotation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotation}}}}} & {[} angle in degrees \textbar{} ‘vertical’ \textbar{} ‘horizontal’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_rotation_mode}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rotation\_mode}}}}} & {[} None \textbar{} “default” \textbar{} “anchor” {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_size}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{size}}}}} or fontsize & {[}size in points \textbar{} ‘xx-small’ \textbar{} ‘x-small’ \textbar{} ‘small’ \textbar{} ‘medium’ \textbar{} ‘large’ \textbar{} ‘x-large’ \textbar{} ‘xx-large’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_stretch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{stretch}}}}} or fontstretch & {[}a numeric value in range 0-1000 \textbar{} ‘ultra-condensed’ \textbar{} ‘extra-condensed’ \textbar{} ‘condensed’ \textbar{} ‘semi-condensed’ \textbar{} ‘normal’ \textbar{} ‘semi-expanded’ \textbar{} ‘expanded’ \textbar{} ‘extra-expanded’ \textbar{} ‘ultra-expanded’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_style}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{style}}}}} or fontstyle & {[} ‘normal’ \textbar{} ‘italic’ \textbar{} ‘oblique’{]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text}}}}} & string or anything printable with ‘\%s’ conversion. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_usetex}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{usetex}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_variant}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{variant}}}}} or fontvariant & {[} ‘normal’ \textbar{} ‘small-caps’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_verticalalignment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{verticalalignment}}}}} or va & {[} ‘center’ \textbar{} ‘top’ \textbar{} ‘bottom’ \textbar{} ‘baseline’ {]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_weight}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{weight}}}}} or fontweight & {[}a numeric value in range 0-1000 \textbar{} ‘ultralight’ \textbar{} ‘light’ \textbar{} ‘normal’ \textbar{} ‘regular’ \textbar{} ‘book’ \textbar{} ‘medium’ \textbar{} ‘roman’ \textbar{} ‘semibold’ \textbar{} ‘demibold’ \textbar{} ‘demi’ \textbar{} ‘bold’ \textbar{} ‘heavy’ \textbar{} ‘extra bold’ \textbar{} ‘black’ {]} \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_wrap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{wrap}}}}} & bool \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_x}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{x}}}}} & float \\ \hline {\hyperref[\detokenize{api/text_api:matplotlib.text.Text.set_y}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{y}}}}} & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.figtext}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.figtext:examples-using-matplotlib-pyplot-figtext}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_integral.py} \end{itemize} \subsection{matplotlib.pyplot.figure} \label{\detokenize{api/_as_gen/matplotlib.pyplot.figure:matplotlib-pyplot-figure}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.figure::doc}}\index{figure() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.figure:matplotlib.pyplot.figure}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{figure}}}{\emph{num=None}, \emph{figsize=None}, \emph{dpi=None}, \emph{facecolor=None}, \emph{edgecolor=None}, \emph{frameon=True}, \emph{FigureClass=\textless{}class 'matplotlib.figure.Figure'\textgreater{}}, \emph{clear=False}, \emph{**kwargs}}{} Creates a new figure. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{num}}] \leavevmode{[}integer or string, optional, default: none{]} If not provided, a new figure will be created, and the figure number will be incremented. The figure objects holds this number in a \sphinxcode{\sphinxupquote{number}} attribute. If num is provided, and a figure with this id already exists, make it active, and returns a reference to it. If this figure does not exists, create it and returns it. If num is a string, the window title will be set to this figure’s \sphinxcode{\sphinxupquote{num}}. \item[{\sphinxstylestrong{figsize}}] \leavevmode{[}tuple of integers, optional, default: None{]} width, height in inches. If not provided, defaults to rc figure.figsize. \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}integer, optional, default: None{]} resolution of the figure. If not provided, defaults to rc figure.dpi. \item[{\sphinxstylestrong{facecolor :}}] \leavevmode the background color. If not provided, defaults to rc figure.facecolor. \item[{\sphinxstylestrong{edgecolor :}}] \leavevmode the border color. If not provided, defaults to rc figure.edgecolor. \item[{\sphinxstylestrong{frameon}}] \leavevmode{[}bool, optional, default: True{]} If False, suppress drawing the figure frame. \item[{\sphinxstylestrong{FigureClass}}] \leavevmode{[}class derived from matplotlib.figure.Figure{]} Optionally use a custom Figure instance. \item[{\sphinxstylestrong{clear}}] \leavevmode{[}bool, optional, default: False{]} If True and the figure already exists, then it is cleared. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{figure}}] \leavevmode{[}Figure{]} The Figure instance returned will also be passed to new\_figure\_manager in the backends, which allows to hook custom Figure classes into the pylab interface. Additional kwargs will be passed to the figure init function. \end{description} \end{description}\end{quote} \paragraph{Notes} If you are creating many figures, make sure you explicitly call “close” on the figures you are not using, because this will enable pylab to properly clean up the memory. rcParams defines the default values, which can be modified in the matplotlibrc file \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.figure}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.figure:examples-using-matplotlib-pyplot-figure}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_mathtext\_asarray.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_sankey\_links.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_sankey\_basics.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_logos2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_sankey\_rankine.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_skewt.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_fig\_x.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_two\_subplots.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_99\_mplot3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_fig\_axes\_labels\_simple.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_fig\_axes\_customize\_simple.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_annotation\_polar.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_99\_axes\_grid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_text\_commands.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_1\_subplot3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_auto\_subplots\_adjust.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_annotate\_transform.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_99\_spines.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_compound\_path\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_scales.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_98\_4\_fancy.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_text\_layout.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_multiple\_figs\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_geo\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_custom\_figure\_class.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_align\_labels\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_demo\_tight\_layout.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_zoom\_effect.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_errorbar\_limits\_simple.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_hist.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_eventcollection\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_linestyles.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_markevery\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_psd\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_figimage\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_barcode\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_hatching.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_layer\_images.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_quiver\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_label\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_plot\_streamplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_barb\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_demo\_bboximage.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_smooth\_user.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_triplot\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tripcolor\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_smooth\_delaunay.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_fancybox\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_dfrac\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_autowrap.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_multiline.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_fancyarrow\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_demo\_text\_rotation\_mode.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_stix\_fonts\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_font\_table\_ttf\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_baseline\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_mathtext\_examples.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_demo\_text\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_arrow\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_polar\_legend.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_polar\_scatter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_xkcd.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_mandelbrot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_anatomy.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_firefox.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/frame_grabbing_sgskip:sphx-glr-gallery-animation-frame-grabbing-sgskip-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Frame grabbing}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/dynamic_image:sphx-glr-gallery-animation-dynamic-image-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Animated image using a precomputed list of images}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/unchained:sphx-glr-gallery-animation-unchained-py}]{\sphinxcrossref{\DUrole{std,std-ref}{MATPLOTLIB UNCHAINED}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/random_walk:sphx-glr-gallery-animation-random-walk-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Animated 3D random walk}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/double_pendulum_sgskip:sphx-glr-gallery-animation-double-pendulum-sgskip-py}]{\sphinxcrossref{\DUrole{std,std-ref}{The double pendulum problem}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/rain:sphx-glr-gallery-animation-rain-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Rain simulation}}}} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_imagegrid\_aspect.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_axesgrid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_rgb.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_axesgrid2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_axes\_divider1.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_axes\_divider2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_axes\_divider3.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_parasite\_simple2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_fixed\_size\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_make\_room\_for\_ylabel\_using\_axesgrid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_axes\_rgb.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_edge\_colorbar.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_axes\_divider.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_axes\_grid2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_axes\_grid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_simple\_axisline3.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_simple\_axis\_direction01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_axis\_direction\_demo\_step01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_simple\_axisartist1.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_simple\_axis\_direction03.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_simple\_axisline2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_axisline\_style.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_simple\_axisline.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_ticklabel\_alignment.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_axis\_direction\_demo\_step02.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_ticklabel\_direction.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_axis\_direction\_demo\_step03.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_parasite\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_axis\_direction\_demo\_step04.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_curvelinear\_grid2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_floating\_axis.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_axis\_direction.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_simple\_axis\_pad.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_curvelinear\_grid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_floating\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_close\_event.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_agg\_buffer\_to\_array.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_hyperlinks\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_load\_converter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_zorder\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_contour\_manual.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_transoffset.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_patheffect\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_multipage\_pdf.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_svg\_filter\_line.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_svg\_filter\_pie.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_demo\_agg\_filter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_contourf3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_wire3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_contour3d\_2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_contour3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_rotate\_axes3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_offset.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_lines3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_surface3d\_2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_3d\_bars.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_quiver3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_surface3d\_radial.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_voxels.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_surface3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_text3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_contour3d\_3.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_contourf3d\_2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_trisurf3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_scatter3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_mixed\_subplots.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_surface3d\_3.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_hist3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_bars3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_voxels\_rgb.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_tricontour3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_voxels\_torus.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_subplot3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_wire3d\_animation.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_tricontourf3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_voxels\_numpy\_logo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_2dcollections3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_lorenz\_attractor.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_polys3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_trisurf3d\_2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_pathpatch3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_recipes\_create\_subplots.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_mri\_with\_eeg.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_tick\_labels\_from\_values.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_spine\_placement\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_tick-locators.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_tick-formatters.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_ellipse\_with\_units.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_toolmanager\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_svg\_histogram\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec05.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec02.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_texsystem\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_fonts\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec03.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec04.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_preamble\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec06.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_cursor.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_menu.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/images:sphx-glr-tutorials-introductory-images-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Image tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/usage:sphx-glr-tutorials-introductory-usage-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Usage Guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/artists:sphx-glr-tutorials-intermediate-artists-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Artist tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/gridspec:sphx-glr-tutorials-intermediate-gridspec-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Figure Layouts Using GridSpec and Other Functions}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-tutorials-intermediate-tight-layout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Tight Layout guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/imshow_extent:sphx-glr-tutorials-intermediate-imshow-extent-py}]{\sphinxcrossref{\DUrole{std,std-ref}{origin and extent in imshow}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/constrainedlayout_guide:sphx-glr-tutorials-intermediate-constrainedlayout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Constrained Layout Guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/advanced/patheffects_guide:sphx-glr-tutorials-advanced-patheffects-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Path effects guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/advanced/path_tutorial:sphx-glr-tutorials-advanced-path-tutorial-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Path Tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/advanced/transforms_tutorial:sphx-glr-tutorials-advanced-transforms-tutorial-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Transformations Tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/colors/colors:sphx-glr-tutorials-colors-colors-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Specifying Colors}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/text/text_props:sphx-glr-tutorials-text-text-props-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Text properties and layout}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/text/text_intro:sphx-glr-tutorials-text-text-intro-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Text in Matplotlib Plots}}}} \end{itemize} \subsection{matplotlib.pyplot.fill} \label{\detokenize{api/_as_gen/matplotlib.pyplot.fill:matplotlib-pyplot-fill}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.fill::doc}}\index{fill() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.fill:matplotlib.pyplot.fill}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{fill}}}{\emph{*args}, \emph{**kwargs}}{} Plot filled polygons. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{args}}] \leavevmode{[}sequence of x, y, {[}color{]}{]} Each polygon is defined by the lists of \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y} positions of its nodes, optionally followed by by a \sphinxstyleemphasis{color} specifier. See {\hyperref[\detokenize{api/colors_api:module-matplotlib.colors}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors}}}}} for supported color specifiers. The standard color cycle is used for polygons without a color specifier. You can plot multiple polygons by providing multiple \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}, \sphinxstyleemphasis{{[}color{]}} groups. For example, each of the following is legal: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{fill}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} a polygon with default color} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{fill}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{b}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} a blue polygon} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{fill}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{x2}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} two polygons} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{fill}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{b}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{x2}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} a blue and a red polygon} \end{sphinxVerbatim} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{a list of :class:{}`\textasciitilde{}matplotlib.patches.Polygon{}`}}] \leavevmode \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Polygon}}}}} properties{]} \end{description} \end{description}\end{quote} \paragraph{Notes} Use {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.fill_between:matplotlib.pyplot.fill_between}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill\_between()}}}}} if you would like to fill the region between two curves. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.fill}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.fill:examples-using-matplotlib-pyplot-fill}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_ginput\_manual\_clabel\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_fill\_spiral.py} \end{itemize} \subsection{matplotlib.pyplot.fill\_between} \label{\detokenize{api/_as_gen/matplotlib.pyplot.fill_between:matplotlib-pyplot-fill-between}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.fill_between::doc}}\index{fill\_between() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.fill_between:matplotlib.pyplot.fill_between}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{fill\_between}}}{\emph{x}, \emph{y1}, \emph{y2=0}, \emph{where=None}, \emph{interpolate=False}, \emph{step=None}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Fill the area between two horizontal curves. The curves are defined by the points (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y1}) and (\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y2}). This creates one or multiple polygons describing the filled area. You may exclude some horizontal sections from filling using \sphinxstyleemphasis{where}. By default, the edges connect the given points directly. Use \sphinxstyleemphasis{step} if the filling should be a step function, i.e. constant in between \sphinxstyleemphasis{x}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}array (length N){]} The x coordinates of the nodes defining the curves. \item[{\sphinxstylestrong{y1}}] \leavevmode{[}array (length N) or scalar{]} The y coordinates of the nodes defining the first curve. \item[{\sphinxstylestrong{y2}}] \leavevmode{[}array (length N) or scalar, optional, default: 0{]} The y coordinates of the nodes defining the second curve. \item[{\sphinxstylestrong{where}}] \leavevmode{[}array of bool (length N), optional, default: None{]} Define \sphinxstyleemphasis{where} to exclude some horizontal regions from being filled. The filled regions are defined by the coordinates \sphinxcode{\sphinxupquote{x{[}where{]}}}. More precisely, fill between \sphinxcode{\sphinxupquote{x{[}i{]}}} and \sphinxcode{\sphinxupquote{x{[}i+1{]}}} if \sphinxcode{\sphinxupquote{where{[}i{]} and where{[}i+1{]}}}. Note that this definition implies that an isolated \sphinxstyleemphasis{True} value between two \sphinxstyleemphasis{False} values in \sphinxstyleemphasis{where} will not result in filling. Both sides of the \sphinxstyleemphasis{True} position remain unfilled due to the adjacent \sphinxstyleemphasis{False} values. \item[{\sphinxstylestrong{interpolate}}] \leavevmode{[}bool, optional{]} This option is only relvant if \sphinxstyleemphasis{where} is used and the two curves are crossing each other. Semantically, \sphinxstyleemphasis{where} is often used for \sphinxstyleemphasis{y1} \textgreater{} \sphinxstyleemphasis{y2} or similar. By default, the nodes of the polygon defining the filled region will only be placed at the positions in the \sphinxstyleemphasis{x} array. Such a polygon cannot describe the above semantics close to the intersection. The x-sections containing the intersecion are simply clipped. Setting \sphinxstyleemphasis{interpolate} to \sphinxstyleemphasis{True} will calculate the actual interscection point and extend the filled region up to this point. \item[{\sphinxstylestrong{step}}] \leavevmode{[}\{‘pre’, ‘post’, ‘mid’\}, optional{]} Define \sphinxstyleemphasis{step} if the filling should be a step function, i.e. constant in between \sphinxstyleemphasis{x}. The value determines where the step will occur: \begin{itemize} \item {} ‘pre’: The y value is continued constantly to the left from every \sphinxstyleemphasis{x} position, i.e. the interval \sphinxcode{\sphinxupquote{(x{[}i-1{]}, x{[}i{]}{]}}} has the value \sphinxcode{\sphinxupquote{y{[}i{]}}}. \item {} ‘post’: The y value is continued constantly to the right from every \sphinxstyleemphasis{x} position, i.e. the interval \sphinxcode{\sphinxupquote{{[}x{[}i{]}, x{[}i+1{]})}} has the value \sphinxcode{\sphinxupquote{y{[}i{]}}}. \item {} ‘mid’: Steps occur half-way between the \sphinxstyleemphasis{x} positions. \end{itemize} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{{}`.PolyCollection{}`}}] \leavevmode A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} containing the plotted polygons. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode All other keyword arguments are passed on to {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}}. They control the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Polygon}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or antialiaseds & Boolean or sequence of booleans \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{array}}}}} & ndarray \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}} & a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cmap}}}}} & a colormap or registered colormap name \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color arg or sequence of rgba tuples \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or edgecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or facecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or dashes or linestyles & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or linewidths or lw & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_norm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{norm}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offset\_position}}}}} & {[} ‘screen’ \textbar{} ‘data’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offsets}}}}} & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_urls}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{urls}}}}} & List{[}str{]} or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.fill_betweenx:matplotlib.pyplot.fill_betweenx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill\_betweenx}}}}}}] \leavevmode Fill between two sets of x-values. \end{description} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘where’, ‘x’, ‘y1’, ‘y2’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.fill\_between}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.fill_between:examples-using-matplotlib-pyplot-fill-between}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_mathtext\_examples.py} \end{itemize} \subsection{matplotlib.pyplot.fill\_betweenx} \label{\detokenize{api/_as_gen/matplotlib.pyplot.fill_betweenx:matplotlib-pyplot-fill-betweenx}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.fill_betweenx::doc}}\index{fill\_betweenx() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.fill_betweenx:matplotlib.pyplot.fill_betweenx}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{fill\_betweenx}}}{\emph{y}, \emph{x1}, \emph{x2=0}, \emph{where=None}, \emph{step=None}, \emph{interpolate=False}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Fill the area between two vertical curves. The curves are defined by the points (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y}) and (\sphinxstyleemphasis{x2}, \sphinxstyleemphasis{y}). This creates one or multiple polygons describing the filled area. You may exclude some vertical sections from filling using \sphinxstyleemphasis{where}. By default, the edges connect the given points directly. Use \sphinxstyleemphasis{step} if the filling should be a step function, i.e. constant in between \sphinxstyleemphasis{y}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{y}}] \leavevmode{[}array (length N){]} The y coordinates of the nodes defining the curves. \item[{\sphinxstylestrong{x1}}] \leavevmode{[}array (length N) or scalar{]} The x coordinates of the nodes defining the first curve. \item[{\sphinxstylestrong{x2}}] \leavevmode{[}array (length N) or scalar, optional, default: 0{]} The x coordinates of the nodes defining the second curve. \item[{\sphinxstylestrong{where}}] \leavevmode{[}array of bool (length N), optional, default: None{]} Define \sphinxstyleemphasis{where} to exclude some vertical regions from being filled. The filled regions are defined by the coordinates \sphinxcode{\sphinxupquote{y{[}where{]}}}. More precisely, fill between \sphinxcode{\sphinxupquote{y{[}i{]}}} and \sphinxcode{\sphinxupquote{y{[}i+1{]}}} if \sphinxcode{\sphinxupquote{where{[}i{]} and where{[}i+1{]}}}. Note that this definition implies that an isolated \sphinxstyleemphasis{True} value between two \sphinxstyleemphasis{False} values in \sphinxstyleemphasis{where} will not result in filling. Both sides of the \sphinxstyleemphasis{True} position remain unfilled due to the adjacent \sphinxstyleemphasis{False} values. \item[{\sphinxstylestrong{interpolate}}] \leavevmode{[}bool, optional{]} This option is only relvant if \sphinxstyleemphasis{where} is used and the two curves are crossing each other. Semantically, \sphinxstyleemphasis{where} is often used for \sphinxstyleemphasis{x1} \textgreater{} \sphinxstyleemphasis{x2} or similar. By default, the nodes of the polygon defining the filled region will only be placed at the positions in the \sphinxstyleemphasis{y} array. Such a polygon cannot describe the above semantics close to the intersection. The y-sections containing the intersecion are simply clipped. Setting \sphinxstyleemphasis{interpolate} to \sphinxstyleemphasis{True} will calculate the actual interscection point and extend the filled region up to this point. \item[{\sphinxstylestrong{step}}] \leavevmode{[}\{‘pre’, ‘post’, ‘mid’\}, optional{]} Define \sphinxstyleemphasis{step} if the filling should be a step function, i.e. constant in between \sphinxstyleemphasis{y}. The value determines where the step will occur: \begin{itemize} \item {} ‘pre’: The y value is continued constantly to the left from every \sphinxstyleemphasis{x} position, i.e. the interval \sphinxcode{\sphinxupquote{(x{[}i-1{]}, x{[}i{]}{]}}} has the value \sphinxcode{\sphinxupquote{y{[}i{]}}}. \item {} ‘post’: The y value is continued constantly to the right from every \sphinxstyleemphasis{x} position, i.e. the interval \sphinxcode{\sphinxupquote{{[}x{[}i{]}, x{[}i+1{]})}} has the value \sphinxcode{\sphinxupquote{y{[}i{]}}}. \item {} ‘mid’: Steps occur half-way between the \sphinxstyleemphasis{x} positions. \end{itemize} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{{}`.PolyCollection{}`}}] \leavevmode A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} containing the plotted polygons. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode All other keyword arguments are passed on to {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}}. They control the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Polygon:matplotlib.patches.Polygon}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Polygon}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or antialiaseds & Boolean or sequence of booleans \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{array}}}}} & ndarray \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}} & a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cmap}}}}} & a colormap or registered colormap name \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color arg or sequence of rgba tuples \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or edgecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or facecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or dashes or linestyles & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or linewidths or lw & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_norm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{norm}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offset\_position}}}}} & {[} ‘screen’ \textbar{} ‘data’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offsets}}}}} & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_urls}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{urls}}}}} & List{[}str{]} or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.fill_between:matplotlib.pyplot.fill_between}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fill\_between}}}}}}] \leavevmode Fill between two sets of y-values. \end{description} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘where’, ‘x1’, ‘x2’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.pyplot.findobj} \label{\detokenize{api/_as_gen/matplotlib.pyplot.findobj:matplotlib-pyplot-findobj}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.findobj::doc}}\index{findobj() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.findobj:matplotlib.pyplot.findobj}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{findobj}}}{\emph{o=None}, \emph{match=None}, \emph{include\_self=True}}{} Find artist objects. Recursively find all {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} instances contained in self. \sphinxstyleemphasis{match} can be \begin{itemize} \item {} None: return all objects contained in artist. \item {} function with signature \sphinxcode{\sphinxupquote{boolean = match(artist)}} used to filter matches \item {} class instance: e.g., Line2D. Only return artists of class type. \end{itemize} If \sphinxstyleemphasis{include\_self} is True (default), include self in the list to be checked for a match. \end{fulllineitems} \subsection{matplotlib.pyplot.flag} \label{\detokenize{api/_as_gen/matplotlib.pyplot.flag:matplotlib-pyplot-flag}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.flag::doc}}\index{flag() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.flag:matplotlib.pyplot.flag}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{flag}}}{}{} Set the colormap to “flag”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.flag}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.flag:examples-using-matplotlib-pyplot-flag}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.gca} \label{\detokenize{api/_as_gen/matplotlib.pyplot.gca:matplotlib-pyplot-gca}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.gca::doc}}\index{gca() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.gca:matplotlib.pyplot.gca}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{gca}}}{\emph{**kwargs}}{} Get the current {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} instance on the current figure matching the given keyword args, or create one. \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.gca}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure.gca}}}}}}] \leavevmode The figure’s gca method. \end{description} \paragraph{Examples} To get the current polar axes on the current figure: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{gca}\PYG{p}{(}\PYG{n}{projection}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{polar}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} If the current axes doesn’t exist, or isn’t a polar one, the appropriate axes will be created and then returned. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.gca}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.gca:examples-using-matplotlib-pyplot-gca}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_scales.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_multiple\_figs\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_smooth\_user.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_triplot\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tripcolor\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_smooth\_delaunay.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_annotated\_heatmap.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_fonteffects.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_text\_rotation\_relative\_to\_line.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_rainbow\_text.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_text\_alignment.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_mathtext\_examples.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_arrow\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_anchored\_artists.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_trifinder\_event\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_ginput\_manual\_clabel\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_set\_and\_get.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_contour\_manual.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_anchored\_artists.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_symlog\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_custom\_scale.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_hinton\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_anscombe.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Legend guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-tutorials-intermediate-tight-layout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Tight Layout guide}}}} \end{itemize} \subsection{matplotlib.pyplot.gcf} \label{\detokenize{api/_as_gen/matplotlib.pyplot.gcf:matplotlib-pyplot-gcf}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.gcf::doc}}\index{gcf() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.gcf:matplotlib.pyplot.gcf}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{gcf}}}{}{} Get a reference to the current figure. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.gcf}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.gcf:examples-using-matplotlib-pyplot-gcf}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_arrow\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_trifinder\_event\_demo.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-tutorials-intermediate-tight-layout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Tight Layout guide}}}} \end{itemize} \subsection{matplotlib.pyplot.gci} \label{\detokenize{api/_as_gen/matplotlib.pyplot.gci:matplotlib-pyplot-gci}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.gci::doc}}\index{gci() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.gci:matplotlib.pyplot.gci}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{gci}}}{}{} Get the current colorable artist. Specifically, returns the current {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarMappable}}}}} instance (image or patch collection), or \sphinxstyleemphasis{None} if no images or patch collections have been defined. The commands {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figimage:matplotlib.pyplot.figimage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figimage()}}}}} create \sphinxcode{\sphinxupquote{Image}} instances, and the commands {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:matplotlib.pyplot.pcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolor()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.scatter:matplotlib.pyplot.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter()}}}}} create {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Collection}}}}} instances. The current image is an attribute of the current axes, or the nearest earlier axes in the current figure that contains an image. \end{fulllineitems} \subsection{matplotlib.pyplot.get\_current\_fig\_manager} \label{\detokenize{api/_as_gen/matplotlib.pyplot.get_current_fig_manager:matplotlib-pyplot-get-current-fig-manager}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.get_current_fig_manager::doc}}\index{get\_current\_fig\_manager() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.get_current_fig_manager:matplotlib.pyplot.get_current_fig_manager}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{get\_current\_fig\_manager}}}{}{}~ \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.get\_current\_fig\_manager}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.get_current_fig_manager:examples-using-matplotlib-pyplot-get-current-fig-manager}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_agg\_buffer.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_pylab\_with\_gtk\_sgskip.py} \end{itemize} \subsection{matplotlib.pyplot.get\_figlabels} \label{\detokenize{api/_as_gen/matplotlib.pyplot.get_figlabels:matplotlib-pyplot-get-figlabels}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.get_figlabels::doc}}\index{get\_figlabels() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.get_figlabels:matplotlib.pyplot.get_figlabels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{get\_figlabels}}}{}{} Return a list of existing figure labels. \end{fulllineitems} \subsection{matplotlib.pyplot.get\_fignums} \label{\detokenize{api/_as_gen/matplotlib.pyplot.get_fignums:matplotlib-pyplot-get-fignums}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.get_fignums::doc}}\index{get\_fignums() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.get_fignums:matplotlib.pyplot.get_fignums}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{get\_fignums}}}{}{} Return a list of existing figure numbers. \end{fulllineitems} \subsection{matplotlib.pyplot.get\_plot\_commands} \label{\detokenize{api/_as_gen/matplotlib.pyplot.get_plot_commands:matplotlib-pyplot-get-plot-commands}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.get_plot_commands::doc}}\index{get\_plot\_commands() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.get_plot_commands:matplotlib.pyplot.get_plot_commands}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{get\_plot\_commands}}}{}{} Get a sorted list of all of the plotting commands. \end{fulllineitems} \subsection{matplotlib.pyplot.ginput} \label{\detokenize{api/_as_gen/matplotlib.pyplot.ginput:matplotlib-pyplot-ginput}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.ginput::doc}}\index{ginput() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.ginput:matplotlib.pyplot.ginput}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{ginput}}}{\emph{*args}, \emph{**kwargs}}{} Blocking call to interact with a figure. Wait until the user clicks \sphinxstyleemphasis{n} times on the figure, and return the coordinates of each click in a list. The buttons used for the various actions (adding points, removing points, terminating the inputs) can be overridden via the arguments \sphinxstyleemphasis{mouse\_add}, \sphinxstyleemphasis{mouse\_pop} and \sphinxstyleemphasis{mouse\_stop}, that give the associated mouse button: 1 for left, 2 for middle, 3 for right. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{n}}] \leavevmode{[}int, optional, default: 1{]} Number of mouse clicks to accumulate. If negative, accumulate clicks until the input is terminated manually. \item[{\sphinxstylestrong{timeout}}] \leavevmode{[}scalar, optional, default: 30{]} Number of seconds to wait before timing out. If zero or negative will never timeout. \item[{\sphinxstylestrong{show\_clicks}}] \leavevmode{[}bool, optional, default: False{]} If True, show a red cross at the location of each click. \item[{\sphinxstylestrong{mouse\_add}}] \leavevmode{[}int, one of (1, 2, 3), optional, default: 1 (left click){]} Mouse button used to add points. \item[{\sphinxstylestrong{mouse\_pop}}] \leavevmode{[}int, one of (1, 2, 3), optional, default: 3 (right click){]} Mouse button used to remove the most recently added point. \item[{\sphinxstylestrong{mouse\_stop}}] \leavevmode{[}int, one of (1, 2, 3), optional, default: 2 (middle click){]} Mouse button used to stop input. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{points}}] \leavevmode{[}list of tuples{]} A list of the clicked (x, y) coordinates. \end{description} \end{description}\end{quote} \paragraph{Notes} The keyboard can also be used to select points in case your mouse does not have one or more of the buttons. The delete and backspace keys act like right clicking (i.e., remove last point), the enter key terminates input and any other key (not already used by the window manager) selects a point. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.ginput}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.ginput:examples-using-matplotlib-pyplot-ginput}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_ginput\_demo\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_ginput\_manual\_clabel\_sgskip.py} \end{itemize} \subsection{matplotlib.pyplot.gray} \label{\detokenize{api/_as_gen/matplotlib.pyplot.gray:matplotlib-pyplot-gray}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.gray::doc}}\index{gray() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.gray:matplotlib.pyplot.gray}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{gray}}}{}{} Set the colormap to “gray”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.grid} \label{\detokenize{api/_as_gen/matplotlib.pyplot.grid:matplotlib-pyplot-grid}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.grid::doc}}\index{grid() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.grid:matplotlib.pyplot.grid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{grid}}}{\emph{b=None}, \emph{which='major'}, \emph{axis='both'}, \emph{**kwargs}}{} Turn the axes grids on or off. Set the axes grids on or off; \sphinxstyleemphasis{b} is a boolean. If \sphinxstyleemphasis{b} is \sphinxstyleemphasis{None} and \sphinxcode{\sphinxupquote{len(kwargs)==0}}, toggle the grid state. If \sphinxstyleemphasis{kwargs} are supplied, it is assumed that you want a grid and \sphinxstyleemphasis{b} is thus set to \sphinxstyleemphasis{True}. \sphinxstyleemphasis{which} can be ‘major’ (default), ‘minor’, or ‘both’ to control whether major tick grids, minor tick grids, or both are affected. \sphinxstyleemphasis{axis} can be ‘both’ (default), ‘x’, or ‘y’ to control which set of gridlines are drawn. \sphinxstyleemphasis{kwargs} are used to set the grid line properties, e.g.,: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{grid}\PYG{p}{(}\PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linestyle}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \end{sphinxVerbatim} Valid {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} kwargs are \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.grid}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.grid:examples-using-matplotlib-pyplot-grid}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_skewt.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_text.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_scales.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_invert\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_geo\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_nan\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_corner\_mask.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_multiline.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_stix\_fonts\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_bachelors\_degrees\_by\_gender.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_customize\_rc.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_findobj\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_custom\_projection.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_symlog\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_custom\_scale.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \subsection{matplotlib.pyplot.hexbin} \label{\detokenize{api/_as_gen/matplotlib.pyplot.hexbin:matplotlib-pyplot-hexbin}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.hexbin::doc}}\index{hexbin() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.hexbin:matplotlib.pyplot.hexbin}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{hexbin}}}{\emph{x}, \emph{y}, \emph{C=None}, \emph{gridsize=100}, \emph{bins=None}, \emph{xscale='linear'}, \emph{yscale='linear'}, \emph{extent=None}, \emph{cmap=None}, \emph{norm=None}, \emph{vmin=None}, \emph{vmax=None}, \emph{alpha=None}, \emph{linewidths=None}, \emph{edgecolors='face'}, \emph{reduce\_C\_function=\textless{}function mean\textgreater{}}, \emph{mincnt=None}, \emph{marginals=False}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Make a hexagonal binning plot. Make a hexagonal binning plot of \sphinxstyleemphasis{x} versus \sphinxstyleemphasis{y}, where \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} are 1-D sequences of the same length, \sphinxstyleemphasis{N}. If \sphinxstyleemphasis{C} is \sphinxstyleemphasis{None} (the default), this is a histogram of the number of occurrences of the observations at (x{[}i{]},y{[}i{]}). If \sphinxstyleemphasis{C} is specified, it specifies values at the coordinate (x{[}i{]},y{[}i{]}). These values are accumulated for each hexagonal bin and then reduced according to \sphinxstyleemphasis{reduce\_C\_function}, which defaults to numpy’s mean function (np.mean). (If \sphinxstyleemphasis{C} is specified, it must also be a 1-D sequence of the same length as \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}.) \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}array or masked array{]} \item[{\sphinxstylestrong{C}}] \leavevmode{[}array or masked array, optional, default is \sphinxstyleemphasis{None}{]} \item[{\sphinxstylestrong{gridsize}}] \leavevmode{[}int or (int, int), optional, default is 100{]} The number of hexagons in the \sphinxstyleemphasis{x}-direction, default is 100. The corresponding number of hexagons in the \sphinxstyleemphasis{y}-direction is chosen such that the hexagons are approximately regular. Alternatively, gridsize can be a tuple with two elements specifying the number of hexagons in the \sphinxstyleemphasis{x}-direction and the \sphinxstyleemphasis{y}-direction. \item[{\sphinxstylestrong{bins}}] \leavevmode{[}\{‘log’\} or int or sequence, optional, default is \sphinxstyleemphasis{None}{]} If \sphinxstyleemphasis{None}, no binning is applied; the color of each hexagon directly corresponds to its count value. If ‘log’, use a logarithmic scale for the color map. Internally, $log_{10}(i+1)$ is used to determine the hexagon color. If an integer, divide the counts in the specified number of bins, and color the hexagons accordingly. If a sequence of values, the values of the lower bound of the bins to be used. \item[{\sphinxstylestrong{xscale}}] \leavevmode{[}\{‘linear’, ‘log’\}, optional, default is ‘linear’{]} Use a linear or log10 scale on the horizontal axis. \item[{\sphinxstylestrong{yscale}}] \leavevmode{[}\{‘linear’, ‘log’\}, optional, default is ‘linear’{]} Use a linear or log10 scale on the vertical axis. \item[{\sphinxstylestrong{mincnt}}] \leavevmode{[}int \textgreater{} 0, optional, default is \sphinxstyleemphasis{None}{]} If not \sphinxstyleemphasis{None}, only display cells with more than \sphinxstyleemphasis{mincnt} number of points in the cell \item[{\sphinxstylestrong{marginals}}] \leavevmode{[}bool, optional, default is \sphinxstyleemphasis{False}{]} if marginals is \sphinxstyleemphasis{True}, plot the marginal density as colormapped rectagles along the bottom of the x-axis and left of the y-axis \item[{\sphinxstylestrong{extent}}] \leavevmode{[}scalar, optional, default is \sphinxstyleemphasis{None}{]} The limits of the bins. The default assigns the limits based on \sphinxstyleemphasis{gridsize}, \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}, \sphinxstyleemphasis{xscale} and \sphinxstyleemphasis{yscale}. If \sphinxstyleemphasis{xscale} or \sphinxstyleemphasis{yscale} is set to ‘log’, the limits are expected to be the exponent for a power of 10. E.g. for x-limits of 1 and 50 in ‘linear’ scale and y-limits of 10 and 1000 in ‘log’ scale, enter (1, 50, 1, 3). Order of scalars is (left, right, bottom, top). \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{object}}] \leavevmode a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} instance; use {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection.get_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_array()}}}}} on this {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} to get the counts in each hexagon. If \sphinxstyleemphasis{marginals} is \sphinxstyleemphasis{True}, horizontal bar and vertical bar (both PolyCollections) will be attached to the return collection as attributes \sphinxstyleemphasis{hbar} and \sphinxstyleemphasis{vbar}. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}object, optional, default is \sphinxstyleemphasis{None}{]} a {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap}}}}} instance. If \sphinxstyleemphasis{None}, defaults to rc \sphinxcode{\sphinxupquote{image.cmap}}. \item[{\sphinxstylestrong{norm}}] \leavevmode{[}object, optional, default is \sphinxstyleemphasis{None}{]} {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance is used to scale luminance data to 0,1. \item[{\sphinxstylestrong{vmin, vmax}}] \leavevmode{[}scalar, optional, default is \sphinxstyleemphasis{None}{]} \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} are used in conjunction with \sphinxstyleemphasis{norm} to normalize luminance data. If \sphinxstyleemphasis{None}, the min and max of the color array \sphinxstyleemphasis{C} are used. Note if you pass a norm instance your settings for \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} will be ignored. \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}scalar between 0 and 1, optional, default is \sphinxstyleemphasis{None}{]} the alpha value for the patches \item[{\sphinxstylestrong{linewidths}}] \leavevmode{[}scalar, optional, default is \sphinxstyleemphasis{None}{]} If \sphinxstyleemphasis{None}, defaults to 1.0. \item[{\sphinxstylestrong{edgecolors}}] \leavevmode{[}\{‘face’, ‘none’, \sphinxstyleemphasis{None}\} or color, optional{]} If ‘face’ (the default), draws the edges in the same color as the fill color. If ‘none’, no edge is drawn; this can sometimes lead to unsightly unpainted pixels between the hexagons. If \sphinxstyleemphasis{None}, draws outlines in the default color. If a matplotlib color arg, draws outlines in the specified color. \end{description} \end{description}\end{quote} \paragraph{Notes} The standard descriptions of all the {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Collection}}}}} parameters: \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or antialiaseds & Boolean or sequence of booleans \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{array}}}}} & ndarray \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}} & a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cmap}}}}} & a colormap or registered colormap name \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color arg or sequence of rgba tuples \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or edgecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or facecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or dashes or linestyles & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or linewidths or lw & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_norm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{norm}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offset\_position}}}}} & {[} ‘screen’ \textbar{} ‘data’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offsets}}}}} & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_urls}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{urls}}}}} & List{[}str{]} or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.pyplot.hist} \label{\detokenize{api/_as_gen/matplotlib.pyplot.hist:matplotlib-pyplot-hist}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.hist::doc}}\index{hist() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.hist:matplotlib.pyplot.hist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{hist}}}{\emph{x}, \emph{bins=None}, \emph{range=None}, \emph{density=None}, \emph{weights=None}, \emph{cumulative=False}, \emph{bottom=None}, \emph{histtype='bar'}, \emph{align='mid'}, \emph{orientation='vertical'}, \emph{rwidth=None}, \emph{log=False}, \emph{color=None}, \emph{label=None}, \emph{stacked=False}, \emph{normed=None}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Plot a histogram. Compute and draw the histogram of \sphinxstyleemphasis{x}. The return value is a tuple (\sphinxstyleemphasis{n}, \sphinxstyleemphasis{bins}, \sphinxstyleemphasis{patches}) or ({[}\sphinxstyleemphasis{n0}, \sphinxstyleemphasis{n1}, …{]}, \sphinxstyleemphasis{bins}, {[}\sphinxstyleemphasis{patches0}, \sphinxstyleemphasis{patches1},…{]}) if the input contains multiple data. Multiple data can be provided via \sphinxstyleemphasis{x} as a list of datasets of potentially different length ({[}\sphinxstyleemphasis{x0}, \sphinxstyleemphasis{x1}, …{]}), or as a 2-D ndarray in which each column is a dataset. Note that the ndarray form is transposed relative to the list form. Masked arrays are not supported at present. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}(n,) array or sequence of (n,) arrays{]} Input values, this takes either a single array or a sequence of arrays which are not required to be of the same length \item[{\sphinxstylestrong{bins}}] \leavevmode{[}integer or sequence or ‘auto’, optional{]} If an integer is given, \sphinxcode{\sphinxupquote{bins + 1}} bin edges are calculated and returned, consistent with \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html\#numpy.histogram}{\sphinxcode{\sphinxupquote{numpy.histogram()}}}. If \sphinxcode{\sphinxupquote{bins}} is a sequence, gives bin edges, including left edge of first bin and right edge of last bin. In this case, \sphinxcode{\sphinxupquote{bins}} is returned unmodified. All but the last (righthand-most) bin is half-open. In other words, if \sphinxcode{\sphinxupquote{bins}} is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{]} \end{sphinxVerbatim} then the first bin is \sphinxcode{\sphinxupquote{{[}1, 2)}} (including 1, but excluding 2) and the second \sphinxcode{\sphinxupquote{{[}2, 3)}}. The last bin, however, is \sphinxcode{\sphinxupquote{{[}3, 4{]}}}, which \sphinxstyleemphasis{includes} 4. Unequally spaced bins are supported if \sphinxstyleemphasis{bins} is a sequence. If Numpy 1.11 is installed, may also be \sphinxcode{\sphinxupquote{'auto'}}. Default is taken from the rcParam \sphinxcode{\sphinxupquote{hist.bins}}. \item[{\sphinxstylestrong{range}}] \leavevmode{[}tuple or None, optional{]} The lower and upper range of the bins. Lower and upper outliers are ignored. If not provided, \sphinxstyleemphasis{range} is \sphinxcode{\sphinxupquote{(x.min(), x.max())}}. Range has no effect if \sphinxstyleemphasis{bins} is a sequence. If \sphinxstyleemphasis{bins} is a sequence or \sphinxstyleemphasis{range} is specified, autoscaling is based on the specified bin range instead of the range of x. Default is \sphinxcode{\sphinxupquote{None}} \item[{\sphinxstylestrong{density}}] \leavevmode{[}boolean, optional{]} If \sphinxcode{\sphinxupquote{True}}, the first element of the return tuple will be the counts normalized to form a probability density, i.e., the area (or integral) under the histogram will sum to 1. This is achieved by dividing the count by the number of observations times the bin width and not dividing by the total number of observations. If \sphinxstyleemphasis{stacked} is also \sphinxcode{\sphinxupquote{True}}, the sum of the histograms is normalized to 1. Default is \sphinxcode{\sphinxupquote{None}} for both \sphinxstyleemphasis{normed} and \sphinxstyleemphasis{density}. If either is set, then that value will be used. If neither are set, then the args will be treated as \sphinxcode{\sphinxupquote{False}}. If both \sphinxstyleemphasis{density} and \sphinxstyleemphasis{normed} are set an error is raised. \item[{\sphinxstylestrong{weights}}] \leavevmode{[}(n, ) array\_like or None, optional{]} An array of weights, of the same shape as \sphinxstyleemphasis{x}. Each value in \sphinxstyleemphasis{x} only contributes its associated weight towards the bin count (instead of 1). If \sphinxstyleemphasis{normed} or \sphinxstyleemphasis{density} is \sphinxcode{\sphinxupquote{True}}, the weights are normalized, so that the integral of the density over the range remains 1. Default is \sphinxcode{\sphinxupquote{None}} \item[{\sphinxstylestrong{cumulative}}] \leavevmode{[}boolean, optional{]} If \sphinxcode{\sphinxupquote{True}}, then a histogram is computed where each bin gives the counts in that bin plus all bins for smaller values. The last bin gives the total number of datapoints. If \sphinxstyleemphasis{normed} or \sphinxstyleemphasis{density} is also \sphinxcode{\sphinxupquote{True}} then the histogram is normalized such that the last bin equals 1. If \sphinxstyleemphasis{cumulative} evaluates to less than 0 (e.g., -1), the direction of accumulation is reversed. In this case, if \sphinxstyleemphasis{normed} and/or \sphinxstyleemphasis{density} is also \sphinxcode{\sphinxupquote{True}}, then the histogram is normalized such that the first bin equals 1. Default is \sphinxcode{\sphinxupquote{False}} \item[{\sphinxstylestrong{bottom}}] \leavevmode{[}array\_like, scalar, or None{]} Location of the bottom baseline of each bin. If a scalar, the base line for each bin is shifted by the same amount. If an array, each bin is shifted independently and the length of bottom must match the number of bins. If None, defaults to 0. Default is \sphinxcode{\sphinxupquote{None}} \item[{\sphinxstylestrong{histtype}}] \leavevmode{[}\{‘bar’, ‘barstacked’, ‘step’, ‘stepfilled’\}, optional{]} The type of histogram to draw. \begin{itemize} \item {} ‘bar’ is a traditional bar-type histogram. If multiple data are given the bars are arranged side by side. \item {} ‘barstacked’ is a bar-type histogram where multiple data are stacked on top of each other. \item {} ‘step’ generates a lineplot that is by default unfilled. \item {} ‘stepfilled’ generates a lineplot that is by default filled. \end{itemize} Default is ‘bar’ \item[{\sphinxstylestrong{align}}] \leavevmode{[}\{‘left’, ‘mid’, ‘right’\}, optional{]} Controls how the histogram is plotted. \begin{itemize} \item {} ‘left’: bars are centered on the left bin edges. \item {} ‘mid’: bars are centered between the bin edges. \item {} ‘right’: bars are centered on the right bin edges. \end{itemize} Default is ‘mid’ \item[{\sphinxstylestrong{orientation}}] \leavevmode{[}\{‘horizontal’, ‘vertical’\}, optional{]} If ‘horizontal’, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.barh:matplotlib.pyplot.barh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{barh}}}}} will be used for bar-type histograms and the \sphinxstyleemphasis{bottom} kwarg will be the left edges. \item[{\sphinxstylestrong{rwidth}}] \leavevmode{[}scalar or None, optional{]} The relative width of the bars as a fraction of the bin width. If \sphinxcode{\sphinxupquote{None}}, automatically compute the width. Ignored if \sphinxstyleemphasis{histtype} is ‘step’ or ‘stepfilled’. Default is \sphinxcode{\sphinxupquote{None}} \item[{\sphinxstylestrong{log}}] \leavevmode{[}boolean, optional{]} If \sphinxcode{\sphinxupquote{True}}, the histogram axis will be set to a log scale. If \sphinxstyleemphasis{log} is \sphinxcode{\sphinxupquote{True}} and \sphinxstyleemphasis{x} is a 1D array, empty bins will be filtered out and only the non-empty \sphinxcode{\sphinxupquote{(n, bins, patches)}} will be returned. Default is \sphinxcode{\sphinxupquote{False}} \item[{\sphinxstylestrong{color}}] \leavevmode{[}color or array\_like of colors or None, optional{]} Color spec or sequence of color specs, one per dataset. Default (\sphinxcode{\sphinxupquote{None}}) uses the standard line color sequence. Default is \sphinxcode{\sphinxupquote{None}} \item[{\sphinxstylestrong{label}}] \leavevmode{[}string or None, optional{]} String, or sequence of strings to match multiple datasets. Bar charts yield multiple patches per dataset, but only the first gets the label, so that the legend command will work as expected. default is \sphinxcode{\sphinxupquote{None}} \item[{\sphinxstylestrong{stacked}}] \leavevmode{[}boolean, optional{]} If \sphinxcode{\sphinxupquote{True}}, multiple data are stacked on top of each other If \sphinxcode{\sphinxupquote{False}} multiple data are arranged side by side if histtype is ‘bar’ or on top of each other if histtype is ‘step’ Default is \sphinxcode{\sphinxupquote{False}} \item[{\sphinxstylestrong{normed}}] \leavevmode{[}bool, optional{]} Deprecated; use the density keyword argument instead. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{n}}] \leavevmode{[}array or list of arrays{]} The values of the histogram bins. See \sphinxstyleemphasis{normed} or \sphinxstyleemphasis{density} and \sphinxstyleemphasis{weights} for a description of the possible semantics. If input \sphinxstyleemphasis{x} is an array, then this is an array of length \sphinxstyleemphasis{nbins}. If input is a sequence arrays \sphinxcode{\sphinxupquote{{[}data1, data2,..{]}}}, then this is a list of arrays with the values of the histograms for each of the arrays in the same order. \item[{\sphinxstylestrong{bins}}] \leavevmode{[}array{]} The edges of the bins. Length nbins + 1 (nbins left edges and right edge of last bin). Always a single array even when multiple data sets are passed in. \item[{\sphinxstylestrong{patches}}] \leavevmode{[}list or list of lists{]} Silent list of individual patches used to create the histogram or list of such list if multiple input datasets. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} properties{]} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hist2d:matplotlib.pyplot.hist2d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hist2d}}}}}}] \leavevmode 2D histograms \end{description} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘weights’, ‘x’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.hist}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.hist:examples-using-matplotlib-pyplot-hist}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_text.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_svg\_histogram\_sgskip.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/images:sphx-glr-tutorials-introductory-images-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Image tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \subsection{matplotlib.pyplot.hist2d} \label{\detokenize{api/_as_gen/matplotlib.pyplot.hist2d:matplotlib-pyplot-hist2d}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.hist2d::doc}}\index{hist2d() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.hist2d:matplotlib.pyplot.hist2d}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{hist2d}}}{\emph{x}, \emph{y}, \emph{bins=10}, \emph{range=None}, \emph{normed=False}, \emph{weights=None}, \emph{cmin=None}, \emph{cmax=None}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Make a 2D histogram plot. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y: array\_like, shape (n, )}}] \leavevmode Input values \item[{\sphinxstylestrong{bins: {[}None \textbar{} int \textbar{} {[}int, int{]} \textbar{} array\_like \textbar{} {[}array, array{]}{]}}}] \leavevmode The bin specification: \begin{itemize} \item {} If int, the number of bins for the two dimensions (nx=ny=bins). \item {} If {[}int, int{]}, the number of bins in each dimension (nx, ny = bins). \item {} If array\_like, the bin edges for the two dimensions (x\_edges=y\_edges=bins). \item {} If {[}array, array{]}, the bin edges in each dimension (x\_edges, y\_edges = bins). \end{itemize} The default value is 10. \item[{\sphinxstylestrong{range}}] \leavevmode{[}array\_like shape(2, 2), optional, default: None{]} The leftmost and rightmost edges of the bins along each dimension (if not specified explicitly in the bins parameters): {[}{[}xmin, xmax{]}, {[}ymin, ymax{]}{]}. All values outside of this range will be considered outliers and not tallied in the histogram. \item[{\sphinxstylestrong{normed}}] \leavevmode{[}boolean, optional, default: False{]} Normalize histogram. \item[{\sphinxstylestrong{weights}}] \leavevmode{[}array\_like, shape (n, ), optional, default: None{]} An array of values w\_i weighing each sample (x\_i, y\_i). \item[{\sphinxstylestrong{cmin}}] \leavevmode{[}scalar, optional, default: None{]} All bins that has count less than cmin will not be displayed and these count values in the return value count histogram will also be set to nan upon return \item[{\sphinxstylestrong{cmax}}] \leavevmode{[}scalar, optional, default: None{]} All bins that has count more than cmax will not be displayed (set to none before passing to imshow) and these count values in the return value count histogram will also be set to nan upon return \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{h}}] \leavevmode{[}2D array{]} The bi-dimensional histogram of samples x and y. Values in x are histogrammed along the first dimension and values in y are histogrammed along the second dimension. \item[{\sphinxstylestrong{xedges}}] \leavevmode{[}1D array{]} The bin edges along the x axis. \item[{\sphinxstylestrong{yedges}}] \leavevmode{[}1D array{]} The bin edges along the y axis. \item[{\sphinxstylestrong{image}}] \leavevmode{[}AxesImage{]} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}\{Colormap, string\}, optional{]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap}}}}} instance. If not set, use rc settings. \item[{\sphinxstylestrong{norm}}] \leavevmode{[}Normalize, optional{]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance is used to scale luminance data to \sphinxcode{\sphinxupquote{{[}0, 1{]}}}. If not set, defaults to \sphinxcode{\sphinxupquote{Normalize()}}. \item[{\sphinxstylestrong{vmin/vmax}}] \leavevmode{[}\{None, scalar\}, optional{]} Arguments passed to the \sphinxcode{\sphinxupquote{Normalize}} instance. \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}\sphinxcode{\sphinxupquote{0 \textless{}= scalar \textless{}= 1}} or \sphinxcode{\sphinxupquote{None}}, optional{]} The alpha blending value. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hist:matplotlib.pyplot.hist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hist}}}}}}] \leavevmode 1D histogram \end{description} \paragraph{Notes} Rendering the histogram with a logarithmic color scale is accomplished by passing a \sphinxcode{\sphinxupquote{colors.LogNorm}} instance to the \sphinxstyleemphasis{norm} keyword argument. Likewise, power-law normalization (similar in effect to gamma correction) can be accomplished with \sphinxcode{\sphinxupquote{colors.PowerNorm}}. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘weights’, ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.pyplot.hlines} \label{\detokenize{api/_as_gen/matplotlib.pyplot.hlines:matplotlib-pyplot-hlines}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.hlines::doc}}\index{hlines() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.hlines:matplotlib.pyplot.hlines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{hlines}}}{\emph{y}, \emph{xmin}, \emph{xmax}, \emph{colors='k'}, \emph{linestyles='solid'}, \emph{label=''}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Plot horizontal lines at each \sphinxstyleemphasis{y} from \sphinxstyleemphasis{xmin} to \sphinxstyleemphasis{xmax}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{y}}] \leavevmode{[}scalar or sequence of scalar{]} y-indexes where to plot the lines. \item[{\sphinxstylestrong{xmin, xmax}}] \leavevmode{[}scalar or 1D array\_like{]} Respective beginning and end of each line. If scalars are provided, all lines will have same length. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}array\_like of colors, optional, default: ‘k’{]} \item[{\sphinxstylestrong{linestyles}}] \leavevmode{[}{[}‘solid’ \textbar{} ‘dashed’ \textbar{} ‘dashdot’ \textbar{} ‘dotted’{]}, optional{]} \item[{\sphinxstylestrong{label}}] \leavevmode{[}string, optional, default: ‘’{]} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lines}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}}{]} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} properties.{]} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.vlines:matplotlib.pyplot.vlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{vlines}}}}}}] \leavevmode vertical lines \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axhline:matplotlib.pyplot.axhline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axhline}}}}}}] \leavevmode horizontal line across the axes \item[{\sphinxcode{\sphinxupquote{}}}] \leavevmode In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: * All arguments with the following names: ‘colors’, ‘xmax’, ‘xmin’, ‘y’. \end{description} \end{fulllineitems} \subsection{matplotlib.pyplot.hold} \label{\detokenize{api/_as_gen/matplotlib.pyplot.hold:matplotlib-pyplot-hold}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.hold::doc}}\index{hold() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.hold:matplotlib.pyplot.hold}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{hold}}}{\emph{b=None}}{}~ \DUrole{versionmodified}{Deprecated since version 2.0: }pyplot.hold is deprecated. Future behavior will be consistent with the long-time default: plot commands add elements without first clearing the Axes and/or Figure. Set the hold state. If \sphinxstyleemphasis{b} is None (default), toggle the hold state, else set the hold state to boolean value \sphinxstyleemphasis{b}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{hold}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} toggle hold} \PYG{n}{hold}\PYG{p}{(}\PYG{k+kc}{True}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} hold is on} \PYG{n}{hold}\PYG{p}{(}\PYG{k+kc}{False}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} hold is off} \end{sphinxVerbatim} When \sphinxstyleemphasis{hold} is \sphinxstyleemphasis{True}, subsequent plot commands will add elements to the current axes. When \sphinxstyleemphasis{hold} is \sphinxstyleemphasis{False}, the current axes and figure will be cleared on the next plot command. \end{fulllineitems} \subsection{matplotlib.pyplot.hot} \label{\detokenize{api/_as_gen/matplotlib.pyplot.hot:matplotlib-pyplot-hot}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.hot::doc}}\index{hot() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.hot:matplotlib.pyplot.hot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{hot}}}{}{} Set the colormap to “hot”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.hsv} \label{\detokenize{api/_as_gen/matplotlib.pyplot.hsv:matplotlib-pyplot-hsv}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.hsv::doc}}\index{hsv() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.hsv:matplotlib.pyplot.hsv}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{hsv}}}{}{} Set the colormap to “hsv”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.imread} \label{\detokenize{api/_as_gen/matplotlib.pyplot.imread:matplotlib-pyplot-imread}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.imread::doc}}\index{imread() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.imread:matplotlib.pyplot.imread}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{imread}}}{\emph{*args}, \emph{**kwargs}}{} Read an image from a file into an array. \sphinxstyleemphasis{fname} may be a string path, a valid URL, or a Python file-like object. If using a file object, it must be opened in binary mode. If \sphinxstyleemphasis{format} is provided, will try to read file of that type, otherwise the format is deduced from the filename. If nothing can be deduced, PNG is tried. Return value is a \sphinxcode{\sphinxupquote{numpy.array}}. For grayscale images, the return array is MxN. For RGB images, the return value is MxNx3. For RGBA images the return value is MxNx4. matplotlib can only read PNGs natively, but if \sphinxhref{http://www.pythonware.com/products/pil/}{PIL} is installed, it will use it to load the image and return an array (if possible) which can be used with {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow()}}}}}. Note, URL strings may not be compatible with PIL. Check the PIL documentation for more information. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.imread}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.imread:examples-using-matplotlib-pyplot-imread}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_clip\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_demo\_annotation\_box.py} \end{itemize} \subsection{matplotlib.pyplot.imsave} \label{\detokenize{api/_as_gen/matplotlib.pyplot.imsave:matplotlib-pyplot-imsave}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.imsave::doc}}\index{imsave() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.imsave:matplotlib.pyplot.imsave}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{imsave}}}{\emph{*args}, \emph{**kwargs}}{} Save an array as in image file. The output formats available depend on the backend being used. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fname}}] \leavevmode{[}str or file-like{]} Path string to a filename, or a Python file-like object. If \sphinxstyleemphasis{format} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{fname} is a string, the output format is deduced from the extension of the filename. \item[{\sphinxstylestrong{arr}}] \leavevmode{[}array-like{]} An MxN (luminance), MxNx3 (RGB) or MxNx4 (RGBA) array. \item[{\sphinxstylestrong{vmin, vmax: {[} None \textbar{} scalar {]}}}] \leavevmode \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} set the color scaling for the image by fixing the values that map to the colormap color limits. If either \sphinxstyleemphasis{vmin} or \sphinxstyleemphasis{vmax} is None, that limit is determined from the \sphinxstyleemphasis{arr} min/max value. \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}matplotlib.colors.Colormap, optional{]} For example, \sphinxcode{\sphinxupquote{cm.viridis}}. If \sphinxcode{\sphinxupquote{None}}, defaults to the \sphinxcode{\sphinxupquote{image.cmap}} rcParam. \item[{\sphinxstylestrong{format}}] \leavevmode{[}str{]} One of the file extensions supported by the active backend. Most backends support png, pdf, ps, eps and svg. \item[{\sphinxstylestrong{origin}}] \leavevmode{[}{[} ‘upper’ \textbar{} ‘lower’ {]}{]} Indicates whether the \sphinxcode{\sphinxupquote{(0, 0)}} index of the array is in the upper left or lower left corner of the axes. Defaults to the \sphinxcode{\sphinxupquote{image.origin}} rcParam. \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}int{]} The DPI to store in the metadata of the file. This does not affect the resolution of the output image. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.pyplot.imshow} \label{\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib-pyplot-imshow}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.imshow::doc}}\index{imshow() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{imshow}}}{\emph{X}, \emph{cmap=None}, \emph{norm=None}, \emph{aspect=None}, \emph{interpolation=None}, \emph{alpha=None}, \emph{vmin=None}, \emph{vmax=None}, \emph{origin=None}, \emph{extent=None}, \emph{shape=None}, \emph{filternorm=1}, \emph{filterrad=4.0}, \emph{imlim=None}, \emph{resample=None}, \emph{url=None}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Display an image on the axes. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{X}}] \leavevmode{[}array\_like, shape (n, m) or (n, m, 3) or (n, m, 4){]} Display the image in \sphinxcode{\sphinxupquote{X}} to current axes. \sphinxcode{\sphinxupquote{X}} may be an array or a PIL image. If \sphinxcode{\sphinxupquote{X}} is an array, it can have the following shapes and types: \begin{itemize} \item {} MxN \textendash{} values to be mapped (float or int) \item {} MxNx3 \textendash{} RGB (float or uint8) \item {} MxNx4 \textendash{} RGBA (float or uint8) \end{itemize} MxN arrays are mapped to colors based on the \sphinxcode{\sphinxupquote{norm}} (mapping scalar to scalar) and the \sphinxcode{\sphinxupquote{cmap}} (mapping the normed scalar to a color). Elements of RGB and RGBA arrays represent pixels of an MxN image. All values should be in the range {[}0 .. 1{]} for floats or {[}0 .. 255{]} for integers. Out-of-range values will be clipped to these bounds. \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}}, optional, default: None{]} If None, default to rc \sphinxcode{\sphinxupquote{image.cmap}} value. \sphinxcode{\sphinxupquote{cmap}} is ignored if \sphinxcode{\sphinxupquote{X}} is 3-D, directly specifying RGB(A) values. \item[{\sphinxstylestrong{aspect}}] \leavevmode{[}{[}‘auto’ \textbar{} ‘equal’ \textbar{} scalar{]}, optional, default: None{]} If ‘auto’, changes the image aspect ratio to match that of the axes. If ‘equal’, and \sphinxcode{\sphinxupquote{extent}} is None, changes the axes aspect ratio to match that of the image. If \sphinxcode{\sphinxupquote{extent}} is not \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, the axes aspect ratio is changed to match that of the extent. If None, default to rc \sphinxcode{\sphinxupquote{image.aspect}} value. \item[{\sphinxstylestrong{interpolation}}] \leavevmode{[}string, optional, default: None{]} Acceptable values are ‘none’, ‘nearest’, ‘bilinear’, ‘bicubic’, ‘spline16’, ‘spline36’, ‘hanning’, ‘hamming’, ‘hermite’, ‘kaiser’, ‘quadric’, ‘catrom’, ‘gaussian’, ‘bessel’, ‘mitchell’, ‘sinc’, ‘lanczos’ If \sphinxcode{\sphinxupquote{interpolation}} is None, default to rc \sphinxcode{\sphinxupquote{image.interpolation}}. See also the \sphinxcode{\sphinxupquote{filternorm}} and \sphinxcode{\sphinxupquote{filterrad}} parameters. If \sphinxcode{\sphinxupquote{interpolation}} is ‘none’, then no interpolation is performed on the Agg, ps and pdf backends. Other backends will fall back to ‘nearest’. \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}, optional, default: None{]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} instance is used to scale a 2-D float \sphinxcode{\sphinxupquote{X}} input to the (0, 1) range for input to the \sphinxcode{\sphinxupquote{cmap}}. If \sphinxcode{\sphinxupquote{norm}} is None, use the default func:\sphinxcode{\sphinxupquote{normalize}}. If \sphinxcode{\sphinxupquote{norm}} is an instance of {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.NoNorm:matplotlib.colors.NoNorm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{NoNorm}}}}}, \sphinxcode{\sphinxupquote{X}} must be an array of integers that index directly into the lookup table of the \sphinxcode{\sphinxupquote{cmap}}. \item[{\sphinxstylestrong{vmin, vmax}}] \leavevmode{[}scalar, optional, default: None{]} \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} are used in conjunction with norm to normalize luminance data. Note if you pass a \sphinxcode{\sphinxupquote{norm}} instance, your settings for \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} will be ignored. \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}scalar, optional, default: None{]} The alpha blending value, between 0 (transparent) and 1 (opaque). The \sphinxcode{\sphinxupquote{alpha}} argument is ignored for RGBA input data. \item[{\sphinxstylestrong{origin}}] \leavevmode{[}{[}‘upper’ \textbar{} ‘lower’{]}, optional, default: None{]} Place the {[}0,0{]} index of the array in the upper left or lower left corner of the axes. If None, default to rc \sphinxcode{\sphinxupquote{image.origin}}. \item[{\sphinxstylestrong{extent}}] \leavevmode{[}scalars (left, right, bottom, top), optional, default: None{]} The location, in data-coordinates, of the lower-left and upper-right corners. If \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, the image is positioned such that the pixel centers fall on zero-based (row, column) indices. \item[{\sphinxstylestrong{shape}}] \leavevmode{[}scalars (columns, rows), optional, default: None{]} For raw buffer images \item[{\sphinxstylestrong{filternorm}}] \leavevmode{[}scalar, optional, default: 1{]} A parameter for the antigrain image resize filter. From the antigrain documentation, if \sphinxcode{\sphinxupquote{filternorm}} = 1, the filter normalizes integer values and corrects the rounding errors. It doesn’t do anything with the source floating point values, it corrects only integers according to the rule of 1.0 which means that any sum of pixel weights must be equal to 1.0. So, the filter function must produce a graph of the proper shape. \item[{\sphinxstylestrong{filterrad}}] \leavevmode{[}scalar, optional, default: 4.0{]} The filter radius for filters that have a radius parameter, i.e. when interpolation is one of: ‘sinc’, ‘lanczos’ or ‘blackman’ \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{image}}] \leavevmode{[}{\hyperref[\detokenize{api/image_api:matplotlib.image.AxesImage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AxesImage}}}}}{]} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} properties.{]} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.matshow:matplotlib.pyplot.matshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matshow}}}}}}] \leavevmode Plot a matrix or an array as an image. \end{description} \paragraph{Notes} Unless \sphinxstyleemphasis{extent} is used, pixel centers will be located at integer coordinates. In other words: the origin will coincide with the center of pixel (0, 0). Two typical representations are used for RGB images with an alpha channel: \begin{itemize} \item {} Straight (unassociated) alpha: R, G, and B channels represent the color of the pixel, disregarding its opacity. \item {} Premultiplied (associated) alpha: R, G, and B channels represent the color of the pixel, adjusted for its opacity by multiplication. \end{itemize} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow}}}}} expects RGB images adopting the straight (unassociated) alpha representation. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All positional and all keyword arguments. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.imshow}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.imshow:examples-using-matplotlib-pyplot-imshow}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplots\_adjust.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_layer\_images.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_annotated\_heatmap.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_dolphin.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_mandelbrot.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/dynamic_image:sphx-glr-gallery-animation-dynamic-image-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Animated image using a precomputed list of images}}}} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_hyperlinks\_sgskip.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/images:sphx-glr-tutorials-introductory-images-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Image tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-tutorials-intermediate-tight-layout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Tight Layout guide}}}} \end{itemize} \subsection{matplotlib.pyplot.inferno} \label{\detokenize{api/_as_gen/matplotlib.pyplot.inferno:matplotlib-pyplot-inferno}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.inferno::doc}}\index{inferno() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.inferno:matplotlib.pyplot.inferno}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{inferno}}}{}{} Set the colormap to “inferno”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.install\_repl\_displayhook} \label{\detokenize{api/_as_gen/matplotlib.pyplot.install_repl_displayhook:matplotlib-pyplot-install-repl-displayhook}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.install_repl_displayhook::doc}}\index{install\_repl\_displayhook() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.install_repl_displayhook:matplotlib.pyplot.install_repl_displayhook}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{install\_repl\_displayhook}}}{}{} Install a repl display hook so that any stale figure are automatically redrawn when control is returned to the repl. This works with IPython terminals and kernels, as well as vanilla python shells. \end{fulllineitems} \subsection{matplotlib.pyplot.ioff} \label{\detokenize{api/_as_gen/matplotlib.pyplot.ioff:matplotlib-pyplot-ioff}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.ioff::doc}}\index{ioff() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.ioff:matplotlib.pyplot.ioff}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{ioff}}}{}{} Turn interactive mode off. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.ioff}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.ioff:examples-using-matplotlib-pyplot-ioff}} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/usage:sphx-glr-tutorials-introductory-usage-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Usage Guide}}}} \end{itemize} \subsection{matplotlib.pyplot.ion} \label{\detokenize{api/_as_gen/matplotlib.pyplot.ion:matplotlib-pyplot-ion}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.ion::doc}}\index{ion() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.ion:matplotlib.pyplot.ion}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{ion}}}{}{} Turn interactive mode on. \end{fulllineitems} \subsection{matplotlib.pyplot.ishold} \label{\detokenize{api/_as_gen/matplotlib.pyplot.ishold:matplotlib-pyplot-ishold}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.ishold::doc}}\index{ishold() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.ishold:matplotlib.pyplot.ishold}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{ishold}}}{}{}~ \DUrole{versionmodified}{Deprecated since version 2.0: }pyplot.hold is deprecated. Future behavior will be consistent with the long-time default: plot commands add elements without first clearing the Axes and/or Figure. Return the hold status of the current axes. \end{fulllineitems} \subsection{matplotlib.pyplot.isinteractive} \label{\detokenize{api/_as_gen/matplotlib.pyplot.isinteractive:matplotlib-pyplot-isinteractive}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.isinteractive::doc}}\index{isinteractive() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.isinteractive:matplotlib.pyplot.isinteractive}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{isinteractive}}}{}{} Return status of interactive mode. \end{fulllineitems} \subsection{matplotlib.pyplot.jet} \label{\detokenize{api/_as_gen/matplotlib.pyplot.jet:matplotlib-pyplot-jet}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.jet::doc}}\index{jet() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.jet:matplotlib.pyplot.jet}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{jet}}}{}{} Set the colormap to “jet”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.legend} \label{\detokenize{api/_as_gen/matplotlib.pyplot.legend:matplotlib-pyplot-legend}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.legend::doc}}\index{legend() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.legend:matplotlib.pyplot.legend}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{legend}}}{\emph{*args}, \emph{**kwargs}}{} Places a legend on the axes. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{legend}\PYG{p}{(}\PYG{p}{)} \PYG{n}{legend}\PYG{p}{(}\PYG{n}{labels}\PYG{p}{)} \PYG{n}{legend}\PYG{p}{(}\PYG{n}{handles}\PYG{p}{,} \PYG{n}{labels}\PYG{p}{)} \end{sphinxVerbatim} The call signatures correspond to three different ways how to use this method. \sphinxstylestrong{1. Automatic detection of elements to be shown in the legend} The elements to be added to the legend are automatically determined, when you do not pass in any extra arguments. In this case, the labels are taken from the artist. You can specify them either at artist creation or by calling the {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_label()}}}}} method on the artist: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Inline label}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{line}\PYG{o}{.}\PYG{n}{set\PYGZus{}label}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Label via method}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} Specific lines can be excluded from the automatic legend element selection by defining a label starting with an underscore. This is default for all artists, so calling \sphinxcode{\sphinxupquote{Axes.legend}} without any arguments and without setting the labels manually will result in no legend being drawn. \sphinxstylestrong{2. Labeling existing plot elements} To make a legend for lines which already exist on the axes (via plot for instance), simply call this function with an iterable of strings, one for each legend item. For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{legend}\PYG{p}{(}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{A simple line}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} Note: This way of using is discouraged, because the relation between plot elements and labels is only implicit by their order and can easily be mixed up. \sphinxstylestrong{3. Explicitly defining the elements in the legend} For full control of which artists have a legend entry, it is possible to pass an iterable of legend artists followed by an iterable of legend labels respectively: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{legend}\PYG{p}{(}\PYG{p}{(}\PYG{n}{line1}\PYG{p}{,} \PYG{n}{line2}\PYG{p}{,} \PYG{n}{line3}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label3}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{handles}}] \leavevmode{[}sequence of {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}}, optional{]} A list of Artists (lines, patches) to be added to the legend. Use this together with \sphinxstyleemphasis{labels}, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient. The length of handles and labels should be the same in this case. If they are not, they are truncated to the smaller length. \item[{\sphinxstylestrong{labels}}] \leavevmode{[}sequence of strings, optional{]} A list of labels to show next to the artists. Use this together with \sphinxstyleemphasis{handles}, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{:class:{}`matplotlib.legend.Legend{}` instance}}] \leavevmode \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{loc}}] \leavevmode{[}int or string or pair of floats, default: ‘upper right’{]} The location of the legend. Possible codes are: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Location String &\sphinxstyletheadfamily Location Code \\ \hline ‘best’ & 0 \\ \hline ‘upper right’ & 1 \\ \hline ‘upper left’ & 2 \\ \hline ‘lower left’ & 3 \\ \hline ‘lower right’ & 4 \\ \hline ‘right’ & 5 \\ \hline ‘center left’ & 6 \\ \hline ‘center right’ & 7 \\ \hline ‘lower center’ & 8 \\ \hline ‘upper center’ & 9 \\ \hline ‘center’ & 10 \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} Alternatively can be a 2-tuple giving \sphinxcode{\sphinxupquote{x, y}} of the lower-left corner of the legend in axes coordinates (in which case \sphinxcode{\sphinxupquote{bbox\_to\_anchor}} will be ignored). \item[{\sphinxstylestrong{bbox\_to\_anchor}}] \leavevmode{[}{\hyperref[\detokenize{api/transformations:matplotlib.transforms.BboxBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{BboxBase}}}}} or pair of floats{]} Specify any arbitrary location for the legend in \sphinxcode{\sphinxupquote{bbox\_transform}} coordinates (default Axes coordinates). For example, to put the legend’s upper right hand corner in the center of the axes the following keywords can be used: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{loc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{upper right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{bbox\PYGZus{}to\PYGZus{}anchor}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{)} \end{sphinxVerbatim} \item[{\sphinxstylestrong{ncol}}] \leavevmode{[}integer{]} The number of columns that the legend has. Default is 1. \item[{\sphinxstylestrong{prop}}] \leavevmode{[}None or {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.font\_manager.FontProperties}}}}} or dict{]} The font properties of the legend. If None (default), the current {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcParams}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.rcParams}}}}} will be used. \item[{\sphinxstylestrong{fontsize}}] \leavevmode{[}int or float or \{‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’\}{]} Controls the font size of the legend. If the value is numeric the size will be the absolute font size in points. String values are relative to the current default font size. This argument is only used if \sphinxcode{\sphinxupquote{prop}} is not specified. \item[{\sphinxstylestrong{numpoints}}] \leavevmode{[}None or int{]} The number of marker points in the legend when creating a legend entry for a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} (line). Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.numpoints"{]}}}. \item[{\sphinxstylestrong{scatterpoints}}] \leavevmode{[}None or int{]} The number of marker points in the legend when creating a legend entry for a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PathCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathCollection}}}}} (scatter plot). Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.scatterpoints"{]}}}. \item[{\sphinxstylestrong{scatteryoffsets}}] \leavevmode{[}iterable of floats{]} The vertical offset (relative to the font size) for the markers created for a scatter plot legend entry. 0.0 is at the base the legend text, and 1.0 is at the top. To draw all markers at the same height, set to \sphinxcode{\sphinxupquote{{[}0.5{]}}}. Default is \sphinxcode{\sphinxupquote{{[}0.375, 0.5, 0.3125{]}}}. \item[{\sphinxstylestrong{markerscale}}] \leavevmode{[}None or int or float{]} The relative size of legend markers compared with the originally drawn ones. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.markerscale"{]}}}. \item[{\sphinxstylestrong{markerfirst}}] \leavevmode{[}bool{]} If \sphinxstyleemphasis{True}, legend marker is placed to the left of the legend label. If \sphinxstyleemphasis{False}, legend marker is placed to the right of the legend label. Default is \sphinxstyleemphasis{True}. \item[{\sphinxstylestrong{frameon}}] \leavevmode{[}None or bool{]} Control whether the legend should be drawn on a patch (frame). Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.frameon"{]}}}. \item[{\sphinxstylestrong{fancybox}}] \leavevmode{[}None or bool{]} Control whether round edges should be enabled around the {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyBboxPatch:matplotlib.patches.FancyBboxPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyBboxPatch}}}}} which makes up the legend’s background. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.fancybox"{]}}}. \item[{\sphinxstylestrong{shadow}}] \leavevmode{[}None or bool{]} Control whether to draw a shadow behind the legend. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.shadow"{]}}}. \item[{\sphinxstylestrong{framealpha}}] \leavevmode{[}None or float{]} Control the alpha transparency of the legend’s background. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.framealpha"{]}}}. If shadow is activated and \sphinxstyleemphasis{framealpha} is \sphinxcode{\sphinxupquote{None}}, the default value is ignored. \item[{\sphinxstylestrong{facecolor}}] \leavevmode{[}None or “inherit” or a color spec{]} Control the legend’s background color. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.facecolor"{]}}}. If \sphinxcode{\sphinxupquote{"inherit"}}, it will take \sphinxcode{\sphinxupquote{rcParams{[}"axes.facecolor"{]}}}. \item[{\sphinxstylestrong{edgecolor}}] \leavevmode{[}None or “inherit” or a color spec{]} Control the legend’s background patch edge color. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.edgecolor"{]}}} If \sphinxcode{\sphinxupquote{"inherit"}}, it will take \sphinxcode{\sphinxupquote{rcParams{[}"axes.edgecolor"{]}}}. \item[{\sphinxstylestrong{mode}}] \leavevmode{[}\{“expand”, None\}{]} If \sphinxcode{\sphinxupquote{mode}} is set to \sphinxcode{\sphinxupquote{"expand"}} the legend will be horizontally expanded to fill the axes area (or \sphinxcode{\sphinxupquote{bbox\_to\_anchor}} if defines the legend’s size). \item[{\sphinxstylestrong{bbox\_transform}}] \leavevmode{[}None or {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}}{]} The transform for the bounding box (\sphinxcode{\sphinxupquote{bbox\_to\_anchor}}). For a value of \sphinxcode{\sphinxupquote{None}} (default) the Axes’ \sphinxcode{\sphinxupquote{transAxes}} transform will be used. \item[{\sphinxstylestrong{title}}] \leavevmode{[}str or None{]} The legend’s title. Default is no title (\sphinxcode{\sphinxupquote{None}}). \item[{\sphinxstylestrong{borderpad}}] \leavevmode{[}float or None{]} The fractional whitespace inside the legend border. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.borderpad"{]}}}. \item[{\sphinxstylestrong{labelspacing}}] \leavevmode{[}float or None{]} The vertical space between the legend entries. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.labelspacing"{]}}}. \item[{\sphinxstylestrong{handlelength}}] \leavevmode{[}float or None{]} The length of the legend handles. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.handlelength"{]}}}. \item[{\sphinxstylestrong{handletextpad}}] \leavevmode{[}float or None{]} The pad between the legend handle and text. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.handletextpad"{]}}}. \item[{\sphinxstylestrong{borderaxespad}}] \leavevmode{[}float or None{]} The pad between the axes and legend border. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.borderaxespad"{]}}}. \item[{\sphinxstylestrong{columnspacing}}] \leavevmode{[}float or None{]} The spacing between columns. Measured in font-size units. Default is \sphinxcode{\sphinxupquote{None}}, which will take the value from \sphinxcode{\sphinxupquote{rcParams{[}"legend.columnspacing"{]}}}. \item[{\sphinxstylestrong{handler\_map}}] \leavevmode{[}dict or None{]} The custom dictionary mapping instances or types to a legend handler. This \sphinxcode{\sphinxupquote{handler\_map}} updates the default handler map found at {\hyperref[\detokenize{api/legend_api:matplotlib.legend.Legend.get_legend_handler_map}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.legend.Legend.get\_legend\_handler\_map()}}}}}. \end{description} \end{description}\end{quote} \paragraph{Notes} Not all kinds of artist are supported by the legend command. See {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Legend guide}}}} for details. \paragraph{Examples} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{legend}.pdf} \end{figure} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.legend}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.legend:examples-using-matplotlib-pyplot-legend}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_sankey\_basics.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_98\_4\_legend.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_symbol.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_step\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_masked\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_bar\_stacked.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_hatching.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_parasite\_simple.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_findobj\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_zorder\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_pylab\_with\_gtk\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_svg\_histogram\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_simple\_legend01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_preamble\_sgskip.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/usage:sphx-glr-tutorials-introductory-usage-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Usage Guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Legend guide}}}} \end{itemize} \subsection{matplotlib.pyplot.locator\_params} \label{\detokenize{api/_as_gen/matplotlib.pyplot.locator_params:matplotlib-pyplot-locator-params}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.locator_params::doc}}\index{locator\_params() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.locator_params:matplotlib.pyplot.locator_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{locator\_params}}}{\emph{axis='both'}, \emph{tight=None}, \emph{**kwargs}}{} Control behavior of tick locators. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{axis}}] \leavevmode{[}{[}‘both’ \textbar{} ‘x’ \textbar{} ‘y’{]}, optional{]} The axis on which to operate. \item[{\sphinxstylestrong{tight}}] \leavevmode{[}bool or None, optional{]} Parameter passed to \sphinxcode{\sphinxupquote{autoscale\_view()}}. Default is None, for no change. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kw :}}] \leavevmode Remaining keyword arguments are passed to directly to the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator.set_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_params()}}}}} method. \item[{\sphinxstylestrong{Typically one might want to reduce the maximum number}}] \leavevmode \item[{\sphinxstylestrong{of ticks and use tight bounds when plotting small}}] \leavevmode \item[{\sphinxstylestrong{subplots, for example::}}] \leavevmode ax.locator\_params(tight=True, nbins=4) \item[{\sphinxstylestrong{Because the locator is involved in autoscaling,}}] \leavevmode \item[{\sphinxstylestrong{:meth:{}`autoscale\_view{}` is called automatically after}}] \leavevmode \item[{\sphinxstylestrong{the parameters are changed.}}] \leavevmode \item[{\sphinxstylestrong{This presently works only for the}}] \leavevmode \item[{\sphinxstylestrong{:class:{}`\textasciitilde{}matplotlib.ticker.MaxNLocator{}` used}}] \leavevmode \item[{\sphinxstylestrong{by default on linear axes, but it may be generalized.}}] \leavevmode \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.pyplot.loglog} \label{\detokenize{api/_as_gen/matplotlib.pyplot.loglog:matplotlib-pyplot-loglog}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.loglog::doc}}\index{loglog() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.loglog:matplotlib.pyplot.loglog}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{loglog}}}{\emph{*args}, \emph{**kwargs}}{} Make a plot with log scaling on both the x and y axis. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{loglog}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{n}{data}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{loglog}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{n}{x2}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt2}\PYG{p}{]}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} This is just a thin wrapper around {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} which additionally changes both the x-axis and the y-axis to log scaling. All of the concepts and parameters of plot can be used here as well. The additional parameters \sphinxstyleemphasis{basex/y}, \sphinxstyleemphasis{subsx/y} and \sphinxstyleemphasis{nonposx/y} control the x/y-axis properties. They are just forwarded to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xscale:matplotlib.axes.Axes.set_xscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_xscale}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yscale:matplotlib.axes.Axes.set_yscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_yscale}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{basex, basey}}] \leavevmode{[}scalar, optional, default 10{]} Base of the x/y logarithm. \item[{\sphinxstylestrong{subsx, subsy}}] \leavevmode{[}sequence, optional{]} The location of the minor x/y ticks. If \sphinxstyleemphasis{None}, reasonable locations are automatically chosen depending on the number of decades in the plot. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xscale:matplotlib.axes.Axes.set_xscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_xscale}}}}} / {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yscale:matplotlib.axes.Axes.set_yscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_yscale}}}}} for details. \item[{\sphinxstylestrong{nonposx, nonposy}}] \leavevmode{[}\{‘mask’, ‘clip’\}, optional, default ‘mask’{]} Non-positive values in x or y can be masked as invalid, or clipped to a very small positive number. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lines}}] \leavevmode A list of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} objects representing the plotted data. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode All parameters supported by {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.pyplot.magma} \label{\detokenize{api/_as_gen/matplotlib.pyplot.magma:matplotlib-pyplot-magma}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.magma::doc}}\index{magma() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.magma:matplotlib.pyplot.magma}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{magma}}}{}{} Set the colormap to “magma”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.magnitude\_spectrum} \label{\detokenize{api/_as_gen/matplotlib.pyplot.magnitude_spectrum:matplotlib-pyplot-magnitude-spectrum}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.magnitude_spectrum::doc}}\index{magnitude\_spectrum() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.magnitude_spectrum:matplotlib.pyplot.magnitude_spectrum}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{magnitude\_spectrum}}}{\emph{x}, \emph{Fs=None}, \emph{Fc=None}, \emph{window=None}, \emph{pad\_to=None}, \emph{sides=None}, \emph{scale=None}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Plot the magnitude spectrum. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{magnitude\PYGZus{}spectrum}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{Fs}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{Fc}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{window}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{window\PYGZus{}hanning}\PYG{p}{,} \PYG{n}{pad\PYGZus{}to}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{sides}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Compute the magnitude spectrum of \sphinxstyleemphasis{x}. Data is padded to a length of \sphinxstyleemphasis{pad\_to} and the windowing function \sphinxstyleemphasis{window} is applied to the signal. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1-D array or sequence{]} Array or sequence containing the data \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see \sphinxcode{\sphinxupquote{window\_hanning()}}, \sphinxcode{\sphinxupquote{window\_none()}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is \sphinxcode{\sphinxupquote{window\_hanning()}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to the length of the input signal (i.e. no padding). \item[{\sphinxstylestrong{scale}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘linear’ \textbar{} ‘dB’ {]}{]} The scaling of the values in the \sphinxstyleemphasis{spec}. ‘linear’ is no scaling. ‘dB’ returns the values in dB scale, i.e., the dB amplitude (20 * log10). ‘default’ is ‘linear’. \item[{\sphinxstylestrong{Fc}}] \leavevmode{[}integer{]} The center frequency of \sphinxstyleemphasis{x} (defaults to 0), which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{spectrum}}] \leavevmode{[}1-D array{]} The values for the magnitude spectrum before scaling (real valued) \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the elements in \sphinxstyleemphasis{spectrum} \item[{\sphinxstylestrong{line}}] \leavevmode{[}a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instance{]} The line created by this function \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Keyword arguments control the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.psd:matplotlib.pyplot.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.psd:matplotlib.pyplot.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}} plots the power spectral density.{}`. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.angle_spectrum:matplotlib.pyplot.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.angle_spectrum:matplotlib.pyplot.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}} plots the angles of the corresponding frequencies. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.phase_spectrum:matplotlib.pyplot.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.phase_spectrum:matplotlib.pyplot.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}} plots the phase (unwrapped angle) of the corresponding frequencies. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.specgram:matplotlib.pyplot.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.specgram:matplotlib.pyplot.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}} can plot the magnitude spectrum of segments within the signal in a colormap. \end{description} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.pyplot.margins} \label{\detokenize{api/_as_gen/matplotlib.pyplot.margins:matplotlib-pyplot-margins}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.margins::doc}}\index{margins() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.margins:matplotlib.pyplot.margins}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{margins}}}{\emph{*args}, \emph{**kw}}{} Set or retrieve autoscaling margins. signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{margins}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} returns xmargin, ymargin \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{margins}\PYG{p}{(}\PYG{n}{margin}\PYG{p}{)} \PYG{n}{margins}\PYG{p}{(}\PYG{n}{xmargin}\PYG{p}{,} \PYG{n}{ymargin}\PYG{p}{)} \PYG{n}{margins}\PYG{p}{(}\PYG{n}{x}\PYG{o}{=}\PYG{n}{xmargin}\PYG{p}{,} \PYG{n}{y}\PYG{o}{=}\PYG{n}{ymargin}\PYG{p}{)} \PYG{n}{margins}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{tight}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{)} \end{sphinxVerbatim} All three forms above set the xmargin and ymargin parameters. All keyword parameters are optional. A single argument specifies both xmargin and ymargin. The padding added to the end of each interval is \sphinxstyleemphasis{margin} times the data interval. The \sphinxstyleemphasis{margin} must be a float in the range {[}0, 1{]}. The \sphinxstyleemphasis{tight} parameter is passed to \sphinxcode{\sphinxupquote{autoscale\_view()}} , which is executed after a margin is changed; the default here is \sphinxstyleemphasis{True}, on the assumption that when margins are specified, no additional padding to match tick marks is usually desired. Setting \sphinxstyleemphasis{tight} to \sphinxstyleemphasis{None} will preserve the previous setting. Specifying any margin changes only the autoscaling; for example, if \sphinxstyleemphasis{xmargin} is not None, then \sphinxstyleemphasis{xmargin} times the X data interval will be added to each end of that interval before it is used in autoscaling. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.margins}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.margins:examples-using-matplotlib-pyplot-margins}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_ticklabels\_rotation.py} \end{itemize} \subsection{matplotlib.pyplot.matshow} \label{\detokenize{api/_as_gen/matplotlib.pyplot.matshow:matplotlib-pyplot-matshow}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.matshow::doc}}\index{matshow() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.matshow:matplotlib.pyplot.matshow}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{matshow}}}{\emph{A}, \emph{fignum=None}, \emph{**kw}}{} Display an array as a matrix in a new figure window. The origin is set at the upper left hand corner and rows (first dimension of the array) are displayed horizontally. The aspect ratio of the figure window is that of the array, unless this would make an excessively short or narrow figure. Tick labels for the xaxis are placed on top. With the exception of \sphinxstyleemphasis{fignum}, keyword arguments are passed to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow()}}}}}. You may set the \sphinxstyleemphasis{origin} kwarg to “lower” if you want the first row in the array to be at the bottom instead of the top. \begin{description} \item[{\sphinxstyleemphasis{fignum}: {[} None \textbar{} integer \textbar{} False {]}}] \leavevmode By default, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.matshow:matplotlib.pyplot.matshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matshow()}}}}} creates a new figure window with automatic numbering. If \sphinxstyleemphasis{fignum} is given as an integer, the created figure will use this figure number. Because of how {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.matshow:matplotlib.pyplot.matshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matshow()}}}}} tries to set the figure aspect ratio to be the one of the array, if you provide the number of an already existing figure, strange things may happen. If \sphinxstyleemphasis{fignum} is \sphinxstyleemphasis{False} or 0, a new figure window will \sphinxstylestrong{NOT} be created. \end{description} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.matshow}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.matshow:examples-using-matplotlib-pyplot-matshow}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_matshow.py} \end{itemize} \subsection{matplotlib.pyplot.minorticks\_off} \label{\detokenize{api/_as_gen/matplotlib.pyplot.minorticks_off:matplotlib-pyplot-minorticks-off}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.minorticks_off::doc}}\index{minorticks\_off() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.minorticks_off:matplotlib.pyplot.minorticks_off}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{minorticks\_off}}}{}{} Remove minor ticks from the current plot. \end{fulllineitems} \subsection{matplotlib.pyplot.minorticks\_on} \label{\detokenize{api/_as_gen/matplotlib.pyplot.minorticks_on:matplotlib-pyplot-minorticks-on}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.minorticks_on::doc}}\index{minorticks\_on() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.minorticks_on:matplotlib.pyplot.minorticks_on}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{minorticks\_on}}}{}{} Display minor ticks on the current plot. Displaying minor ticks reduces performance; turn them off using minorticks\_off() if drawing speed is a problem. \end{fulllineitems} \subsection{matplotlib.pyplot.nipy\_spectral} \label{\detokenize{api/_as_gen/matplotlib.pyplot.nipy_spectral:matplotlib-pyplot-nipy-spectral}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.nipy_spectral::doc}}\index{nipy\_spectral() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.nipy_spectral:matplotlib.pyplot.nipy_spectral}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{nipy\_spectral}}}{}{} Set the colormap to “nipy\_spectral”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.over} \label{\detokenize{api/_as_gen/matplotlib.pyplot.over:matplotlib-pyplot-over}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.over::doc}}\index{over() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.over:matplotlib.pyplot.over}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{over}}}{\emph{func}, \emph{*args}, \emph{**kwargs}}{}~ \DUrole{versionmodified}{Deprecated since version 2.0: }pyplot.hold is deprecated. Future behavior will be consistent with the long-time default: plot commands add elements without first clearing the Axes and/or Figure. Call a function with hold(True). Calls: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{func}\PYG{p}{(}\PYG{o}{*}\PYG{n}{args}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} with \sphinxcode{\sphinxupquote{hold(True)}} and then restores the hold state. \end{fulllineitems} \subsection{matplotlib.pyplot.pause} \label{\detokenize{api/_as_gen/matplotlib.pyplot.pause:matplotlib-pyplot-pause}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.pause::doc}}\index{pause() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.pause:matplotlib.pyplot.pause}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{pause}}}{\emph{interval}}{} Pause for \sphinxstyleemphasis{interval} seconds. If there is an active figure, it will be updated and displayed before the pause, and the GUI event loop (if any) will run during the pause. This can be used for crude animation. For more complex animation, see {\hyperref[\detokenize{api/animation_api:module-matplotlib.animation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.animation}}}}}. \paragraph{Notes} This function is experimental; its behavior may be changed or extended in a future release. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.pause}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.pause:examples-using-matplotlib-pyplot-pause}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_animation\_animation\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_rotate\_axes3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_wire3d\_animation.py} \end{itemize} \subsection{matplotlib.pyplot.pcolor} \label{\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:matplotlib-pyplot-pcolor}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.pcolor::doc}}\index{pcolor() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:matplotlib.pyplot.pcolor}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{pcolor}}}{\emph{*args}, \emph{**kwargs}}{} Create a pseudocolor plot of a 2-D array. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{pcolor}\PYG{p}{(}\PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{pcolor}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} pcolor can be very slow for large arrays; consider using the similar but much faster {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolormesh:matplotlib.pyplot.pcolormesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolormesh()}}}}} instead. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{C}}] \leavevmode{[}array\_like{]} An array of color values. \item[{\sphinxstylestrong{X, Y}}] \leavevmode{[}array\_like, optional{]} If given, specify the (x, y) coordinates of the colored quadrilaterals; the quadrilateral for \sphinxcode{\sphinxupquote{C{[}i,j{]}}} has corners at: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n}{X}\PYG{p}{[}\PYG{n}{i}\PYG{p}{,} \PYG{n}{j}\PYG{p}{]}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{[}\PYG{n}{i}\PYG{p}{,} \PYG{n}{j}\PYG{p}{]}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{n}{X}\PYG{p}{[}\PYG{n}{i}\PYG{p}{,} \PYG{n}{j}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{[}\PYG{n}{i}\PYG{p}{,} \PYG{n}{j}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{n}{X}\PYG{p}{[}\PYG{n}{i}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{j}\PYG{p}{]}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{[}\PYG{n}{i}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{j}\PYG{p}{]}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{n}{X}\PYG{p}{[}\PYG{n}{i}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{j}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{[}\PYG{n}{i}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{j}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} Ideally the dimensions of \sphinxcode{\sphinxupquote{X}} and \sphinxcode{\sphinxupquote{Y}} should be one greater than those of \sphinxcode{\sphinxupquote{C}}; if the dimensions are the same, then the last row and column of \sphinxcode{\sphinxupquote{C}} will be ignored. Note that the column index corresponds to the x-coordinate, and the row index corresponds to y; for details, see the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:axes-pcolor-grid-orientation}]{\sphinxcrossref{\DUrole{std,std-ref}{Grid Orientation}}}} section below. If either or both of \sphinxcode{\sphinxupquote{X}} and \sphinxcode{\sphinxupquote{Y}} are 1-D arrays or column vectors, they will be expanded as needed into the appropriate 2-D arrays, making a rectangular grid. \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}}, optional, default: None{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, default to rc settings. \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}}, optional, default: None{]} An instance is used to scale luminance data to (0, 1). If \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, defaults to \sphinxcode{\sphinxupquote{normalize()}}. \item[{\sphinxstylestrong{vmin, vmax}}] \leavevmode{[}scalar, optional, default: None{]} \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} are used in conjunction with \sphinxcode{\sphinxupquote{norm}} to normalize luminance data. If either is \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, it is autoscaled to the respective min or max of the color array \sphinxcode{\sphinxupquote{C}}. If not \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, \sphinxcode{\sphinxupquote{vmin}} or \sphinxcode{\sphinxupquote{vmax}} passed in here override any pre-existing values supplied in the \sphinxcode{\sphinxupquote{norm}} instance. \item[{\sphinxstylestrong{edgecolors}}] \leavevmode{[}\{None, ‘none’, color, color sequence\}{]} If None, the rc setting is used by default. If ‘none’, edges will not be visible. An mpl color or sequence of colors will set the edge color. \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}scalar, optional, default: None{]} The alpha blending value, between 0 (transparent) and 1 (opaque). \item[{\sphinxstylestrong{snap}}] \leavevmode{[}bool, optional, default: False{]} Whether to snap the mesh to pixel boundaries. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{collection}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.Collection}}}}}{]} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{antialiaseds}}] \leavevmode{[}bool, optional, default: False{]} The default \sphinxcode{\sphinxupquote{antialiaseds}} is False if the default \sphinxcode{\sphinxupquote{edgecolors="none"}} is used. This eliminates artificial lines at patch boundaries, and works regardless of the value of alpha. If \sphinxcode{\sphinxupquote{edgecolors}} is not “none”, then the default \sphinxcode{\sphinxupquote{antialiaseds}} is taken from \sphinxcode{\sphinxupquote{rcParams{[}"patch.antialiased"{]}}}, which defaults to True. Stroking the edges may be preferred if \sphinxcode{\sphinxupquote{alpha}} is 1, but will cause artifacts otherwise. \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Any unused keyword arguments are passed along to the {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} constructor: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or antialiaseds & Boolean or sequence of booleans \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{array}}}}} & ndarray \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}} & a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cmap}}}}} & a colormap or registered colormap name \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color arg or sequence of rgba tuples \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or edgecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or facecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or dashes or linestyles & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or linewidths or lw & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_norm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{norm}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offset\_position}}}}} & {[} ‘screen’ \textbar{} ‘data’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offsets}}}}} & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_urls}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{urls}}}}} & List{[}str{]} or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolormesh:matplotlib.pyplot.pcolormesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolormesh}}}}}}] \leavevmode for an explanation of the differences between pcolor and pcolormesh. \end{description} \paragraph{Notes} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:axes-pcolor-grid-orientation}} \sphinxcode{\sphinxupquote{X}}, \sphinxcode{\sphinxupquote{Y}} and \sphinxcode{\sphinxupquote{C}} may be masked arrays. If either C{[}i, j{]}, or one of the vertices surrounding C{[}i,j{]} (\sphinxcode{\sphinxupquote{X}} or \sphinxcode{\sphinxupquote{Y}} at {[}i, j{]}, {[}i+1, j{]}, {[}i, j+1{]}, {[}i+1, j+1{]}) is masked, nothing is plotted. The grid orientation follows the MATLAB convention: an array \sphinxcode{\sphinxupquote{C}} with shape (nrows, ncolumns) is plotted with the column number as \sphinxcode{\sphinxupquote{X}} and the row number as \sphinxcode{\sphinxupquote{Y}}, increasing up; hence it is plotted the way the array would be printed, except that the \sphinxcode{\sphinxupquote{Y}} axis is reversed. That is, \sphinxcode{\sphinxupquote{C}} is taken as \sphinxcode{\sphinxupquote{C}} (y, x). Similarly for \sphinxcode{\sphinxupquote{meshgrid()}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{)} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{)} \PYG{n}{X}\PYG{p}{,} \PYG{n}{Y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{meshgrid}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \end{sphinxVerbatim} is equivalent to: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{X} \PYG{o}{=} \PYG{n}{array}\PYG{p}{(}\PYG{p}{[}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{,} \PYG{l+m+mi}{4}\PYG{p}{]}\PYG{p}{]}\PYG{p}{)} \PYG{n}{Y} \PYG{o}{=} \PYG{n}{array}\PYG{p}{(}\PYG{p}{[}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} so if you have: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{C} \PYG{o}{=} \PYG{n}{rand}\PYG{p}{(}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)}\PYG{p}{,} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} then you need to transpose C: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{pcolor}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{C}\PYG{o}{.}\PYG{n}{T}\PYG{p}{)} \end{sphinxVerbatim} or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{pcolor}\PYG{p}{(}\PYG{n}{C}\PYG{o}{.}\PYG{n}{T}\PYG{p}{)} \end{sphinxVerbatim} MATLAB {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:matplotlib.pyplot.pcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolor()}}}}} always discards the last row and column of \sphinxcode{\sphinxupquote{C}}, but Matplotlib displays the last row and column if \sphinxcode{\sphinxupquote{X}} and \sphinxcode{\sphinxupquote{Y}} are not specified, or if \sphinxcode{\sphinxupquote{X}} and \sphinxcode{\sphinxupquote{Y}} have one more row and column than \sphinxcode{\sphinxupquote{C}}. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All positional and all keyword arguments. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.pyplot.pcolormesh} \label{\detokenize{api/_as_gen/matplotlib.pyplot.pcolormesh:matplotlib-pyplot-pcolormesh}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.pcolormesh::doc}}\index{pcolormesh() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.pcolormesh:matplotlib.pyplot.pcolormesh}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{pcolormesh}}}{\emph{*args}, \emph{**kwargs}}{} Plot a quadrilateral mesh. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{C}\PYG{p}{)} \PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{C}\PYG{p}{)} \PYG{n}{pcolormesh}\PYG{p}{(}\PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Create a pseudocolor plot of a 2-D array. pcolormesh is similar to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:matplotlib.pyplot.pcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolor()}}}}}, but uses a different mechanism and returns a different object; pcolor returns a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} but pcolormesh returns a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.QuadMesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{QuadMesh}}}}}. It is much faster, so it is almost always preferred for large arrays. \sphinxstyleemphasis{C} may be a masked array, but \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} may not. Masked array support is implemented via \sphinxstyleemphasis{cmap} and \sphinxstyleemphasis{norm}; in contrast, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:matplotlib.pyplot.pcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolor()}}}}} simply does not draw quadrilaterals with masked colors or vertices. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{matplotlib.collections.QuadMesh}}] \leavevmode \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}Colormap, optional{]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap}}}}} instance. If \sphinxcode{\sphinxupquote{None}}, use rc settings. \item[{\sphinxstylestrong{norm}}] \leavevmode{[}Normalize, optional{]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance is used to scale luminance data to 0,1. If \sphinxcode{\sphinxupquote{None}}, defaults to \sphinxcode{\sphinxupquote{normalize()}}. \item[{\sphinxstylestrong{vmin, vmax}}] \leavevmode{[}scalar, optional{]} \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} are used in conjunction with \sphinxstyleemphasis{norm} to normalize luminance data. If either is \sphinxcode{\sphinxupquote{None}}, it is autoscaled to the respective min or max of the color array \sphinxstyleemphasis{C}. If not \sphinxcode{\sphinxupquote{None}}, \sphinxstyleemphasis{vmin} or \sphinxstyleemphasis{vmax} passed in here override any pre-existing values supplied in the \sphinxstyleemphasis{norm} instance. \item[{\sphinxstylestrong{shading}}] \leavevmode{[}{[} ‘flat’ \textbar{} ‘gouraud’ {]}, optional{]} ‘flat’ indicates a solid color for each quad. When ‘gouraud’, each quad will be Gouraud shaded. When gouraud shading, \sphinxstyleemphasis{edgecolors} is ignored. \item[{\sphinxstylestrong{edgecolors}}] \leavevmode{[}string, color, color sequence, optional{]}\begin{itemize} \item {} If \sphinxcode{\sphinxupquote{None}}, the rc setting is used by default. \item {} If \sphinxcode{\sphinxupquote{'None'}}, edges will not be visible. \item {} If \sphinxcode{\sphinxupquote{'face'}}, edges will have the same color as the faces. \end{itemize} An mpl color or sequence of colors will also set the edge color. \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}scalar, optional{]} Alpha blending value. Must be between 0 and 1. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:matplotlib.pyplot.pcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.pcolor}}}}}}] \leavevmode For an explanation of the grid orientation ({\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.pcolor:axes-pcolor-grid-orientation}]{\sphinxcrossref{\DUrole{std,std-ref}{Grid Orientation}}}}) and the expansion of 1-D \sphinxstyleemphasis{X} and/or \sphinxstyleemphasis{Y} to 2-D arrays. \end{description} \paragraph{Notes} kwargs can be used to control the {\hyperref[\detokenize{api/collections_api:matplotlib.collections.QuadMesh}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.QuadMesh}}}}} properties: \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or antialiaseds & Boolean or sequence of booleans \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{array}}}}} & ndarray \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}} & a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cmap}}}}} & a colormap or registered colormap name \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color arg or sequence of rgba tuples \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or edgecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or facecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or dashes or linestyles & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or linewidths or lw & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_norm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{norm}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offset\_position}}}}} & {[} ‘screen’ \textbar{} ‘data’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offsets}}}}} & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_urls}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{urls}}}}} & List{[}str{]} or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All positional and all keyword arguments. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.pyplot.phase\_spectrum} \label{\detokenize{api/_as_gen/matplotlib.pyplot.phase_spectrum:matplotlib-pyplot-phase-spectrum}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.phase_spectrum::doc}}\index{phase\_spectrum() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.phase_spectrum:matplotlib.pyplot.phase_spectrum}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{phase\_spectrum}}}{\emph{x}, \emph{Fs=None}, \emph{Fc=None}, \emph{window=None}, \emph{pad\_to=None}, \emph{sides=None}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Plot the phase spectrum. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{phase\PYGZus{}spectrum}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{Fs}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{Fc}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{window}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{window\PYGZus{}hanning}\PYG{p}{,} \PYG{n}{pad\PYGZus{}to}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{sides}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Compute the phase spectrum (unwrapped angle spectrum) of \sphinxstyleemphasis{x}. Data is padded to a length of \sphinxstyleemphasis{pad\_to} and the windowing function \sphinxstyleemphasis{window} is applied to the signal. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1-D array or sequence{]} Array or sequence containing the data \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see \sphinxcode{\sphinxupquote{window\_hanning()}}, \sphinxcode{\sphinxupquote{window\_none()}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is \sphinxcode{\sphinxupquote{window\_hanning()}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to the length of the input signal (i.e. no padding). \item[{\sphinxstylestrong{Fc}}] \leavevmode{[}integer{]} The center frequency of \sphinxstyleemphasis{x} (defaults to 0), which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{spectrum}}] \leavevmode{[}1-D array{]} The values for the phase spectrum in radians (real valued) \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the elements in \sphinxstyleemphasis{spectrum} \item[{\sphinxstylestrong{line}}] \leavevmode{[}a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instance{]} The line created by this function \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Keyword arguments control the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.magnitude_spectrum:matplotlib.pyplot.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.magnitude_spectrum:matplotlib.pyplot.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}} plots the magnitudes of the corresponding frequencies. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.angle_spectrum:matplotlib.pyplot.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.angle_spectrum:matplotlib.pyplot.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}} plots the wrapped version of this function. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.specgram:matplotlib.pyplot.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.specgram:matplotlib.pyplot.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}} can plot the phase spectrum of segments within the signal in a colormap. \end{description} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.pyplot.pie} \label{\detokenize{api/_as_gen/matplotlib.pyplot.pie:matplotlib-pyplot-pie}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.pie::doc}}\index{pie() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.pie:matplotlib.pyplot.pie}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{pie}}}{\emph{x}, \emph{explode=None}, \emph{labels=None}, \emph{colors=None}, \emph{autopct=None}, \emph{pctdistance=0.6}, \emph{shadow=False}, \emph{labeldistance=1.1}, \emph{startangle=None}, \emph{radius=None}, \emph{counterclock=True}, \emph{wedgeprops=None}, \emph{textprops=None}, \emph{center=(0}, \emph{0)}, \emph{frame=False}, \emph{rotatelabels=False}, \emph{hold=None}, \emph{data=None}}{} Plot a pie chart. Make a pie chart of array \sphinxstyleemphasis{x}. The fractional area of each wedge is given by \sphinxcode{\sphinxupquote{x/sum(x)}}. If \sphinxcode{\sphinxupquote{sum(x) \textless{} 1}}, then the values of \sphinxstyleemphasis{x} give the fractional area directly and the array will not be normalized. The resulting pie will have an empty wedge of size \sphinxcode{\sphinxupquote{1 - sum(x)}}. The wedges are plotted counterclockwise, by default starting from the x-axis. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}array-like{]} The wedge sizes. \item[{\sphinxstylestrong{explode}}] \leavevmode{[}array-like, optional, default: None{]} If not \sphinxstyleemphasis{None}, is a \sphinxcode{\sphinxupquote{len(x)}} array which specifies the fraction of the radius with which to offset each wedge. \item[{\sphinxstylestrong{labels}}] \leavevmode{[}list, optional, default: None{]} A sequence of strings providing the labels for each wedge \item[{\sphinxstylestrong{colors}}] \leavevmode{[}array-like, optional, default: None{]} A sequence of matplotlib color args through which the pie chart will cycle. If \sphinxstyleemphasis{None}, will use the colors in the currently active cycle. \item[{\sphinxstylestrong{autopct}}] \leavevmode{[}None (default), string, or function, optional{]} If not \sphinxstyleemphasis{None}, is a string or function used to label the wedges with their numeric value. The label will be placed inside the wedge. If it is a format string, the label will be \sphinxcode{\sphinxupquote{fmt\%pct}}. If it is a function, it will be called. \item[{\sphinxstylestrong{pctdistance}}] \leavevmode{[}float, optional, default: 0.6{]} The ratio between the center of each pie slice and the start of the text generated by \sphinxstyleemphasis{autopct}. Ignored if \sphinxstyleemphasis{autopct} is \sphinxstyleemphasis{None}. \item[{\sphinxstylestrong{shadow}}] \leavevmode{[}bool, optional, default: False{]} Draw a shadow beneath the pie. \item[{\sphinxstylestrong{labeldistance}}] \leavevmode{[}float, optional, default: 1.1{]} The radial distance at which the pie labels are drawn \item[{\sphinxstylestrong{startangle}}] \leavevmode{[}float, optional, default: None{]} If not \sphinxstyleemphasis{None}, rotates the start of the pie chart by \sphinxstyleemphasis{angle} degrees counterclockwise from the x-axis. \item[{\sphinxstylestrong{radius}}] \leavevmode{[}float, optional, default: None{]} The radius of the pie, if \sphinxstyleemphasis{radius} is \sphinxstyleemphasis{None} it will be set to 1. \item[{\sphinxstylestrong{counterclock}}] \leavevmode{[}bool, optional, default: True{]} Specify fractions direction, clockwise or counterclockwise. \item[{\sphinxstylestrong{wedgeprops}}] \leavevmode{[}dict, optional, default: None{]} Dict of arguments passed to the wedge objects making the pie. For example, you can pass in \sphinxcode{\sphinxupquote{wedgeprops = \{'linewidth': 3\}}} to set the width of the wedge border lines equal to 3. For more details, look at the doc/arguments of the wedge object. By default \sphinxcode{\sphinxupquote{clip\_on=False}}. \item[{\sphinxstylestrong{textprops}}] \leavevmode{[}dict, optional, default: None{]} Dict of arguments to pass to the text objects. \item[{\sphinxstylestrong{center}}] \leavevmode{[}list of float, optional, default: (0, 0){]} Center position of the chart. Takes value (0, 0) or is a sequence of 2 scalars. \item[{\sphinxstylestrong{frame}}] \leavevmode{[}bool, optional, default: False{]} Plot axes frame with the chart if true. \item[{\sphinxstylestrong{rotatelabels}}] \leavevmode{[}bool, optional, default: False{]} Rotate each label to the angle of the corresponding slice if true. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{patches}}] \leavevmode{[}list{]} A sequence of {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Wedge:matplotlib.patches.Wedge}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.Wedge}}}}} instances \item[{\sphinxstylestrong{texts}}] \leavevmode{[}list{]} A list of the label {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}} instances. \item[{\sphinxstylestrong{autotexts}}] \leavevmode{[}list{]} A list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances for the numeric labels. This will only be returned if the parameter \sphinxstyleemphasis{autopct} is not \sphinxstyleemphasis{None}. \end{description} \end{description}\end{quote} \paragraph{Notes} The pie chart will probably look best if the figure and axes are square, or the Axes aspect is equal. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘colors’, ‘explode’, ‘labels’, ‘x’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.pie}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.pie:examples-using-matplotlib-pyplot-pie}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_pie\_demo2.py} \end{itemize} \subsection{matplotlib.pyplot.pink} \label{\detokenize{api/_as_gen/matplotlib.pyplot.pink:matplotlib-pyplot-pink}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.pink::doc}}\index{pink() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.pink:matplotlib.pyplot.pink}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{pink}}}{}{} Set the colormap to “pink”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.plasma} \label{\detokenize{api/_as_gen/matplotlib.pyplot.plasma:matplotlib-pyplot-plasma}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.plasma::doc}}\index{plasma() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.plasma:matplotlib.pyplot.plasma}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{plasma}}}{}{} Set the colormap to “plasma”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.plot} \label{\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib-pyplot-plot}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.plot::doc}}\index{plot() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{plot}}}{\emph{*args}, \emph{**kwargs}}{} Plot y versus x as lines and/or markers. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{n}{data}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{n}{x2}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt2}\PYG{p}{]}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} The coordinates of the points or line nodes are given by \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}. The optional parameter \sphinxstyleemphasis{fmt} is a convenient way for defining basic formatting like color, marker and linestyle. It’s a shortcut string notation described in the \sphinxstyleemphasis{Notes} section below. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} plot x and y using default line style and color} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bo}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} plot x and y using blue circle markers} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} plot y using x as index array 0..N\PYGZhy{}1} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{y}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r+}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} ditto, but with red plusses} \end{sphinxVerbatim} You can use {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties as keyword arguments for more control on the appearance. Line properties and \sphinxstyleemphasis{fmt} can be mixed. The following two calls yield identical results: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{go\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{markersize}\PYG{o}{=}\PYG{l+m+mi}{12}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{green}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{marker}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{o}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linestyle}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{dashed}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{g+go}{ linewidth=2, markersize=12)} \end{sphinxVerbatim} When conflicting with \sphinxstyleemphasis{fmt}, keyword arguments take precedence. \sphinxstylestrong{Plotting labelled data} There’s a convenient way for plotting objects with labelled data (i.e. data that can be accessed by index \sphinxcode{\sphinxupquote{obj{[}'y'{]}}}). Instead of giving the data in \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}, you can provide the object in the \sphinxstyleemphasis{data} parameter and just give the labels for \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{xlabel}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ylabel}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{data}\PYG{o}{=}\PYG{n}{obj}\PYG{p}{)} \end{sphinxVerbatim} All indexable objects are supported. This could e.g. be a \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#dict}{\sphinxcode{\sphinxupquote{dict}}}, a \sphinxcode{\sphinxupquote{pandas.DataFame}} or a structured numpy array. \sphinxstylestrong{Plotting multiple sets of data} There are various ways to plot multiple sets of data. \begin{itemize} \item {} The most straight forward way is just to call {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} multiple times. Example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bo}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x2}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{go}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \item {} Alternatively, if your data is already a 2d array, you can pass it directly to \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}. A separate data set will be drawn for every column. Example: an array \sphinxcode{\sphinxupquote{a}} where the first column represents the \sphinxstyleemphasis{x} values and the other columns are the \sphinxstyleemphasis{y} columns: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{a}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{a}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \item {} The third way is to specify multiple sets of \sphinxstyleemphasis{{[}x{]}}, \sphinxstyleemphasis{y}, \sphinxstyleemphasis{{[}fmt{]}} groups: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x1}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g\PYGZca{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{x2}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} In this case, any additional keyword argument applies to all datasets. Also this syntax cannot be combined with the \sphinxstyleemphasis{data} parameter. \end{itemize} By default, each line is assigned a different style specified by a ‘style cycle’. The \sphinxstyleemphasis{fmt} and line property parameters are only necessary if you want explicit deviations from these defaults. Alternatively, you can also change the style cycle using the ‘axes.prop\_cycle’ rcParam. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}array-like or scalar{]} The horizontal / vertical coordinates of the data points. \sphinxstyleemphasis{x} values are optional. If not given, they default to \sphinxcode{\sphinxupquote{{[}0, ..., N-1{]}}}. Commonly, these parameters are arrays of length N. However, scalars are supported as well (equivalent to an array with constant value). The parameters can also be 2-dimensional. Then, the columns represent separate data sets. \item[{\sphinxstylestrong{fmt}}] \leavevmode{[}str, optional{]} A format string, e.g. ‘ro’ for red circles. See the \sphinxstyleemphasis{Notes} section for a full description of the format strings. Format strings are just an abbreviation for quickly setting basic line properties. All of these and more can also be controlled by keyword arguments. \item[{\sphinxstylestrong{data}}] \leavevmode{[}indexable object, optional{]} An object with labelled data. If given, provide the label names to plot in \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. \begin{sphinxadmonition}{note}{Note:} Technically there’s a slight ambiguity in calls where the second label is a valid \sphinxstyleemphasis{fmt}. \sphinxcode{\sphinxupquote{plot('n', 'o', data=obj)}} could be \sphinxcode{\sphinxupquote{plt(x, y)}} or \sphinxcode{\sphinxupquote{plt(y, fmt)}}. In such cases, the former interpretation is chosen, but a warning is issued. You may suppress the warning by adding an empty format string \sphinxcode{\sphinxupquote{plot('n', 'o', '{'}, data=obj)}}. \end{sphinxadmonition} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lines}}] \leavevmode A list of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} objects representing the plotted data. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scalex, scaley}}] \leavevmode{[}bool, optional, default: True{]} These parameters determined if the view limits are adapted to the data limits. The values are passed on to \sphinxcode{\sphinxupquote{autoscale\_view}}. \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties, optional{]} \sphinxstyleemphasis{kwargs} are used to specify properties like a line label (for auto legends), linewidth, antialiasing, marker face color. Example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{go\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{line 1}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{4}\PYG{p}{,}\PYG{l+m+mi}{9}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{rs}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{line 2}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} If you make multiple lines with one plot command, the kwargs apply to all those lines. Here is a list of available {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.scatter:matplotlib.pyplot.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter}}}}}}] \leavevmode XY scatter plot with markers of variing size and/or color ( sometimes also called bubble chart). \end{description} \paragraph{Notes} \sphinxstylestrong{Format Strings} A format string consists of a part for color, marker and line: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fmt} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{[color][marker][line]}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} Each of them is optional. If not provided, the value from the style cycle is used. Exception: If \sphinxcode{\sphinxupquote{line}} is given, but no \sphinxcode{\sphinxupquote{marker}}, the data will be a line without markers. \sphinxstylestrong{Colors} The following color abbreviations are supported: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily character &\sphinxstyletheadfamily color \\ \hline \sphinxcode{\sphinxupquote{'b'}} & blue \\ \hline \sphinxcode{\sphinxupquote{'g'}} & green \\ \hline \sphinxcode{\sphinxupquote{'r'}} & red \\ \hline \sphinxcode{\sphinxupquote{'c'}} & cyan \\ \hline \sphinxcode{\sphinxupquote{'m'}} & magenta \\ \hline \sphinxcode{\sphinxupquote{'y'}} & yellow \\ \hline \sphinxcode{\sphinxupquote{'k'}} & black \\ \hline \sphinxcode{\sphinxupquote{'w'}} & white \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} If the color is the only part of the format string, you can additionally use any {\hyperref[\detokenize{api/colors_api:module-matplotlib.colors}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors}}}}} spec, e.g. full names (\sphinxcode{\sphinxupquote{'green'}}) or hex strings (\sphinxcode{\sphinxupquote{'\#008000'}}). \sphinxstylestrong{Markers} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily character &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'.'}} & point marker \\ \hline \sphinxcode{\sphinxupquote{','}} & pixel marker \\ \hline \sphinxcode{\sphinxupquote{'o'}} & circle marker \\ \hline \sphinxcode{\sphinxupquote{'v'}} & triangle\_down marker \\ \hline \sphinxcode{\sphinxupquote{'\textasciicircum{}'}} & triangle\_up marker \\ \hline \sphinxcode{\sphinxupquote{'\textless{}'}} & triangle\_left marker \\ \hline \sphinxcode{\sphinxupquote{'\textgreater{}'}} & triangle\_right marker \\ \hline \sphinxcode{\sphinxupquote{'1'}} & tri\_down marker \\ \hline \sphinxcode{\sphinxupquote{'2'}} & tri\_up marker \\ \hline \sphinxcode{\sphinxupquote{'3'}} & tri\_left marker \\ \hline \sphinxcode{\sphinxupquote{'4'}} & tri\_right marker \\ \hline \sphinxcode{\sphinxupquote{'s'}} & square marker \\ \hline \sphinxcode{\sphinxupquote{'p'}} & pentagon marker \\ \hline \sphinxcode{\sphinxupquote{'*'}} & star marker \\ \hline \sphinxcode{\sphinxupquote{'h'}} & hexagon1 marker \\ \hline \sphinxcode{\sphinxupquote{'H'}} & hexagon2 marker \\ \hline \sphinxcode{\sphinxupquote{'+'}} & plus marker \\ \hline \sphinxcode{\sphinxupquote{'x'}} & x marker \\ \hline \sphinxcode{\sphinxupquote{'D'}} & diamond marker \\ \hline \sphinxcode{\sphinxupquote{'d'}} & thin\_diamond marker \\ \hline \sphinxcode{\sphinxupquote{'\textbar{}'}} & vline marker \\ \hline \sphinxcode{\sphinxupquote{'\_'}} & hline marker \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \sphinxstylestrong{Line Styles} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily character &\sphinxstyletheadfamily description \\ \hline \sphinxcode{\sphinxupquote{'-'}} & solid line style \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} & dashed line style \\ \hline \sphinxcode{\sphinxupquote{'-.'}} & dash-dot line style \\ \hline \sphinxcode{\sphinxupquote{':'}} & dotted line style \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Example format strings: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} blue markers with default shape} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{ro}\PYG{l+s+s1}{\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} red circles} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{g\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} green solid line} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} dashed line with default color} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k\PYGZca{}:}\PYG{l+s+s1}{\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} black triangle\PYGZus{}up markers connected by a dotted line} \end{sphinxVerbatim} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.plot}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.plot:examples-using-matplotlib-pyplot-plot}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_simple.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_formatstr.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_three.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_98\_4\_legend.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_two\_subplots.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_mathtext.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_scales.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_invert\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_multiple\_figs\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_shared\_axis\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_figure\_title.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axhspan\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_arctest.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_masked\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_nan\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_simple\_plot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_masked.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_psd\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_corner\_mask.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_specgram\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_triinterp\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_marker\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_dolphin.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_titles\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_text\_fontdict.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_text\_rotation\_relative\_to\_line.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_multiline.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_stix\_fonts\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_style\_sheets\_plot\_solarizedlight2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_integral.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_xkcd.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_bachelors\_degrees\_by\_gender.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/frame_grabbing_sgskip:sphx-glr-gallery-animation-frame-grabbing-sgskip-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Frame grabbing}}}} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_ginput\_demo\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_print\_stdout\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_coords\_report.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_customize\_rc.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_set\_and\_get.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_agg\_buffer.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_findobj\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_zorder\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_transoffset.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_multipage\_pdf.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_custom\_projection.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_symlog\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_custom\_scale.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_anscombe.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_ticklabels\_rotation.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_pylab\_with\_gtk\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_toolmanager\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_simple\_legend01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_texsystem\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_fonts\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_preamble\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_textbox.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_buttons.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_slider\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_rectangle\_selector.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/customizing:sphx-glr-tutorials-introductory-customizing-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Matplotlib with style sheets and rcParams}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/usage:sphx-glr-tutorials-introductory-usage-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Usage Guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Legend guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/advanced/patheffects_guide:sphx-glr-tutorials-advanced-patheffects-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Path effects guide}}}} \end{itemize} \subsection{matplotlib.pyplot.plot\_date} \label{\detokenize{api/_as_gen/matplotlib.pyplot.plot_date:matplotlib-pyplot-plot-date}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.plot_date::doc}}\index{plot\_date() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.plot_date:matplotlib.pyplot.plot_date}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{plot\_date}}}{\emph{x}, \emph{y}, \emph{fmt='o'}, \emph{tz=None}, \emph{xdate=True}, \emph{ydate=False}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Plot data that contains dates. Similar to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}, this plots \sphinxstyleemphasis{y} vs. \sphinxstyleemphasis{x} as lines or markers. However, the axis labels are formatted as dates depending on \sphinxstyleemphasis{xdate} and \sphinxstyleemphasis{ydate}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}array-like{]} The coordinates of the data points. If \sphinxstyleemphasis{xdate} or \sphinxstyleemphasis{ydate} is \sphinxstyleemphasis{True}, the respective values \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} are interpreted as {\hyperref[\detokenize{api/dates_api:date-format}]{\sphinxcrossref{\DUrole{std,std-ref}{Matplotlib dates}}}}. \item[{\sphinxstylestrong{fmt}}] \leavevmode{[}str, optional{]} The plot format string. For details, see the corresponding parameter in {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}. \item[{\sphinxstylestrong{tz}}] \leavevmode{[}{[} \sphinxstyleemphasis{None} \textbar{} timezone string \textbar{} \sphinxcode{\sphinxupquote{tzinfo}} instance{]}{]} The time zone to use in labeling dates. If \sphinxstyleemphasis{None}, defaults to rcParam \sphinxcode{\sphinxupquote{timezone}}. \item[{\sphinxstylestrong{xdate}}] \leavevmode{[}bool, optional, default: True{]} If \sphinxstyleemphasis{True}, the \sphinxstyleemphasis{x}-axis will be interpreted as Matplotlib dates. \item[{\sphinxstylestrong{ydate}}] \leavevmode{[}bool, optional, default: False{]} If \sphinxstyleemphasis{True}, the \sphinxstyleemphasis{y}-axis will be interpreted as Matplotlib dates. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lines}}] \leavevmode A list of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} objects representing the plotted data. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode Keyword arguments control the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/dates_api:module-matplotlib.dates}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates}}}}}}] \leavevmode Helper functions on dates. \item[{{\hyperref[\detokenize{api/dates_api:matplotlib.dates.date2num}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.date2num}}}}}}] \leavevmode Convert dates to num. \item[{{\hyperref[\detokenize{api/dates_api:matplotlib.dates.num2date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.num2date}}}}}}] \leavevmode Convert num to dates. \item[{{\hyperref[\detokenize{api/dates_api:matplotlib.dates.drange}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.dates.drange}}}}}}] \leavevmode Create an equally spaced sequence of dates. \end{description} \paragraph{Notes} If you are using custom date tickers and formatters, it may be necessary to set the formatters/locators after the call to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot_date:matplotlib.pyplot.plot_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot\_date}}}}}. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot_date:matplotlib.pyplot.plot_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot\_date}}}}} will set the default tick locator to {\hyperref[\detokenize{api/dates_api:matplotlib.dates.AutoDateLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AutoDateLocator}}}}} (if the tick locator is not already set to a {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{DateLocator}}}}} instance) and the default tick formatter to {\hyperref[\detokenize{api/dates_api:matplotlib.dates.AutoDateFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AutoDateFormatter}}}}} (if the tick formatter is not already set to a {\hyperref[\detokenize{api/dates_api:matplotlib.dates.DateFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{DateFormatter}}}}} instance). \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.plot\_date}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.plot_date:examples-using-matplotlib-pyplot-plot-date}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_date\_demo\_rrule.py} \end{itemize} \subsection{matplotlib.pyplot.plotfile} \label{\detokenize{api/_as_gen/matplotlib.pyplot.plotfile:matplotlib-pyplot-plotfile}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.plotfile::doc}}\index{plotfile() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.plotfile:matplotlib.pyplot.plotfile}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{plotfile}}}{\emph{fname}, \emph{cols=(0}, \emph{)}, \emph{plotfuncs=None}, \emph{comments='\#'}, \emph{skiprows=0}, \emph{checkrows=5}, \emph{delimiter='}, \emph{'}, \emph{names=None}, \emph{subplots=True}, \emph{newfig=True}, \emph{**kwargs}}{} Plot the data in a file. \sphinxstyleemphasis{cols} is a sequence of column identifiers to plot. An identifier is either an int or a string. If it is an int, it indicates the column number. If it is a string, it indicates the column header. matplotlib will make column headers lower case, replace spaces with underscores, and remove all illegal characters; so \sphinxcode{\sphinxupquote{'Adj Close*'}} will have name \sphinxcode{\sphinxupquote{'adj\_close'}}. \begin{itemize} \item {} If len(\sphinxstyleemphasis{cols}) == 1, only that column will be plotted on the \sphinxstyleemphasis{y} axis. \item {} If len(\sphinxstyleemphasis{cols}) \textgreater{} 1, the first element will be an identifier for data for the \sphinxstyleemphasis{x} axis and the remaining elements will be the column indexes for multiple subplots if \sphinxstyleemphasis{subplots} is \sphinxstyleemphasis{True} (the default), or for lines in a single subplot if \sphinxstyleemphasis{subplots} is \sphinxstyleemphasis{False}. \end{itemize} \sphinxstyleemphasis{plotfuncs}, if not \sphinxstyleemphasis{None}, is a dictionary mapping identifier to an {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} plotting function as a string. Default is ‘plot’, other choices are ‘semilogy’, ‘fill’, ‘bar’, etc. You must use the same type of identifier in the \sphinxstyleemphasis{cols} vector as you use in the \sphinxstyleemphasis{plotfuncs} dictionary, e.g., integer column numbers in both or column names in both. If \sphinxstyleemphasis{subplots} is \sphinxstyleemphasis{False}, then including any function such as ‘semilogy’ that changes the axis scaling will set the scaling for all columns. \sphinxstyleemphasis{comments}, \sphinxstyleemphasis{skiprows}, \sphinxstyleemphasis{checkrows}, \sphinxstyleemphasis{delimiter}, and \sphinxstyleemphasis{names} are all passed on to \sphinxcode{\sphinxupquote{matplotlib.pylab.csv2rec()}} to load the data into a record array. If \sphinxstyleemphasis{newfig} is \sphinxstyleemphasis{True}, the plot always will be made in a new figure; if \sphinxstyleemphasis{False}, it will be made in the current figure if one exists, else in a new figure. kwargs are passed on to plotting functions. Example usage: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} plot the 2nd and 4th column against the 1st in two subplots} \PYG{n}{plotfile}\PYG{p}{(}\PYG{n}{fname}\PYG{p}{,} \PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} plot using column names; specify an alternate plot type for volume} \PYG{n}{plotfile}\PYG{p}{(}\PYG{n}{fname}\PYG{p}{,} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{date}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{volume}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{adj\PYGZus{}close}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{,} \PYG{n}{plotfuncs}\PYG{o}{=}\PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{volume}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{semilogy}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}}\PYG{p}{)} \end{sphinxVerbatim} Note: plotfile is intended as a convenience for quickly plotting data from flat files; it is not intended as an alternative interface to general plotting with pyplot or matplotlib. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.plotfile}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.plotfile:examples-using-matplotlib-pyplot-plotfile}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_plotfile\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.polar} \label{\detokenize{api/_as_gen/matplotlib.pyplot.polar:matplotlib-pyplot-polar}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.polar::doc}}\index{polar() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.polar:matplotlib.pyplot.polar}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{polar}}}{\emph{*args}, \emph{**kwargs}}{} Make a polar plot. call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{polar}\PYG{p}{(}\PYG{n}{theta}\PYG{p}{,} \PYG{n}{r}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Multiple \sphinxstyleemphasis{theta}, \sphinxstyleemphasis{r} arguments are supported, with format strings, as in {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot()}}}}}. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.polar}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.polar:examples-using-matplotlib-pyplot-polar}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_transoffset.py} \end{itemize} \subsection{matplotlib.pyplot.prism} \label{\detokenize{api/_as_gen/matplotlib.pyplot.prism:matplotlib-pyplot-prism}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.prism::doc}}\index{prism() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.prism:matplotlib.pyplot.prism}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{prism}}}{}{} Set the colormap to “prism”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.psd} \label{\detokenize{api/_as_gen/matplotlib.pyplot.psd:matplotlib-pyplot-psd}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.psd::doc}}\index{psd() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.psd:matplotlib.pyplot.psd}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{psd}}}{\emph{x}, \emph{NFFT=None}, \emph{Fs=None}, \emph{Fc=None}, \emph{detrend=None}, \emph{window=None}, \emph{noverlap=None}, \emph{pad\_to=None}, \emph{sides=None}, \emph{scale\_by\_freq=None}, \emph{return\_line=None}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Plot the power spectral density. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{psd}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{NFFT}\PYG{o}{=}\PYG{l+m+mi}{256}\PYG{p}{,} \PYG{n}{Fs}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{Fc}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{detrend}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{detrend\PYGZus{}none}\PYG{p}{,} \PYG{n}{window}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{window\PYGZus{}hanning}\PYG{p}{,} \PYG{n}{noverlap}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{pad\PYGZus{}to}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{sides}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{scale\PYGZus{}by\PYGZus{}freq}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{return\PYGZus{}line}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} The power spectral density $P_{xx}$ by Welch’s average periodogram method. The vector \sphinxstyleemphasis{x} is divided into \sphinxstyleemphasis{NFFT} length segments. Each segment is detrended by function \sphinxstyleemphasis{detrend} and windowed by function \sphinxstyleemphasis{window}. \sphinxstyleemphasis{noverlap} gives the length of the overlap between segments. The $|\mathrm{fft}(i)|^2$ of each segment $i$ are averaged to compute $P_{xx}$, with a scaling to correct for power loss due to windowing. If len(\sphinxstyleemphasis{x}) \textless{} \sphinxstyleemphasis{NFFT}, it will be zero padded to \sphinxstyleemphasis{NFFT}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1-D array or sequence{]} Array or sequence containing the data \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see \sphinxcode{\sphinxupquote{window\_hanning()}}, \sphinxcode{\sphinxupquote{window\_none()}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is \sphinxcode{\sphinxupquote{window\_hanning()}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. This can be different from \sphinxstyleemphasis{NFFT}, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to \sphinxstyleemphasis{NFFT} \item[{\sphinxstylestrong{NFFT}}] \leavevmode{[}integer{]} The number of data points used in each block for the FFT. A power 2 is most efficient. The default value is 256. This should \sphinxstyleemphasis{NOT} be used to get zero padding, or the scaling of the result will be incorrect. Use \sphinxstyleemphasis{pad\_to} for this instead. \item[{\sphinxstylestrong{detrend}}] \leavevmode{[}\{‘default’, ‘constant’, ‘mean’, ‘linear’, ‘none’\} or callable{]} The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the \sphinxstyleemphasis{detrend} parameter is a vector, in matplotlib is it a function. The \sphinxcode{\sphinxupquote{pylab}} module defines \sphinxcode{\sphinxupquote{detrend\_none()}}, \sphinxcode{\sphinxupquote{detrend\_mean()}}, and \sphinxcode{\sphinxupquote{detrend\_linear()}}, but you can use a custom function as well. You can also use a string to choose one of the functions. ‘default’, ‘constant’, and ‘mean’ call \sphinxcode{\sphinxupquote{detrend\_mean()}}. ‘linear’ calls \sphinxcode{\sphinxupquote{detrend\_linear()}}. ‘none’ calls \sphinxcode{\sphinxupquote{detrend\_none()}}. \item[{\sphinxstylestrong{scale\_by\_freq}}] \leavevmode{[}boolean, optional{]} Specifies whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz\textasciicircum{}-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. \item[{\sphinxstylestrong{noverlap}}] \leavevmode{[}integer{]} The number of points of overlap between segments. The default value is 0 (no overlap). \item[{\sphinxstylestrong{Fc}}] \leavevmode{[}integer{]} The center frequency of \sphinxstyleemphasis{x} (defaults to 0), which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband. \item[{\sphinxstylestrong{return\_line}}] \leavevmode{[}bool{]} Whether to include the line object plotted in the returned values. Default is False. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Pxx}}] \leavevmode{[}1-D array{]} The values for the power spectrum \sphinxcode{\sphinxupquote{P\_\{xx\}}} before scaling (real valued) \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the elements in \sphinxstyleemphasis{Pxx} \item[{\sphinxstylestrong{line}}] \leavevmode{[}a {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instance{]} The line created by this function. Only returned if \sphinxstyleemphasis{return\_line} is True. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Keyword arguments control the {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} properties: \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or aa & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} or c & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dash_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dash\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_dashes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{dashes}}}}} & sequence of on/off ink in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_drawstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{drawstyle}}}}} & {[}‘default’ \textbar{} ‘steps’ \textbar{} ‘steps-pre’ \textbar{} ‘steps-mid’ \textbar{} ‘steps-post’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_fillstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fillstyle}}}}} & {[}‘full’ \textbar{} ‘left’ \textbar{} ‘right’ \textbar{} ‘bottom’ \textbar{} ‘top’ \textbar{} ‘none’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or ls & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or lw & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_marker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{marker}}}}} & {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{A valid marker style}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgecolor}}}}} or mec & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markeredgewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markeredgewidth}}}}} or mew & float value in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecolor}}}}} or mfc & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markerfacecoloralt}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markerfacecoloralt}}}}} or mfcalt & any matplotlib color \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markersize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markersize}}}}} or ms & float \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_markevery}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markevery}}}}} & {[}None \textbar{} int \textbar{} length-2 tuple of int \textbar{} slice \textbar{} list/array of int \textbar{} float \textbar{} length-2 tuple of float{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & float distance in points or callable pick function \sphinxcode{\sphinxupquote{fn(artist, event)}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_capstyle}}}}} & {[}‘butt’ \textbar{} ‘round’ \textbar{} ‘projecting’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_solid_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{solid\_joinstyle}}}}} & {[}‘miter’ \textbar{} ‘round’ \textbar{} ‘bevel’{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.transforms.Transform}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_xdata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{xdata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D.set_ydata}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ydata}}}}} & 1D array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.specgram:matplotlib.pyplot.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.specgram:matplotlib.pyplot.specgram}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{specgram()}}}}} differs in the default overlap; in not returning the mean of the segment periodograms; in returning the times of the segments; and in plotting a colormap instead of a line. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.magnitude_spectrum:matplotlib.pyplot.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.magnitude_spectrum:matplotlib.pyplot.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}} plots the magnitude spectrum. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.csd:matplotlib.pyplot.csd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{csd()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.csd:matplotlib.pyplot.csd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{csd()}}}}} plots the spectral density between two signals. \end{description} \paragraph{Notes} For plotting, the power is plotted as $10\log_{10}(P_{xx})$ for decibels, though \sphinxstyleemphasis{Pxx} itself is returned. \paragraph{References} Bendat \& Piersol \textendash{} Random Data: Analysis and Measurement Procedures, John Wiley \& Sons (1986) \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.psd}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.psd:examples-using-matplotlib-pyplot-psd}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_psd\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.quiver} \label{\detokenize{api/_as_gen/matplotlib.pyplot.quiver:matplotlib-pyplot-quiver}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.quiver::doc}}\index{quiver() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.quiver:matplotlib.pyplot.quiver}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{quiver}}}{\emph{*args}, \emph{**kw}}{} Plot a 2-D field of arrows. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{quiver}\PYG{p}{(}\PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \PYG{n}{quiver}\PYG{p}{(}\PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \PYG{n}{quiver}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \PYG{n}{quiver}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{n}{C}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \end{sphinxVerbatim} \sphinxstyleemphasis{U} and \sphinxstyleemphasis{V} are the arrow data, \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} set the location of the arrows, and \sphinxstyleemphasis{C} sets the color of the arrows. These arguments may be 1-D or 2-D arrays or sequences. If \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are absent, they will be generated as a uniform grid. If \sphinxstyleemphasis{U} and \sphinxstyleemphasis{V} are 2-D arrays and \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are 1-D, and if \sphinxcode{\sphinxupquote{len(X)}} and \sphinxcode{\sphinxupquote{len(Y)}} match the column and row dimensions of \sphinxstyleemphasis{U}, then \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} will be expanded with \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.meshgrid.html\#numpy.meshgrid}{\sphinxcode{\sphinxupquote{numpy.meshgrid()}}}. The default settings auto-scales the length of the arrows to a reasonable size. To change this behavior see the \sphinxstyleemphasis{scale} and \sphinxstyleemphasis{scale\_units} kwargs. The defaults give a slightly swept-back arrow; to make the head a triangle, make \sphinxstyleemphasis{headaxislength} the same as \sphinxstyleemphasis{headlength}. To make the arrow more pointed, reduce \sphinxstyleemphasis{headwidth} or increase \sphinxstyleemphasis{headlength} and \sphinxstyleemphasis{headaxislength}. To make the head smaller relative to the shaft, scale down all the head parameters. You will probably do best to leave minshaft alone. \sphinxstyleemphasis{linewidths} and \sphinxstyleemphasis{edgecolors} can be used to customize the arrow outlines. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{X}}] \leavevmode{[}1D or 2D array, sequence, optional{]} The x coordinates of the arrow locations \item[{\sphinxstylestrong{Y}}] \leavevmode{[}1D or 2D array, sequence, optional{]} The y coordinates of the arrow locations \item[{\sphinxstylestrong{U}}] \leavevmode{[}1D or 2D array or masked array, sequence{]} The x components of the arrow vectors \item[{\sphinxstylestrong{V}}] \leavevmode{[}1D or 2D array or masked array, sequence{]} The y components of the arrow vectors \item[{\sphinxstylestrong{C}}] \leavevmode{[}1D or 2D array, sequence, optional{]} The arrow colors \item[{\sphinxstylestrong{units}}] \leavevmode{[}{[} ‘width’ \textbar{} ‘height’ \textbar{} ‘dots’ \textbar{} ‘inches’ \textbar{} ‘x’ \textbar{} ‘y’ \textbar{} ‘xy’ {]}{]} The arrow dimensions (except for \sphinxstyleemphasis{length}) are measured in multiples of this unit. ‘width’ or ‘height’: the width or height of the axis ‘dots’ or ‘inches’: pixels or inches, based on the figure dpi ‘x’, ‘y’, or ‘xy’: respectively \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}, or $\sqrt{X^2 + Y^2}$ in data units The arrows scale differently depending on the units. For ‘x’ or ‘y’, the arrows get larger as one zooms in; for other units, the arrow size is independent of the zoom state. For ‘width or ‘height’, the arrow size increases with the width and height of the axes, respectively, when the window is resized; for ‘dots’ or ‘inches’, resizing does not change the arrows. \item[{\sphinxstylestrong{angles}}] \leavevmode{[}{[} ‘uv’ \textbar{} ‘xy’ {]}, array, optional{]} Method for determining the angle of the arrows. Default is ‘uv’. ‘uv’: the arrow axis aspect ratio is 1 so that if \sphinxstyleemphasis{U*==*V} the orientation of the arrow on the plot is 45 degrees counter-clockwise from the horizontal axis (positive to the right). ‘xy’: arrows point from (x,y) to (x+u, y+v). Use this for plotting a gradient field, for example. Alternatively, arbitrary angles may be specified as an array of values in degrees, counter-clockwise from the horizontal axis. Note: inverting a data axis will correspondingly invert the arrows only with \sphinxcode{\sphinxupquote{angles='xy'}}. \item[{\sphinxstylestrong{scale}}] \leavevmode{[}None, float, optional{]} Number of data units per arrow length unit, e.g., m/s per plot width; a smaller scale parameter makes the arrow longer. Default is \sphinxstyleemphasis{None}. If \sphinxstyleemphasis{None}, a simple autoscaling algorithm is used, based on the average vector length and the number of vectors. The arrow length unit is given by the \sphinxstyleemphasis{scale\_units} parameter \item[{\sphinxstylestrong{scale\_units}}] \leavevmode{[}{[} ‘width’ \textbar{} ‘height’ \textbar{} ‘dots’ \textbar{} ‘inches’ \textbar{} ‘x’ \textbar{} ‘y’ \textbar{} ‘xy’ {]}, None, optional{]} If the \sphinxstyleemphasis{scale} kwarg is \sphinxstyleemphasis{None}, the arrow length unit. Default is \sphinxstyleemphasis{None}. e.g. \sphinxstyleemphasis{scale\_units} is ‘inches’, \sphinxstyleemphasis{scale} is 2.0, and \sphinxcode{\sphinxupquote{(u,v) = (1,0)}}, then the vector will be 0.5 inches long. If \sphinxstyleemphasis{scale\_units} is ‘width’/’height’, then the vector will be half the width/height of the axes. If \sphinxstyleemphasis{scale\_units} is ‘x’ then the vector will be 0.5 x-axis units. To plot vectors in the x-y plane, with u and v having the same units as x and y, use \sphinxcode{\sphinxupquote{angles='xy', scale\_units='xy', scale=1}}. \item[{\sphinxstylestrong{width}}] \leavevmode{[}scalar, optional{]} Shaft width in arrow units; default depends on choice of units, above, and number of vectors; a typical starting value is about 0.005 times the width of the plot. \item[{\sphinxstylestrong{headwidth}}] \leavevmode{[}scalar, optional{]} Head width as multiple of shaft width, default is 3 \item[{\sphinxstylestrong{headlength}}] \leavevmode{[}scalar, optional{]} Head length as multiple of shaft width, default is 5 \item[{\sphinxstylestrong{headaxislength}}] \leavevmode{[}scalar, optional{]} Head length at shaft intersection, default is 4.5 \item[{\sphinxstylestrong{minshaft}}] \leavevmode{[}scalar, optional{]} Length below which arrow scales, in units of head length. Do not set this to less than 1, or small arrows will look terrible! Default is 1 \item[{\sphinxstylestrong{minlength}}] \leavevmode{[}scalar, optional{]} Minimum length as a multiple of shaft width; if an arrow length is less than this, plot a dot (hexagon) of this diameter instead. Default is 1. \item[{\sphinxstylestrong{pivot}}] \leavevmode{[}{[} ‘tail’ \textbar{} ‘mid’ \textbar{} ‘middle’ \textbar{} ‘tip’ {]}, optional{]} The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name \sphinxstyleemphasis{pivot}. \item[{\sphinxstylestrong{color}}] \leavevmode{[}{[} color \textbar{} color sequence {]}, optional{]} This is a synonym for the {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} facecolor kwarg. If \sphinxstyleemphasis{C} has been set, \sphinxstyleemphasis{color} has no effect. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.quiverkey:matplotlib.pyplot.quiverkey}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{quiverkey}}}}}}] \leavevmode Add a key to a quiver plot \end{description} \paragraph{Notes} Additional {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} keyword arguments: \begin{quote} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{|l|l|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_antialiased}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{antialiased}}}}} or antialiaseds & Boolean or sequence of booleans \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_array}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{array}}}}} & ndarray \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_capstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{capstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim}}}}} & a length 2 sequence of floats; may be overridden in methods that have \sphinxcode{\sphinxupquote{vmin}} and \sphinxcode{\sphinxupquote{vmax}} kwargs. \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cmap}}}}} & a colormap or registered colormap name \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_color}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{color}}}}} & matplotlib color arg or sequence of rgba tuples \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_edgecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{edgecolor}}}}} or edgecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_facecolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{facecolor}}}}} or facecolors & matplotlib color spec or sequence of specs \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_hatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hatch}}}}} & {[} ‘/’ \textbar{} ‘' \textbar{} ‘\textbar{}’ \textbar{} ‘-‘ \textbar{} ‘+’ \textbar{} ‘x’ \textbar{} ‘o’ \textbar{} ‘O’ \textbar{} ‘.’ \textbar{} ‘*’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_joinstyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{joinstyle}}}}} & unknown \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linestyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linestyle}}}}} or dashes or linestyles & {[}‘solid’ \textbar{} ‘dashed’, ‘dashdot’, ‘dotted’ \textbar{} (offset, on-off-dash-seq) \textbar{} \sphinxcode{\sphinxupquote{'-'}} \textbar{} \sphinxcode{\sphinxupquote{'-{-}'}} \textbar{} \sphinxcode{\sphinxupquote{'-.'}} \textbar{} \sphinxcode{\sphinxupquote{':'}} \textbar{} \sphinxcode{\sphinxupquote{'None'}} \textbar{} \sphinxcode{\sphinxupquote{' '}} \textbar{} \sphinxcode{\sphinxupquote{'{'}}}{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_linewidth}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{linewidth}}}}} or linewidths or lw & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/cm_api:matplotlib.cm.ScalarMappable.set_norm}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{norm}}}}} & {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offset_position}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offset\_position}}}}} & {[} ‘screen’ \textbar{} ‘data’ {]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_offsets}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{offsets}}}}} & float or sequence of floats \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_pickradius}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pickradius}}}}} & float distance in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection.set_urls}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{urls}}}}} & List{[}str{]} or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \end{quote} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.quiver}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.quiver:examples-using-matplotlib-pyplot-quiver}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_quiver\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.quiverkey} \label{\detokenize{api/_as_gen/matplotlib.pyplot.quiverkey:matplotlib-pyplot-quiverkey}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.quiverkey::doc}}\index{quiverkey() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.quiverkey:matplotlib.pyplot.quiverkey}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{quiverkey}}}{\emph{*args}, \emph{**kw}}{} Add a key to a quiver plot. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{quiverkey}\PYG{p}{(}\PYG{n}{Q}\PYG{p}{,} \PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{U}\PYG{p}{,} \PYG{n}{label}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kw}\PYG{p}{)} \end{sphinxVerbatim} Arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{Q}:}] \leavevmode The Quiver instance returned by a call to quiver. \item[{\sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}:}] \leavevmode The location of the key; additional explanation follows. \item[{\sphinxstyleemphasis{U}:}] \leavevmode The length of the key \item[{\sphinxstyleemphasis{label}:}] \leavevmode A string with the length and units of the key \end{description} \end{quote} Keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{angle} = 0}] \leavevmode The angle of the key arrow. Measured in degrees anti-clockwise from the x-axis. \item[{\sphinxstyleemphasis{coordinates} = {[} ‘axes’ \textbar{} ‘figure’ \textbar{} ‘data’ \textbar{} ‘inches’ {]}}] \leavevmode Coordinate system and units for \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}: ‘axes’ and ‘figure’ are normalized coordinate systems with 0,0 in the lower left and 1,1 in the upper right; ‘data’ are the axes data coordinates (used for the locations of the vectors in the quiver plot itself); ‘inches’ is position in the figure in inches, with 0,0 at the lower left corner. \item[{\sphinxstyleemphasis{color}:}] \leavevmode overrides face and edge colors from \sphinxstyleemphasis{Q}. \item[{\sphinxstyleemphasis{labelpos} = {[} ‘N’ \textbar{} ‘S’ \textbar{} ‘E’ \textbar{} ‘W’ {]}}] \leavevmode Position the label above, below, to the right, to the left of the arrow, respectively. \item[{\sphinxstyleemphasis{labelsep}:}] \leavevmode Distance in inches between the arrow and the label. Default is 0.1 \item[{\sphinxstyleemphasis{labelcolor}:}] \leavevmode defaults to default {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} color. \item[{\sphinxstyleemphasis{fontproperties}:}] \leavevmode A dictionary with keyword arguments accepted by the {\hyperref[\detokenize{api/font_manager_api:matplotlib.font_manager.FontProperties}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FontProperties}}}}} initializer: \sphinxstyleemphasis{family}, \sphinxstyleemphasis{style}, \sphinxstyleemphasis{variant}, \sphinxstyleemphasis{size}, \sphinxstyleemphasis{weight} \end{description} \end{quote} Any additional keyword arguments are used to override vector properties taken from \sphinxstyleemphasis{Q}. The positioning of the key depends on \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}, \sphinxstyleemphasis{coordinates}, and \sphinxstyleemphasis{labelpos}. If \sphinxstyleemphasis{labelpos} is ‘N’ or ‘S’, \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y} give the position of the middle of the key arrow. If \sphinxstyleemphasis{labelpos} is ‘E’, \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y} positions the head, and if \sphinxstyleemphasis{labelpos} is ‘W’, \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y} positions the tail; in either of these two cases, \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y} is somewhere in the middle of the arrow+label key object. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.quiverkey}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.quiverkey:examples-using-matplotlib-pyplot-quiverkey}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_quiver\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.rc} \label{\detokenize{api/_as_gen/matplotlib.pyplot.rc:matplotlib-pyplot-rc}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.rc::doc}}\index{rc() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.rc:matplotlib.pyplot.rc}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{rc}}}{\emph{*args}, \emph{**kwargs}}{} Set the current rc params. Group is the grouping for the rc, e.g., for \sphinxcode{\sphinxupquote{lines.linewidth}} the group is \sphinxcode{\sphinxupquote{lines}}, for \sphinxcode{\sphinxupquote{axes.facecolor}}, the group is \sphinxcode{\sphinxupquote{axes}}, and so on. Group may also be a list or tuple of group names, e.g., (\sphinxstyleemphasis{xtick}, \sphinxstyleemphasis{ytick}). \sphinxstyleemphasis{kwargs} is a dictionary attribute name/value pairs, e.g.,: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{rc}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} sets the current rc params and is equivalent to: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines.linewidth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mi}{2} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines.color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} The following aliases are available to save typing for interactive users: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Alias &\sphinxstyletheadfamily Property \\ \hline ‘lw’ & ‘linewidth’ \\ \hline ‘ls’ & ‘linestyle’ \\ \hline ‘c’ & ‘color’ \\ \hline ‘fc’ & ‘facecolor’ \\ \hline ‘ec’ & ‘edgecolor’ \\ \hline ‘mew’ & ‘markeredgewidth’ \\ \hline ‘aa’ & ‘antialiased’ \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Thus you could abbreviate the above rc command as: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{rc}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{lines}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{lw}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{c}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} Note you can use python’s kwargs dictionary facility to store dictionaries of default parameters. e.g., you can customize the font rc as follows: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{font} \PYG{o}{=} \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{family}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{monospace}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{weight}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bold}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{size}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{larger}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{\PYGZcb{}} \PYG{n}{rc}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{font}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{font}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} pass in the font dict as kwargs} \end{sphinxVerbatim} This enables you to easily switch between several configurations. Use \sphinxcode{\sphinxupquote{matplotlib.style.use('default')}} or {\hyperref[\detokenize{api/matplotlib_configuration_api:matplotlib.rcdefaults}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rcdefaults()}}}}} to restore the default rc params after changes. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.rc}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.rc:examples-using-matplotlib-pyplot-rc}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_color\_color\_cycler.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_polar\_legend.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_customize\_rc.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_multipage\_pdf.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/color_cycle:sphx-glr-tutorials-intermediate-color-cycle-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Styling with cycler}}}} \end{itemize} \subsection{matplotlib.pyplot.rc\_context} \label{\detokenize{api/_as_gen/matplotlib.pyplot.rc_context:matplotlib-pyplot-rc-context}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.rc_context::doc}}\index{rc\_context() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.rc_context:matplotlib.pyplot.rc_context}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{rc\_context}}}{\emph{rc=None}, \emph{fname=None}}{} Return a context manager for managing rc settings. This allows one to do: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{with} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rc\PYGZus{}context}\PYG{p}{(}\PYG{n}{fname}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{screen.rc}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{:} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{a}\PYG{p}{)} \PYG{k}{with} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rc\PYGZus{}context}\PYG{p}{(}\PYG{n}{fname}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{print.rc}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{:} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{b}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{c}\PYG{p}{)} \end{sphinxVerbatim} The ‘a’ vs ‘x’ and ‘c’ vs ‘x’ plots would have settings from ‘screen.rc’, while the ‘b’ vs ‘x’ plot would have settings from ‘print.rc’. A dictionary can also be passed to the context manager: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{with} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rc\PYGZus{}context}\PYG{p}{(}\PYG{n}{rc}\PYG{o}{=}\PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{text.usetex}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{k+kc}{True}\PYG{p}{\PYGZcb{}}\PYG{p}{,} \PYG{n}{fname}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{screen.rc}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{:} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{a}\PYG{p}{)} \end{sphinxVerbatim} The ‘rc’ dictionary takes precedence over the settings loaded from ‘fname’. Passing a dictionary only is also valid. For example a common usage is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{with} \PYG{n}{mpl}\PYG{o}{.}\PYG{n}{rc\PYGZus{}context}\PYG{p}{(}\PYG{n}{rc}\PYG{o}{=}\PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{interactive}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{k+kc}{False}\PYG{p}{\PYGZcb{}}\PYG{p}{)}\PYG{p}{:} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{,} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{3}\PYG{p}{)}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{savefig}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{A.png}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n+nb}{format}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{png}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{close}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.rc\_context}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.rc_context:examples-using-matplotlib-pyplot-rc-context}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_auto\_ticks.py} \end{itemize} \subsection{matplotlib.pyplot.rcdefaults} \label{\detokenize{api/_as_gen/matplotlib.pyplot.rcdefaults:matplotlib-pyplot-rcdefaults}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.rcdefaults::doc}}\index{rcdefaults() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.rcdefaults:matplotlib.pyplot.rcdefaults}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{rcdefaults}}}{}{} Restore the rc params from Matplotlib’s internal defaults. \sphinxstrong{See also:} \begin{description} \item[{\sphinxcode{\sphinxupquote{rc\_file\_defaults}}}] \leavevmode Restore the rc params from the rc file originally loaded by Matplotlib. \item[{{\hyperref[\detokenize{api/style_api:matplotlib.style.use}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.style.use}}}}}}] \leavevmode Use a specific style file. Call \sphinxcode{\sphinxupquote{style.use('default')}} to restore the default style. \end{description} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.rcdefaults}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.rcdefaults:examples-using-matplotlib-pyplot-rcdefaults}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_barh.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_artist\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_customize\_rc.py} \end{itemize} \subsection{matplotlib.pyplot.rgrids} \label{\detokenize{api/_as_gen/matplotlib.pyplot.rgrids:matplotlib-pyplot-rgrids}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.rgrids::doc}}\index{rgrids() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.rgrids:matplotlib.pyplot.rgrids}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{rgrids}}}{\emph{*args}, \emph{**kwargs}}{} Get or set the radial gridlines on a polar plot. call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{lines}\PYG{p}{,} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{rgrids}\PYG{p}{(}\PYG{p}{)} \PYG{n}{lines}\PYG{p}{,} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{rgrids}\PYG{p}{(}\PYG{n}{radii}\PYG{p}{,} \PYG{n}{labels}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{angle}\PYG{o}{=}\PYG{l+m+mf}{22.5}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} When called with no arguments, \sphinxcode{\sphinxupquote{rgrid()}} simply returns the tuple (\sphinxstyleemphasis{lines}, \sphinxstyleemphasis{labels}), where \sphinxstyleemphasis{lines} is an array of radial gridlines ({\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instances) and \sphinxstyleemphasis{labels} is an array of tick labels ({\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances). When called with arguments, the labels will appear at the specified radial distances and angles. \sphinxstyleemphasis{labels}, if not \sphinxstyleemphasis{None}, is a len(\sphinxstyleemphasis{radii}) list of strings of the labels to use at each angle. If \sphinxstyleemphasis{labels} is None, the rformatter will be used Examples: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} set the locations of the radial gridlines and labels} \PYG{n}{lines}\PYG{p}{,} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{rgrids}\PYG{p}{(} \PYG{p}{(}\PYG{l+m+mf}{0.25}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{)} \PYG{p}{)} \PYG{c+c1}{\PYGZsh{} set the locations and labels of the radial gridlines and labels} \PYG{n}{lines}\PYG{p}{,} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{rgrids}\PYG{p}{(} \PYG{p}{(}\PYG{l+m+mf}{0.25}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{1.0}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Tom}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Dick}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Harry}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsection{matplotlib.pyplot.savefig} \label{\detokenize{api/_as_gen/matplotlib.pyplot.savefig:matplotlib-pyplot-savefig}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.savefig::doc}}\index{savefig() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.savefig:matplotlib.pyplot.savefig}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{savefig}}}{\emph{*args}, \emph{**kwargs}}{} Save the current figure. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{savefig}\PYG{p}{(}\PYG{n}{fname}\PYG{p}{,} \PYG{n}{dpi}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{w}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{edgecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{w}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{orientation}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{portrait}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{papertype}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n+nb}{format}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{transparent}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{,} \PYG{n}{bbox\PYGZus{}inches}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{pad\PYGZus{}inches}\PYG{o}{=}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{n}{frameon}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)} \end{sphinxVerbatim} The output formats available depend on the backend being used. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fname}}] \leavevmode{[}str or file-like object{]} A string containing a path to a filename, or a Python file-like object, or possibly some backend-dependent object such as {\hyperref[\detokenize{api/backend_pdf_api:matplotlib.backends.backend_pdf.PdfPages}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PdfPages}}}}}. If \sphinxstyleemphasis{format} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{fname} is a string, the output format is deduced from the extension of the filename. If the filename has no extension, the value of the rc parameter \sphinxcode{\sphinxupquote{savefig.format}} is used. If \sphinxstyleemphasis{fname} is not a string, remember to specify \sphinxstyleemphasis{format} to ensure that the correct backend is used. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{dpi}}] \leavevmode{[}{[} \sphinxstyleemphasis{None} \textbar{} scalar \textgreater{} 0 \textbar{} ‘figure’{]}{]} The resolution in dots per inch. If \sphinxstyleemphasis{None} it will default to the value \sphinxcode{\sphinxupquote{savefig.dpi}} in the matplotlibrc file. If ‘figure’ it will set the dpi to be the value of the figure. \item[{\sphinxstylestrong{facecolor}}] \leavevmode{[}color spec or None, optional{]} the facecolor of the figure; if None, defaults to savefig.facecolor \item[{\sphinxstylestrong{edgecolor}}] \leavevmode{[}color spec or None, optional{]} the edgecolor of the figure; if None, defaults to savefig.edgecolor \item[{\sphinxstylestrong{orientation}}] \leavevmode{[}\{‘landscape’, ‘portrait’\}{]} not supported on all backends; currently only on postscript output \item[{\sphinxstylestrong{papertype}}] \leavevmode{[}str{]} One of ‘letter’, ‘legal’, ‘executive’, ‘ledger’, ‘a0’ through ‘a10’, ‘b0’ through ‘b10’. Only supported for postscript output. \item[{\sphinxstylestrong{format}}] \leavevmode{[}str{]} One of the file extensions supported by the active backend. Most backends support png, pdf, ps, eps and svg. \item[{\sphinxstylestrong{transparent}}] \leavevmode{[}bool{]} If \sphinxstyleemphasis{True}, the axes patches will all be transparent; the figure patch will also be transparent unless facecolor and/or edgecolor are specified via kwargs. This is useful, for example, for displaying a plot on top of a colored background on a web page. The transparency of these patches will be restored to their original values upon exit of this function. \item[{\sphinxstylestrong{frameon}}] \leavevmode{[}bool{]} If \sphinxstyleemphasis{True}, the figure patch will be colored, if \sphinxstyleemphasis{False}, the figure background will be transparent. If not provided, the rcParam ‘savefig.frameon’ will be used. \item[{\sphinxstylestrong{bbox\_inches}}] \leavevmode{[}str or {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}}, optional{]} Bbox in inches. Only the given portion of the figure is saved. If ‘tight’, try to figure out the tight bbox of the figure. If None, use savefig.bbox \item[{\sphinxstylestrong{pad\_inches}}] \leavevmode{[}scalar, optional{]} Amount of padding around the figure when bbox\_inches is ‘tight’. If None, use savefig.pad\_inches \item[{\sphinxstylestrong{bbox\_extra\_artists}}] \leavevmode{[}list of {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}}, optional{]} A list of extra artists that will be considered when the tight bbox is calculated. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.savefig}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.savefig:examples-using-matplotlib-pyplot-savefig}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_fonteffects.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_stix\_fonts\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_print\_stdout\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_tight\_bbox\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_rasterization\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_svg\_filter\_line.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_svg\_filter\_pie.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_svg\_tooltip\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_svg\_histogram\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_texsystem\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_fonts\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_preamble\_sgskip.py} \end{itemize} \subsection{matplotlib.pyplot.sca} \label{\detokenize{api/_as_gen/matplotlib.pyplot.sca:matplotlib-pyplot-sca}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.sca::doc}}\index{sca() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.sca:matplotlib.pyplot.sca}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{sca}}}{\emph{ax}}{} Set the current Axes instance to \sphinxstyleemphasis{ax}. The current Figure is updated to the parent of \sphinxstyleemphasis{ax}. \end{fulllineitems} \subsection{matplotlib.pyplot.scatter} \label{\detokenize{api/_as_gen/matplotlib.pyplot.scatter:matplotlib-pyplot-scatter}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.scatter::doc}}\index{scatter() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.scatter:matplotlib.pyplot.scatter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{scatter}}}{\emph{x}, \emph{y}, \emph{s=None}, \emph{c=None}, \emph{marker=None}, \emph{cmap=None}, \emph{norm=None}, \emph{vmin=None}, \emph{vmax=None}, \emph{alpha=None}, \emph{linewidths=None}, \emph{verts=None}, \emph{edgecolors=None}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} A scatter plot of \sphinxstyleemphasis{y} vs \sphinxstyleemphasis{x} with varying marker size and/or color. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}array\_like, shape (n, ){]} The data positions. \item[{\sphinxstylestrong{s}}] \leavevmode{[}scalar or array\_like, shape (n, ), optional{]} The marker size in points**2. Default is \sphinxcode{\sphinxupquote{rcParams{[}'lines.markersize'{]} ** 2}}. \item[{\sphinxstylestrong{c}}] \leavevmode{[}color, sequence, or sequence of color, optional, default: ‘b’{]} The marker color. Possible values: \begin{itemize} \item {} A single color format string. \item {} A sequence of color specifications of length n. \item {} A sequence of n numbers to be mapped to colors using \sphinxstyleemphasis{cmap} and \sphinxstyleemphasis{norm}. \item {} A 2-D array in which the rows are RGB or RGBA. \end{itemize} Note that \sphinxstyleemphasis{c} should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. If you want to specify the same RGB or RGBA value for all points, use a 2-D array with a single row. \item[{\sphinxstylestrong{marker}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.markers.MarkerStyle:matplotlib.markers.MarkerStyle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MarkerStyle}}}}}, optional, default: ‘o’{]} The marker style. \sphinxstyleemphasis{marker} can be either an instance of the class or the text shorthand for a particular marker. See {\hyperref[\detokenize{api/markers_api:module-matplotlib.markers}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{markers}}}}} for more information marker styles. \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}}, optional, default: None{]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}} instance or registered colormap name. \sphinxstyleemphasis{cmap} is only used if \sphinxstyleemphasis{c} is an array of floats. If \sphinxcode{\sphinxupquote{None}}, defaults to rc \sphinxcode{\sphinxupquote{image.cmap}}. \item[{\sphinxstylestrong{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}, optional, default: None{]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}} instance is used to scale luminance data to 0, 1. \sphinxstyleemphasis{norm} is only used if \sphinxstyleemphasis{c} is an array of floats. If \sphinxstyleemphasis{None}, use the default {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{colors.Normalize}}}}}. \item[{\sphinxstylestrong{vmin, vmax}}] \leavevmode{[}scalar, optional, default: None{]} \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} are used in conjunction with \sphinxstyleemphasis{norm} to normalize luminance data. If None, the respective min and max of the color array is used. \sphinxstyleemphasis{vmin} and \sphinxstyleemphasis{vmax} are ignored if you pass a \sphinxstyleemphasis{norm} instance. \item[{\sphinxstylestrong{alpha}}] \leavevmode{[}scalar, optional, default: None{]} The alpha blending value, between 0 (transparent) and 1 (opaque). \item[{\sphinxstylestrong{linewidths}}] \leavevmode{[}scalar or array\_like, optional, default: None{]} The linewidth of the marker edges. Note: The default \sphinxstyleemphasis{edgecolors} is ‘face’. You may want to change this as well. If \sphinxstyleemphasis{None}, defaults to rcParams \sphinxcode{\sphinxupquote{lines.linewidth}}. \item[{\sphinxstylestrong{verts}}] \leavevmode{[}sequence of (x, y), optional{]} If \sphinxstyleemphasis{marker} is \sphinxstyleemphasis{None}, these vertices will be used to construct the marker. The center of the marker is located at (0, 0) in normalized units. The overall marker is rescaled by \sphinxstyleemphasis{s}. \item[{\sphinxstylestrong{edgecolors}}] \leavevmode{[}color or sequence of color, optional, default: ‘face’{]} The edge color of the marker. Possible values: \begin{itemize} \item {} ‘face’: The edge color will always be the same as the face color. \item {} ‘none’: No patch boundary will be drawn. \item {} A matplotib color. \end{itemize} For non-filled markers, the \sphinxstyleemphasis{edgecolors} kwarg is ignored and forced to ‘face’ internally. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{paths}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.PathCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathCollection}}}}}{]} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.Collection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Collection}}}}} properties{]} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}}] \leavevmode To plot scatter plots when markers are identical in size and color. \end{description} \paragraph{Notes} \begin{itemize} \item {} The {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} function will be faster for scatterplots where markers don’t vary in size or color. \item {} Any or all of \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}, \sphinxstyleemphasis{s}, and \sphinxstyleemphasis{c} may be masked arrays, in which case all masks will be combined and only unmasked points will be plotted. \item {} Fundamentally, scatter works with 1-D arrays; \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}, \sphinxstyleemphasis{s}, and \sphinxstyleemphasis{c} may be input as 2-D arrays, but within scatter they will be flattened. The exception is \sphinxstyleemphasis{c}, which will be flattened only if its size matches the size of \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. \end{itemize} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘c’, ‘color’, ‘edgecolors’, ‘facecolor’, ‘facecolors’, ‘linewidths’, ‘s’, ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.scatter}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.scatter:examples-using-matplotlib-pyplot-scatter}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_symbol.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_masked.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_star\_poly.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_quiver\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_scatter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_hyperlinks\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_zorder\_demo.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \subsection{matplotlib.pyplot.sci} \label{\detokenize{api/_as_gen/matplotlib.pyplot.sci:matplotlib-pyplot-sci}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.sci::doc}}\index{sci() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.sci:matplotlib.pyplot.sci}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{sci}}}{\emph{im}}{} Set the current image. This image will be the target of colormap commands like {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.jet:matplotlib.pyplot.jet}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{jet()}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hot:matplotlib.pyplot.hot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hot()}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.clim:matplotlib.pyplot.clim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clim()}}}}}). The current image is an attribute of the current axes. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.sci}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.sci:examples-using-matplotlib-pyplot-sci}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_line\_collection.py} \end{itemize} \subsection{matplotlib.pyplot.semilogx} \label{\detokenize{api/_as_gen/matplotlib.pyplot.semilogx:matplotlib-pyplot-semilogx}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.semilogx::doc}}\index{semilogx() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.semilogx:matplotlib.pyplot.semilogx}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{semilogx}}}{\emph{*args}, \emph{**kwargs}}{} Make a plot with log scaling on the x axis. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{semilogx}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{n}{data}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{semilogx}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{n}{x2}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt2}\PYG{p}{]}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} This is just a thin wrapper around {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} which additionally changes the x-axis to log scaling. All of the concepts and parameters of plot can be used here as well. The additional parameters \sphinxstyleemphasis{basex}, \sphinxstyleemphasis{subsx} and \sphinxstyleemphasis{nonposx} control the x-axis properties. They are just forwarded to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xscale:matplotlib.axes.Axes.set_xscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_xscale}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{basex}}] \leavevmode{[}scalar, optional, default 10{]} Base of the x logarithm. \item[{\sphinxstylestrong{subsx}}] \leavevmode{[}array\_like, optional{]} The location of the minor xticks. If \sphinxstyleemphasis{None}, reasonable locations are automatically chosen depending on the number of decades in the plot. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xscale:matplotlib.axes.Axes.set_xscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_xscale}}}}} for details. \item[{\sphinxstylestrong{nonposx}}] \leavevmode{[}\{‘mask’, ‘clip’\}, optional, default ‘mask’{]} Non-positive values in x can be masked as invalid, or clipped to a very small positive number. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lines}}] \leavevmode A list of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} objects representing the plotted data. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode All parameters supported by {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.pyplot.semilogy} \label{\detokenize{api/_as_gen/matplotlib.pyplot.semilogy:matplotlib-pyplot-semilogy}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.semilogy::doc}}\index{semilogy() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.semilogy:matplotlib.pyplot.semilogy}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{semilogy}}}{\emph{*args}, \emph{**kwargs}}{} Make a plot with log scaling on the y axis. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{semilogy}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{n}{data}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{semilogy}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{n}{x2}\PYG{p}{]}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt2}\PYG{p}{]}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} This is just a thin wrapper around {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} which additionally changes the y-axis to log scaling. All of the concepts and parameters of plot can be used here as well. The additional parameters \sphinxstyleemphasis{basey}, \sphinxstyleemphasis{subsy} and \sphinxstyleemphasis{nonposy} control the y-axis properties. They are just forwarded to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yscale:matplotlib.axes.Axes.set_yscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_yscale}}}}}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{basey}}] \leavevmode{[}scalar, optional, default 10{]} Base of the y logarithm. \item[{\sphinxstylestrong{subsy}}] \leavevmode{[}array\_like, optional{]} The location of the minor yticks. If \sphinxstyleemphasis{None}, reasonable locations are automatically chosen depending on the number of decades in the plot. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yscale:matplotlib.axes.Axes.set_yscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes.set\_yscale}}}}} for details. \item[{\sphinxstylestrong{nonposy}}] \leavevmode{[}\{‘mask’, ‘clip’\}, optional, default ‘mask’{]} Non-positive values in y can be masked as invalid, or clipped to a very small positive number. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lines}}] \leavevmode A list of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} objects representing the plotted data. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode All parameters supported by {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.pyplot.set\_cmap} \label{\detokenize{api/_as_gen/matplotlib.pyplot.set_cmap:matplotlib-pyplot-set-cmap}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.set_cmap::doc}}\index{set\_cmap() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.set_cmap:matplotlib.pyplot.set_cmap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{set\_cmap}}}{\emph{cmap}}{} Set the default colormap. Applies to the current image if any. See help(colormaps) for more information. \sphinxstyleemphasis{cmap} must be a {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}} instance, or the name of a registered colormap. See {\hyperref[\detokenize{api/cm_api:matplotlib.cm.register_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.register\_cmap()}}}}} and {\hyperref[\detokenize{api/cm_api:matplotlib.cm.get_cmap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.cm.get\_cmap()}}}}}. \end{fulllineitems} \subsection{matplotlib.pyplot.setp} \label{\detokenize{api/_as_gen/matplotlib.pyplot.setp:matplotlib-pyplot-setp}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.setp::doc}}\index{setp() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.setp:matplotlib.pyplot.setp}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{setp}}}{\emph{*args}, \emph{**kwargs}}{} Set a property on an artist object. matplotlib supports the use of {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.setp:matplotlib.pyplot.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setp()}}}}} (“set property”) and \sphinxcode{\sphinxupquote{getp()}} to set and get object properties, as well as to do introspection on the object. For example, to set the linestyle of a line to be dashed, you can do: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{line}\PYG{p}{,} \PYG{o}{=} \PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{setp}\PYG{p}{(}\PYG{n}{line}\PYG{p}{,} \PYG{n}{linestyle}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZhy{}\PYGZhy{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} If you want to know the valid types of arguments, you can provide the name of the property you want to set without a value: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{setp}\PYG{p}{(}\PYG{n}{line}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linestyle}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{g+go}{ linestyle: [ \PYGZsq{}\PYGZhy{}\PYGZsq{} \textbar{} \PYGZsq{}\PYGZhy{}\PYGZhy{}\PYGZsq{} \textbar{} \PYGZsq{}\PYGZhy{}.\PYGZsq{} \textbar{} \PYGZsq{}:\PYGZsq{} \textbar{} \PYGZsq{}steps\PYGZsq{} \textbar{} \PYGZsq{}None\PYGZsq{} ]} \end{sphinxVerbatim} If you want to see all the properties that can be set, and their possible values, you can do: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{setp}\PYG{p}{(}\PYG{n}{line}\PYG{p}{)} \PYG{g+go}{ ... long output listing omitted} \end{sphinxVerbatim} You may specify another output file to {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.setp:matplotlib.pyplot.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setp}}}}} if \sphinxhref{https://docs.python.org/3/library/sys.html\#sys.stdout}{\sphinxcode{\sphinxupquote{sys.stdout}}} is not acceptable for some reason using the \sphinxcode{\sphinxupquote{file}} keyword-only argument: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k}{with} \PYG{n}{fopen}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{output.log}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k}{as} \PYG{n}{f}\PYG{p}{:} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} } \PYG{n}{setp}\PYG{p}{(}\PYG{n}{line}\PYG{p}{,} \PYG{n}{file}\PYG{o}{=}\PYG{n}{f}\PYG{p}{)} \end{sphinxVerbatim} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.setp:matplotlib.pyplot.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setp()}}}}} operates on a single instance or a iterable of instances. If you are in query mode introspecting the possible values, only the first instance in the sequence is used. When actually setting values, all the instances will be set. e.g., suppose you have a list of two lines, the following will make both lines thicker and red: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{x} \PYG{o}{=} \PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mf}{1.0}\PYG{p}{,}\PYG{l+m+mf}{0.01}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{y1} \PYG{o}{=} \PYG{n}{sin}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{x}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{y2} \PYG{o}{=} \PYG{n}{sin}\PYG{p}{(}\PYG{l+m+mi}{4}\PYG{o}{*}\PYG{n}{pi}\PYG{o}{*}\PYG{n}{x}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{lines} \PYG{o}{=} \PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{,} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{setp}\PYG{p}{(}\PYG{n}{lines}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.setp:matplotlib.pyplot.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setp()}}}}} works with the MATLAB style string/value pairs or with python kwargs. For example, the following are equivalent: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{setp}\PYG{p}{(}\PYG{n}{lines}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{linewidth}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{color}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} MATLAB style} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{setp}\PYG{p}{(}\PYG{n}{lines}\PYG{p}{,} \PYG{n}{linewidth}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} python style} \end{sphinxVerbatim} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.setp}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.setp:examples-using-matplotlib-pyplot-setp}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_shared\_axis\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_boxplot\_vs\_violin.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_boxplot\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_stem\_plot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_arctest.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_masked\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_annotated\_heatmap.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_fonteffects.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_pie\_and\_donut\_labels.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_axes\_divider.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_ginput\_manual\_clabel\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_set\_and\_get.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_patheffect\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_anscombe.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_topographic\_hillshading.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_evans\_test.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/lifecycle:sphx-glr-tutorials-introductory-lifecycle-py}]{\sphinxcrossref{\DUrole{std,std-ref}{The Lifecycle of a Plot}}}} \end{itemize} \subsection{matplotlib.pyplot.show} \label{\detokenize{api/_as_gen/matplotlib.pyplot.show:matplotlib-pyplot-show}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.show::doc}}\index{show() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.show:matplotlib.pyplot.show}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{show}}}{\emph{*args}, \emph{**kw}}{} Display a figure. When running in ipython with its pylab mode, display all figures and return to the ipython prompt. In non-interactive mode, display all figures and block until the figures have been closed; in interactive mode it has no effect unless figures were created prior to a change from non-interactive to interactive mode (not recommended). In that case it displays the figures but does not block. A single experimental keyword argument, \sphinxstyleemphasis{block}, may be set to True or False to override the blocking behavior described above. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.show}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.show:examples-using-matplotlib-pyplot-show}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_font\_family\_rc\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_unicode\_minus.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_font\_file.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_watermark\_text.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_quad\_bezier.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_legend.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_watermark\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_image\_zcoord.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_mathtext\_asarray.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_span\_regions.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_two\_scales.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_power\_norm.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_joinstyle.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_histogram\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_scatter\_piecharts.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_patch\_collection.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_sankey\_links.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_line\_with\_text.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_sankey\_basics.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_logos2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_sankey\_rankine.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_filled\_step.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_radar\_chart.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_skewt.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_simple.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_formatstr.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_three.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_fig\_x.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_98\_4\_legend.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_two\_subplots.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_annotation\_basic.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_99\_mplot3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_98\_4\_fill\_between.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_mathtext.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_dollar\_ticks.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_text.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_fig\_axes\_labels\_simple.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_fig\_axes\_customize\_simple.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_annotation\_polar.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_align\_ylabels.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_99\_axes\_grid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_text\_commands.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_1\_subplot3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_auto\_subplots\_adjust.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_annotate\_transform.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_99\_spines.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_compound\_path\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_scales.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_boxplot\_demo\_pyplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_98\_4\_fancy.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_text\_layout.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_props.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_invert\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplot\_toolbar.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_multiple\_figs\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplots\_adjust.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_geo\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplot\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_custom\_figure\_class.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_shared\_axis\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_margins.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_ganged\_plots.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_align\_labels\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_figure\_title.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axhspan\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_fahrenheit\_celsius\_scales.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axis\_equal\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplots\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_broken\_axis.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_demo\_tight\_layout.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_zoom\_effect.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_color\_color\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_color\_color\_by\_yvalue.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_color\_colorbar\_basics.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_color\_color\_cycler.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_color\_color\_cycle\_default.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_color\_named\_colors.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_color\_colormap\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_errorbar.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_histogram\_histtypes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_errorbar\_features.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_hexbin\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_histogram\_multihist.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_histogram\_features.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_boxplot\_vs\_violin.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_histogram\_cumulative.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_boxplot\_color.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_multiple\_histograms\_side\_by\_side.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_errorbars\_and\_boxes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_errorbar\_limits.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_violinplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_hist.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_customized\_violin.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_bxp.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_boxplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_barchart\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_boxplot\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_stem\_plot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_interp\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_arctest.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_with\_legend.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_custom\_symbol.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_symbol.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_step\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_xcorr\_acorr\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_line\_demo\_dash\_control.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_masked\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_fill.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_nan\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_errorbar\_subsample.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_simple\_plot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_masked.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_barh.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_bar\_stacked.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_broken\_barh.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_categorical\_variables.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_cohere.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_vline\_hline\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_star\_poly.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_line\_styles\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_gradient\_bar.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_errorbar\_limits\_simple.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_marker\_fillstyle\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_csd\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_stackplot\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_demo2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_spectrum\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_hist.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_eventcollection\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_multicolored\_line.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_fill\_betweenx\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_barchart.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_fill\_between\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_linestyles.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_eventplot\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_marker\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_markevery\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_psd\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_quiver\_simple\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_figimage\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_matshow.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_spy\_demos.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_clip\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_barcode\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_interpolation\_methods.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_corner\_mask.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_specgram\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_quadmesh\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_hatching.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_layer\_images.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_quiver\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_log.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_affine\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_multi\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_nonuniform.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_pcolormesh\_levels.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_shading\_example.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_label\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_triinterp\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_plot\_streamplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_barb\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_demo\_bboximage.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_irregulardatagrid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_pcolor\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_masked.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_smooth\_user.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_transparency\_blend.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_trigradient\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_triplot\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_custom\_cmap.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tripcolor\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_smooth\_delaunay.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_annotated\_heatmap.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_ellipse\_rotated.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_scatter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_marker\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_ellipse\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_ellipse\_collection.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_compound\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_path\_patch.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_hatch\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_donut.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_artist\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_line\_collection.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_collections.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_dolphin.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_fancybox\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_arrow\_simple\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_titles\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_dfrac\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_figlegend\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_mathtext\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_fancytextbox\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_text\_fontdict.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_tex\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_autowrap.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_accented\_text.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_text\_rotation\_relative\_to\_line.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_dashpointlabel.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_text\_rotation.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_multiline.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_date.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_engineering\_formatter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_custom\_legends.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_custom\_date\_formatter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_fancyarrow\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_demo\_text\_rotation\_mode.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_rainbow\_text.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_stix\_fonts\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_font\_table\_ttf\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_baseline\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_fonts\_demo\_kw.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_text\_alignment.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_fonts\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_demo\_annotation\_box.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_mathtext\_examples.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_demo\_text\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_legend\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_arrow\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_annotation\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_polar\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_pie\_features.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_polar\_bar.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_polar\_legend.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_polar\_scatter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_pie\_demo2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_nested\_pie.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_pie\_and\_donut\_labels.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_style\_sheets\_dark\_background.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_style\_sheets\_bmh.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_style\_sheets\_fivethirtyeight.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_style\_sheets\_grayscale.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_style\_sheets\_plot\_solarizedlight2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_style\_sheets\_ggplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_style\_sheets\_style\_sheets\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_integral.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_xkcd.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_mandelbrot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_anatomy.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_firefox.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_bachelors\_degrees\_by\_gender.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/simple_anim:sphx-glr-gallery-animation-simple-anim-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Animated line plot}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/animate_decay:sphx-glr-gallery-animation-animate-decay-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Decay}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/dynamic_image:sphx-glr-gallery-animation-dynamic-image-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Animated image using a precomputed list of images}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/animated_histogram:sphx-glr-gallery-animation-animated-histogram-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Animated histogram}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/strip_chart:sphx-glr-gallery-animation-strip-chart-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Oscilloscope}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/bayes_update:sphx-glr-gallery-animation-bayes-update-py}]{\sphinxcrossref{\DUrole{std,std-ref}{The Bayes update}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/unchained:sphx-glr-gallery-animation-unchained-py}]{\sphinxcrossref{\DUrole{std,std-ref}{MATPLOTLIB UNCHAINED}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/random_walk:sphx-glr-gallery-animation-random-walk-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Animated 3D random walk}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/double_pendulum_sgskip:sphx-glr-gallery-animation-double-pendulum-sgskip-py}]{\sphinxcrossref{\DUrole{std,std-ref}{The double pendulum problem}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/rain:sphx-glr-gallery-animation-rain-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Rain simulation}}}} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_imagegrid\_aspect.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_axesgrid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_parasite\_simple.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_axisline4.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_colorbar\_with\_axes\_divider.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_rgb.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_axesgrid2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_axes\_divider1.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_axes\_divider2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_axes\_divider3.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_colorbar\_with\_inset\_locator.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_colorbar\_of\_inset\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_inset\_locator\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_parasite\_simple2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_fixed\_size\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_scatter\_hist\_locatable\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_inset\_locator\_demo2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_axes\_hbox\_divider.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_make\_room\_for\_ylabel\_using\_axesgrid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_axes\_rgb.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_anchored\_artists.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_edge\_colorbar.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_axes\_divider.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_axes\_grid2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_axes\_grid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_simple\_axisline3.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_simple\_axis\_direction01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_axis\_direction\_demo\_step01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_simple\_axisartist1.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_simple\_axis\_direction03.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_simple\_axisline2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_axisline\_style.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_simple\_axisline.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_ticklabel\_alignment.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_axis\_direction\_demo\_step02.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_ticklabel\_direction.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_parasite\_axes2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_axis\_direction\_demo\_step03.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_parasite\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_axis\_direction\_demo\_step04.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_curvelinear\_grid2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_floating\_axis.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_axis\_direction.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_simple\_axis\_pad.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_curvelinear\_grid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_floating\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_ginput\_demo\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_close\_event.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_keypress\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_zoom\_window.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_timers.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_pick\_event\_demo2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_coords\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_image\_slices\_viewer.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_pong\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_legend\_picking.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_figure\_axes\_enter\_leave.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_looking\_glass.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_trifinder\_event\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_ginput\_manual\_clabel\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_resample.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_lasso\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_data\_browser.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_viewlims.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_pick\_event\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_path\_editor.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_poly\_editor.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_frontpage\_contour.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_coords\_report.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_keyword\_plotting.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_agg\_buffer\_to\_array.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_pythonic\_matplotlib.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_fill\_spiral.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_tight\_bbox\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_customize\_rc.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_load\_converter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_bbox\_intersect.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_set\_and\_get.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_findobj\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_zorder\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_contour\_manual.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_transoffset.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_plotfile\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_patheffect\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_table\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_cursor\_demo\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_multiprocess\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_anchored\_artists.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_demo\_ribbon\_box.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_demo\_agg\_filter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_custom\_projection.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_contourf3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_wire3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_contour3d\_2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_contour3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_offset.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_lines3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_surface3d\_2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_wire3d\_zero\_stride.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_3d\_bars.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_quiver3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_surface3d\_radial.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_voxels.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_surface3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_text3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_contour3d\_3.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_contourf3d\_2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_trisurf3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_scatter3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_mixed\_subplots.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_surface3d\_3.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_hist3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_bars3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_voxels\_rgb.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_tricontour3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_voxels\_torus.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_subplot3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_custom\_shaded\_3d\_surface.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_tricontourf3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_voxels\_numpy\_logo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_2dcollections3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_lorenz\_attractor.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_polys3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_trisurf3d\_2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_pathpatch3d.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_recipes\_share\_axis\_lims\_views.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_recipes\_transparent\_legends.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_recipes\_create\_subplots.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_recipes\_placing\_text\_boxes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_recipes\_common\_date\_problems.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_recipes\_fill\_between\_alpha.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_log\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_log\_bar.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_aspect\_loglog.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_symlog\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_log\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_scales.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_custom\_scale.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_mri\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_hinton\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_system\_monitor.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_mri\_with\_eeg.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_advanced\_hillshading.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_anscombe.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_topographic\_hillshading.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_leftventricle\_bulleye.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_tick\_xlabel\_top.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_tick\_label\_right.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_ticklabels\_rotation.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_custom\_ticker1.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_tick\_labels\_from\_values.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_auto\_ticks.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_spines\_dropped.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_spines\_bounds.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_date\_demo\_rrule.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_colorbar\_tick\_labelling\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_spines.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_major\_minor\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_date\_demo\_convert.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_centered\_ticklabels.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_date\_index\_formatter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_multiple\_yaxis\_with\_spines.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_spine\_placement\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_scalarformatter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_tick-locators.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_tick-formatters.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_radian\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_units\_sample.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_units\_scatter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_bar\_demo2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_annotate\_with\_units.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_bar\_unit\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_artist\_tests.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_ellipse\_with\_units.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_evans\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_lineprops\_dialog\_gtk\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_pylab\_with\_gtk\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_toolmanager\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_anchored\_box01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_simple01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_simple02.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_anchored\_box03.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_simple\_legend02.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_anchored\_box02.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_simple03.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_simple\_coord01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec05.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_simple\_legend01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_simple\_coord02.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec02.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_simple\_coord03.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations\_power.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_connect\_simple01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec03.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations\_lognorm.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_text\_arrow.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec04.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations\_symlognorm.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_simple04.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_anchored\_box04.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations\_bounds.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec06.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_custom\_boxstyle01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations\_custom.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_connectionstyle\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_custom\_boxstyle02.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_explain.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_simple\_annotate01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_multicursor.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_cursor.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_textbox.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_check\_buttons.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_buttons.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_span\_selector.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_radio\_buttons.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_slider\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_rectangle\_selector.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_polygon\_selector\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_lasso\_selector\_demo\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_menu.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/sample_plots:sphx-glr-tutorials-introductory-sample-plots-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Sample plots in Matplotlib}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/customizing:sphx-glr-tutorials-introductory-customizing-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Matplotlib with style sheets and rcParams}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/usage:sphx-glr-tutorials-introductory-usage-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Usage Guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/lifecycle:sphx-glr-tutorials-introductory-lifecycle-py}]{\sphinxcrossref{\DUrole{std,std-ref}{The Lifecycle of a Plot}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/color_cycle:sphx-glr-tutorials-intermediate-color-cycle-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Styling with cycler}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Legend guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/artists:sphx-glr-tutorials-intermediate-artists-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Artist tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/gridspec:sphx-glr-tutorials-intermediate-gridspec-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Figure Layouts Using GridSpec and Other Functions}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-tutorials-intermediate-tight-layout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Tight Layout guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/constrainedlayout_guide:sphx-glr-tutorials-intermediate-constrainedlayout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Constrained Layout Guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/advanced/patheffects_guide:sphx-glr-tutorials-advanced-patheffects-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Path effects guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/advanced/path_tutorial:sphx-glr-tutorials-advanced-path-tutorial-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Path Tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/advanced/transforms_tutorial:sphx-glr-tutorials-advanced-transforms-tutorial-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Transformations Tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/colors/colormaps:sphx-glr-tutorials-colors-colormaps-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Colormaps in Matplotlib}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/text/text_props:sphx-glr-tutorials-text-text-props-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Text properties and layout}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/text/text_intro:sphx-glr-tutorials-text-text-intro-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Text in Matplotlib Plots}}}} \end{itemize} \subsection{matplotlib.pyplot.specgram} \label{\detokenize{api/_as_gen/matplotlib.pyplot.specgram:matplotlib-pyplot-specgram}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.specgram::doc}}\index{specgram() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.specgram:matplotlib.pyplot.specgram}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{specgram}}}{\emph{x}, \emph{NFFT=None}, \emph{Fs=None}, \emph{Fc=None}, \emph{detrend=None}, \emph{window=None}, \emph{noverlap=None}, \emph{cmap=None}, \emph{xextent=None}, \emph{pad\_to=None}, \emph{sides=None}, \emph{scale\_by\_freq=None}, \emph{mode=None}, \emph{scale=None}, \emph{vmin=None}, \emph{vmax=None}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Plot a spectrogram. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{specgram}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{NFFT}\PYG{o}{=}\PYG{l+m+mi}{256}\PYG{p}{,} \PYG{n}{Fs}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{Fc}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{detrend}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{detrend\PYGZus{}none}\PYG{p}{,} \PYG{n}{window}\PYG{o}{=}\PYG{n}{mlab}\PYG{o}{.}\PYG{n}{window\PYGZus{}hanning}\PYG{p}{,} \PYG{n}{noverlap}\PYG{o}{=}\PYG{l+m+mi}{128}\PYG{p}{,} \PYG{n}{cmap}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{xextent}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{pad\PYGZus{}to}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{sides}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{scale\PYGZus{}by\PYGZus{}freq}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{mode}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{scale}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{default}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Compute and plot a spectrogram of data in \sphinxstyleemphasis{x}. Data are split into \sphinxstyleemphasis{NFFT} length segments and the spectrum of each section is computed. The windowing function \sphinxstyleemphasis{window} is applied to each segment, and the amount of overlap of each segment is specified with \sphinxstyleemphasis{noverlap}. The spectrogram is plotted as a colormap (using imshow). \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1-D array or sequence{]} Array or sequence containing the data. \item[{\sphinxstylestrong{Fs}}] \leavevmode{[}scalar{]} The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. The default value is 2. \item[{\sphinxstylestrong{window}}] \leavevmode{[}callable or ndarray{]} A function or a vector of length \sphinxstyleemphasis{NFFT}. To create window vectors see \sphinxcode{\sphinxupquote{window\_hanning()}}, \sphinxcode{\sphinxupquote{window\_none()}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html\#numpy.blackman}{\sphinxcode{\sphinxupquote{numpy.blackman()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html\#numpy.hamming}{\sphinxcode{\sphinxupquote{numpy.hamming()}}}, \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html\#numpy.bartlett}{\sphinxcode{\sphinxupquote{numpy.bartlett()}}}, \sphinxcode{\sphinxupquote{scipy.signal()}}, \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get\_window.html\#scipy.signal.get\_window}{\sphinxcode{\sphinxupquote{scipy.signal.get\_window()}}}, etc. The default is \sphinxcode{\sphinxupquote{window\_hanning()}}. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. \item[{\sphinxstylestrong{sides}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘onesided’ \textbar{} ‘twosided’ {]}{]} Specifies which sides of the spectrum to return. Default gives the default behavior, which returns one-sided for real data and both for complex data. ‘onesided’ forces the return of a one-sided spectrum, while ‘twosided’ forces two-sided. \item[{\sphinxstylestrong{pad\_to}}] \leavevmode{[}integer{]} The number of points to which the data segment is padded when performing the FFT. This can be different from \sphinxstyleemphasis{NFFT}, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the \sphinxstyleemphasis{n} parameter in the call to fft(). The default is None, which sets \sphinxstyleemphasis{pad\_to} equal to \sphinxstyleemphasis{NFFT} \item[{\sphinxstylestrong{NFFT}}] \leavevmode{[}integer{]} The number of data points used in each block for the FFT. A power 2 is most efficient. The default value is 256. This should \sphinxstyleemphasis{NOT} be used to get zero padding, or the scaling of the result will be incorrect. Use \sphinxstyleemphasis{pad\_to} for this instead. \item[{\sphinxstylestrong{detrend}}] \leavevmode{[}\{‘default’, ‘constant’, ‘mean’, ‘linear’, ‘none’\} or callable{]} The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the \sphinxstyleemphasis{detrend} parameter is a vector, in matplotlib is it a function. The \sphinxcode{\sphinxupquote{pylab}} module defines \sphinxcode{\sphinxupquote{detrend\_none()}}, \sphinxcode{\sphinxupquote{detrend\_mean()}}, and \sphinxcode{\sphinxupquote{detrend\_linear()}}, but you can use a custom function as well. You can also use a string to choose one of the functions. ‘default’, ‘constant’, and ‘mean’ call \sphinxcode{\sphinxupquote{detrend\_mean()}}. ‘linear’ calls \sphinxcode{\sphinxupquote{detrend\_linear()}}. ‘none’ calls \sphinxcode{\sphinxupquote{detrend\_none()}}. \item[{\sphinxstylestrong{scale\_by\_freq}}] \leavevmode{[}boolean, optional{]} Specifies whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz\textasciicircum{}-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. \item[{\sphinxstylestrong{mode}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘psd’ \textbar{} ‘magnitude’ \textbar{} ‘angle’ \textbar{} ‘phase’ {]}{]} What sort of spectrum to use. Default is ‘psd’, which takes the power spectral density. ‘complex’ returns the complex-valued frequency spectrum. ‘magnitude’ returns the magnitude spectrum. ‘angle’ returns the phase spectrum without unwrapping. ‘phase’ returns the phase spectrum with unwrapping. \item[{\sphinxstylestrong{noverlap}}] \leavevmode{[}integer{]} The number of points of overlap between blocks. The default value is 128. \item[{\sphinxstylestrong{scale}}] \leavevmode{[}{[} ‘default’ \textbar{} ‘linear’ \textbar{} ‘dB’ {]}{]} The scaling of the values in the \sphinxstyleemphasis{spec}. ‘linear’ is no scaling. ‘dB’ returns the values in dB scale. When \sphinxstyleemphasis{mode} is ‘psd’, this is dB power (10 * log10). Otherwise this is dB amplitude (20 * log10). ‘default’ is ‘dB’ if \sphinxstyleemphasis{mode} is ‘psd’ or ‘magnitude’ and ‘linear’ otherwise. This must be ‘linear’ if \sphinxstyleemphasis{mode} is ‘angle’ or ‘phase’. \item[{\sphinxstylestrong{Fc}}] \leavevmode{[}integer{]} The center frequency of \sphinxstyleemphasis{x} (defaults to 0), which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband. \item[{\sphinxstylestrong{cmap :}}] \leavevmode A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap}}}}} instance; if \sphinxstyleemphasis{None}, use default determined by rc \item[{\sphinxstylestrong{xextent}}] \leavevmode{[}{[}None \textbar{} (xmin, xmax){]}{]} The image extent along the x-axis. The default sets \sphinxstyleemphasis{xmin} to the left border of the first bin (\sphinxstyleemphasis{spectrum} column) and \sphinxstyleemphasis{xmax} to the right border of the last bin. Note that for \sphinxstyleemphasis{noverlap\textgreater{}0} the width of the bins is smaller than those of the segments. \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Additional kwargs are passed on to imshow which makes the specgram image \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{spectrum}}] \leavevmode{[}2-D array{]} Columns are the periodograms of successive segments. \item[{\sphinxstylestrong{freqs}}] \leavevmode{[}1-D array{]} The frequencies corresponding to the rows in \sphinxstyleemphasis{spectrum}. \item[{\sphinxstylestrong{t}}] \leavevmode{[}1-D array{]} The times corresponding to midpoints of segments (i.e., the columns in \sphinxstyleemphasis{spectrum}). \item[{\sphinxstylestrong{im}}] \leavevmode{[}instance of class {\hyperref[\detokenize{api/image_api:matplotlib.image.AxesImage}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AxesImage}}}}}{]} The image created by imshow containing the spectrogram \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.psd:matplotlib.pyplot.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}}}] \leavevmode {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.psd:matplotlib.pyplot.psd}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{psd()}}}}} differs in the default overlap; in returning the mean of the segment periodograms; in not returning times; and in generating a line plot instead of colormap. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.magnitude_spectrum:matplotlib.pyplot.magnitude_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{magnitude\_spectrum()}}}}}}] \leavevmode A single spectrum, similar to having a single segment when \sphinxstyleemphasis{mode} is ‘magnitude’. Plots a line instead of a colormap. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.angle_spectrum:matplotlib.pyplot.angle_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{angle\_spectrum()}}}}}}] \leavevmode A single spectrum, similar to having a single segment when \sphinxstyleemphasis{mode} is ‘angle’. Plots a line instead of a colormap. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.phase_spectrum:matplotlib.pyplot.phase_spectrum}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{phase\_spectrum()}}}}}}] \leavevmode A single spectrum, similar to having a single segment when \sphinxstyleemphasis{mode} is ‘phase’. Plots a line instead of a colormap. \end{description} \paragraph{Notes} The parameters \sphinxstyleemphasis{detrend} and \sphinxstyleemphasis{scale\_by\_freq} do only apply when \sphinxstyleemphasis{mode} is set to ‘psd’. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.specgram}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.specgram:examples-using-matplotlib-pyplot-specgram}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_specgram\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.spectral} \label{\detokenize{api/_as_gen/matplotlib.pyplot.spectral:matplotlib-pyplot-spectral}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.spectral::doc}}\index{spectral() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.spectral:matplotlib.pyplot.spectral}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{spectral}}}{}{} Set the colormap to “spectral”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.spring} \label{\detokenize{api/_as_gen/matplotlib.pyplot.spring:matplotlib-pyplot-spring}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.spring::doc}}\index{spring() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.spring:matplotlib.pyplot.spring}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{spring}}}{}{} Set the colormap to “spring”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.spy} \label{\detokenize{api/_as_gen/matplotlib.pyplot.spy:matplotlib-pyplot-spy}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.spy::doc}}\index{spy() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.spy:matplotlib.pyplot.spy}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{spy}}}{\emph{Z}, \emph{precision=0}, \emph{marker=None}, \emph{markersize=None}, \emph{aspect='equal'}, \emph{**kwargs}}{} Plot the sparsity pattern on a 2-D array. \sphinxcode{\sphinxupquote{spy(Z)}} plots the sparsity pattern of the 2-D array \sphinxstyleemphasis{Z}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{Z}}] \leavevmode{[}sparse array (n, m){]} The array to be plotted. \item[{\sphinxstylestrong{precision}}] \leavevmode{[}float, optional, default: 0{]} If \sphinxstyleemphasis{precision} is 0, any non-zero value will be plotted; else, values of $|Z| > precision$ will be plotted. For \sphinxhref{https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.spmatrix.html\#scipy.sparse.spmatrix}{\sphinxcode{\sphinxupquote{scipy.sparse.spmatrix}}} instances, there is a special case: if \sphinxstyleemphasis{precision} is ‘present’, any value present in the array will be plotted, even if it is identically zero. \item[{\sphinxstylestrong{origin}}] \leavevmode{[}{[}“upper”, “lower”{]}, optional, default: “upper”{]} Place the {[}0,0{]} index of the array in the upper left or lower left corner of the axes. \item[{\sphinxstylestrong{aspect}}] \leavevmode{[}{[}‘auto’ \textbar{} ‘equal’ \textbar{} scalar{]}, optional, default: “equal”{]} If ‘equal’, and \sphinxcode{\sphinxupquote{extent}} is None, changes the axes aspect ratio to match that of the image. If \sphinxcode{\sphinxupquote{extent}} is not \sphinxhref{https://docs.python.org/3/library/constants.html\#None}{\sphinxcode{\sphinxupquote{None}}}, the axes aspect ratio is changed to match that of the extent. If ‘auto’, changes the image aspect ratio to match that of the axes. If None, default to rc \sphinxcode{\sphinxupquote{image.aspect}} value. \item[{\sphinxstylestrong{Two plotting styles are available: image or marker. Both}}] \leavevmode \item[{\sphinxstylestrong{are available for full arrays, but only the marker style}}] \leavevmode \item[{\sphinxstylestrong{works for :class:{}`scipy.sparse.spmatrix{}` instances.}}] \leavevmode \item[{\sphinxstylestrong{If *marker* and *markersize* are *None*, an image will be}}] \leavevmode \item[{\sphinxstylestrong{returned and any remaining kwargs are passed to}}] \leavevmode \item[{\sphinxstylestrong{:func:{}`\textasciitilde{}matplotlib.pyplot.imshow{}`; else, a}}] \leavevmode \item[{\sphinxstylestrong{:class:{}`\textasciitilde{}matplotlib.lines.Line2D{}` object will be returned with}}] \leavevmode \item[{\sphinxstylestrong{the value of marker determining the marker type, and any}}] \leavevmode \item[{\sphinxstylestrong{remaining kwargs passed to the}}] \leavevmode \item[{\sphinxstylestrong{:meth:{}`\textasciitilde{}matplotlib.axes.Axes.plot{}` method.}}] \leavevmode \item[{\sphinxstylestrong{If *marker* and *markersize* are *None*, useful kwargs include:}}] \leavevmode \item[{\sphinxstylestrong{* *cmap*}}] \leavevmode \item[{\sphinxstylestrong{* *alpha*}}] \leavevmode \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{imshow}}}}}}] \leavevmode for image options. \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}}] \leavevmode for plotting options \end{description} \end{fulllineitems} \subsection{matplotlib.pyplot.stackplot} \label{\detokenize{api/_as_gen/matplotlib.pyplot.stackplot:matplotlib-pyplot-stackplot}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.stackplot::doc}}\index{stackplot() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.stackplot:matplotlib.pyplot.stackplot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{stackplot}}}{\emph{x}, \emph{*args}, \emph{**kwargs}}{} Draws a stacked area plot. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}1d array of dimension N{]} \item[{\sphinxstylestrong{y}}] \leavevmode{[}2d array (dimension MxN), or sequence of 1d arrays (each dimension 1xN){]} The data is assumed to be unstacked. Each of the following calls is legal: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{stackplot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} where y is MxN} \PYG{n}{stackplot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y1}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{n}{y3}\PYG{p}{,} \PYG{n}{y4}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} where y1, y2, y3, y4, are all 1xNm} \end{sphinxVerbatim} \item[{\sphinxstylestrong{baseline}}] \leavevmode{[}{[}‘zero’ \textbar{} ‘sym’ \textbar{} ‘wiggle’ \textbar{} ‘weighted\_wiggle’{]}{]} Method used to calculate the baseline: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{'zero'}}: Constant zero baseline, i.e. a simple stacked plot. \item {} \sphinxcode{\sphinxupquote{'sym'}}: Symmetric around zero and is sometimes called ‘ThemeRiver’. \item {} \sphinxcode{\sphinxupquote{'wiggle'}}: Minimizes the sum of the squared slopes. \item {} \sphinxcode{\sphinxupquote{'weighted\_wiggle'}}: Does the same but weights to account for size of each layer. It is also called ‘Streamgraph’-layout. More details can be found at \sphinxurl{http://leebyron.com/streamgraph/}. \end{itemize} \item[{\sphinxstylestrong{labels}}] \leavevmode{[}Length N sequence of strings{]} Labels to assign to each data series. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}Length N sequence of colors{]} A list or tuple of colors. These will be cycled through and used to colour the stacked areas. \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode All other keyword arguments are passed to \sphinxcode{\sphinxupquote{Axes.fill\_between()}}. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{list of {}`.PolyCollection{}`}}] \leavevmode A list of {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PolyCollection}}}}} instances, one for each element in the stacked area plot. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsection{matplotlib.pyplot.stem} \label{\detokenize{api/_as_gen/matplotlib.pyplot.stem:matplotlib-pyplot-stem}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.stem::doc}}\index{stem() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.stem:matplotlib.pyplot.stem}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{stem}}}{\emph{*args}, \emph{**kwargs}}{} Create a stem plot. A stem plot plots vertical lines at each \sphinxstyleemphasis{x} location from the baseline to \sphinxstyleemphasis{y}, and places a marker there. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{stem}\PYG{p}{(}\PYG{p}{[}\PYG{n}{x}\PYG{p}{,}\PYG{p}{]} \PYG{n}{y}\PYG{p}{,} \PYG{n}{linefmt}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{markerfmt}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{basefmt}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)} \end{sphinxVerbatim} The x-positions are optional. The formats may be provided either as positional or as keyword-arguments. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}array-like, optional{]} The x-positions of the stems. Default: (0, 1, …, len(y) - 1). \item[{\sphinxstylestrong{y}}] \leavevmode{[}array-like{]} The y-values of the stem heads. \item[{\sphinxstylestrong{linefmt}}] \leavevmode{[}str, optional{]} A string defining the properties of the vertical lines. Usually, this will be a color or a color and a linestyle: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Character &\sphinxstyletheadfamily Line Style \\ \hline \sphinxcode{\sphinxupquote{'-'}} & solid line \\ \hline \sphinxcode{\sphinxupquote{'-{-}'}} & dashed line \\ \hline \sphinxcode{\sphinxupquote{'-.'}} & dash-dot line \\ \hline \sphinxcode{\sphinxupquote{':'}} & dotted line \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Default: ‘C0-‘, i.e. solid line with the first color of the color cycle. Note: While it is technically possible to specify valid formats other than color or color and linestyle (e.g. ‘rx’ or ‘-.’), this is beyond the intention of the method and will most likely not result in a reasonable reasonable plot. \item[{\sphinxstylestrong{markerfmt}}] \leavevmode{[}str, optional{]} A string defining the properties of the markers at the stem heads. Default: ‘C0o’, i.e. filled circles with the first color of the color cycle. \item[{\sphinxstylestrong{basefmt}}] \leavevmode{[}str, optional{]} A format string defining the properties of the baseline. Default: ‘C3-‘ (‘C2-‘ in classic mode). \item[{\sphinxstylestrong{bottom}}] \leavevmode{[}float, optional, default: 0{]} The y-position of the baseline. \item[{\sphinxstylestrong{label}}] \leavevmode{[}str, optional, default: None{]} The label to use for the stems in legends. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{:class:{}`\textasciitilde{}matplotlib.container.StemContainer{}`}}] \leavevmode The stemcontainer may be treated like a tuple (\sphinxstyleemphasis{markerline}, \sphinxstyleemphasis{stemlines}, \sphinxstyleemphasis{baseline}) \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode No other parameters are supported. They are currently ignored silently for backward compatibility. This behavior is deprecated. Future versions will not accept any other parameters and will raise a TypeError instead. \end{description} \end{description}\end{quote} \paragraph{Notes} \sphinxstrong{See also:} The MATLAB function \sphinxhref{http://www.mathworks.com/help/techdoc/ref/stem.html}{stem} which inspired this method. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All positional and all keyword arguments. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.stem}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.stem:examples-using-matplotlib-pyplot-stem}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_stem\_plot.py} \end{itemize} \subsection{matplotlib.pyplot.step} \label{\detokenize{api/_as_gen/matplotlib.pyplot.step:matplotlib-pyplot-step}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.step::doc}}\index{step() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.step:matplotlib.pyplot.step}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{step}}}{\emph{x}, \emph{y}, \emph{*args}, \emph{**kwargs}}{} Make a step plot. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{step}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{data}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{where}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{pre}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{step}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt}\PYG{p}{]}\PYG{p}{,} \PYG{n}{x2}\PYG{p}{,} \PYG{n}{y2}\PYG{p}{,} \PYG{p}{[}\PYG{n}{fmt2}\PYG{p}{]}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{o}{*}\PYG{p}{,} \PYG{n}{where}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{pre}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} This is just a thin wrapper around {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} which changes some formatting options. Most of the concepts and parameters of plot can be used here as well. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}array\_like{]} 1-D sequence of x positions. It is assumed, but not checked, that it is uniformly increasing. \item[{\sphinxstylestrong{y}}] \leavevmode{[}array\_like{]} 1-D sequence of y levels. \item[{\sphinxstylestrong{fmt}}] \leavevmode{[}str, optional{]} A format string, e.g. ‘g’ for a green line. See {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}} for a more detailed description. Note: While full format strings are accepted, it is recommended to only specify the color. Line styles are currently ignored (use the keyword argument \sphinxstyleemphasis{linestyle} instead). Markers are accepted and plotted on the given positions, however, this is a rarely needed feature for step plots. \item[{\sphinxstylestrong{data}}] \leavevmode{[}indexable object, optional{]} An object with labelled data. If given, provide the label names to plot in \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. \item[{\sphinxstylestrong{where}}] \leavevmode{[}\{‘pre’, ‘post’, ‘mid’\}, optional, default ‘pre’{]} Define where the steps should be placed: \begin{itemize} \item {} ‘pre’: The y value is continued constantly to the left from every \sphinxstyleemphasis{x} position, i.e. the interval \sphinxcode{\sphinxupquote{(x{[}i-1{]}, x{[}i{]}{]}}} has the value \sphinxcode{\sphinxupquote{y{[}i{]}}}. \item {} ‘post’: The y value is continued constantly to the right from every \sphinxstyleemphasis{x} position, i.e. the interval \sphinxcode{\sphinxupquote{{[}x{[}i{]}, x{[}i+1{]})}} has the value \sphinxcode{\sphinxupquote{y{[}i{]}}}. \item {} ‘mid’: Steps occur half-way between the \sphinxstyleemphasis{x} positions. \end{itemize} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lines}}] \leavevmode A list of {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} objects representing the plotted data. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode Additional parameters are the same as those for {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}. \end{description} \end{description}\end{quote} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.step}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.step:examples-using-matplotlib-pyplot-step}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_step\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.streamplot} \label{\detokenize{api/_as_gen/matplotlib.pyplot.streamplot:matplotlib-pyplot-streamplot}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.streamplot::doc}}\index{streamplot() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.streamplot:matplotlib.pyplot.streamplot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{streamplot}}}{\emph{x}, \emph{y}, \emph{u}, \emph{v}, \emph{density=1}, \emph{linewidth=None}, \emph{color=None}, \emph{cmap=None}, \emph{norm=None}, \emph{arrowsize=1}, \emph{arrowstyle='-\textbar{}\textgreater{}'}, \emph{minlength=0.1}, \emph{transform=None}, \emph{zorder=None}, \emph{start\_points=None}, \emph{maxlength=4.0}, \emph{integration\_direction='both'}, \emph{hold=None}, \emph{data=None}}{} Draws streamlines of a vector flow. \begin{description} \item[{\sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}}] \leavevmode{[}1d arrays{]} an \sphinxstyleemphasis{evenly spaced} grid. \item[{\sphinxstyleemphasis{u}, \sphinxstyleemphasis{v}}] \leavevmode{[}2d arrays{]} x and y-velocities. Number of rows should match length of y, and the number of columns should match x. \item[{\sphinxstyleemphasis{density}}] \leavevmode{[}float or 2-tuple{]} Controls the closeness of streamlines. When \sphinxcode{\sphinxupquote{density = 1}}, the domain is divided into a 30x30 grid—\sphinxstyleemphasis{density} linearly scales this grid. Each cell in the grid can have, at most, one traversing streamline. For different densities in each direction, use {[}density\_x, density\_y{]}. \item[{\sphinxstyleemphasis{linewidth}}] \leavevmode{[}numeric or 2d array{]} vary linewidth when given a 2d array with the same shape as velocities. \item[{\sphinxstyleemphasis{color}}] \leavevmode{[}matplotlib color code, or 2d array{]} Streamline color. When given an array with the same shape as velocities, \sphinxstyleemphasis{color} values are converted to colors using \sphinxstyleemphasis{cmap}. \item[{\sphinxstyleemphasis{cmap}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}}{]} Colormap used to plot streamlines and arrows. Only necessary when using an array input for \sphinxstyleemphasis{color}. \item[{\sphinxstyleemphasis{norm}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Normalize}}}}}{]} Normalize object used to scale luminance data to 0, 1. If None, stretch (min, max) to (0, 1). Only necessary when \sphinxstyleemphasis{color} is an array. \item[{\sphinxstyleemphasis{arrowsize}}] \leavevmode{[}float{]} Factor scale arrow size. \item[{\sphinxstyleemphasis{arrowstyle}}] \leavevmode{[}str{]} Arrow style specification. See {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FancyArrowPatch}}}}}. \item[{\sphinxstyleemphasis{minlength}}] \leavevmode{[}float{]} Minimum length of streamline in axes coordinates. \item[{\sphinxstyleemphasis{start\_points}: Nx2 array}] \leavevmode Coordinates of starting points for the streamlines. In data coordinates, the same as the \sphinxcode{\sphinxupquote{x}} and \sphinxcode{\sphinxupquote{y}} arrays. \item[{\sphinxstyleemphasis{zorder}}] \leavevmode{[}int{]} any number \item[{\sphinxstyleemphasis{maxlength}}] \leavevmode{[}float{]} Maximum length of streamline in axes coordinates. \item[{\sphinxstyleemphasis{integration\_direction}}] \leavevmode{[}{[}‘forward’, ‘backward’, ‘both’{]}{]} Integrate the streamline in forward, backward or both directions. \end{description} Returns: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{stream\_container}}] \leavevmode{[}StreamplotSet{]} Container object with attributes \begin{itemize} \item {} lines: {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} of streamlines \item {} arrows: collection of {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.FancyArrowPatch:matplotlib.patches.FancyArrowPatch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches.FancyArrowPatch}}}}} objects representing arrows half-way along stream lines. \end{itemize} This container will probably change in the future to allow changes to the colormap, alpha, etc. for both lines and arrows, but these changes should be backward compatible. \end{description} \end{quote} \end{fulllineitems} \subsection{matplotlib.pyplot.subplot} \label{\detokenize{api/_as_gen/matplotlib.pyplot.subplot:matplotlib-pyplot-subplot}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.subplot::doc}}\index{subplot() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.subplot:matplotlib.pyplot.subplot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{subplot}}}{\emph{*args}, \emph{**kwargs}}{} Return a subplot axes at the given grid position. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{subplot}\PYG{p}{(}\PYG{n}{nrows}\PYG{p}{,} \PYG{n}{ncols}\PYG{p}{,} \PYG{n}{index}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} In the current figure, create and return an {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}}, at position \sphinxstyleemphasis{index} of a (virtual) grid of \sphinxstyleemphasis{nrows} by \sphinxstyleemphasis{ncols} axes. Indexes go from 1 to \sphinxcode{\sphinxupquote{nrows * ncols}}, incrementing in row-major order. If \sphinxstyleemphasis{nrows}, \sphinxstyleemphasis{ncols} and \sphinxstyleemphasis{index} are all less than 10, they can also be given as a single, concatenated, three-digit number. For example, \sphinxcode{\sphinxupquote{subplot(2, 3, 3)}} and \sphinxcode{\sphinxupquote{subplot(233)}} both create an {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes}}}}} at the top right corner of the current figure, occupying half of the figure height and a third of the figure width. \begin{sphinxadmonition}{note}{Note:} Creating a subplot will delete any pre-existing subplot that overlaps with it beyond sharing a boundary: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{c+c1}{\PYGZsh{} plot a line, implicitly creating a subplot(111)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} now create a subplot which represents the top plot of a grid} \PYG{c+c1}{\PYGZsh{} with 2 rows and 1 column. Since this subplot will overlap the} \PYG{c+c1}{\PYGZsh{} first, the plot (and its axes) previously created, will be removed} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{211}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{12}\PYG{p}{)}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplot}\PYG{p}{(}\PYG{l+m+mi}{212}\PYG{p}{,} \PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{y}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} creates 2nd subplot with yellow background} \end{sphinxVerbatim} If you do not want this behavior, use the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_subplot()}}}}} method or the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axes:matplotlib.pyplot.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axes()}}}}} function instead. \end{sphinxadmonition} Keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{facecolor}:}] \leavevmode The background color of the subplot, which can be any valid color specifier. See {\hyperref[\detokenize{api/colors_api:module-matplotlib.colors}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors}}}}} for more information. \item[{\sphinxstyleemphasis{polar}:}] \leavevmode A boolean flag indicating whether the subplot plot should be a polar projection. Defaults to \sphinxstyleemphasis{False}. \item[{\sphinxstyleemphasis{projection}:}] \leavevmode A string giving the name of a custom projection to be used for the subplot. This projection must have been previously registered. See {\hyperref[\detokenize{api/projections_api:module-matplotlib.projections}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.projections}}}}}. \end{description} \end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axes:matplotlib.pyplot.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axes()}}}}}}] \leavevmode For additional information on {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axes:matplotlib.pyplot.axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axes()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot:matplotlib.pyplot.subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot()}}}}} keyword arguments. \item[{\sphinxcode{\sphinxupquote{gallery/pie\_and\_polar\_charts/polar\_scatter.py}}}] \leavevmode For an example \end{description} \sphinxstylestrong{Example:} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{subplot}.pdf} \end{figure} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.subplot}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.subplot:examples-using-matplotlib-pyplot-subplot}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_98\_4\_legend.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_two\_subplots.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_scales.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_multiple\_figs\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplots\_adjust.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_geo\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_shared\_axis\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_margins.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_figure\_title.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_demo\_tight\_layout.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_zoom\_effect.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_nan\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_star\_poly.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_linestyles.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_psd\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_corner\_mask.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_specgram\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_triinterp\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_barb\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_demo\_bboximage.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_ellipse\_rotated.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_fancybox\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_multiline.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_fonts\_demo\_kw.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_fonts\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_demo\_text\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_polar\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_polar\_bar.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_pie\_demo2.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/unchained:sphx-glr-gallery-animation-unchained-py}]{\sphinxcrossref{\DUrole{std,std-ref}{MATPLOTLIB UNCHAINED}}}} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_simple\_colorbar.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_trifinder\_event\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_customize\_rc.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_zorder\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_transoffset.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_patheffect\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_demo\_agg\_filter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_custom\_projection.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_recipes\_share\_axis\_lims\_views.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_symlog\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_anscombe.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_tick-locators.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec05.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_simple\_legend01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec02.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec03.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/legend_guide:sphx-glr-tutorials-intermediate-legend-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Legend guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-tutorials-intermediate-tight-layout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Tight Layout guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/constrainedlayout_guide:sphx-glr-tutorials-intermediate-constrainedlayout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Constrained Layout Guide}}}} \end{itemize} \subsection{matplotlib.pyplot.subplot2grid} \label{\detokenize{api/_as_gen/matplotlib.pyplot.subplot2grid:matplotlib-pyplot-subplot2grid}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.subplot2grid::doc}}\index{subplot2grid() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.subplot2grid:matplotlib.pyplot.subplot2grid}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{subplot2grid}}}{\emph{shape}, \emph{loc}, \emph{rowspan=1}, \emph{colspan=1}, \emph{fig=None}, \emph{**kwargs}}{} Create an axis at specific location inside a regular grid. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{shape}}] \leavevmode{[}sequence of 2 ints{]} Shape of grid in which to place axis. First entry is number of rows, second entry is number of columns. \item[{\sphinxstylestrong{loc}}] \leavevmode{[}sequence of 2 ints{]} Location to place axis within grid. First entry is row number, second entry is column number. \item[{\sphinxstylestrong{rowspan}}] \leavevmode{[}int{]} Number of rows for the axis to span to the right. \item[{\sphinxstylestrong{colspan}}] \leavevmode{[}int{]} Number of columns for the axis to span downwards. \item[{\sphinxstylestrong{fig}}] \leavevmode{[}\sphinxcode{\sphinxupquote{Figure}}, optional{]} Figure to place axis in. Defaults to current figure. \item[{\sphinxstylestrong{**kwargs}}] \leavevmode Additional keyword arguments are handed to \sphinxcode{\sphinxupquote{add\_subplot}}. \end{description} \end{description}\end{quote} \paragraph{Notes} The following call \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{subplot2grid}\PYG{p}{(}\PYG{n}{shape}\PYG{p}{,} \PYG{n}{loc}\PYG{p}{,} \PYG{n}{rowspan}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{colspan}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{)} \end{sphinxVerbatim} is identical to \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{gridspec}\PYG{o}{=}\PYG{n}{GridSpec}\PYG{p}{(}\PYG{n}{shape}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n}{shape}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{)} \PYG{n}{subplotspec}\PYG{o}{=}\PYG{n}{gridspec}\PYG{o}{.}\PYG{n}{new\PYGZus{}subplotspec}\PYG{p}{(}\PYG{n}{loc}\PYG{p}{,} \PYG{n}{rowspan}\PYG{p}{,} \PYG{n}{colspan}\PYG{p}{)} \PYG{n}{subplot}\PYG{p}{(}\PYG{n}{subplotspec}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.subplot2grid}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.subplot2grid:examples-using-matplotlib-pyplot-subplot2grid}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_demo\_tight\_layout.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec01.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-tutorials-intermediate-tight-layout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Tight Layout guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/constrainedlayout_guide:sphx-glr-tutorials-intermediate-constrainedlayout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Constrained Layout Guide}}}} \end{itemize} \subsection{matplotlib.pyplot.subplot\_tool} \label{\detokenize{api/_as_gen/matplotlib.pyplot.subplot_tool:matplotlib-pyplot-subplot-tool}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.subplot_tool::doc}}\index{subplot\_tool() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.subplot_tool:matplotlib.pyplot.subplot_tool}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{subplot\_tool}}}{\emph{targetfig=None}}{} Launch a subplot tool window for a figure. A {\hyperref[\detokenize{api/widgets_api:matplotlib.widgets.SubplotTool}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.widgets.SubplotTool}}}}} instance is returned. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.subplot\_tool}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.subplot_tool:examples-using-matplotlib-pyplot-subplot-tool}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplot\_toolbar.py} \end{itemize} \subsection{matplotlib.pyplot.subplots} \label{\detokenize{api/_as_gen/matplotlib.pyplot.subplots:matplotlib-pyplot-subplots}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.subplots::doc}}\index{subplots() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.subplots:matplotlib.pyplot.subplots}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{subplots}}}{\emph{nrows=1}, \emph{ncols=1}, \emph{sharex=False}, \emph{sharey=False}, \emph{squeeze=True}, \emph{subplot\_kw=None}, \emph{gridspec\_kw=None}, \emph{**fig\_kw}}{} Create a figure and a set of subplots This utility wrapper makes it convenient to create common layouts of subplots, including the enclosing figure object, in a single call. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{nrows, ncols}}] \leavevmode{[}int, optional, default: 1{]} Number of rows/columns of the subplot grid. \item[{\sphinxstylestrong{sharex, sharey}}] \leavevmode{[}bool or \{‘none’, ‘all’, ‘row’, ‘col’\}, default: False{]} Controls sharing of properties among x (\sphinxcode{\sphinxupquote{sharex}}) or y (\sphinxcode{\sphinxupquote{sharey}}) axes: \begin{itemize} \item {} True or ‘all’: x- or y-axis will be shared among all subplots. \item {} False or ‘none’: each subplot x- or y-axis will be independent. \item {} ‘row’: each subplot row will share an x- or y-axis. \item {} ‘col’: each subplot column will share an x- or y-axis. \end{itemize} When subplots have a shared x-axis along a column, only the x tick labels of the bottom subplot are visible. Similarly, when subplots have a shared y-axis along a row, only the y tick labels of the first column subplot are visible. \item[{\sphinxstylestrong{squeeze}}] \leavevmode{[}bool, optional, default: True{]}\begin{itemize} \item {} If True, extra dimensions are squeezed out from the returned Axes object: \begin{itemize} \item {} if only one subplot is constructed (nrows=ncols=1), the resulting single Axes object is returned as a scalar. \item {} for Nx1 or 1xN subplots, the returned object is a 1D numpy object array of Axes objects are returned as numpy 1D arrays. \item {} for NxM, subplots with N\textgreater{}1 and M\textgreater{}1 are returned as a 2D arrays. \end{itemize} \item {} If False, no squeezing at all is done: the returned Axes object is always a 2D array containing Axes instances, even if it ends up being 1x1. \end{itemize} \item[{\sphinxstylestrong{subplot\_kw}}] \leavevmode{[}dict, optional{]} Dict with keywords passed to the {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure.add_subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_subplot()}}}}} call used to create each subplot. \item[{\sphinxstylestrong{gridspec\_kw}}] \leavevmode{[}dict, optional{]} Dict with keywords passed to the {\hyperref[\detokenize{api/_as_gen/matplotlib.gridspec.GridSpec:matplotlib.gridspec.GridSpec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{GridSpec}}}}} constructor used to create the grid the subplots are placed on. \item[{\sphinxstylestrong{**fig\_kw :}}] \leavevmode All additional keyword arguments are passed to the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figure:matplotlib.pyplot.figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure()}}}}} call. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{fig}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.figure.Figure}}}}} object{]} \item[{\sphinxstylestrong{ax}}] \leavevmode{[}Axes object or array of Axes objects.{]} ax can be either a single {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} object or an array of Axes objects if more than one subplot was created. The dimensions of the resulting array can be controlled with the squeeze keyword, see above. \end{description} \end{description}\end{quote} \sphinxstrong{See also:} {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.figure:matplotlib.pyplot.figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.subplot:matplotlib.pyplot.subplot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subplot}}}}} \paragraph{Examples} First create some toy data: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{,} \PYG{l+m+mi}{400}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{x}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2}\PYG{p}{)} \end{sphinxVerbatim} Creates just a figure and only one subplot \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Simple plot}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} Creates two subplots and unpacks the output array immediately \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{f}\PYG{p}{,} \PYG{p}{(}\PYG{n}{ax1}\PYG{p}{,} \PYG{n}{ax2}\PYG{p}{)} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{sharey}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{ax1}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{ax1}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Sharing Y axis}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{ax2}\PYG{o}{.}\PYG{n}{scatter}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \end{sphinxVerbatim} Creates four polar axes, and accesses them through the returned array \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{fig}\PYG{p}{,} \PYG{n}{axes} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{subplot\PYGZus{}kw}\PYG{o}{=}\PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{polar}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axes}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{axes}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{scatter}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{)} \end{sphinxVerbatim} Share a X axis with each column of subplots \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{sharex}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{col}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} Share a Y axis with each row of subplots \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{sharey}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{row}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} Share both X and Y axes with all subplots \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{sharex}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{all}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{sharey}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{all}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} Note that this is the same as \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{sharex}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{,} \PYG{n}{sharey}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.subplots}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.subplots:examples-using-matplotlib-pyplot-subplots}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_font\_family\_rc\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_unicode\_minus.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_font\_file.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_watermark\_text.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_quad\_bezier.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_legend.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_watermark\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_image\_zcoord.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_span\_regions.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_two\_scales.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_power\_norm.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_joinstyle.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_histogram\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_scatter\_piecharts.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_patch\_collection.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_line\_with\_text.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_filled\_step.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_radar\_chart.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_annotation\_basic.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_whats\_new\_98\_4\_fill\_between.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_dollar\_ticks.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_align\_ylabels.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_boxplot\_demo\_pyplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_props.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplot\_toolbar.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplot\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_ganged\_plots.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_fahrenheit\_celsius\_scales.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axis\_equal\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplots\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_broken\_axis.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_demo\_tight\_layout.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_color\_color\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_color\_color\_by\_yvalue.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_color\_colorbar\_basics.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_color\_color\_cycler.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_color\_color\_cycle\_default.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_color\_named\_colors.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_color\_colormap\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_errorbar.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_histogram\_histtypes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_errorbar\_features.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_hexbin\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_histogram\_multihist.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_histogram\_features.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_boxplot\_vs\_violin.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_histogram\_cumulative.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_boxplot\_color.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_multiple\_histograms\_side\_by\_side.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_errorbars\_and\_boxes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_errorbar\_limits.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_violinplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_hist.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_customized\_violin.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_bxp.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_boxplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_barchart\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_boxplot\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_interp\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_with\_legend.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_custom\_symbol.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_xcorr\_acorr\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_line\_demo\_dash\_control.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_fill.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_errorbar\_subsample.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_simple\_plot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_barh.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_broken\_barh.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_categorical\_variables.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_cohere.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_vline\_hline\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_line\_styles\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_gradient\_bar.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_marker\_fillstyle\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_csd\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_stackplot\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_demo2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_spectrum\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_multicolored\_line.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_fill\_betweenx\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_barchart.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_fill\_between\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_eventplot\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_marker\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_psd\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_quiver\_simple\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_spy\_demos.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_clip\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_interpolation\_methods.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_quadmesh\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_log.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_affine\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_multi\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_nonuniform.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_pcolormesh\_levels.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_shading\_example.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_irregulardatagrid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_pcolor\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_masked.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_transparency\_blend.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_trigradient\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_custom\_cmap.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_annotated\_heatmap.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_ellipse\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_ellipse\_collection.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_compound\_path.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_path\_patch.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_hatch\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_donut.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_artist\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_line\_collection.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_collections.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_dolphin.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_figlegend\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_mathtext\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_tex\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_accented\_text.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_dashpointlabel.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_text\_rotation.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_date.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_engineering\_formatter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_custom\_legends.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_custom\_date\_formatter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_demo\_annotation\_box.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_legend\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_annotation\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_pie\_features.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_nested\_pie.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pie\_and\_polar\_charts\_pie\_and\_donut\_labels.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_style\_sheets\_dark\_background.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_style\_sheets\_bmh.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_style\_sheets\_fivethirtyeight.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_style\_sheets\_grayscale.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_style\_sheets\_ggplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_style\_sheets\_style\_sheets\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_integral.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_bachelors\_degrees\_by\_gender.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_animation\_animation\_demo.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/simple_anim:sphx-glr-gallery-animation-simple-anim-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Animated line plot}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/animate_decay:sphx-glr-gallery-animation-animate-decay-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Decay}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/animated_histogram:sphx-glr-gallery-animation-animated-histogram-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Animated histogram}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/strip_chart:sphx-glr-gallery-animation-strip-chart-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Oscilloscope}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/bayes_update:sphx-glr-gallery-animation-bayes-update-py}]{\sphinxcrossref{\DUrole{std,std-ref}{The Bayes update}}}} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_colorbar\_with\_axes\_divider.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_colorbar\_with\_inset\_locator.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_colorbar\_of\_inset\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_inset\_locator\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_scatter\_hist\_locatable\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_inset\_locator\_demo2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_axes\_hbox\_divider.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_axes\_rgb.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_keypress\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_zoom\_window.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_timers.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_pick\_event\_demo2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_coords\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_image\_slices\_viewer.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_pong\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_legend\_picking.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_figure\_axes\_enter\_leave.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_looking\_glass.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_resample.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_data\_browser.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_viewlims.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_pick\_event\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_path\_editor.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_poly\_editor.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_frontpage\_histogram.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_frontpage\_membrane.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_frontpage\_contour.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_frontpage\_3D.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_coords\_report.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_keyword\_plotting.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_agg\_buffer\_to\_array.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_pythonic\_matplotlib.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_bbox\_intersect.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_findobj\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_rasterization\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_cursor\_demo\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_multiprocess\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_demo\_ribbon\_box.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_wire3d\_zero\_stride.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_custom\_shaded\_3d\_surface.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_recipes\_transparent\_legends.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_recipes\_create\_subplots.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_recipes\_placing\_text\_boxes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_recipes\_common\_date\_problems.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_recipes\_fill\_between\_alpha.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_log\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_log\_bar.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_aspect\_loglog.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_log\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_scales.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_mri\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_system\_monitor.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_advanced\_hillshading.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_topographic\_hillshading.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_leftventricle\_bulleye.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_tick\_xlabel\_top.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_tick\_label\_right.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_custom\_ticker1.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_auto\_ticks.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_spines\_dropped.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_spines\_bounds.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_date\_demo\_rrule.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_colorbar\_tick\_labelling\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_spines.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_major\_minor\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_date\_demo\_convert.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_centered\_ticklabels.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_date\_index\_formatter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_multiple\_yaxis\_with\_spines.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_scalarformatter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_radian\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_units\_sample.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_units\_scatter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_bar\_demo2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_annotate\_with\_units.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_bar\_unit\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_artist\_tests.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_units\_evans\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_lineprops\_dialog\_gtk\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_pylab\_with\_gtk\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_svg\_tooltip\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_anchored\_box01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_simple01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_simple02.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_anchored\_box03.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_simple\_legend02.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_anchored\_box02.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_simple03.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_simple\_coord01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_simple\_coord02.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_simple\_coord03.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations\_power.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_connect\_simple01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations\_lognorm.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_text\_arrow.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations\_symlognorm.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_simple04.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_anchored\_box04.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations\_bounds.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_custom\_boxstyle01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations\_custom.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_connectionstyle\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_custom\_boxstyle02.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_annotate\_explain.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_simple\_annotate01.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_colormap\_normalizations.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_multicursor.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_textbox.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_check\_buttons.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_buttons.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_span\_selector.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_radio\_buttons.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_slider\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_rectangle\_selector.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_polygon\_selector\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_lasso\_selector\_demo\_sgskip.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/sample_plots:sphx-glr-tutorials-introductory-sample-plots-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Sample plots in Matplotlib}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/usage:sphx-glr-tutorials-introductory-usage-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Usage Guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/lifecycle:sphx-glr-tutorials-introductory-lifecycle-py}]{\sphinxcrossref{\DUrole{std,std-ref}{The Lifecycle of a Plot}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/color_cycle:sphx-glr-tutorials-intermediate-color-cycle-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Styling with cycler}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/artists:sphx-glr-tutorials-intermediate-artists-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Artist tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/gridspec:sphx-glr-tutorials-intermediate-gridspec-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Figure Layouts Using GridSpec and Other Functions}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-tutorials-intermediate-tight-layout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Tight Layout guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/constrainedlayout_guide:sphx-glr-tutorials-intermediate-constrainedlayout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Constrained Layout Guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/colors/colors:sphx-glr-tutorials-colors-colors-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Specifying Colors}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/colors/colorbar_only:sphx-glr-tutorials-colors-colorbar-only-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customized Colorbars Tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/colors/colormapnorms:sphx-glr-tutorials-colors-colormapnorms-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Colormap Normalization}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/colors/colormaps:sphx-glr-tutorials-colors-colormaps-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Colormaps in Matplotlib}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/text/text_intro:sphx-glr-tutorials-text-text-intro-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Text in Matplotlib Plots}}}} \end{itemize} \subsection{matplotlib.pyplot.subplots\_adjust} \label{\detokenize{api/_as_gen/matplotlib.pyplot.subplots_adjust:matplotlib-pyplot-subplots-adjust}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.subplots_adjust::doc}}\index{subplots\_adjust() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.subplots_adjust:matplotlib.pyplot.subplots_adjust}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{subplots\_adjust}}}{\emph{*args}, \emph{**kwargs}}{} Tune the subplot layout. call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{subplots\PYGZus{}adjust}\PYG{p}{(}\PYG{n}{left}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{bottom}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{right}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{top}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{wspace}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{hspace}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)} \end{sphinxVerbatim} The parameter meanings (and suggested defaults) are: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{left} \PYG{o}{=} \PYG{l+m+mf}{0.125} \PYG{c+c1}{\PYGZsh{} the left side of the subplots of the figure} \PYG{n}{right} \PYG{o}{=} \PYG{l+m+mf}{0.9} \PYG{c+c1}{\PYGZsh{} the right side of the subplots of the figure} \PYG{n}{bottom} \PYG{o}{=} \PYG{l+m+mf}{0.1} \PYG{c+c1}{\PYGZsh{} the bottom of the subplots of the figure} \PYG{n}{top} \PYG{o}{=} \PYG{l+m+mf}{0.9} \PYG{c+c1}{\PYGZsh{} the top of the subplots of the figure} \PYG{n}{wspace} \PYG{o}{=} \PYG{l+m+mf}{0.2} \PYG{c+c1}{\PYGZsh{} the amount of width reserved for space between subplots,} \PYG{c+c1}{\PYGZsh{} expressed as a fraction of the average axis width} \PYG{n}{hspace} \PYG{o}{=} \PYG{l+m+mf}{0.2} \PYG{c+c1}{\PYGZsh{} the amount of height reserved for space between subplots,} \PYG{c+c1}{\PYGZsh{} expressed as a fraction of the average axis height} \end{sphinxVerbatim} The actual defaults are controlled by the rc file \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.subplots\_adjust}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.subplots_adjust:examples-using-matplotlib-pyplot-subplots-adjust}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_scales.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplots\_adjust.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_figure\_title.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_statistics\_customized\_violin.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_irregulardatagrid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_text\_fontdict.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_multiline.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_legend\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axisartist\_demo\_parasite\_axes2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_table\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_demo\_agg\_filter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_ticklabels\_rotation.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_spines.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_tick-locators.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_textbox.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_check\_buttons.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_buttons.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_radio\_buttons.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_widgets\_slider\_demo.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \subsection{matplotlib.pyplot.summer} \label{\detokenize{api/_as_gen/matplotlib.pyplot.summer:matplotlib-pyplot-summer}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.summer::doc}}\index{summer() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.summer:matplotlib.pyplot.summer}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{summer}}}{}{} Set the colormap to “summer”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.suptitle} \label{\detokenize{api/_as_gen/matplotlib.pyplot.suptitle:matplotlib-pyplot-suptitle}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.suptitle::doc}}\index{suptitle() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.suptitle:matplotlib.pyplot.suptitle}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{suptitle}}}{\emph{*args}, \emph{**kwargs}}{} Add a centered title to the figure. kwargs are {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}} properties. Using figure coordinates, the defaults are: \begin{quote} \begin{description} \item[{x}] \leavevmode{[}0.5{]} The x location of the text in figure coords \item[{y}] \leavevmode{[}0.98{]} The y location of the text in figure coords \item[{horizontalalignment}] \leavevmode{[}‘center’{]} The horizontal alignment of the text \item[{verticalalignment}] \leavevmode{[}‘top’{]} The vertical alignment of the text \end{description} \end{quote} If the \sphinxcode{\sphinxupquote{fontproperties}} keyword argument is given then the rcParams defaults for \sphinxcode{\sphinxupquote{fontsize}} (\sphinxcode{\sphinxupquote{figure.titlesize}}) and \sphinxcode{\sphinxupquote{fontweight}} (\sphinxcode{\sphinxupquote{figure.titleweight}}) will be ignored in favour of the \sphinxcode{\sphinxupquote{FontProperties}} defaults. A {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.text.Text}}}}} instance is returned. Example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{o}{.}\PYG{n}{suptitle}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{this is the figure title}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{12}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.suptitle}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.suptitle:examples-using-matplotlib-pyplot-suptitle}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_figure\_title.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_demo\_gridspec04.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \subsection{matplotlib.pyplot.switch\_backend} \label{\detokenize{api/_as_gen/matplotlib.pyplot.switch_backend:matplotlib-pyplot-switch-backend}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.switch_backend::doc}}\index{switch\_backend() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.switch_backend:matplotlib.pyplot.switch_backend}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{switch\_backend}}}{\emph{newbackend}}{} Switch the default backend. This feature is \sphinxstylestrong{experimental}, and is only expected to work switching to an image backend. e.g., if you have a bunch of PostScript scripts that you want to run from an interactive ipython session, you may want to switch to the PS backend before running them to avoid having a bunch of GUI windows popup. If you try to interactively switch from one GUI backend to another, you will explode. Calling this command will close all open windows. \end{fulllineitems} \subsection{matplotlib.pyplot.table} \label{\detokenize{api/_as_gen/matplotlib.pyplot.table:matplotlib-pyplot-table}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.table::doc}}\index{table() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.table:matplotlib.pyplot.table}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{table}}}{\emph{**kwargs}}{} Add a table to the current axes. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{table}\PYG{p}{(}\PYG{n}{cellText}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{cellColours}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{cellLoc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{colWidths}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{rowLabels}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{rowColours}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{rowLoc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{left}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{colLabels}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{colColours}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{colLoc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{loc}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bottom}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{bbox}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)} \end{sphinxVerbatim} Returns a {\hyperref[\detokenize{api/table_api:matplotlib.table.Table}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.table.Table}}}}} instance. Either \sphinxcode{\sphinxupquote{cellText}} or \sphinxcode{\sphinxupquote{cellColours}} must be provided. For finer grained control over tables, use the {\hyperref[\detokenize{api/table_api:matplotlib.table.Table}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Table}}}}} class and add it to the axes with {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.add_table:matplotlib.axes.Axes.add_table}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_table()}}}}}. Thanks to John Gill for providing the class and table. kwargs control the {\hyperref[\detokenize{api/table_api:matplotlib.table.Table}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Table}}}}} properties: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Property &\sphinxstyletheadfamily Description \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_agg_filter:matplotlib.artist.Artist.set_agg_filter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{agg\_filter}}}}} & a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_alpha:matplotlib.artist.Artist.set_alpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{alpha}}}}} & float (0.0 transparent through 1.0 opaque) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_animated:matplotlib.artist.Artist.set_animated}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{animated}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_box:matplotlib.artist.Artist.set_clip_box}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_box}}}}} & a {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Bbox}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Bbox}}}}} instance \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_on:matplotlib.artist.Artist.set_clip_on}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_on}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_clip_path:matplotlib.artist.Artist.set_clip_path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{clip\_path}}}}} & {[}({\hyperref[\detokenize{api/path_api:matplotlib.path.Path}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path}}}}}, {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}}) \textbar{} {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Patch:matplotlib.patches.Patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch}}}}} \textbar{} None{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_contains:matplotlib.artist.Artist.set_contains}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contains}}}}} & a callable function \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_figure:matplotlib.artist.Artist.set_figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{figure}}}}} & a {\hyperref[\detokenize{api/_as_gen/matplotlib.figure.Figure:matplotlib.figure.Figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Figure}}}}} instance \\ \hline {\hyperref[\detokenize{api/table_api:matplotlib.table.Table.set_fontsize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{fontsize}}}}} & a float in points \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_gid:matplotlib.artist.Artist.set_gid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{gid}}}}} & an id string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_label:matplotlib.artist.Artist.set_label}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{label}}}}} & object \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_path_effects:matplotlib.artist.Artist.set_path_effects}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{path\_effects}}}}} & {\hyperref[\detokenize{api/patheffects_api:matplotlib.patheffects.AbstractPathEffect}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{AbstractPathEffect}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_picker:matplotlib.artist.Artist.set_picker}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{picker}}}}} & {[}None \textbar{} bool \textbar{} float \textbar{} callable{]} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_rasterized:matplotlib.artist.Artist.set_rasterized}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{rasterized}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_sketch_params:matplotlib.artist.Artist.set_sketch_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{sketch\_params}}}}} & (scale: float, length: float, randomness: float) \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_snap:matplotlib.artist.Artist.set_snap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{snap}}}}} & bool or None \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_transform:matplotlib.artist.Artist.set_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{transform}}}}} & {\hyperref[\detokenize{api/transformations:matplotlib.transforms.Transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Transform}}}}} \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_url:matplotlib.artist.Artist.set_url}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{url}}}}} & a url string \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_visible:matplotlib.artist.Artist.set_visible}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{visible}}}}} & bool \\ \hline {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.set_zorder:matplotlib.artist.Artist.set_zorder}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{zorder}}}}} & float \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.table}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.table:examples-using-matplotlib-pyplot-table}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_font\_table\_ttf\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_table\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.text} \label{\detokenize{api/_as_gen/matplotlib.pyplot.text:matplotlib-pyplot-text}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.text::doc}}\index{text() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.text:matplotlib.pyplot.text}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{text}}}{\emph{x}, \emph{y}, \emph{s}, \emph{fontdict=None}, \emph{withdash=False}, \emph{**kwargs}}{} Add text to the axes. Add the text \sphinxstyleemphasis{s} to the axes at location \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} in data coordinates. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}scalars{]} The position to place the text. By default, this is in data coordinates. The coordinate system can be changed using the \sphinxstyleemphasis{transform} parameter. \item[{\sphinxstylestrong{s}}] \leavevmode{[}str{]} The text. \item[{\sphinxstylestrong{fontdict}}] \leavevmode{[}dictionary, optional, default: None{]} A dictionary to override the default text properties. If fontdict is None, the defaults are determined by your rc parameters. \item[{\sphinxstylestrong{withdash}}] \leavevmode{[}boolean, optional, default: False{]} Creates a {\hyperref[\detokenize{api/text_api:matplotlib.text.TextWithDash}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TextWithDash}}}}} instance instead of a {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instance. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{text}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}}{]} The created {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instance. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} properties.{]} Other miscellaneous text parameters. \end{description} \end{description}\end{quote} \paragraph{Examples} Individual keyword arguments can be used to override any given parameter: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{text}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{s}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{12}\PYG{p}{)} \end{sphinxVerbatim} The default transform specifies that text is in data coords, alternatively, you can specify text in axis coords (0,0 is lower-left and 1,1 is upper-right). The example below places text in the center of the axes: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{matplotlib}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{g+gp}{... } \PYG{n}{verticalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \end{sphinxVerbatim} You can put a rectangular box around the text instance (e.g., to set a background color) by using the keyword \sphinxcode{\sphinxupquote{bbox}}. \sphinxcode{\sphinxupquote{bbox}} is a dictionary of {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}} properties. For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{text}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{s}\PYG{p}{,} \PYG{n}{bbox}\PYG{o}{=}\PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.text}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.text:examples-using-matplotlib-pyplot-text}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_mathtext.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_text.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_artist\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_fancytextbox\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_text\_fontdict.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_autowrap.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_fonteffects.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_text\_rotation\_relative\_to\_line.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_multiline.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_stix\_fonts\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_fonts\_demo\_kw.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_fonts\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_arrow\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_integral.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_bachelors\_degrees\_by\_gender.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_close\_event.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_transoffset.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_anscombe.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_texsystem\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_fonts\_sgskip.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/advanced/patheffects_guide:sphx-glr-tutorials-advanced-patheffects-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Path effects guide}}}} \end{itemize} \subsection{matplotlib.pyplot.thetagrids} \label{\detokenize{api/_as_gen/matplotlib.pyplot.thetagrids:matplotlib-pyplot-thetagrids}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.thetagrids::doc}}\index{thetagrids() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.thetagrids:matplotlib.pyplot.thetagrids}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{thetagrids}}}{\emph{*args}, \emph{**kwargs}}{} Get or set the theta locations of the gridlines in a polar plot. If no arguments are passed, return a tuple (\sphinxstyleemphasis{lines}, \sphinxstyleemphasis{labels}) where \sphinxstyleemphasis{lines} is an array of radial gridlines ({\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instances) and \sphinxstyleemphasis{labels} is an array of tick labels ({\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{lines}\PYG{p}{,} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{thetagrids}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} Otherwise the syntax is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{lines}\PYG{p}{,} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{thetagrids}\PYG{p}{(}\PYG{n}{angles}\PYG{p}{,} \PYG{n}{labels}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{fmt}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+si}{\PYGZpc{}d}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{frac} \PYG{o}{=} \PYG{l+m+mf}{1.1}\PYG{p}{)} \end{sphinxVerbatim} set the angles at which to place the theta grids (these gridlines are equal along the theta dimension). \sphinxstyleemphasis{angles} is in degrees. \sphinxstyleemphasis{labels}, if not \sphinxstyleemphasis{None}, is a len(angles) list of strings of the labels to use at each angle. If \sphinxstyleemphasis{labels} is \sphinxstyleemphasis{None}, the labels will be \sphinxcode{\sphinxupquote{fmt\%angle}}. \sphinxstyleemphasis{frac} is the fraction of the polar axes radius at which to place the label (1 is the edge). e.g., 1.05 is outside the axes and 0.95 is inside the axes. Return value is a list of tuples (\sphinxstyleemphasis{lines}, \sphinxstyleemphasis{labels}): \begin{itemize} \item {} \sphinxstyleemphasis{lines} are {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} instances \item {} \sphinxstyleemphasis{labels} are {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. \end{itemize} Note that on input, the \sphinxstyleemphasis{labels} argument is a list of strings, and on output it is a list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instances. Examples: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} set the locations of the radial gridlines and labels} \PYG{n}{lines}\PYG{p}{,} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{thetagrids}\PYG{p}{(} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{45}\PYG{p}{,}\PYG{l+m+mi}{360}\PYG{p}{,}\PYG{l+m+mi}{90}\PYG{p}{)} \PYG{p}{)} \PYG{c+c1}{\PYGZsh{} set the locations and labels of the radial gridlines and labels} \PYG{n}{lines}\PYG{p}{,} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{thetagrids}\PYG{p}{(} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{45}\PYG{p}{,}\PYG{l+m+mi}{360}\PYG{p}{,}\PYG{l+m+mi}{90}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{NE}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{NW}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{SW}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{SE}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsection{matplotlib.pyplot.tick\_params} \label{\detokenize{api/_as_gen/matplotlib.pyplot.tick_params:matplotlib-pyplot-tick-params}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.tick_params::doc}}\index{tick\_params() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.tick_params:matplotlib.pyplot.tick_params}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{tick\_params}}}{\emph{axis='both'}, \emph{**kwargs}}{} Change the appearance of ticks, tick labels, and gridlines. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{axis}}] \leavevmode{[}\{‘x’, ‘y’, ‘both’\}, optional{]} Which axis to apply the parameters to. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{axis}}] \leavevmode{[}\{‘x’, ‘y’, ‘both’\}{]} Axis on which to operate; default is ‘both’. \item[{\sphinxstylestrong{reset}}] \leavevmode{[}bool{]} If \sphinxstyleemphasis{True}, set all parameters to defaults before processing other keyword arguments. Default is \sphinxstyleemphasis{False}. \item[{\sphinxstylestrong{which}}] \leavevmode{[}\{‘major’, ‘minor’, ‘both’\}{]} Default is ‘major’; apply arguments to \sphinxstyleemphasis{which} ticks. \item[{\sphinxstylestrong{direction}}] \leavevmode{[}\{‘in’, ‘out’, ‘inout’\}{]} Puts ticks inside the axes, outside the axes, or both. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float{]} Tick length in points. \item[{\sphinxstylestrong{width}}] \leavevmode{[}float{]} Tick width in points. \item[{\sphinxstylestrong{color}}] \leavevmode{[}color{]} Tick color; accepts any mpl color spec. \item[{\sphinxstylestrong{pad}}] \leavevmode{[}float{]} Distance in points between tick and label. \item[{\sphinxstylestrong{labelsize}}] \leavevmode{[}float or str{]} Tick label font size in points or as a string (e.g., ‘large’). \item[{\sphinxstylestrong{labelcolor}}] \leavevmode{[}color{]} Tick label color; mpl color spec. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}color{]} Changes the tick color and the label color to the same value: mpl color spec. \item[{\sphinxstylestrong{zorder}}] \leavevmode{[}float{]} Tick and label zorder. \item[{\sphinxstylestrong{bottom, top, left, right}}] \leavevmode{[}bool{]} Whether to draw the respective ticks. \item[{\sphinxstylestrong{labelbottom, labeltop, labelleft, labelright}}] \leavevmode{[}bool{]} Whether to draw the respective tick labels. \item[{\sphinxstylestrong{labelrotation}}] \leavevmode{[}float{]} Tick label rotation \item[{\sphinxstylestrong{grid\_color}}] \leavevmode{[}color{]} Changes the gridline color to the given mpl color spec. \item[{\sphinxstylestrong{grid\_alpha}}] \leavevmode{[}float{]} Transparency of gridlines: 0 (transparent) to 1 (opaque). \item[{\sphinxstylestrong{grid\_linewidth}}] \leavevmode{[}float{]} Width of gridlines in points. \item[{\sphinxstylestrong{grid\_linestyle}}] \leavevmode{[}string{]} Any valid {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} line style spec. \end{description} \end{description}\end{quote} \paragraph{Examples} Usage \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ax}\PYG{o}{.}\PYG{n}{tick\PYGZus{}params}\PYG{p}{(}\PYG{n}{direction}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{out}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{length}\PYG{o}{=}\PYG{l+m+mi}{6}\PYG{p}{,} \PYG{n}{width}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{n}{colors}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{grid\PYGZus{}color}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{grid\PYGZus{}alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \end{sphinxVerbatim} This will make all major ticks be red, pointing out of the box, and with dimensions 6 points by 2 points. Tick labels will also be red. Gridlines will be red and translucent. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.tick\_params}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.tick_params:examples-using-matplotlib-pyplot-tick-params}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_bachelors\_degrees\_by\_gender.py} \end{itemize} \subsection{matplotlib.pyplot.ticklabel\_format} \label{\detokenize{api/_as_gen/matplotlib.pyplot.ticklabel_format:matplotlib-pyplot-ticklabel-format}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.ticklabel_format::doc}}\index{ticklabel\_format() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.ticklabel_format:matplotlib.pyplot.ticklabel_format}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{ticklabel\_format}}}{\emph{**kwargs}}{} Change the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarFormatter}}}}} used by default for linear axes. Optional keyword arguments: \begin{quote} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Keyword &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{style} & {[} ‘sci’ (or ‘scientific’) \textbar{} ‘plain’ {]} plain turns off scientific notation \\ \hline \sphinxstyleemphasis{scilimits} & (m, n), pair of integers; if \sphinxstyleemphasis{style} is ‘sci’, scientific notation will be used for numbers outside the range 10{}`m{}`:sup: to 10{}`n{}`:sup:. Use (0,0) to include all numbers. \\ \hline \sphinxstyleemphasis{useOffset} & {[} bool \textbar{} offset {]}; if True, the offset will be calculated as needed; if False, no offset will be used; if a numeric offset is specified, it will be used. \\ \hline \sphinxstyleemphasis{axis} & {[} ‘x’ \textbar{} ‘y’ \textbar{} ‘both’ {]} \\ \hline \sphinxstyleemphasis{useLocale} & If True, format the number according to the current locale. This affects things such as the character used for the decimal separator. If False, use C-style (English) formatting. The default setting is controlled by the axes.formatter.use\_locale rcparam. \\ \hline \sphinxstyleemphasis{useMathText} & If True, render the offset and scientific notation in mathtext \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{quote} Only the major ticks are affected. If the method is called when the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.ScalarFormatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ScalarFormatter}}}}} is not the {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.Formatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Formatter}}}}} being used, an \sphinxhref{https://docs.python.org/3/library/exceptions.html\#AttributeError}{\sphinxcode{\sphinxupquote{AttributeError}}} will be raised. \end{fulllineitems} \subsection{matplotlib.pyplot.tight\_layout} \label{\detokenize{api/_as_gen/matplotlib.pyplot.tight_layout:matplotlib-pyplot-tight-layout}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.tight_layout::doc}}\index{tight\_layout() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.tight_layout:matplotlib.pyplot.tight_layout}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{tight\_layout}}}{\emph{pad=1.08}, \emph{h\_pad=None}, \emph{w\_pad=None}, \emph{rect=None}}{} Automatically adjust subplot parameters to give specified padding. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{pad}}] \leavevmode{[}float{]} padding between the figure edge and the edges of subplots, as a fraction of the font-size. \item[{\sphinxstylestrong{h\_pad, w\_pad}}] \leavevmode{[}float{]} padding (height/width) between edges of adjacent subplots. Defaults to \sphinxcode{\sphinxupquote{pad\_inches}}. \item[{\sphinxstylestrong{rect}}] \leavevmode{[}if rect is given, it is interpreted as a rectangle{]} (left, bottom, right, top) in the normalized figure coordinate that the whole subplots area (including labels) will fit into. Default is (0, 0, 1, 1). \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.tight\_layout}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.tight_layout:examples-using-matplotlib-pyplot-tight-layout}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_demo\_tight\_layout.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_nan\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_linestyles.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_interpolation\_methods.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_triinterp\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_plot\_streamplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_image\_annotated\_heatmap.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_artist\_reference.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_figlegend\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_engineering\_formatter.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_zorder\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_wire3d\_zero\_stride.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_symlog\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_specialty\_plots\_mri\_with\_eeg.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_texsystem\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_fonts\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_preamble\_sgskip.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/intermediate/tight_layout_guide:sphx-glr-tutorials-intermediate-tight-layout-guide-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Tight Layout guide}}}} \end{itemize} \subsection{matplotlib.pyplot.title} \label{\detokenize{api/_as_gen/matplotlib.pyplot.title:matplotlib-pyplot-title}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.title::doc}}\index{title() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.title:matplotlib.pyplot.title}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{title}}}{\emph{s}, \emph{*args}, \emph{**kwargs}}{} Set a title of the current axes. Set one of the three available axes titles. The available titles are positioned above the axes in the center, flush with the left edge, and flush with the right edge. \sphinxstrong{See also:} See {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.text:matplotlib.pyplot.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text()}}}}} for adding text to the current axes \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{label}}] \leavevmode{[}str{]} Text to use for the title \item[{\sphinxstylestrong{fontdict}}] \leavevmode{[}dict{]} A dictionary controlling the appearance of the title text, the default \sphinxcode{\sphinxupquote{fontdict}} is: \begin{quote} \{‘fontsize’: rcParams{[}‘axes.titlesize’{]}, ‘fontweight’ : rcParams{[}‘axes.titleweight’{]}, ‘verticalalignment’: ‘baseline’, ‘horizontalalignment’: loc\} \end{quote} \item[{\sphinxstylestrong{loc}}] \leavevmode{[}\{‘center’, ‘left’, ‘right’\}, str, optional{]} Which title to set, defaults to ‘center’ \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{text}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}}{]} The matplotlib text instance representing the title \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{kwargs}}] \leavevmode{[}text properties{]} Other keyword arguments are text properties, see {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} for a list of valid text properties. \end{description} \end{description}\end{quote} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.title}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.title:examples-using-matplotlib-pyplot-title}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_api\_sankey\_basics.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_mathtext.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_text.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_scales.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_invert\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_geo\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_figure\_title.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_masked\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_nan\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_bar\_stacked.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_psd\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_corner\_mask.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_quiver\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_label\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_triinterp\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_smooth\_user.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contour\_image.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_triplot\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tripcolor\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_smooth\_delaunay.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_titles\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_text\_fontdict.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_fonteffects.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_multiline.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_font\_table\_ttf\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_style\_sheets\_plot\_solarizedlight2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_xkcd.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_trifinder\_event\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_ginput\_manual\_clabel\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_tight\_bbox\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_set\_and\_get.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_findobj\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_zorder\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_contour\_manual.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_multipage\_pdf.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_table\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_custom\_scale.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_user\_interfaces\_svg\_histogram\_sgskip.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/usage:sphx-glr-tutorials-introductory-usage-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Usage Guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \subsection{matplotlib.pyplot.tricontour} \label{\detokenize{api/_as_gen/matplotlib.pyplot.tricontour:matplotlib-pyplot-tricontour}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.tricontour::doc}}\index{tricontour() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.tricontour:matplotlib.pyplot.tricontour}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{tricontour}}}{\emph{*args}, \emph{**kwargs}}{} Draw contours on an unstructured triangular grid. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tricontour:matplotlib.pyplot.tricontour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tricontour()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tricontourf:matplotlib.pyplot.tricontourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tricontourf()}}}}} draw contour lines and filled contours, respectively. Except as noted, function signatures and return values are the same for both versions. The triangulation can be specified in one of two ways; either: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{triangulation}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} where triangulation is a {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.tri.Triangulation}}}}} object, or \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{o}{=}\PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{mask}\PYG{o}{=}\PYG{n}{mask}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{n}{mask}\PYG{o}{=}\PYG{n}{mask}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} in which case a Triangulation object will be created. See {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} for a explanation of these possibilities. The remaining arguments may be: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxstyleemphasis{Z} is the array of values to contour, one per point in the triangulation. The level values are chosen automatically. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{N}\PYG{p}{)} \end{sphinxVerbatim} contour up to \sphinxstyleemphasis{N+1} automatically chosen contour levels (\sphinxstyleemphasis{N} intervals). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{V}\PYG{p}{)} \end{sphinxVerbatim} draw contour lines at the values specified in sequence \sphinxstyleemphasis{V}, which must be in increasing order. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontourf}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{V}\PYG{p}{)} \end{sphinxVerbatim} fill the (len(\sphinxstyleemphasis{V})-1) regions between the values in \sphinxstyleemphasis{V}, which must be in increasing order. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Use keyword args to control colors, linewidth, origin, cmap … see below for more details. \sphinxcode{\sphinxupquote{C = tricontour(...)}} returns a \sphinxcode{\sphinxupquote{TriContourSet}} object. Optional keyword arguments: \begin{quote} \sphinxstyleemphasis{colors}: {[} \sphinxstyleemphasis{None} \textbar{} string \textbar{} (mpl\_colors) {]} If \sphinxstyleemphasis{None}, the colormap specified by cmap will be used. If a string, like ‘r’ or ‘red’, all levels will be plotted in this color. If a tuple of matplotlib color args (string, float, rgb, etc), different levels will be plotted in different colors in the order specified. \sphinxstyleemphasis{alpha}: float The alpha blending value \sphinxstyleemphasis{cmap}: {[} \sphinxstyleemphasis{None} \textbar{} Colormap {]} A cm {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}} instance or \sphinxstyleemphasis{None}. If \sphinxstyleemphasis{cmap} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{colors} is \sphinxstyleemphasis{None}, a default Colormap is used. \sphinxstyleemphasis{norm}: {[} \sphinxstyleemphasis{None} \textbar{} Normalize {]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance for scaling data values to colors. If \sphinxstyleemphasis{norm} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{colors} is \sphinxstyleemphasis{None}, the default linear scaling is used. \sphinxstyleemphasis{levels} {[}level0, level1, …, leveln{]} A list of floating point numbers indicating the level curves to draw, in increasing order; e.g., to draw just the zero contour pass \sphinxcode{\sphinxupquote{levels={[}0{]}}} \sphinxstyleemphasis{origin}: {[} \sphinxstyleemphasis{None} \textbar{} ‘upper’ \textbar{} ‘lower’ \textbar{} ‘image’ {]} If \sphinxstyleemphasis{None}, the first value of \sphinxstyleemphasis{Z} will correspond to the lower left corner, location (0,0). If ‘image’, the rc value for \sphinxcode{\sphinxupquote{image.origin}} will be used. This keyword is not active if \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are specified in the call to contour. \sphinxstyleemphasis{extent}: {[} \sphinxstyleemphasis{None} \textbar{} (x0,x1,y0,y1) {]} If \sphinxstyleemphasis{origin} is not \sphinxstyleemphasis{None}, then \sphinxstyleemphasis{extent} is interpreted as in {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.imshow()}}}}}: it gives the outer pixel boundaries. In this case, the position of Z{[}0,0{]} is the center of the pixel, not a corner. If \sphinxstyleemphasis{origin} is \sphinxstyleemphasis{None}, then (\sphinxstyleemphasis{x0}, \sphinxstyleemphasis{y0}) is the position of Z{[}0,0{]}, and (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) is the position of Z{[}-1,-1{]}. This keyword is not active if \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are specified in the call to contour. \sphinxstyleemphasis{locator}: {[} \sphinxstyleemphasis{None} \textbar{} ticker.Locator subclass {]} If \sphinxstyleemphasis{locator} is None, the default {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MaxNLocator}}}}} is used. The locator is used to determine the contour levels if they are not given explicitly via the \sphinxstyleemphasis{V} argument. \sphinxstyleemphasis{extend}: {[} ‘neither’ \textbar{} ‘both’ \textbar{} ‘min’ \textbar{} ‘max’ {]} Unless this is ‘neither’, contour levels are automatically added to one or both ends of the range so that all data are included. These added ranges are then mapped to the special colormap values which default to the ends of the colormap range, but can be set via {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_under}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap.set\_under()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_over}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap.set\_over()}}}}} methods. \sphinxstyleemphasis{xunits}, \sphinxstyleemphasis{yunits}: {[} \sphinxstyleemphasis{None} \textbar{} registered units {]} Override axis units by specifying an instance of a {\hyperref[\detokenize{api/units_api:matplotlib.units.ConversionInterface}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.units.ConversionInterface}}}}}. \end{quote} tricontour-only keyword arguments: \begin{quote} \sphinxstyleemphasis{linewidths}: {[} \sphinxstyleemphasis{None} \textbar{} number \textbar{} tuple of numbers {]} If \sphinxstyleemphasis{linewidths} is \sphinxstyleemphasis{None}, the default width in \sphinxcode{\sphinxupquote{lines.linewidth}} in \sphinxcode{\sphinxupquote{matplotlibrc}} is used. If a number, all levels will be plotted with this linewidth. If a tuple, different levels will be plotted with different linewidths in the order specified \sphinxstyleemphasis{linestyles}: {[} \sphinxstyleemphasis{None} \textbar{} ‘solid’ \textbar{} ‘dashed’ \textbar{} ‘dashdot’ \textbar{} ‘dotted’ {]} If \sphinxstyleemphasis{linestyles} is \sphinxstyleemphasis{None}, the ‘solid’ is used. \sphinxstyleemphasis{linestyles} can also be an iterable of the above strings specifying a set of linestyles to be used. If this iterable is shorter than the number of contour levels it will be repeated as necessary. If contour is using a monochrome colormap and the contour level is less than 0, then the linestyle specified in \sphinxcode{\sphinxupquote{contour.negative\_linestyle}} in \sphinxcode{\sphinxupquote{matplotlibrc}} will be used. \end{quote} tricontourf-only keyword arguments: \begin{quote} \sphinxstyleemphasis{antialiased}: bool enable antialiasing \end{quote} Note: tricontourf fills intervals that are closed at the top; that is, for boundaries \sphinxstyleemphasis{z1} and \sphinxstyleemphasis{z2}, the filled region is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{z1} \PYG{o}{\PYGZlt{}} \PYG{n}{z} \PYG{o}{\PYGZlt{}}\PYG{o}{=} \PYG{n}{z2} \end{sphinxVerbatim} There is one exception: if the lowest boundary coincides with the minimum value of the \sphinxstyleemphasis{z} array, then that minimum value will be included in the lowest interval. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.tricontour}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.tricontour:examples-using-matplotlib-pyplot-tricontour}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_irregulardatagrid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_smooth\_user.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_smooth\_delaunay.py} \end{itemize} \subsection{matplotlib.pyplot.tricontourf} \label{\detokenize{api/_as_gen/matplotlib.pyplot.tricontourf:matplotlib-pyplot-tricontourf}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.tricontourf::doc}}\index{tricontourf() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.tricontourf:matplotlib.pyplot.tricontourf}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{tricontourf}}}{\emph{*args}, \emph{**kwargs}}{} Draw contours on an unstructured triangular grid. {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tricontour:matplotlib.pyplot.tricontour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tricontour()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.tricontourf:matplotlib.pyplot.tricontourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tricontourf()}}}}} draw contour lines and filled contours, respectively. Except as noted, function signatures and return values are the same for both versions. The triangulation can be specified in one of two ways; either: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{triangulation}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} where triangulation is a {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.tri.Triangulation}}}}} object, or \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{o}{=}\PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{mask}\PYG{o}{=}\PYG{n}{mask}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{n}{mask}\PYG{o}{=}\PYG{n}{mask}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} in which case a Triangulation object will be created. See {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} for a explanation of these possibilities. The remaining arguments may be: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxstyleemphasis{Z} is the array of values to contour, one per point in the triangulation. The level values are chosen automatically. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{N}\PYG{p}{)} \end{sphinxVerbatim} contour up to \sphinxstyleemphasis{N+1} automatically chosen contour levels (\sphinxstyleemphasis{N} intervals). \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{V}\PYG{p}{)} \end{sphinxVerbatim} draw contour lines at the values specified in sequence \sphinxstyleemphasis{V}, which must be in increasing order. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontourf}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{V}\PYG{p}{)} \end{sphinxVerbatim} fill the (len(\sphinxstyleemphasis{V})-1) regions between the values in \sphinxstyleemphasis{V}, which must be in increasing order. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tricontour}\PYG{p}{(}\PYG{n}{Z}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Use keyword args to control colors, linewidth, origin, cmap … see below for more details. \sphinxcode{\sphinxupquote{C = tricontour(...)}} returns a \sphinxcode{\sphinxupquote{TriContourSet}} object. Optional keyword arguments: \begin{quote} \sphinxstyleemphasis{colors}: {[} \sphinxstyleemphasis{None} \textbar{} string \textbar{} (mpl\_colors) {]} If \sphinxstyleemphasis{None}, the colormap specified by cmap will be used. If a string, like ‘r’ or ‘red’, all levels will be plotted in this color. If a tuple of matplotlib color args (string, float, rgb, etc), different levels will be plotted in different colors in the order specified. \sphinxstyleemphasis{alpha}: float The alpha blending value \sphinxstyleemphasis{cmap}: {[} \sphinxstyleemphasis{None} \textbar{} Colormap {]} A cm {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Colormap}}}}} instance or \sphinxstyleemphasis{None}. If \sphinxstyleemphasis{cmap} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{colors} is \sphinxstyleemphasis{None}, a default Colormap is used. \sphinxstyleemphasis{norm}: {[} \sphinxstyleemphasis{None} \textbar{} Normalize {]} A {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Normalize:matplotlib.colors.Normalize}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Normalize}}}}} instance for scaling data values to colors. If \sphinxstyleemphasis{norm} is \sphinxstyleemphasis{None} and \sphinxstyleemphasis{colors} is \sphinxstyleemphasis{None}, the default linear scaling is used. \sphinxstyleemphasis{levels} {[}level0, level1, …, leveln{]} A list of floating point numbers indicating the level curves to draw, in increasing order; e.g., to draw just the zero contour pass \sphinxcode{\sphinxupquote{levels={[}0{]}}} \sphinxstyleemphasis{origin}: {[} \sphinxstyleemphasis{None} \textbar{} ‘upper’ \textbar{} ‘lower’ \textbar{} ‘image’ {]} If \sphinxstyleemphasis{None}, the first value of \sphinxstyleemphasis{Z} will correspond to the lower left corner, location (0,0). If ‘image’, the rc value for \sphinxcode{\sphinxupquote{image.origin}} will be used. This keyword is not active if \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are specified in the call to contour. \sphinxstyleemphasis{extent}: {[} \sphinxstyleemphasis{None} \textbar{} (x0,x1,y0,y1) {]} If \sphinxstyleemphasis{origin} is not \sphinxstyleemphasis{None}, then \sphinxstyleemphasis{extent} is interpreted as in {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.imshow:matplotlib.pyplot.imshow}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.imshow()}}}}}: it gives the outer pixel boundaries. In this case, the position of Z{[}0,0{]} is the center of the pixel, not a corner. If \sphinxstyleemphasis{origin} is \sphinxstyleemphasis{None}, then (\sphinxstyleemphasis{x0}, \sphinxstyleemphasis{y0}) is the position of Z{[}0,0{]}, and (\sphinxstyleemphasis{x1}, \sphinxstyleemphasis{y1}) is the position of Z{[}-1,-1{]}. This keyword is not active if \sphinxstyleemphasis{X} and \sphinxstyleemphasis{Y} are specified in the call to contour. \sphinxstyleemphasis{locator}: {[} \sphinxstyleemphasis{None} \textbar{} ticker.Locator subclass {]} If \sphinxstyleemphasis{locator} is None, the default {\hyperref[\detokenize{api/ticker_api:matplotlib.ticker.MaxNLocator}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MaxNLocator}}}}} is used. The locator is used to determine the contour levels if they are not given explicitly via the \sphinxstyleemphasis{V} argument. \sphinxstyleemphasis{extend}: {[} ‘neither’ \textbar{} ‘both’ \textbar{} ‘min’ \textbar{} ‘max’ {]} Unless this is ‘neither’, contour levels are automatically added to one or both ends of the range so that all data are included. These added ranges are then mapped to the special colormap values which default to the ends of the colormap range, but can be set via {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_under}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap.set\_under()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.colors.Colormap:matplotlib.colors.Colormap.set_over}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.colors.Colormap.set\_over()}}}}} methods. \sphinxstyleemphasis{xunits}, \sphinxstyleemphasis{yunits}: {[} \sphinxstyleemphasis{None} \textbar{} registered units {]} Override axis units by specifying an instance of a {\hyperref[\detokenize{api/units_api:matplotlib.units.ConversionInterface}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.units.ConversionInterface}}}}}. \end{quote} tricontour-only keyword arguments: \begin{quote} \sphinxstyleemphasis{linewidths}: {[} \sphinxstyleemphasis{None} \textbar{} number \textbar{} tuple of numbers {]} If \sphinxstyleemphasis{linewidths} is \sphinxstyleemphasis{None}, the default width in \sphinxcode{\sphinxupquote{lines.linewidth}} in \sphinxcode{\sphinxupquote{matplotlibrc}} is used. If a number, all levels will be plotted with this linewidth. If a tuple, different levels will be plotted with different linewidths in the order specified \sphinxstyleemphasis{linestyles}: {[} \sphinxstyleemphasis{None} \textbar{} ‘solid’ \textbar{} ‘dashed’ \textbar{} ‘dashdot’ \textbar{} ‘dotted’ {]} If \sphinxstyleemphasis{linestyles} is \sphinxstyleemphasis{None}, the ‘solid’ is used. \sphinxstyleemphasis{linestyles} can also be an iterable of the above strings specifying a set of linestyles to be used. If this iterable is shorter than the number of contour levels it will be repeated as necessary. If contour is using a monochrome colormap and the contour level is less than 0, then the linestyle specified in \sphinxcode{\sphinxupquote{contour.negative\_linestyle}} in \sphinxcode{\sphinxupquote{matplotlibrc}} will be used. \end{quote} tricontourf-only keyword arguments: \begin{quote} \sphinxstyleemphasis{antialiased}: bool enable antialiasing \end{quote} Note: tricontourf fills intervals that are closed at the top; that is, for boundaries \sphinxstyleemphasis{z1} and \sphinxstyleemphasis{z2}, the filled region is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{z1} \PYG{o}{\PYGZlt{}} \PYG{n}{z} \PYG{o}{\PYGZlt{}}\PYG{o}{=} \PYG{n}{z2} \end{sphinxVerbatim} There is one exception: if the lowest boundary coincides with the minimum value of the \sphinxstyleemphasis{z} array, then that minimum value will be included in the lowest interval. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.tricontourf}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.tricontourf:examples-using-matplotlib-pyplot-tricontourf}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_triinterp\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_irregulardatagrid.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_smooth\_user.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.tripcolor} \label{\detokenize{api/_as_gen/matplotlib.pyplot.tripcolor:matplotlib-pyplot-tripcolor}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.tripcolor::doc}}\index{tripcolor() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.tripcolor:matplotlib.pyplot.tripcolor}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{tripcolor}}}{\emph{*args}, \emph{**kwargs}}{} Create a pseudocolor plot of an unstructured triangular grid. The triangulation can be specified in one of two ways; either: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tripcolor}\PYG{p}{(}\PYG{n}{triangulation}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} where triangulation is a {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.tri.Triangulation}}}}} object, or \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{tripcolor}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tripcolor}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tripcolor}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{o}{=}\PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tripcolor}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{mask}\PYG{o}{=}\PYG{n}{mask}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{tripcolor}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{n}{mask}\PYG{o}{=}\PYG{n}{mask}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} in which case a Triangulation object will be created. See {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} for a explanation of these possibilities. The next argument must be \sphinxstyleemphasis{C}, the array of color values, either one per point in the triangulation if color values are defined at points, or one per triangle in the triangulation if color values are defined at triangles. If there are the same number of points and triangles in the triangulation it is assumed that color values are defined at points; to force the use of color values at triangles use the kwarg \sphinxcode{\sphinxupquote{facecolors=C}} instead of just \sphinxcode{\sphinxupquote{C}}. \sphinxstyleemphasis{shading} may be ‘flat’ (the default) or ‘gouraud’. If \sphinxstyleemphasis{shading} is ‘flat’ and C values are defined at points, the color values used for each triangle are from the mean C of the triangle’s three points. If \sphinxstyleemphasis{shading} is ‘gouraud’ then color values must be defined at points. The remaining kwargs are the same as for {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.pcolor:matplotlib.axes.Axes.pcolor}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{pcolor()}}}}}. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.tripcolor}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.tripcolor:examples-using-matplotlib-pyplot-tripcolor}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tripcolor\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.triplot} \label{\detokenize{api/_as_gen/matplotlib.pyplot.triplot:matplotlib-pyplot-triplot}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.triplot::doc}}\index{triplot() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.triplot:matplotlib.pyplot.triplot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{triplot}}}{\emph{*args}, \emph{**kwargs}}{} Draw a unstructured triangular grid as lines and/or markers. The triangulation to plot can be specified in one of two ways; either: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{triplot}\PYG{p}{(}\PYG{n}{triangulation}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} where triangulation is a {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.tri.Triangulation}}}}} object, or \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{triplot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{triplot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{triplot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{o}{=}\PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{triplot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{mask}\PYG{o}{=}\PYG{n}{mask}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{triplot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{n}{mask}\PYG{o}{=}\PYG{n}{mask}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} in which case a Triangulation object will be created. See {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} for a explanation of these possibilities. The remaining args and kwargs are the same as for {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot()}}}}}. Return a list of 2 {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} containing respectively: \begin{itemize} \item {} the lines plotted for triangles edges \item {} the markers plotted for triangles nodes \end{itemize} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.triplot}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.triplot:examples-using-matplotlib-pyplot-triplot}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_triinterp\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_smooth\_user.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_triplot\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_smooth\_delaunay.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_trifinder\_event\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.twinx} \label{\detokenize{api/_as_gen/matplotlib.pyplot.twinx:matplotlib-pyplot-twinx}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.twinx::doc}}\index{twinx() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.twinx:matplotlib.pyplot.twinx}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{twinx}}}{\emph{ax=None}}{} Make a second axes that shares the \sphinxstyleemphasis{x}-axis. The new axes will overlay \sphinxstyleemphasis{ax} (or the current axes if \sphinxstyleemphasis{ax} is \sphinxstyleemphasis{None}). The ticks for \sphinxstyleemphasis{ax2} will be placed on the right, and the \sphinxstyleemphasis{ax2} instance is returned. \sphinxstrong{See also:} \begin{description} \item[{\sphinxcode{\sphinxupquote{examples/api\_examples/two\_scales.py}}}] \leavevmode For an example \end{description} \end{fulllineitems} \subsection{matplotlib.pyplot.twiny} \label{\detokenize{api/_as_gen/matplotlib.pyplot.twiny:matplotlib-pyplot-twiny}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.twiny::doc}}\index{twiny() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.twiny:matplotlib.pyplot.twiny}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{twiny}}}{\emph{ax=None}}{} Make a second axes that shares the \sphinxstyleemphasis{y}-axis. The new axis will overlay \sphinxstyleemphasis{ax} (or the current axes if \sphinxstyleemphasis{ax} is \sphinxstyleemphasis{None}). The ticks for \sphinxstyleemphasis{ax2} will be placed on the top, and the \sphinxstyleemphasis{ax2} instance is returned. \end{fulllineitems} \subsection{matplotlib.pyplot.uninstall\_repl\_displayhook} \label{\detokenize{api/_as_gen/matplotlib.pyplot.uninstall_repl_displayhook:matplotlib-pyplot-uninstall-repl-displayhook}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.uninstall_repl_displayhook::doc}}\index{uninstall\_repl\_displayhook() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.uninstall_repl_displayhook:matplotlib.pyplot.uninstall_repl_displayhook}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{uninstall\_repl\_displayhook}}}{}{} Uninstalls the matplotlib display hook. \end{fulllineitems} \subsection{matplotlib.pyplot.violinplot} \label{\detokenize{api/_as_gen/matplotlib.pyplot.violinplot:matplotlib-pyplot-violinplot}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.violinplot::doc}}\index{violinplot() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.violinplot:matplotlib.pyplot.violinplot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{violinplot}}}{\emph{dataset}, \emph{positions=None}, \emph{vert=True}, \emph{widths=0.5}, \emph{showmeans=False}, \emph{showextrema=True}, \emph{showmedians=False}, \emph{points=100}, \emph{bw\_method=None}, \emph{hold=None}, \emph{data=None}}{} Make a violin plot. Make a violin plot for each column of \sphinxstyleemphasis{dataset} or each vector in sequence \sphinxstyleemphasis{dataset}. Each filled area extends to represent the entire data range, with optional lines at the mean, the median, the minimum, and the maximum. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{dataset}}] \leavevmode{[}Array or a sequence of vectors.{]} The input data. \item[{\sphinxstylestrong{positions}}] \leavevmode{[}array-like, default = {[}1, 2, …, n{]}{]} Sets the positions of the violins. The ticks and limits are automatically set to match the positions. \item[{\sphinxstylestrong{vert}}] \leavevmode{[}bool, default = True.{]} If true, creates a vertical violin plot. Otherwise, creates a horizontal violin plot. \item[{\sphinxstylestrong{widths}}] \leavevmode{[}array-like, default = 0.5{]} Either a scalar or a vector that sets the maximal width of each violin. The default is 0.5, which uses about half of the available horizontal space. \item[{\sphinxstylestrong{showmeans}}] \leavevmode{[}bool, default = False{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, will toggle rendering of the means. \item[{\sphinxstylestrong{showextrema}}] \leavevmode{[}bool, default = True{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, will toggle rendering of the extrema. \item[{\sphinxstylestrong{showmedians}}] \leavevmode{[}bool, default = False{]} If \sphinxhref{https://docs.python.org/3/library/constants.html\#True}{\sphinxcode{\sphinxupquote{True}}}, will toggle rendering of the medians. \item[{\sphinxstylestrong{points}}] \leavevmode{[}scalar, default = 100{]} Defines the number of points to evaluate each of the gaussian kernel density estimations at. \item[{\sphinxstylestrong{bw\_method}}] \leavevmode{[}str, scalar or callable, optional{]} The method used to calculate the estimator bandwidth. This can be ‘scott’, ‘silverman’, a scalar constant or a callable. If a scalar, this will be used directly as \sphinxcode{\sphinxupquote{kde.factor}}. If a callable, it should take a \sphinxcode{\sphinxupquote{GaussianKDE}} instance as its only parameter and return a scalar. If None (default), ‘scott’ is used. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{result}}] \leavevmode{[}dict{]} A dictionary mapping each component of the violinplot to a list of the corresponding collection instances created. The dictionary has the following keys: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{bodies}}: A list of the {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PolyCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.PolyCollection}}}}} instances containing the filled area of each violin. \item {} \sphinxcode{\sphinxupquote{cmeans}}: A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} instance created to identify the mean values of each of the violin’s distribution. \item {} \sphinxcode{\sphinxupquote{cmins}}: A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} instance created to identify the bottom of each violin’s distribution. \item {} \sphinxcode{\sphinxupquote{cmaxes}}: A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} instance created to identify the top of each violin’s distribution. \item {} \sphinxcode{\sphinxupquote{cbars}}: A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} instance created to identify the centers of each violin’s distribution. \item {} \sphinxcode{\sphinxupquote{cmedians}}: A {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}} instance created to identify the median values of each of the violin’s distribution. \end{itemize} \end{description} \end{description}\end{quote} \paragraph{Notes} \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘dataset’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.pyplot.viridis} \label{\detokenize{api/_as_gen/matplotlib.pyplot.viridis:matplotlib-pyplot-viridis}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.viridis::doc}}\index{viridis() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.viridis:matplotlib.pyplot.viridis}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{viridis}}}{}{} Set the colormap to “viridis”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.vlines} \label{\detokenize{api/_as_gen/matplotlib.pyplot.vlines:matplotlib-pyplot-vlines}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.vlines::doc}}\index{vlines() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.vlines:matplotlib.pyplot.vlines}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{vlines}}}{\emph{x}, \emph{ymin}, \emph{ymax}, \emph{colors='k'}, \emph{linestyles='solid'}, \emph{label=''}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Plot vertical lines. Plot vertical lines at each \sphinxstyleemphasis{x} from \sphinxstyleemphasis{ymin} to \sphinxstyleemphasis{ymax}. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}scalar or 1D array\_like{]} x-indexes where to plot the lines. \item[{\sphinxstylestrong{ymin, ymax}}] \leavevmode{[}scalar or 1D array\_like{]} Respective beginning and end of each line. If scalars are provided, all lines will have same length. \item[{\sphinxstylestrong{colors}}] \leavevmode{[}array\_like of colors, optional, default: ‘k’{]} \item[{\sphinxstylestrong{linestyles}}] \leavevmode{[}{[}‘solid’ \textbar{} ‘dashed’ \textbar{} ‘dashdot’ \textbar{} ‘dotted’{]}, optional{]} \item[{\sphinxstylestrong{label}}] \leavevmode{[}string, optional, default: ‘’{]} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lines}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}}{]} \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} properties.{]} \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.hlines:matplotlib.pyplot.hlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hlines}}}}}}] \leavevmode horizontal lines \item[{{\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.axvline:matplotlib.pyplot.axvline}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axvline}}}}}}] \leavevmode vertical line across the axes \item[{\sphinxcode{\sphinxupquote{}}}] \leavevmode In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: * All arguments with the following names: ‘colors’, ‘x’, ‘ymax’, ‘ymin’. \end{description} \end{fulllineitems} \subsection{matplotlib.pyplot.waitforbuttonpress} \label{\detokenize{api/_as_gen/matplotlib.pyplot.waitforbuttonpress:matplotlib-pyplot-waitforbuttonpress}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.waitforbuttonpress::doc}}\index{waitforbuttonpress() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.waitforbuttonpress:matplotlib.pyplot.waitforbuttonpress}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{waitforbuttonpress}}}{\emph{*args}, \emph{**kwargs}}{} Blocking call to interact with the figure. This will return True is a key was pressed, False if a mouse button was pressed and None if \sphinxstyleemphasis{timeout} was reached without either being pressed. If \sphinxstyleemphasis{timeout} is negative, does not timeout. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.waitforbuttonpress}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.waitforbuttonpress:examples-using-matplotlib-pyplot-waitforbuttonpress}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_event\_handling\_ginput\_manual\_clabel\_sgskip.py} \end{itemize} \subsection{matplotlib.pyplot.winter} \label{\detokenize{api/_as_gen/matplotlib.pyplot.winter:matplotlib-pyplot-winter}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.winter::doc}}\index{winter() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.winter:matplotlib.pyplot.winter}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{winter}}}{}{} Set the colormap to “winter”. This changes the default colormap as well as the colormap of the current image if there is one. See \sphinxcode{\sphinxupquote{help(colormaps)}} for more information. \end{fulllineitems} \subsection{matplotlib.pyplot.xcorr} \label{\detokenize{api/_as_gen/matplotlib.pyplot.xcorr:matplotlib-pyplot-xcorr}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.xcorr::doc}}\index{xcorr() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.xcorr:matplotlib.pyplot.xcorr}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{xcorr}}}{\emph{x}, \emph{y}, \emph{normed=True}, \emph{detrend=\textless{}function detrend\_none\textgreater{}}, \emph{usevlines=True}, \emph{maxlags=10}, \emph{hold=None}, \emph{data=None}, \emph{**kwargs}}{} Plot the cross correlation between \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. The correlation with lag k is defined as sum\_n x{[}n+k{]} * conj(y{[}n{]}). \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x}}] \leavevmode{[}sequence of scalars of length n{]} \item[{\sphinxstylestrong{y}}] \leavevmode{[}sequence of scalars of length n{]} \item[{\sphinxstylestrong{hold}}] \leavevmode{[}bool, optional, \sphinxstyleemphasis{deprecated}, default: True{]} \item[{\sphinxstylestrong{detrend}}] \leavevmode{[}callable, optional, default: \sphinxcode{\sphinxupquote{mlab.detrend\_none}}{]} \sphinxstyleemphasis{x} is detrended by the \sphinxstyleemphasis{detrend} callable. Default is no normalization. \item[{\sphinxstylestrong{normed}}] \leavevmode{[}bool, optional, default: True{]} If \sphinxcode{\sphinxupquote{True}}, input vectors are normalised to unit length. \item[{\sphinxstylestrong{usevlines}}] \leavevmode{[}bool, optional, default: True{]} If \sphinxcode{\sphinxupquote{True}}, \sphinxcode{\sphinxupquote{Axes.vlines}} is used to plot the vertical lines from the origin to the acorr. Otherwise, \sphinxcode{\sphinxupquote{Axes.plot}} is used. \item[{\sphinxstylestrong{maxlags}}] \leavevmode{[}int, optional{]} Number of lags to show. If None, will return all \sphinxcode{\sphinxupquote{2 * len(x) - 1}} lags. Default is 10. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{lags}}] \leavevmode{[}array (lenth \sphinxcode{\sphinxupquote{2*maxlags+1}}){]} lag vector. \item[{\sphinxstylestrong{c}}] \leavevmode{[}array (length \sphinxcode{\sphinxupquote{2*maxlags+1}}){]} auto correlation vector. \item[{\sphinxstylestrong{line}}] \leavevmode{[}{\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} or {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}}{]} {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} added to the axes of the correlation \begin{quote} {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} if \sphinxstyleemphasis{usevlines} is True {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} if \sphinxstyleemphasis{usevlines} is False \end{quote} \item[{\sphinxstylestrong{b}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} or None{]} Horizontal line at 0 if \sphinxstyleemphasis{usevlines} is True None \sphinxstyleemphasis{usevlines} is False \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{linestyle}}] \leavevmode{[}{\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} property, optional{]} Only used if usevlines is \sphinxcode{\sphinxupquote{False}}. \item[{\sphinxstylestrong{marker}}] \leavevmode{[}string, optional{]} Default is ‘o’. \end{description} \end{description}\end{quote} \paragraph{Notes} The cross correlation is performed with \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.correlate.html\#numpy.correlate}{\sphinxcode{\sphinxupquote{numpy.correlate()}}} with \sphinxcode{\sphinxupquote{mode = 2}}. \begin{sphinxadmonition}{note}{Note:} In addition to the above described arguments, this function can take a \sphinxstylestrong{data} keyword argument. If such a \sphinxstylestrong{data} argument is given, the following arguments are replaced by \sphinxstylestrong{data{[}\textless{}arg\textgreater{}{]}}: \begin{itemize} \item {} All arguments with the following names: ‘x’, ‘y’. \end{itemize} \end{sphinxadmonition} \end{fulllineitems} \subsection{matplotlib.pyplot.xkcd} \label{\detokenize{api/_as_gen/matplotlib.pyplot.xkcd:matplotlib-pyplot-xkcd}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.xkcd::doc}}\index{xkcd() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.xkcd:matplotlib.pyplot.xkcd}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{xkcd}}}{\emph{scale=1}, \emph{length=100}, \emph{randomness=2}}{} Turns on \sphinxhref{https://xkcd.com/}{xkcd} sketch-style drawing mode. This will only have effect on things drawn after this function is called. For best results, the “Humor Sans” font should be installed: it is not included with matplotlib. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}float, optional{]} The amplitude of the wiggle perpendicular to the source line. \item[{\sphinxstylestrong{length}}] \leavevmode{[}float, optional{]} The length of the wiggle along the line. \item[{\sphinxstylestrong{randomness}}] \leavevmode{[}float, optional{]} The scale factor by which the length is shrunken or expanded. \end{description} \end{description}\end{quote} \paragraph{Notes} This function works by a number of rcParams, so it will probably override others you have set before. If you want the effects of this function to be temporary, it can be used as a context manager, for example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{with} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{xkcd}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} This figure will be in XKCD\PYGZhy{}style} \PYG{n}{fig1} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} ...} \PYG{c+c1}{\PYGZsh{} This figure will be in regular style} \PYG{n}{fig2} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.xkcd}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.xkcd:examples-using-matplotlib-pyplot-xkcd}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_xkcd.py} \end{itemize} \subsection{matplotlib.pyplot.xlabel} \label{\detokenize{api/_as_gen/matplotlib.pyplot.xlabel:matplotlib-pyplot-xlabel}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.xlabel::doc}}\index{xlabel() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.xlabel:matplotlib.pyplot.xlabel}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{xlabel}}}{\emph{s}, \emph{*args}, \emph{**kwargs}}{} Set the x-axis label of the current axes. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{xlabel}\PYG{p}{(}\PYG{n}{label}\PYG{p}{,} \PYG{n}{fontdict}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{labelpad}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} This is the pyplot equivalent of calling {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlabel:matplotlib.axes.Axes.set_xlabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xlabel}}}}} on the current axes. See there for a full parameter description. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.xlabel}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.xlabel:examples-using-matplotlib-pyplot-xlabel}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_mathtext.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_text.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_invert\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_figure\_title.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_symbol.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_nan\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_triplot\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tripcolor\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_text\_fontdict.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_multiline.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_style\_sheets\_plot\_solarizedlight2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_xkcd.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_findobj\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_plotfile\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_custom\_scale.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_texsystem\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_fonts\_sgskip.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_preamble\_sgskip.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/usage:sphx-glr-tutorials-introductory-usage-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Usage Guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \subsection{matplotlib.pyplot.xlim} \label{\detokenize{api/_as_gen/matplotlib.pyplot.xlim:matplotlib-pyplot-xlim}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.xlim::doc}}\index{xlim() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.xlim:matplotlib.pyplot.xlim}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{xlim}}}{\emph{*args}, \emph{**kwargs}}{} Get or set the x limits of the current axes. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax} \PYG{o}{=} \PYG{n}{xlim}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} return the current xlim} \PYG{n}{xlim}\PYG{p}{(}\PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{)}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} set the xlim to xmin, xmax} \PYG{n}{xlim}\PYG{p}{(}\PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} set the xlim to xmin, xmax} \end{sphinxVerbatim} If you do not specify args, you can pass \sphinxstyleemphasis{xmin} or \sphinxstyleemphasis{xmax} as kwargs, i.e.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{xlim}\PYG{p}{(}\PYG{n}{xmax}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} adjust the max leaving min unchanged} \PYG{n}{xlim}\PYG{p}{(}\PYG{n}{xmin}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} adjust the min leaving max unchanged} \end{sphinxVerbatim} Setting limits turns autoscaling off for the x-axis. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{xmin, xmax}}] \leavevmode A tuple of the new x-axis limits. \end{description} \end{description}\end{quote} \paragraph{Notes} Calling this function with no arguments (e.g. \sphinxcode{\sphinxupquote{xlim()}}) is the pyplot equivalent of calling {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xlim:matplotlib.axes.Axes.get_xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_xlim}}}}} on the current axes. Calling this function with arguments is the pyplot equivalent of calling {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim:matplotlib.axes.Axes.set_xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xlim}}}}} on the current axes. All arguments are passed though. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.xlim}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.xlim:examples-using-matplotlib-pyplot-xlim}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_invert\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_shared\_axis\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_step\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_errorbar\_limits\_simple.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_ellipse\_rotated.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_fonteffects.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_text\_rotation\_relative\_to\_line.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_arrow\_demo.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/frame_grabbing_sgskip:sphx-glr-gallery-animation-frame-grabbing-sgskip-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Frame grabbing}}}} \end{itemize} \subsection{matplotlib.pyplot.xscale} \label{\detokenize{api/_as_gen/matplotlib.pyplot.xscale:matplotlib-pyplot-xscale}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.xscale::doc}}\index{xscale() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.xscale:matplotlib.pyplot.xscale}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{xscale}}}{\emph{*args}, \emph{**kwargs}}{} Set the scaling of the x-axis. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{xscale}\PYG{p}{(}\PYG{n}{scale}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}{[}‘linear’ \textbar{} ‘log’ \textbar{} ‘logit’ \textbar{} ‘symlog’{]}{]} The scaling type. \item[{\sphinxstylestrong{**kwargs}}] \leavevmode Additional parameters depend on \sphinxstyleemphasis{scale}. See Notes. \end{description} \end{description}\end{quote} \paragraph{Notes} This is the pyplot equivalent of calling {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xscale:matplotlib.axes.Axes.set_xscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xscale}}}}} on the current axes. Different keywords may be accepted, depending on the scale: \begin{quote} ‘linear’ ‘log’ \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{basex}/\sphinxstyleemphasis{basey}:}] \leavevmode The base of the logarithm \item[{\sphinxstyleemphasis{nonposx}/\sphinxstyleemphasis{nonposy}: {[}‘mask’ \textbar{} ‘clip’ {]}}] \leavevmode non-positive values in \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} can be masked as invalid, or clipped to a very small positive number \item[{\sphinxstyleemphasis{subsx}/\sphinxstyleemphasis{subsy}:}] \leavevmode Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale: \sphinxcode{\sphinxupquote{{[}2, 3, 4, 5, 6, 7, 8, 9{]}}} will place 8 logarithmically spaced minor ticks between each major tick. \end{description} \end{quote} ‘logit’ \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{nonpos}: {[}‘mask’ \textbar{} ‘clip’ {]}}] \leavevmode values beyond {]}0, 1{[} can be masked as invalid, or clipped to a number very close to 0 or 1 \end{description} \end{quote} ‘symlog’ \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{basex}/\sphinxstyleemphasis{basey}:}] \leavevmode The base of the logarithm \item[{\sphinxstyleemphasis{linthreshx}/\sphinxstyleemphasis{linthreshy}:}] \leavevmode A single float which defines the range (-\sphinxstyleemphasis{x}, \sphinxstyleemphasis{x}), within which the plot is linear. This avoids having the plot go to infinity around zero. \item[{\sphinxstyleemphasis{subsx}/\sphinxstyleemphasis{subsy}:}] \leavevmode Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale: \sphinxcode{\sphinxupquote{{[}2, 3, 4, 5, 6, 7, 8, 9{]}}} will place 8 logarithmically spaced minor ticks between each major tick. \item[{\sphinxstyleemphasis{linscalex}/\sphinxstyleemphasis{linscaley}:}] \leavevmode This allows the linear range (-\sphinxstyleemphasis{linthresh} to \sphinxstyleemphasis{linthresh}) to be stretched relative to the logarithmic range. Its value is the number of decades to use for each half of the linear range. For example, when \sphinxstyleemphasis{linscale} == 1.0 (the default), the space used for the positive and negative halves of the linear range will be equal to one decade in the logarithmic range. \end{description} \end{quote} \end{quote} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.xscale}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.xscale:examples-using-matplotlib-pyplot-xscale}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_symlog\_demo.py} \end{itemize} \subsection{matplotlib.pyplot.xticks} \label{\detokenize{api/_as_gen/matplotlib.pyplot.xticks:matplotlib-pyplot-xticks}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.xticks::doc}}\index{xticks() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.xticks:matplotlib.pyplot.xticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{xticks}}}{\emph{*args}, \emph{**kwargs}}{} Get or set the current tick locations and labels of the x-axis. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{locs}\PYG{p}{,} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{xticks}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Get locations and labels} \PYG{n}{xticks}\PYG{p}{(}\PYG{n}{locs}\PYG{p}{,} \PYG{p}{[}\PYG{n}{labels}\PYG{p}{]}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Set locations and labels} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{locs}}] \leavevmode{[}array\_like{]} A list of positions at which ticks should be placed. You can pass an empty list to disable xticks. \item[{\sphinxstylestrong{labels}}] \leavevmode{[}array\_like, optional{]} A list of explicit labels to place at the given \sphinxstyleemphasis{locs}. \item[{\sphinxstylestrong{**kwargs}}] \leavevmode {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} properties can be used to control the appearance of the labels. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{locs}}] \leavevmode An array of label locations. \item[{\sphinxstylestrong{labels}}] \leavevmode A list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} objects. \end{description} \end{description}\end{quote} \paragraph{Notes} Calling this function with no arguments (e.g. \sphinxcode{\sphinxupquote{xticks()}}) is the pyplot equivalent of calling {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xticks:matplotlib.axes.Axes.get_xticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_xticks}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_xticklabels:matplotlib.axes.Axes.get_xticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_xticklabels}}}}} on the current axes. Calling this function with arguments is the pyplot equivalent of calling {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xticks:matplotlib.axes.Axes.set_xticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xticks}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xticklabels:matplotlib.axes.Axes.set_xticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xticklabels}}}}} on the current axes. \paragraph{Examples} Get the current locations and labels: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{locs}\PYG{p}{,} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{xticks}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} Set label locations: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{xticks}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{step}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} Set text labels: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{xticks}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Tom}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Dick}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Harry}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Sally}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Sue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} Set text labels and properties: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{xticks}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{12}\PYG{p}{)}\PYG{p}{,} \PYG{n}{calendar}\PYG{o}{.}\PYG{n}{month\PYGZus{}name}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{l+m+mi}{13}\PYG{p}{]}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{20}\PYG{p}{)} \end{sphinxVerbatim} Disable xticks: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{xticks}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.xticks}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.xticks:examples-using-matplotlib-pyplot-xticks}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_bar\_stacked.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_linestyles.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_multiline.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_arrow\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_xkcd.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_bachelors\_degrees\_by\_gender.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_colorbar\_of\_inset\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_inset\_locator\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_inset\_locator\_demo2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_table\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_ticklabels\_rotation.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_ticks\_and\_spines\_custom\_ticker1.py} \end{itemize} \subsection{matplotlib.pyplot.ylabel} \label{\detokenize{api/_as_gen/matplotlib.pyplot.ylabel:matplotlib-pyplot-ylabel}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.ylabel::doc}}\index{ylabel() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.ylabel:matplotlib.pyplot.ylabel}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{ylabel}}}{\emph{s}, \emph{*args}, \emph{**kwargs}}{} Set the y-axis label of the current axes. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ylabel}\PYG{p}{(}\PYG{n}{label}\PYG{p}{,} \PYG{n}{fontdict}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{labelpad}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} This is the pyplot equivalent of calling {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylabel:matplotlib.axes.Axes.set_ylabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_ylabel}}}}} on the current axes. See there for a full parameter description. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.ylabel}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.ylabel:examples-using-matplotlib-pyplot-ylabel}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_simple.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_mathtext.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_text.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_invert\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_subplot.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_figure\_title.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_scatter\_symbol.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_nan\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_bar\_stacked.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_contourf\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_triplot\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tricontour\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_images\_contours\_and\_fields\_tripcolor\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_text\_fontdict.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_multiline.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_style\_sheets\_plot\_solarizedlight2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_xkcd.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_tight\_bbox\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_findobj\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_plotfile\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_table\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_symlog\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_custom\_scale.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_userdemo\_pgf\_preamble\_sgskip.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/usage:sphx-glr-tutorials-introductory-usage-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Usage Guide}}}} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \subsection{matplotlib.pyplot.ylim} \label{\detokenize{api/_as_gen/matplotlib.pyplot.ylim:matplotlib-pyplot-ylim}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.ylim::doc}}\index{ylim() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.ylim:matplotlib.pyplot.ylim}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{ylim}}}{\emph{*args}, \emph{**kwargs}}{} Get or set the y-limits of the current axes. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax} \PYG{o}{=} \PYG{n}{ylim}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} return the current ylim} \PYG{n}{ylim}\PYG{p}{(}\PYG{p}{(}\PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax}\PYG{p}{)}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} set the ylim to ymin, ymax} \PYG{n}{ylim}\PYG{p}{(}\PYG{n}{ymin}\PYG{p}{,} \PYG{n}{ymax}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} set the ylim to ymin, ymax} \end{sphinxVerbatim} If you do not specify args, you can alternatively pass \sphinxstyleemphasis{ymin} or \sphinxstyleemphasis{ymax} as kwargs, i.e.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ylim}\PYG{p}{(}\PYG{n}{ymax}\PYG{o}{=}\PYG{l+m+mi}{3}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} adjust the max leaving min unchanged} \PYG{n}{ylim}\PYG{p}{(}\PYG{n}{ymin}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} adjust the min leaving max unchanged} \end{sphinxVerbatim} Setting limits turns autoscaling off for the y-axis. \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ymin, ymax}}] \leavevmode A tuple of the new y-axis limits. \end{description} \end{description}\end{quote} \paragraph{Notes} Calling this function with no arguments (e.g. \sphinxcode{\sphinxupquote{ylim()}}) is the pyplot equivalent of calling {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_ylim:matplotlib.axes.Axes.get_ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_ylim}}}}} on the current axes. Calling this function with arguments is the pyplot equivalent of calling {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:matplotlib.axes.Axes.set_ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_ylim}}}}} on the current axes. All arguments are passed though. \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.ylim}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.ylim:examples-using-matplotlib-pyplot-ylim}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_step\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_errorbar\_limits\_simple.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_shapes\_and\_collections\_ellipse\_rotated.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_fonteffects.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_arrow\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_integral.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{gallery/animation/frame_grabbing_sgskip:sphx-glr-gallery-animation-frame-grabbing-sgskip-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Frame grabbing}}}} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_findobj\_demo.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \subsection{matplotlib.pyplot.yscale} \label{\detokenize{api/_as_gen/matplotlib.pyplot.yscale:matplotlib-pyplot-yscale}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.yscale::doc}}\index{yscale() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.yscale:matplotlib.pyplot.yscale}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{yscale}}}{\emph{*args}, \emph{**kwargs}}{} Set the scaling of the y-axis. Call signature: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{yscale}\PYG{p}{(}\PYG{n}{scale}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{scale}}] \leavevmode{[}{[}‘linear’ \textbar{} ‘log’ \textbar{} ‘logit’ \textbar{} ‘symlog’{]}{]} The scaling type. \item[{\sphinxstylestrong{**kwargs}}] \leavevmode Additional parameters depend on \sphinxstyleemphasis{scale}. See Notes. \end{description} \end{description}\end{quote} \paragraph{Notes} This is the pyplot equivalent of calling {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yscale:matplotlib.axes.Axes.set_yscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_yscale}}}}} on the current axes. Different keywords may be accepted, depending on the scale: \begin{quote} ‘linear’ ‘log’ \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{basex}/\sphinxstyleemphasis{basey}:}] \leavevmode The base of the logarithm \item[{\sphinxstyleemphasis{nonposx}/\sphinxstyleemphasis{nonposy}: {[}‘mask’ \textbar{} ‘clip’ {]}}] \leavevmode non-positive values in \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} can be masked as invalid, or clipped to a very small positive number \item[{\sphinxstyleemphasis{subsx}/\sphinxstyleemphasis{subsy}:}] \leavevmode Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale: \sphinxcode{\sphinxupquote{{[}2, 3, 4, 5, 6, 7, 8, 9{]}}} will place 8 logarithmically spaced minor ticks between each major tick. \end{description} \end{quote} ‘logit’ \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{nonpos}: {[}‘mask’ \textbar{} ‘clip’ {]}}] \leavevmode values beyond {]}0, 1{[} can be masked as invalid, or clipped to a number very close to 0 or 1 \end{description} \end{quote} ‘symlog’ \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{basex}/\sphinxstyleemphasis{basey}:}] \leavevmode The base of the logarithm \item[{\sphinxstyleemphasis{linthreshx}/\sphinxstyleemphasis{linthreshy}:}] \leavevmode A single float which defines the range (-\sphinxstyleemphasis{x}, \sphinxstyleemphasis{x}), within which the plot is linear. This avoids having the plot go to infinity around zero. \item[{\sphinxstyleemphasis{subsx}/\sphinxstyleemphasis{subsy}:}] \leavevmode Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale: \sphinxcode{\sphinxupquote{{[}2, 3, 4, 5, 6, 7, 8, 9{]}}} will place 8 logarithmically spaced minor ticks between each major tick. \item[{\sphinxstyleemphasis{linscalex}/\sphinxstyleemphasis{linscaley}:}] \leavevmode This allows the linear range (-\sphinxstyleemphasis{linthresh} to \sphinxstyleemphasis{linthresh}) to be stretched relative to the logarithmic range. Its value is the number of decades to use for each half of the linear range. For example, when \sphinxstyleemphasis{linscale} == 1.0 (the default), the space used for the positive and negative halves of the linear range will be equal to one decade in the logarithmic range. \end{description} \end{quote} \end{quote} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.yscale}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.yscale:examples-using-matplotlib-pyplot-yscale}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_pyplots\_pyplot\_scales.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_scales\_symlog\_demo.py} \end{itemize} \begin{itemize} \item {} {\hyperref[\detokenize{tutorials/introductory/pyplot:sphx-glr-tutorials-introductory-pyplot-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Pyplot tutorial}}}} \end{itemize} \subsection{matplotlib.pyplot.yticks} \label{\detokenize{api/_as_gen/matplotlib.pyplot.yticks:matplotlib-pyplot-yticks}}\label{\detokenize{api/_as_gen/matplotlib.pyplot.yticks::doc}}\index{yticks() (in module matplotlib.pyplot)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/matplotlib.pyplot.yticks:matplotlib.pyplot.yticks}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.pyplot.}}\sphinxbfcode{\sphinxupquote{yticks}}}{\emph{*args}, \emph{**kwargs}}{} Get or set the current tick locations and labels of the y-axis. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{locs}\PYG{p}{,} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{yticks}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Get locations and labels} \PYG{n}{yticks}\PYG{p}{(}\PYG{n}{locs}\PYG{p}{,} \PYG{p}{[}\PYG{n}{labels}\PYG{p}{]}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Set locations and labels} \end{sphinxVerbatim} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{locs}}] \leavevmode{[}array\_like{]} A list of positions at which ticks should be placed. You can pass an empty list to disable yticks. \item[{\sphinxstylestrong{labels}}] \leavevmode{[}array\_like, optional{]} A list of explicit labels to place at the given \sphinxstyleemphasis{locs}. \item[{\sphinxstylestrong{**kwargs}}] \leavevmode {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} properties can be used to control the appearance of the labels. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{locs}}] \leavevmode An array of label locations. \item[{\sphinxstylestrong{labels}}] \leavevmode A list of {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} objects. \end{description} \end{description}\end{quote} \paragraph{Notes} Calling this function with no arguments (e.g. \sphinxcode{\sphinxupquote{yticks()}}) is the pyplot equivalent of calling {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yticks:matplotlib.axes.Axes.get_yticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_yticks}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yticklabels:matplotlib.axes.Axes.get_yticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_yticklabels}}}}} on the current axes. Calling this function with arguments is the pyplot equivalent of calling {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yticks:matplotlib.axes.Axes.set_yticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_yticks}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yticklabels:matplotlib.axes.Axes.set_yticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_yticklabels}}}}} on the current axes. \paragraph{Examples} Get the current locations and labels: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{locs}\PYG{p}{,} \PYG{n}{labels} \PYG{o}{=} \PYG{n}{yticks}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} Set label locations: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{yticks}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{step}\PYG{o}{=}\PYG{l+m+mf}{0.2}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} Set text labels: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{yticks}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{5}\PYG{p}{)}\PYG{p}{,} \PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Tom}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Dick}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Harry}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Sally}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Sue}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} Set text labels and properties: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{yticks}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{12}\PYG{p}{)}\PYG{p}{,} \PYG{n}{calendar}\PYG{o}{.}\PYG{n}{month\PYGZus{}name}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:}\PYG{l+m+mi}{13}\PYG{p}{]}\PYG{p}{,} \PYG{n}{rotation}\PYG{o}{=}\PYG{l+m+mi}{45}\PYG{p}{)} \end{sphinxVerbatim} Disable yticks: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{yticks}\PYG{p}{(}\PYG{p}{[}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \subsubsection{Examples using \sphinxstyleliteralintitle{\sphinxupquote{matplotlib.pyplot.yticks}}} \label{\detokenize{api/_as_gen/matplotlib.pyplot.yticks:examples-using-matplotlib-pyplot-yticks}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_subplots\_axes\_and\_figures\_axes\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_bar\_stacked.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_lines\_bars\_and\_markers\_linestyles.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_stix\_fonts\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_usetex\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_text\_labels\_and\_annotations\_arrow\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_xkcd.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_showcase\_bachelors\_degrees\_by\_gender.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_demo\_colorbar\_of\_inset\_axes.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_inset\_locator\_demo.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_axes\_grid1\_inset\_locator\_demo2.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_tight\_bbox\_test.py} \end{itemize} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_misc\_table\_demo.py} \end{itemize} \chapter{Toolkits} \label{\detokenize{api/index:toolkits}} \section{The Matplotlib axes\_grid Toolkit API} \label{\detokenize{api/toolkits/axes_grid:the-matplotlib-axes-grid-toolkit-api}}\label{\detokenize{api/toolkits/axes_grid:axes-grid-api-index}}\label{\detokenize{api/toolkits/axes_grid::doc}}\begin{quote}\begin{description} \item[{Release}] \leavevmode 2.2.2 \item[{Date}] \leavevmode June 28, 2018 \end{description}\end{quote} \subsection{Axes Grid} \label{\detokenize{api/toolkits/axes_grid:axes-grid}} \begin{sphinxadmonition}{note}{Note:} There is an older version of the AxesGrid toolkit, \sphinxcode{\sphinxupquote{axes\_grid}} (instead of \sphinxcode{\sphinxupquote{axes\_grid1}}). The old version had a single namespace for all axes\_grid objects, and in the new version this toolkit was broken into the two modules below. For the documentation on \sphinxcode{\sphinxupquote{axes\_grid}}, see the \sphinxhref{https://matplotlib.org/2.0.1/mpl\_toolkits/axes\_grid/index.html\#toolkit-axesgrid-index}{previous version of the docs}. \end{sphinxadmonition} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.axes_grid1:module-mpl_toolkits.axes_grid1}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axes\_grid1}}}}} & \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.axisartist:module-mpl_toolkits.axisartist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axisartist}}}}} & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{mpl\_toolkits.axes\_grid1} \label{\detokenize{api/_as_gen/mpl_toolkits.axes_grid1:module-mpl_toolkits.axes_grid1}}\label{\detokenize{api/_as_gen/mpl_toolkits.axes_grid1:mpl-toolkits-axes-grid1}}\label{\detokenize{api/_as_gen/mpl_toolkits.axes_grid1::doc}}\index{mpl\_toolkits.axes\_grid1 (module)} \subsubsection{mpl\_toolkits.axisartist} \label{\detokenize{api/_as_gen/mpl_toolkits.axisartist:module-mpl_toolkits.axisartist}}\label{\detokenize{api/_as_gen/mpl_toolkits.axisartist:mpl-toolkits-axisartist}}\label{\detokenize{api/_as_gen/mpl_toolkits.axisartist::doc}}\index{mpl\_toolkits.axisartist (module)} \section{mplot3d API} \label{\detokenize{api/toolkits/mplot3d:mplot3d-api}}\label{\detokenize{api/toolkits/mplot3d:toolkit-mplot3d-api}}\label{\detokenize{api/toolkits/mplot3d::doc}} \begin{sphinxShadowBox} \sphinxstyletopictitle{Contents} \begin{itemize} \item {} \phantomsection\label{\detokenize{api/toolkits/mplot3d:id1}}{\hyperref[\detokenize{api/toolkits/mplot3d:mplot3d-api}]{\sphinxcrossref{mplot3d API}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{api/toolkits/mplot3d:id2}}{\hyperref[\detokenize{api/toolkits/mplot3d:axes3d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axes3d}}}}} \item {} \phantomsection\label{\detokenize{api/toolkits/mplot3d:id3}}{\hyperref[\detokenize{api/toolkits/mplot3d:axis3d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axis3d}}}}} \item {} \phantomsection\label{\detokenize{api/toolkits/mplot3d:id4}}{\hyperref[\detokenize{api/toolkits/mplot3d:art3d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d}}}}} \item {} \phantomsection\label{\detokenize{api/toolkits/mplot3d:id5}}{\hyperref[\detokenize{api/toolkits/mplot3d:art3d-utility-functions}]{\sphinxcrossref{Art3D Utility Functions}}} \item {} \phantomsection\label{\detokenize{api/toolkits/mplot3d:id6}}{\hyperref[\detokenize{api/toolkits/mplot3d:proj3d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d}}}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \subsection{\sphinxstyleliteralintitle{\sphinxupquote{axes3d}}} \label{\detokenize{api/toolkits/mplot3d:axes3d}}\label{\detokenize{api/toolkits/mplot3d:toolkit-mplot3d-axesapi}} \begin{sphinxadmonition}{note}{Note:} Significant effort went into bringing axes3d to feature-parity with regular axes objects for version 1.1.0. However, more work remains. Please report any functions that do not behave as expected as a bug. In addition, help and patches would be greatly appreciated! \end{sphinxadmonition} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axes3d.Axes3D}}}}}(fig{[}, rect{]}) & 3D axes object. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{mpl\_toolkits.mplot3d.axes3d.Axes3D} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl-toolkits-mplot3d-axes3d-axes3d}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D::doc}}\index{Axes3D (class in mpl\_toolkits.mplot3d.axes3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.axes3d.}}\sphinxbfcode{\sphinxupquote{Axes3D}}}{\emph{fig}, \emph{rect=None}, \emph{*args}, \emph{**kwargs}}{} 3D axes object. \index{add\_collection3d() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.add_collection3d}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_collection3d}}}{\emph{col}, \emph{zs=0}, \emph{zdir='z'}}{} Add a 3D collection object to the plot. 2D collection types are converted to a 3D version by modifying the object and adding z coordinate information. \begin{description} \item[{Supported are:}] \leavevmode\begin{itemize} \item {} PolyCollection \item {} LineCollection \item {} PatchCollection \end{itemize} \end{description} \end{fulllineitems} \index{add\_contour\_set() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.add_contour_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_contour\_set}}}{\emph{cset}, \emph{extend3d=False}, \emph{stride=5}, \emph{zdir='z'}, \emph{offset=None}}{}~ \end{fulllineitems} \index{add\_contourf\_set() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.add_contourf_set}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_contourf\_set}}}{\emph{cset}, \emph{zdir='z'}, \emph{offset=None}}{}~ \end{fulllineitems} \index{auto\_scale\_xyz() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.auto_scale_xyz}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{auto\_scale\_xyz}}}{\emph{X}, \emph{Y}, \emph{Z=None}, \emph{had\_data=None}}{}~ \end{fulllineitems} \index{autoscale() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.autoscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale}}}{\emph{enable=True}, \emph{axis='both'}, \emph{tight=None}}{} Convenience method for simple axis view autoscaling. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.autoscale:matplotlib.axes.Axes.autoscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.autoscale()}}}}} for full explanation. Note that this function behaves the same, but for all three axes. Therefore, ‘z’ can be passed for \sphinxstyleemphasis{axis}, and ‘both’ applies to all three axes. \DUrole{versionmodified}{New in version 1.1.0: }This function was added, but not tested. Please report any bugs. \end{fulllineitems} \index{autoscale\_view() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.autoscale_view}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{autoscale\_view}}}{\emph{tight=None}, \emph{scalex=True}, \emph{scaley=True}, \emph{scalez=True}}{} Autoscale the view limits using the data limits. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.autoscale_view:matplotlib.axes.Axes.autoscale_view}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.autoscale\_view()}}}}} for documentation. Note that this function applies to the 3D axes, and as such adds the \sphinxstyleemphasis{scalez} to the function arguments. \DUrole{versionmodified}{Changed in version 1.1.0: }Function signature was changed to better match the 2D version. \sphinxstyleemphasis{tight} is now explicitly a kwarg and placed first. \DUrole{versionmodified}{Changed in version 1.2.1: }This is now fully functional. \end{fulllineitems} \index{bar() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.bar}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{bar}}}{\emph{left}, \emph{height}, \emph{zs=0}, \emph{zdir='z'}, \emph{*args}, \emph{**kwargs}}{} Add 2D bar(s). \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{left} & The x coordinates of the left sides of the bars. \\ \hline \sphinxstyleemphasis{height} & The height of the bars. \\ \hline \sphinxstyleemphasis{zs} & Z coordinate of bars, if one value is specified they will all be placed at the same z. \\ \hline \sphinxstyleemphasis{zdir} & Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Keyword arguments are passed onto {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.bar:matplotlib.axes.Axes.bar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{bar()}}}}}. Returns a {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3DCollection:mpl_toolkits.mplot3d.art3d.Patch3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch3DCollection}}}}} \end{fulllineitems} \index{bar3d() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.bar3d}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{bar3d}}}{\emph{x}, \emph{y}, \emph{z}, \emph{dx}, \emph{dy}, \emph{dz}, \emph{color=None}, \emph{zsort='average'}, \emph{shade=True}, \emph{*args}, \emph{**kwargs}}{} Generate a 3D barplot. This method creates three dimensional barplot where the width, depth, height, and color of the bars can all be uniquely set. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y, z}}] \leavevmode{[}array-like{]} The coordinates of the anchor point of the bars. \item[{\sphinxstylestrong{dx, dy, dz}}] \leavevmode{[}scalar or array-like{]} The width, depth, and height of the bars, respectively. \item[{\sphinxstylestrong{color}}] \leavevmode{[}sequence of valid color specifications, optional{]} The color of the bars can be specified globally or individually. This parameter can be: \begin{itemize} \item {} A single color value, to color all bars the same color. \item {} An array of colors of length N bars, to color each bar independently. \item {} An array of colors of length 6, to color the faces of the bars similarly. \item {} An array of colors of length 6 * N bars, to color each face independently. \end{itemize} When coloring the faces of the boxes specifically, this is the order of the coloring: \begin{enumerate} \item {} -Z (bottom of box) \item {} +Z (top of box) \item {} -Y \item {} +Y \item {} -X \item {} +X \end{enumerate} \item[{\sphinxstylestrong{zsort}}] \leavevmode{[}str, optional{]} The z-axis sorting scheme passed onto {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Poly3DCollection()}}}}} \item[{\sphinxstylestrong{shade}}] \leavevmode{[}bool, optional (default = True){]} When true, this shades the dark sides of the bars (relative to the plot’s source of light). \item[{\sphinxstylestrong{Any additional keyword arguments are passed onto}}] \leavevmode \item[{\sphinxstylestrong{:func:{}`\textasciitilde{}mpl\_toolkits.mplot3d.art3d.Poly3DCollection{}`}}] \leavevmode \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{collection}}] \leavevmode{[}Poly3DCollection{]} A collection of three dimensional polygons representing the bars. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{can\_pan() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.can_pan}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{can\_pan}}}{}{} Return \sphinxstyleemphasis{True} if this axes supports the pan/zoom button functionality. 3D axes objects do not use the pan/zoom button. \end{fulllineitems} \index{can\_zoom() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.can_zoom}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{can\_zoom}}}{}{} Return \sphinxstyleemphasis{True} if this axes supports the zoom box button functionality. 3D axes objects do not use the zoom box button. \end{fulllineitems} \index{cla() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.cla}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{cla}}}{}{} Clear axes \end{fulllineitems} \index{clabel() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.clabel}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{clabel}}}{\emph{*args}, \emph{**kwargs}}{} This function is currently not implemented for 3D axes. Returns \sphinxstyleemphasis{None}. \end{fulllineitems} \index{contour() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.contour}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contour}}}{\emph{X}, \emph{Y}, \emph{Z}, \emph{*args}, \emph{**kwargs}}{} Create a 3D contour plot. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}, & Data values as numpy.arrays \\ \hline \sphinxstyleemphasis{Z} &\\ \hline \sphinxstyleemphasis{extend3d} & Whether to extend contour in 3D (default: False) \\ \hline \sphinxstyleemphasis{stride} & Stride (step size) for extending contour \\ \hline \sphinxstyleemphasis{zdir} & The direction to use: x, y or z (default) \\ \hline \sphinxstyleemphasis{offset} & If specified plot a projection of the contour lines on this position in plane normal to zdir \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} The positional and other keyword arguments are passed on to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contour:matplotlib.axes.Axes.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}} Returns a {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contour:matplotlib.axes.Axes.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour}}}}} \end{fulllineitems} \index{contour3D() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.contour3D}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contour3D}}}{\emph{X}, \emph{Y}, \emph{Z}, \emph{*args}, \emph{**kwargs}}{} Create a 3D contour plot. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}, & Data values as numpy.arrays \\ \hline \sphinxstyleemphasis{Z} &\\ \hline \sphinxstyleemphasis{extend3d} & Whether to extend contour in 3D (default: False) \\ \hline \sphinxstyleemphasis{stride} & Stride (step size) for extending contour \\ \hline \sphinxstyleemphasis{zdir} & The direction to use: x, y or z (default) \\ \hline \sphinxstyleemphasis{offset} & If specified plot a projection of the contour lines on this position in plane normal to zdir \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} The positional and other keyword arguments are passed on to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contour:matplotlib.axes.Axes.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour()}}}}} Returns a {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contour:matplotlib.axes.Axes.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour}}}}} \end{fulllineitems} \index{contourf() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.contourf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contourf}}}{\emph{X}, \emph{Y}, \emph{Z}, \emph{*args}, \emph{**kwargs}}{} Create a 3D contourf plot. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}, & Data values as numpy.arrays \\ \hline \sphinxstyleemphasis{Z} &\\ \hline \sphinxstyleemphasis{zdir} & The direction to use: x, y or z (default) \\ \hline \sphinxstyleemphasis{offset} & If specified plot a projection of the filled contour on this position in plane normal to zdir \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} The positional and keyword arguments are passed on to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contourf:matplotlib.axes.Axes.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}} Returns a {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contourf:matplotlib.axes.Axes.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf}}}}} \DUrole{versionmodified}{Changed in version 1.1.0: }The \sphinxstyleemphasis{zdir} and \sphinxstyleemphasis{offset} kwargs were added. \end{fulllineitems} \index{contourf3D() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.contourf3D}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{contourf3D}}}{\emph{X}, \emph{Y}, \emph{Z}, \emph{*args}, \emph{**kwargs}}{} Create a 3D contourf plot. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}, & Data values as numpy.arrays \\ \hline \sphinxstyleemphasis{Z} &\\ \hline \sphinxstyleemphasis{zdir} & The direction to use: x, y or z (default) \\ \hline \sphinxstyleemphasis{offset} & If specified plot a projection of the filled contour on this position in plane normal to zdir \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} The positional and keyword arguments are passed on to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contourf:matplotlib.axes.Axes.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf()}}}}} Returns a {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contourf:matplotlib.axes.Axes.contourf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contourf}}}}} \DUrole{versionmodified}{Changed in version 1.1.0: }The \sphinxstyleemphasis{zdir} and \sphinxstyleemphasis{offset} kwargs were added. \end{fulllineitems} \index{convert\_zunits() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.convert_zunits}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{convert\_zunits}}}{\emph{z}}{} For artists in an axes, if the zaxis has units support, convert \sphinxstyleemphasis{z} using zaxis unit type \DUrole{versionmodified}{New in version 1.2.1.} \end{fulllineitems} \index{disable\_mouse\_rotation() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.disable_mouse_rotation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{disable\_mouse\_rotation}}}{}{} Disable mouse button callbacks. \end{fulllineitems} \index{draw() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draw everything (plot lines, axes, labels) \end{fulllineitems} \index{format\_coord() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.format_coord}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_coord}}}{\emph{xd}, \emph{yd}}{} Given the 2D view coordinates attempt to guess a 3D coordinate. Looks for the nearest edge to the point and then assumes that the point is at the same z location as the nearest point on the edge. \end{fulllineitems} \index{format\_zdata() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.format_zdata}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{format\_zdata}}}{\emph{z}}{} Return \sphinxstyleemphasis{z} string formatted. This function will use the \sphinxcode{\sphinxupquote{fmt\_zdata}} attribute if it is callable, else will fall back on the zaxis major formatter \end{fulllineitems} \index{get\_autoscale\_on() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_autoscale_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_autoscale\_on}}}{}{} Get whether autoscaling is applied for all axes on plot commands \DUrole{versionmodified}{New in version 1.1.0: }This function was added, but not tested. Please report any bugs. \end{fulllineitems} \index{get\_autoscalez\_on() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_autoscalez_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_autoscalez\_on}}}{}{} Get whether autoscaling for the z-axis is applied on plot commands \DUrole{versionmodified}{New in version 1.1.0: }This function was added, but not tested. Please report any bugs. \end{fulllineitems} \index{get\_axis\_position() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_axis_position}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_axis\_position}}}{}{}~ \end{fulllineitems} \index{get\_axisbelow() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_axisbelow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_axisbelow}}}{}{} Get whether axis below is true or not. For axes3d objects, this will always be \sphinxstyleemphasis{True} \DUrole{versionmodified}{New in version 1.1.0: }This function was added for completeness. \end{fulllineitems} \index{get\_children() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_children}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_children}}}{}{} return a list of child artists \end{fulllineitems} \index{get\_frame\_on() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_frame_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_frame\_on}}}{}{} Get whether the 3D axes panels are drawn. \DUrole{versionmodified}{New in version 1.1.0.} \end{fulllineitems} \index{get\_proj() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_proj}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_proj}}}{}{} Create the projection matrix from the current viewing position. elev stores the elevation angle in the z plane azim stores the azimuth angle in the x,y plane dist is the distance of the eye viewing point from the object point. \end{fulllineitems} \index{get\_w\_lims() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_w_lims}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_w\_lims}}}{}{} Get 3D world limits. \end{fulllineitems} \index{get\_xlim() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_xlim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_xlim}}}{}{} Get the x-axis range \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{xlimits}}] \leavevmode{[}tuple{]} Returns the current x-axis limits as the tuple (\sphinxcode{\sphinxupquote{left}}, \sphinxcode{\sphinxupquote{right}}). \end{description} \end{description}\end{quote} \paragraph{Notes} The x-axis may be inverted, in which case the \sphinxcode{\sphinxupquote{left}} value will be greater than the \sphinxcode{\sphinxupquote{right}} value. \begin{quote} \DUrole{versionmodified}{Changed in version 1.1.0: }This function now correctly refers to the 3D x-limits \end{quote} \end{fulllineitems} \index{get\_xlim3d() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_xlim3d}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_xlim3d}}}{}{} Get the x-axis range \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{xlimits}}] \leavevmode{[}tuple{]} Returns the current x-axis limits as the tuple (\sphinxcode{\sphinxupquote{left}}, \sphinxcode{\sphinxupquote{right}}). \end{description} \end{description}\end{quote} \paragraph{Notes} The x-axis may be inverted, in which case the \sphinxcode{\sphinxupquote{left}} value will be greater than the \sphinxcode{\sphinxupquote{right}} value. \begin{quote} \DUrole{versionmodified}{Changed in version 1.1.0: }This function now correctly refers to the 3D x-limits \end{quote} \end{fulllineitems} \index{get\_ylim() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_ylim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_ylim}}}{}{} Get the y-axis range \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ylimits}}] \leavevmode{[}tuple{]} Returns the current y-axis limits as the tuple (\sphinxcode{\sphinxupquote{bottom}}, \sphinxcode{\sphinxupquote{top}}). \end{description} \end{description}\end{quote} \paragraph{Notes} The y-axis may be inverted, in which case the \sphinxcode{\sphinxupquote{bottom}} value will be greater than the \sphinxcode{\sphinxupquote{top}} value. \begin{quote} \DUrole{versionmodified}{Changed in version 1.1.0: }This function now correctly refers to the 3D y-limits. \end{quote} \end{fulllineitems} \index{get\_ylim3d() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_ylim3d}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_ylim3d}}}{}{} Get the y-axis range \begin{quote}\begin{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{ylimits}}] \leavevmode{[}tuple{]} Returns the current y-axis limits as the tuple (\sphinxcode{\sphinxupquote{bottom}}, \sphinxcode{\sphinxupquote{top}}). \end{description} \end{description}\end{quote} \paragraph{Notes} The y-axis may be inverted, in which case the \sphinxcode{\sphinxupquote{bottom}} value will be greater than the \sphinxcode{\sphinxupquote{top}} value. \begin{quote} \DUrole{versionmodified}{Changed in version 1.1.0: }This function now correctly refers to the 3D y-limits. \end{quote} \end{fulllineitems} \index{get\_zbound() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_zbound}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zbound}}}{}{} Returns the z-axis numerical bounds where: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{lowerBound} \PYG{o}{\PYGZlt{}} \PYG{n}{upperBound} \end{sphinxVerbatim} \DUrole{versionmodified}{New in version 1.1.0: }This function was added, but not tested. Please report any bugs. \end{fulllineitems} \index{get\_zlabel() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_zlabel}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zlabel}}}{}{} Get the z-label text string. \DUrole{versionmodified}{New in version 1.1.0: }This function was added, but not tested. Please report any bugs. \end{fulllineitems} \index{get\_zlim() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_zlim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zlim}}}{}{} Get 3D z limits. \end{fulllineitems} \index{get\_zlim3d() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_zlim3d}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zlim3d}}}{}{} Get 3D z limits. \end{fulllineitems} \index{get\_zmajorticklabels() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_zmajorticklabels}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zmajorticklabels}}}{}{} Get the ztick labels as a list of Text instances \DUrole{versionmodified}{New in version 1.1.0.} \end{fulllineitems} \index{get\_zminorticklabels() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_zminorticklabels}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zminorticklabels}}}{}{} Get the ztick labels as a list of Text instances \begin{sphinxadmonition}{note}{Note:} Minor ticks are not supported. This function was added only for completeness. \end{sphinxadmonition} \DUrole{versionmodified}{New in version 1.1.0.} \end{fulllineitems} \index{get\_zscale() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_zscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zscale}}}{}{}~ \end{fulllineitems} \index{get\_zticklabels() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_zticklabels}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zticklabels}}}{\emph{minor=False}}{} Get ztick labels as a list of Text instances. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yticklabels:matplotlib.axes.Axes.get_yticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.get\_yticklabels()}}}}} for more details. \begin{sphinxadmonition}{note}{Note:} Minor ticks are not supported. \end{sphinxadmonition} \DUrole{versionmodified}{New in version 1.1.0.} \end{fulllineitems} \index{get\_zticklines() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_zticklines}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zticklines}}}{}{} Get ztick lines as a list of Line2D instances. Note that this function is provided merely for completeness. These lines are re-calculated as the display changes. \DUrole{versionmodified}{New in version 1.1.0.} \end{fulllineitems} \index{get\_zticks() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.get_zticks}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_zticks}}}{\emph{minor=False}}{} Return the z ticks as a list of locations See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.get_yticks:matplotlib.axes.Axes.get_yticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.get\_yticks()}}}}} for more details. \begin{sphinxadmonition}{note}{Note:} Minor ticks are not supported. \end{sphinxadmonition} \DUrole{versionmodified}{New in version 1.1.0.} \end{fulllineitems} \index{grid() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.grid}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{grid}}}{\emph{b=True}, \emph{**kwargs}}{} Set / unset 3D grid. \begin{sphinxadmonition}{note}{Note:} Currently, this function does not behave the same as {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.grid:matplotlib.axes.Axes.grid}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.grid()}}}}}, but it is intended to eventually support that behavior. \end{sphinxadmonition} \DUrole{versionmodified}{Changed in version 1.1.0: }This function was changed, but not tested. Please report any bugs. \end{fulllineitems} \index{have\_units() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.have_units}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{have\_units}}}{}{} Return \sphinxstyleemphasis{True} if units are set on the \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}, or \sphinxstyleemphasis{z} axes \end{fulllineitems} \index{invert\_zaxis() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.invert_zaxis}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{invert\_zaxis}}}{}{} Invert the z-axis. \DUrole{versionmodified}{New in version 1.1.0: }This function was added, but not tested. Please report any bugs. \end{fulllineitems} \index{locator\_params() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.locator_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{locator\_params}}}{\emph{axis='both'}, \emph{tight=None}, \emph{**kwargs}}{} Convenience method for controlling tick locators. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.locator_params:matplotlib.axes.Axes.locator_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.locator\_params()}}}}} for full documentation Note that this is for Axes3D objects, therefore, setting \sphinxstyleemphasis{axis} to ‘both’ will result in the parameters being set for all three axes. Also, \sphinxstyleemphasis{axis} can also take a value of ‘z’ to apply parameters to the z axis. \DUrole{versionmodified}{New in version 1.1.0: }This function was added, but not tested. Please report any bugs. \end{fulllineitems} \index{margins() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.margins}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{margins}}}{\emph{*args}, \emph{**kw}}{} Convenience method to set or retrieve autoscaling margins. \begin{description} \item[{signatures::}] \leavevmode margins() \end{description} returns xmargin, ymargin, zmargin \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{margins}\PYG{p}{(}\PYG{n}{margin}\PYG{p}{)} \PYG{n}{margins}\PYG{p}{(}\PYG{n}{xmargin}\PYG{p}{,} \PYG{n}{ymargin}\PYG{p}{,} \PYG{n}{zmargin}\PYG{p}{)} \PYG{n}{margins}\PYG{p}{(}\PYG{n}{x}\PYG{o}{=}\PYG{n}{xmargin}\PYG{p}{,} \PYG{n}{y}\PYG{o}{=}\PYG{n}{ymargin}\PYG{p}{,} \PYG{n}{z}\PYG{o}{=}\PYG{n}{zmargin}\PYG{p}{)} \PYG{n}{margins}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{tight}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{)} \end{sphinxVerbatim} All forms above set the xmargin, ymargin and zmargin parameters. All keyword parameters are optional. A single argument specifies xmargin, ymargin and zmargin. The \sphinxstyleemphasis{tight} parameter is passed to {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.autoscale_view}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{autoscale\_view()}}}}}, which is executed after a margin is changed; the default here is \sphinxstyleemphasis{True}, on the assumption that when margins are specified, no additional padding to match tick marks is usually desired. Setting \sphinxstyleemphasis{tight} to \sphinxstyleemphasis{None} will preserve the previous setting. Specifying any margin changes only the autoscaling; for example, if \sphinxstyleemphasis{xmargin} is not None, then \sphinxstyleemphasis{xmargin} times the X data interval will be added to each end of that interval before it is used in autoscaling. \DUrole{versionmodified}{New in version 1.1.0: }This function was added, but not tested. Please report any bugs. \end{fulllineitems} \index{mouse\_init() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.mouse_init}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{mouse\_init}}}{\emph{rotate\_btn=1}, \emph{zoom\_btn=3}}{} Initializes mouse button callbacks to enable 3D rotation of the axes. Also optionally sets the mouse buttons for 3D rotation and zooming. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{rotate\_btn} & The integer or list of integers specifying which mouse button or buttons to use for 3D rotation of the axes. Default = 1. \\ \hline \sphinxstyleemphasis{zoom\_btn} & The integer or list of integers specifying which mouse button or buttons to use to zoom the 3D axes. Default = 3. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \end{fulllineitems} \index{name (mpl\_toolkits.mplot3d.axes3d.Axes3D attribute)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.name}}\pysigline{\sphinxbfcode{\sphinxupquote{name}}\sphinxbfcode{\sphinxupquote{ = '3d'}}} \end{fulllineitems} \index{plot() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.plot}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{plot}}}{\emph{xs}, \emph{ys}, \emph{*args}, \emph{**kwargs}}{} Plot 2D or 3D data. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{xs}, \sphinxstyleemphasis{ys} & x, y coordinates of vertices \\ \hline \sphinxstyleemphasis{zs} & z value(s), either one for all points or one for each point. \\ \hline \sphinxstyleemphasis{zdir} & Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Other arguments are passed on to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot()}}}}} \end{fulllineitems} \index{plot3D() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.plot3D}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{plot3D}}}{\emph{xs}, \emph{ys}, \emph{*args}, \emph{**kwargs}}{} Plot 2D or 3D data. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{xs}, \sphinxstyleemphasis{ys} & x, y coordinates of vertices \\ \hline \sphinxstyleemphasis{zs} & z value(s), either one for all points or one for each point. \\ \hline \sphinxstyleemphasis{zdir} & Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Other arguments are passed on to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot()}}}}} \end{fulllineitems} \index{plot\_surface() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.plot_surface}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{plot\_surface}}}{\emph{X}, \emph{Y}, \emph{Z}, \emph{*args}, \emph{**kwargs}}{} Create a surface plot. By default it will be colored in shades of a solid color, but it also supports color mapping by supplying the \sphinxstyleemphasis{cmap} argument. \begin{sphinxadmonition}{note}{Note:} The \sphinxstyleemphasis{rcount} and \sphinxstyleemphasis{ccount} kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. \end{sphinxadmonition} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{X, Y, Z}}] \leavevmode{[}2d arrays{]} Data values. \item[{\sphinxstylestrong{rcount, ccount}}] \leavevmode{[}int{]} Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Defaults to 50. \DUrole{versionmodified}{New in version 2.0.} \item[{\sphinxstylestrong{rstride, cstride}}] \leavevmode{[}int{]} Downsampling stride in each direction. These arguments are mutually exclusive with \sphinxstyleemphasis{rcount} and \sphinxstyleemphasis{ccount}. If only one of \sphinxstyleemphasis{rstride} or \sphinxstyleemphasis{cstride} is set, the other defaults to 10. ‘classic’ mode uses a default of \sphinxcode{\sphinxupquote{rstride = cstride = 10}} instead of the new default of \sphinxcode{\sphinxupquote{rcount = ccount = 50}}. \item[{\sphinxstylestrong{color}}] \leavevmode{[}color-like{]} Color of the surface patches. \item[{\sphinxstylestrong{cmap}}] \leavevmode{[}Colormap{]} Colormap of the surface patches. \item[{\sphinxstylestrong{facecolors}}] \leavevmode{[}array-like of colors.{]} Colors of each individual patch. \item[{\sphinxstylestrong{norm}}] \leavevmode{[}Normalize{]} Normalization for the colormap. \item[{\sphinxstylestrong{vmin, vmax}}] \leavevmode{[}float{]} Bounds for the normalization. \item[{\sphinxstylestrong{shade}}] \leavevmode{[}bool{]} Whether to shade the face colors. \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Other arguments are forwarded to {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Poly3DCollection}}}}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{plot\_trisurf() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.plot_trisurf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{plot\_trisurf}}}{\emph{*args}, \emph{**kwargs}}{}~ \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}, \sphinxstyleemphasis{Z} & Data values as 1D arrays \\ \hline \sphinxstyleemphasis{color} & Color of the surface patches \\ \hline \sphinxstyleemphasis{cmap} & A colormap for the surface patches. \\ \hline \sphinxstyleemphasis{norm} & An instance of Normalize to map values to colors \\ \hline \sphinxstyleemphasis{vmin} & Minimum value to map \\ \hline \sphinxstyleemphasis{vmax} & Maximum value to map \\ \hline \sphinxstyleemphasis{shade} & Whether to shade the facecolors \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} The (optional) triangulation can be specified in one of two ways; either: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plot\PYGZus{}trisurf}\PYG{p}{(}\PYG{n}{triangulation}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} where triangulation is a {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} object, or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plot\PYGZus{}trisurf}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{plot\PYGZus{}trisurf}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{n}{plot\PYGZus{}trisurf}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{triangles}\PYG{o}{=}\PYG{n}{triangles}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} in which case a Triangulation object will be created. See {\hyperref[\detokenize{api/tri_api:matplotlib.tri.Triangulation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Triangulation}}}}} for a explanation of these possibilities. The remaining arguments are: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plot\PYGZus{}trisurf}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{)} \end{sphinxVerbatim} where \sphinxstyleemphasis{Z} is the array of values to contour, one per point in the triangulation. Other arguments are passed on to {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Poly3DCollection}}}}} \sphinxstylestrong{Examples:} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{trisurf3d}.pdf} \end{figure} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{trisurf3d_2}.pdf} \end{figure} \DUrole{versionmodified}{New in version 1.2.0: }This plotting function was added for the v1.2.0 release. \end{fulllineitems} \index{plot\_wireframe() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.plot_wireframe}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{plot\_wireframe}}}{\emph{X}, \emph{Y}, \emph{Z}, \emph{*args}, \emph{**kwargs}}{} Plot a 3D wireframe. \begin{sphinxadmonition}{note}{Note:} The \sphinxstyleemphasis{rcount} and \sphinxstyleemphasis{ccount} kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. \end{sphinxadmonition} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{X, Y, Z}}] \leavevmode{[}2d arrays{]} Data values. \item[{\sphinxstylestrong{rcount, ccount}}] \leavevmode{[}int{]} Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Setting a count to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot. Defaults to 50. \DUrole{versionmodified}{New in version 2.0.} \item[{\sphinxstylestrong{rstride, cstride}}] \leavevmode{[}int{]} Downsampling stride in each direction. These arguments are mutually exclusive with \sphinxstyleemphasis{rcount} and \sphinxstyleemphasis{ccount}. If only one of \sphinxstyleemphasis{rstride} or \sphinxstyleemphasis{cstride} is set, the other defaults to 1. Setting a stride to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot. ‘classic’ mode uses a default of \sphinxcode{\sphinxupquote{rstride = cstride = 1}} instead of the new default of \sphinxcode{\sphinxupquote{rcount = ccount = 50}}. \item[{\sphinxstylestrong{**kwargs :}}] \leavevmode Other arguments are forwarded to {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Line3DCollection:mpl_toolkits.mplot3d.art3d.Line3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line3DCollection}}}}}. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{quiver() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.quiver}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{quiver}}}{\emph{*args}, \emph{**kwargs}}{} Plot a 3D field of arrows. call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{quiver}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{n}{W}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}, \sphinxstyleemphasis{Z}:}] \leavevmode The x, y and z coordinates of the arrow locations (default is tail of arrow; see \sphinxstyleemphasis{pivot} kwarg) \item[{\sphinxstyleemphasis{U}, \sphinxstyleemphasis{V}, \sphinxstyleemphasis{W}:}] \leavevmode The x, y and z components of the arrow vectors \end{description} \end{quote} The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted. Keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{length}: {[}1.0 \textbar{} float{]}}] \leavevmode The length of each quiver, default to 1.0, the unit is the same with the axes \item[{\sphinxstyleemphasis{arrow\_length\_ratio}: {[}0.3 \textbar{} float{]}}] \leavevmode The ratio of the arrow head with respect to the quiver, default to 0.3 \item[{\sphinxstyleemphasis{pivot}: {[} ‘tail’ \textbar{} ‘middle’ \textbar{} ‘tip’ {]}}] \leavevmode The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name \sphinxstyleemphasis{pivot}. Default is ‘tail’ \item[{\sphinxstyleemphasis{normalize}: bool}] \leavevmode When True, all of the arrows will be the same length. This defaults to False, where the arrows will be different lengths depending on the values of u,v,w. \end{description} \end{quote} Any additional keyword arguments are delegated to {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} \end{fulllineitems} \index{quiver3D() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.quiver3D}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{quiver3D}}}{\emph{*args}, \emph{**kwargs}}{} Plot a 3D field of arrows. call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{quiver}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{Z}\PYG{p}{,} \PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{n}{W}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} Arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}, \sphinxstyleemphasis{Z}:}] \leavevmode The x, y and z coordinates of the arrow locations (default is tail of arrow; see \sphinxstyleemphasis{pivot} kwarg) \item[{\sphinxstyleemphasis{U}, \sphinxstyleemphasis{V}, \sphinxstyleemphasis{W}:}] \leavevmode The x, y and z components of the arrow vectors \end{description} \end{quote} The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted. Keyword arguments: \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{length}: {[}1.0 \textbar{} float{]}}] \leavevmode The length of each quiver, default to 1.0, the unit is the same with the axes \item[{\sphinxstyleemphasis{arrow\_length\_ratio}: {[}0.3 \textbar{} float{]}}] \leavevmode The ratio of the arrow head with respect to the quiver, default to 0.3 \item[{\sphinxstyleemphasis{pivot}: {[} ‘tail’ \textbar{} ‘middle’ \textbar{} ‘tip’ {]}}] \leavevmode The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name \sphinxstyleemphasis{pivot}. Default is ‘tail’ \item[{\sphinxstyleemphasis{normalize}: bool}] \leavevmode When True, all of the arrows will be the same length. This defaults to False, where the arrows will be different lengths depending on the values of u,v,w. \end{description} \end{quote} Any additional keyword arguments are delegated to {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}} \end{fulllineitems} \index{scatter() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.scatter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{scatter}}}{\emph{xs}, \emph{ys}, \emph{zs=0}, \emph{zdir='z'}, \emph{s=20}, \emph{c=None}, \emph{depthshade=True}, \emph{*args}, \emph{**kwargs}}{} Create a scatter plot. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{xs}, \sphinxstyleemphasis{ys} & Positions of data points. \\ \hline \sphinxstyleemphasis{zs} & Either an array of the same length as \sphinxstyleemphasis{xs} and \sphinxstyleemphasis{ys} or a single value to place all points in the same plane. Default is 0. \\ \hline \sphinxstyleemphasis{zdir} & Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. \\ \hline \sphinxstyleemphasis{s} & Size in points\textasciicircum{}2. It is a scalar or an array of the same length as \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. \\ \hline \sphinxstyleemphasis{c} & A color. \sphinxstyleemphasis{c} can be a single color format string, or a sequence of color specifications of length \sphinxstyleemphasis{N}, or a sequence of \sphinxstyleemphasis{N} numbers to be mapped to colors using the \sphinxstyleemphasis{cmap} and \sphinxstyleemphasis{norm} specified via kwargs (see below). Note that \sphinxstyleemphasis{c} should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. \sphinxstyleemphasis{c} can be a 2-D array in which the rows are RGB or RGBA, however, including the case of a single row to specify the same color for all points. \\ \hline \sphinxstyleemphasis{depthshade} & Whether or not to shade the scatter markers to give the appearance of depth. Default is \sphinxstyleemphasis{True}. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Keyword arguments are passed on to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.scatter:matplotlib.axes.Axes.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter()}}}}}. Returns a {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3DCollection:mpl_toolkits.mplot3d.art3d.Patch3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch3DCollection}}}}} \end{fulllineitems} \index{scatter3D() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.scatter3D}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{scatter3D}}}{\emph{xs}, \emph{ys}, \emph{zs=0}, \emph{zdir='z'}, \emph{s=20}, \emph{c=None}, \emph{depthshade=True}, \emph{*args}, \emph{**kwargs}}{} Create a scatter plot. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{xs}, \sphinxstyleemphasis{ys} & Positions of data points. \\ \hline \sphinxstyleemphasis{zs} & Either an array of the same length as \sphinxstyleemphasis{xs} and \sphinxstyleemphasis{ys} or a single value to place all points in the same plane. Default is 0. \\ \hline \sphinxstyleemphasis{zdir} & Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. \\ \hline \sphinxstyleemphasis{s} & Size in points\textasciicircum{}2. It is a scalar or an array of the same length as \sphinxstyleemphasis{x} and \sphinxstyleemphasis{y}. \\ \hline \sphinxstyleemphasis{c} & A color. \sphinxstyleemphasis{c} can be a single color format string, or a sequence of color specifications of length \sphinxstyleemphasis{N}, or a sequence of \sphinxstyleemphasis{N} numbers to be mapped to colors using the \sphinxstyleemphasis{cmap} and \sphinxstyleemphasis{norm} specified via kwargs (see below). Note that \sphinxstyleemphasis{c} should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. \sphinxstyleemphasis{c} can be a 2-D array in which the rows are RGB or RGBA, however, including the case of a single row to specify the same color for all points. \\ \hline \sphinxstyleemphasis{depthshade} & Whether or not to shade the scatter markers to give the appearance of depth. Default is \sphinxstyleemphasis{True}. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Keyword arguments are passed on to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.scatter:matplotlib.axes.Axes.scatter}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scatter()}}}}}. Returns a {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3DCollection:mpl_toolkits.mplot3d.art3d.Patch3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch3DCollection}}}}} \end{fulllineitems} \index{set\_autoscale\_on() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_autoscale_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_autoscale\_on}}}{\emph{b}}{} Set whether autoscaling is applied on plot commands \DUrole{versionmodified}{New in version 1.1.0: }This function was added, but not tested. Please report any bugs. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_autoscalez\_on() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_autoscalez_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_autoscalez\_on}}}{\emph{b}}{} Set whether autoscaling for the z-axis is applied on plot commands \DUrole{versionmodified}{New in version 1.1.0: }This function was added, but not tested. Please report any bugs. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_axis\_off() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_axis_off}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_axis\_off}}}{}{} Turn off the axis. \end{fulllineitems} \index{set\_axis\_on() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_axis_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_axis\_on}}}{}{} Turn on the axis. \end{fulllineitems} \index{set\_axisbelow() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_axisbelow}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_axisbelow}}}{\emph{b}}{} Set whether axis ticks and gridlines are above or below most artists. For axes3d objects, this will ignore any settings and just use \sphinxstyleemphasis{True} \DUrole{versionmodified}{New in version 1.1.0: }This function was added for completeness. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_frame\_on() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_frame_on}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_frame\_on}}}{\emph{b}}{} Set whether the 3D axes panels are drawn. \DUrole{versionmodified}{New in version 1.1.0.} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{b}}] \leavevmode{[}bool{]} \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_proj\_type() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_proj_type}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_proj\_type}}}{\emph{proj\_type}}{} Set the projection type. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{proj\_type}}] \leavevmode{[}str{]} Type of projection, accepts ‘persp’ and ‘ortho’. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_title() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_title}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_title}}}{\emph{label}, \emph{fontdict=None}, \emph{loc='center'}, \emph{**kwargs}}{} Set a title for the axes. Set one of the three available axes titles. The available titles are positioned above the axes in the center, flush with the left edge, and flush with the right edge. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{label}}] \leavevmode{[}str{]} Text to use for the title \item[{\sphinxstylestrong{fontdict}}] \leavevmode{[}dict{]} A dictionary controlling the appearance of the title text, the default \sphinxcode{\sphinxupquote{fontdict}} is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{\PYGZob{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{fontsize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes.titlesize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{fontweight}\PYG{l+s+s1}{\PYGZsq{}} \PYG{p}{:} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes.titleweight}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{verticalalignment}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{baseline}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{horizontalalignment}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{loc}\PYG{p}{\PYGZcb{}} \end{sphinxVerbatim} \item[{\sphinxstylestrong{loc}}] \leavevmode{[}\{‘center’, ‘left’, ‘right’\}, str, optional{]} Which title to set, defaults to ‘center’ \item[{\sphinxstylestrong{pad}}] \leavevmode{[}float{]} The offset of the title from the top of the axes, in points. Default is \sphinxcode{\sphinxupquote{None}} to use rcParams{[}‘axes.titlepad’{]}. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{text}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}}{]} The matplotlib text instance representing the title \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} properties{]} Other keyword arguments are text properties, see {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} for a list of valid text properties. \end{description} \end{description}\end{quote} \end{fulllineitems} \index{set\_top\_view() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_top_view}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_top\_view}}}{}{}~ \end{fulllineitems} \index{set\_xlim() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_xlim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_xlim}}}{\emph{left=None}, \emph{right=None}, \emph{emit=True}, \emph{auto=False}, \emph{**kw}}{} Set 3D x limits. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim:matplotlib.axes.Axes.set_xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_xlim()}}}}} for full documentation. \end{fulllineitems} \index{set\_xlim3d() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_xlim3d}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_xlim3d}}}{\emph{left=None}, \emph{right=None}, \emph{emit=True}, \emph{auto=False}, \emph{**kw}}{} Set 3D x limits. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim:matplotlib.axes.Axes.set_xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_xlim()}}}}} for full documentation. \end{fulllineitems} \index{set\_xscale() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_xscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_xscale}}}{\emph{value}, \emph{**kwargs}}{} Set the x-axis scale. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{value}}] \leavevmode{[}\{“linear”, “log”, “symlog”, “logit”\}{]} scaling strategy to apply \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LinearScale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LinearScale}}}}}}] \leavevmode linear transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogTransform}}}}}}] \leavevmode log transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.SymmetricalLogTransform}}}}}}] \leavevmode symlog transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogisticTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogisticTransform}}}}}}] \leavevmode logit transform .. versionadded :: 1.1.0 This function was added, but not tested. Please report any bugs. \end{description} \paragraph{Notes} Different kwargs are accepted, depending on the scale. See the {\hyperref[\detokenize{api/scale_api:module-matplotlib.scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scale}}}}} module for more information. \end{fulllineitems} \index{set\_ylim() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_ylim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_ylim}}}{\emph{bottom=None}, \emph{top=None}, \emph{emit=True}, \emph{auto=False}, \emph{**kw}}{} Set 3D y limits. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:matplotlib.axes.Axes.set_ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_ylim()}}}}} for full documentation. \end{fulllineitems} \index{set\_ylim3d() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_ylim3d}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_ylim3d}}}{\emph{bottom=None}, \emph{top=None}, \emph{emit=True}, \emph{auto=False}, \emph{**kw}}{} Set 3D y limits. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:matplotlib.axes.Axes.set_ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_ylim()}}}}} for full documentation. \end{fulllineitems} \index{set\_yscale() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_yscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_yscale}}}{\emph{value}, \emph{**kwargs}}{} Set the y-axis scale. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{value}}] \leavevmode{[}\{“linear”, “log”, “symlog”, “logit”\}{]} scaling strategy to apply \end{description} \end{description}\end{quote} \sphinxstrong{See also:} \begin{description} \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LinearScale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LinearScale}}}}}}] \leavevmode linear transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogTransform}}}}}}] \leavevmode log transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.SymmetricalLogTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.SymmetricalLogTransform}}}}}}] \leavevmode symlog transform \item[{{\hyperref[\detokenize{api/scale_api:matplotlib.scale.LogisticTransform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.LogisticTransform}}}}}}] \leavevmode logit transform .. versionadded :: 1.1.0 This function was added, but not tested. Please report any bugs. \end{description} \paragraph{Notes} Different kwargs are accepted, depending on the scale. See the {\hyperref[\detokenize{api/scale_api:module-matplotlib.scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{scale}}}}} module for more information. \end{fulllineitems} \index{set\_zbound() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_zbound}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zbound}}}{\emph{lower=None}, \emph{upper=None}}{} Set the lower and upper numerical bounds of the z-axis. This method will honor axes inversion regardless of parameter order. It will not change the \sphinxcode{\sphinxupquote{\_autoscaleZon}} attribute. \DUrole{versionmodified}{New in version 1.1.0: }This function was added, but not tested. Please report any bugs. \end{fulllineitems} \index{set\_zlabel() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_zlabel}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zlabel}}}{\emph{zlabel}, \emph{fontdict=None}, \emph{labelpad=None}, \emph{**kwargs}}{} Set zlabel. See doc for \sphinxcode{\sphinxupquote{set\_ylabel()}} for description. \end{fulllineitems} \index{set\_zlim() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_zlim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zlim}}}{\emph{bottom=None}, \emph{top=None}, \emph{emit=True}, \emph{auto=False}, \emph{**kw}}{} Set 3D z limits. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:matplotlib.axes.Axes.set_ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_ylim()}}}}} for full documentation \end{fulllineitems} \index{set\_zlim3d() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_zlim3d}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zlim3d}}}{\emph{bottom=None}, \emph{top=None}, \emph{emit=True}, \emph{auto=False}, \emph{**kw}}{} Set 3D z limits. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_ylim:matplotlib.axes.Axes.set_ylim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_ylim()}}}}} for full documentation \end{fulllineitems} \index{set\_zmargin() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_zmargin}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zmargin}}}{\emph{m}}{} Set padding of Z data limits prior to autoscaling. \sphinxstyleemphasis{m} times the data interval will be added to each end of that interval before it is used in autoscaling. accepts: float in range 0 to 1 \DUrole{versionmodified}{New in version 1.1.0: }This function was added, but not tested. Please report any bugs. \end{fulllineitems} \index{set\_zscale() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_zscale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zscale}}}{\emph{value}, \emph{**kwargs}}{} Set the scaling of the z-axis: ‘linear’ \textbar{} ‘log’ \textbar{} ‘logit’ \textbar{} ‘symlog’ ACCEPTS: {[}‘linear’ \textbar{} ‘log’ \textbar{} ‘logit’ \textbar{} ‘symlog’{]} \begin{description} \item[{Different kwargs are accepted, depending on the scale:}] \leavevmode ‘linear’ ‘log’ \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{basex}/\sphinxstyleemphasis{basey}:}] \leavevmode The base of the logarithm \item[{\sphinxstyleemphasis{nonposx}/\sphinxstyleemphasis{nonposy}: {[}‘mask’ \textbar{} ‘clip’ {]}}] \leavevmode non-positive values in \sphinxstyleemphasis{x} or \sphinxstyleemphasis{y} can be masked as invalid, or clipped to a very small positive number \item[{\sphinxstyleemphasis{subsx}/\sphinxstyleemphasis{subsy}:}] \leavevmode Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale: \sphinxcode{\sphinxupquote{{[}2, 3, 4, 5, 6, 7, 8, 9{]}}} will place 8 logarithmically spaced minor ticks between each major tick. \end{description} \end{quote} ‘logit’ \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{nonpos}: {[}‘mask’ \textbar{} ‘clip’ {]}}] \leavevmode values beyond {]}0, 1{[} can be masked as invalid, or clipped to a number very close to 0 or 1 \end{description} \end{quote} ‘symlog’ \begin{quote} \begin{description} \item[{\sphinxstyleemphasis{basex}/\sphinxstyleemphasis{basey}:}] \leavevmode The base of the logarithm \item[{\sphinxstyleemphasis{linthreshx}/\sphinxstyleemphasis{linthreshy}:}] \leavevmode A single float which defines the range (-\sphinxstyleemphasis{x}, \sphinxstyleemphasis{x}), within which the plot is linear. This avoids having the plot go to infinity around zero. \item[{\sphinxstyleemphasis{subsx}/\sphinxstyleemphasis{subsy}:}] \leavevmode Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale: \sphinxcode{\sphinxupquote{{[}2, 3, 4, 5, 6, 7, 8, 9{]}}} will place 8 logarithmically spaced minor ticks between each major tick. \item[{\sphinxstyleemphasis{linscalex}/\sphinxstyleemphasis{linscaley}:}] \leavevmode This allows the linear range (-\sphinxstyleemphasis{linthresh} to \sphinxstyleemphasis{linthresh}) to be stretched relative to the logarithmic range. Its value is the number of decades to use for each half of the linear range. For example, when \sphinxstyleemphasis{linscale} == 1.0 (the default), the space used for the positive and negative halves of the linear range will be equal to one decade in the logarithmic range. \end{description} \end{quote} \end{description} \begin{sphinxadmonition}{note}{Note:} Currently, Axes3D objects only supports linear scales. Other scales may or may not work, and support for these is improving with each release. \end{sphinxadmonition} \DUrole{versionmodified}{New in version 1.1.0: }This function was added, but not tested. Please report any bugs. \end{fulllineitems} \index{set\_zticklabels() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_zticklabels}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zticklabels}}}{\emph{*args}, \emph{**kwargs}}{} Set z-axis tick labels. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yticklabels:matplotlib.axes.Axes.set_yticklabels}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_yticklabels()}}}}} for more details. \begin{sphinxadmonition}{note}{Note:} Minor ticks are not supported by Axes3D objects. \end{sphinxadmonition} \DUrole{versionmodified}{New in version 1.1.0.} \end{fulllineitems} \index{set\_zticks() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.set_zticks}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zticks}}}{\emph{*args}, \emph{**kwargs}}{} Set z-axis tick locations. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yticks:matplotlib.axes.Axes.set_yticks}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.set\_yticks()}}}}} for more details. \begin{sphinxadmonition}{note}{Note:} Minor ticks are not supported. \end{sphinxadmonition} \DUrole{versionmodified}{New in version 1.1.0.} \end{fulllineitems} \index{text() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.text}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{text}}}{\emph{x}, \emph{y}, \emph{z}, \emph{s}, \emph{zdir=None}, \emph{**kwargs}}{} Add text to the plot. kwargs will be passed on to Axes.text, except for the \sphinxcode{\sphinxupquote{zdir}} keyword, which sets the direction to be used as the z direction. \end{fulllineitems} \index{text2D() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.text2D}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{text2D}}}{\emph{x}, \emph{y}, \emph{s}, \emph{fontdict=None}, \emph{withdash=False}, \emph{**kwargs}}{} Add text to the axes. Add the text \sphinxstyleemphasis{s} to the axes at location \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y} in data coordinates. \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{x, y}}] \leavevmode{[}scalars{]} The position to place the text. By default, this is in data coordinates. The coordinate system can be changed using the \sphinxstyleemphasis{transform} parameter. \item[{\sphinxstylestrong{s}}] \leavevmode{[}str{]} The text. \item[{\sphinxstylestrong{fontdict}}] \leavevmode{[}dictionary, optional, default: None{]} A dictionary to override the default text properties. If fontdict is None, the defaults are determined by your rc parameters. \item[{\sphinxstylestrong{withdash}}] \leavevmode{[}boolean, optional, default: False{]} Creates a {\hyperref[\detokenize{api/text_api:matplotlib.text.TextWithDash}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{TextWithDash}}}}} instance instead of a {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instance. \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{text}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}}{]} The created {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} instance. \end{description} \item[{Other Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode{[}{\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text}}}}} properties.{]} Other miscellaneous text parameters. \end{description} \end{description}\end{quote} \paragraph{Examples} Individual keyword arguments can be used to override any given parameter: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{text}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{s}\PYG{p}{,} \PYG{n}{fontsize}\PYG{o}{=}\PYG{l+m+mi}{12}\PYG{p}{)} \end{sphinxVerbatim} The default transform specifies that text is in data coords, alternatively, you can specify text in axis coords (0,0 is lower-left and 1,1 is upper-right). The example below places text in the center of the axes: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{text}\PYG{p}{(}\PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+m+mf}{0.5}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{matplotlib}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{horizontalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{g+gp}{... } \PYG{n}{verticalalignment}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{center}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{transform}\PYG{o}{=}\PYG{n}{ax}\PYG{o}{.}\PYG{n}{transAxes}\PYG{p}{)} \end{sphinxVerbatim} You can put a rectangular box around the text instance (e.g., to set a background color) by using the keyword \sphinxcode{\sphinxupquote{bbox}}. \sphinxcode{\sphinxupquote{bbox}} is a dictionary of {\hyperref[\detokenize{api/_as_gen/matplotlib.patches.Rectangle:matplotlib.patches.Rectangle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rectangle}}}}} properties. For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{text}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{s}\PYG{p}{,} \PYG{n}{bbox}\PYG{o}{=}\PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{facecolor}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{red}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} \end{fulllineitems} \index{text3D() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.text3D}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{text3D}}}{\emph{x}, \emph{y}, \emph{z}, \emph{s}, \emph{zdir=None}, \emph{**kwargs}}{} Add text to the plot. kwargs will be passed on to Axes.text, except for the \sphinxcode{\sphinxupquote{zdir}} keyword, which sets the direction to be used as the z direction. \end{fulllineitems} \index{tick\_params() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.tick_params}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tick\_params}}}{\emph{axis='both'}, \emph{**kwargs}}{} Convenience method for changing the appearance of ticks and tick labels. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.tick_params:matplotlib.axes.Axes.tick_params}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.tick\_params()}}}}} for more complete documentation. The only difference is that setting \sphinxstyleemphasis{axis} to ‘both’ will mean that the settings are applied to all three axes. Also, the \sphinxstyleemphasis{axis} parameter also accepts a value of ‘z’, which would mean to apply to only the z-axis. Also, because of how Axes3D objects are drawn very differently from regular 2D axes, some of these settings may have ambiguous meaning. For simplicity, the ‘z’ axis will accept settings as if it was like the ‘y’ axis. \begin{sphinxadmonition}{note}{Note:} While this function is currently implemented, the core part of the Axes3D object may ignore some of these settings. Future releases will fix this. Priority will be given to those who file bugs. \end{sphinxadmonition} \DUrole{versionmodified}{New in version 1.1.0: }This function was added, but not tested. Please report any bugs. \end{fulllineitems} \index{ticklabel\_format() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.ticklabel_format}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{ticklabel\_format}}}{\emph{**kwargs}}{} Convenience method for manipulating the ScalarFormatter used by default for linear axes in Axed3D objects. See {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.ticklabel_format:matplotlib.axes.Axes.ticklabel_format}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.ticklabel\_format()}}}}} for full documentation. Note that this version applies to all three axes of the Axes3D object. Therefore, the \sphinxstyleemphasis{axis} argument will also accept a value of ‘z’ and the value of ‘both’ will apply to all three axes. \DUrole{versionmodified}{New in version 1.1.0: }This function was added, but not tested. Please report any bugs. \end{fulllineitems} \index{tricontour() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.tricontour}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tricontour}}}{\emph{*args}, \emph{**kwargs}}{} Create a 3D contour plot. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}, & Data values as numpy.arrays \\ \hline \sphinxstyleemphasis{Z} &\\ \hline \sphinxstyleemphasis{extend3d} & Whether to extend contour in 3D (default: False) \\ \hline \sphinxstyleemphasis{stride} & Stride (step size) for extending contour \\ \hline \sphinxstyleemphasis{zdir} & The direction to use: x, y or z (default) \\ \hline \sphinxstyleemphasis{offset} & If specified plot a projection of the contour lines on this position in plane normal to zdir \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Other keyword arguments are passed on to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.tricontour:matplotlib.axes.Axes.tricontour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tricontour()}}}}} Returns a {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contour:matplotlib.axes.Axes.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour}}}}} \DUrole{versionmodified}{Changed in version 1.3.0: }Added support for custom triangulations EXPERIMENTAL: This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering. \end{fulllineitems} \index{tricontourf() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.tricontourf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tricontourf}}}{\emph{*args}, \emph{**kwargs}}{} Create a 3D contourf plot. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxstyletheadfamily Argument &\sphinxstyletheadfamily Description \\ \hline \sphinxstyleemphasis{X}, \sphinxstyleemphasis{Y}, & Data values as numpy.arrays \\ \hline \sphinxstyleemphasis{Z} &\\ \hline \sphinxstyleemphasis{zdir} & The direction to use: x, y or z (default) \\ \hline \sphinxstyleemphasis{offset} & If specified plot a projection of the contour lines on this position in plane normal to zdir \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Other keyword arguments are passed on to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.tricontour:matplotlib.axes.Axes.tricontour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{tricontour()}}}}} Returns a {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.contour:matplotlib.axes.Axes.contour}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{contour}}}}} \DUrole{versionmodified}{Changed in version 1.3.0: }Added support for custom triangulations EXPERIMENTAL: This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering. \end{fulllineitems} \index{tunit\_cube() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.tunit_cube}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tunit\_cube}}}{\emph{vals=None}, \emph{M=None}}{}~ \end{fulllineitems} \index{tunit\_edges() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.tunit_edges}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{tunit\_edges}}}{\emph{vals=None}, \emph{M=None}}{}~ \end{fulllineitems} \index{unit\_cube() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.unit_cube}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{unit\_cube}}}{\emph{vals=None}}{}~ \end{fulllineitems} \index{update\_datalim() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.update_datalim}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{update\_datalim}}}{\emph{xys}, \emph{**kwargs}}{} Update the data lim bbox with seq of xy tups or equiv. 2-D array \end{fulllineitems} \index{view\_init() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.view_init}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{view\_init}}}{\emph{elev=None}, \emph{azim=None}}{} Set the elevation and azimuth of the axes. This can be used to rotate the axes programmatically. ‘elev’ stores the elevation angle in the z plane. ‘azim’ stores the azimuth angle in the x,y plane. if elev or azim are None (default), then the initial value is used which was specified in the {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Axes3D}}}}} constructor. \end{fulllineitems} \index{voxels() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.voxels}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{voxels}}}{\sphinxoptional{\emph{x}, \emph{y}, \emph{z}}, \emph{/}, \emph{filled}, \emph{**kwargs}}{} Plot a set of filled voxels All voxels are plotted as 1x1x1 cubes on the axis, with filled{[}0,0,0{]} placed with its lower corner at the origin. Occluded faces are not plotted. Call signatures: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{voxels}\PYG{p}{(}\PYG{n}{filled}\PYG{p}{,} \PYG{n}{facecolors}\PYG{o}{=}\PYG{n}{fc}\PYG{p}{,} \PYG{n}{edgecolors}\PYG{o}{=}\PYG{n}{ec}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{voxels}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{z}\PYG{p}{,} \PYG{n}{filled}\PYG{p}{,} \PYG{n}{facecolors}\PYG{o}{=}\PYG{n}{fc}\PYG{p}{,} \PYG{n}{edgecolors}\PYG{o}{=}\PYG{n}{ec}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} \DUrole{versionmodified}{New in version 2.1.} \begin{quote}\begin{description} \item[{Parameters}] \leavevmode\begin{description} \item[{\sphinxstylestrong{filled}}] \leavevmode{[}3D np.array of bool{]} A 3d array of values, with truthy values indicating which voxels to fill \item[{\sphinxstylestrong{x, y, z}}] \leavevmode{[}3D np.array, optional{]} The coordinates of the corners of the voxels. This should broadcast to a shape one larger in every dimension than the shape of \sphinxcode{\sphinxupquote{filled}}. These can be used to plot non-cubic voxels. If not specified, defaults to increasing integers along each axis, like those returned by \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.indices.html\#numpy.indices}{\sphinxcode{\sphinxupquote{indices()}}}. As indicated by the \sphinxcode{\sphinxupquote{/}} in the function signature, these arguments can only be passed positionally. \item[{\sphinxstylestrong{facecolors, edgecolors}}] \leavevmode{[}array\_like, optional{]} The color to draw the faces and edges of the voxels. Can only be passed as keyword arguments. This parameter can be: \begin{itemize} \item {} A single color value, to color all voxels the same color. This can be either a string, or a 1D rgb/rgba array \item {} \sphinxcode{\sphinxupquote{None}}, the default, to use a single color for the faces, and the style default for the edges. \item {} A 3D ndarray of color names, with each item the color for the corresponding voxel. The size must match the voxels. \item {} A 4D ndarray of rgb/rgba data, with the components along the last axis. \end{itemize} \item[{\sphinxstylestrong{**kwargs}}] \leavevmode Additional keyword arguments to pass onto {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Poly3DCollection()}}}}} \end{description} \item[{Returns}] \leavevmode\begin{description} \item[{\sphinxstylestrong{faces}}] \leavevmode{[}dict{]} A dictionary indexed by coordinate, where \sphinxcode{\sphinxupquote{faces{[}i,j,k{]}}} is a \sphinxcode{\sphinxupquote{Poly3DCollection}} of the faces drawn for the voxel \sphinxcode{\sphinxupquote{filled{[}i,j,k{]}}}. If no faces were drawn for a given voxel, either because it was not asked to be drawn, or it is fully occluded, then \sphinxcode{\sphinxupquote{(i,j,k) not in faces}}. \end{description} \end{description}\end{quote} \paragraph{Examples} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{voxels}.pdf} \end{figure} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{voxels_rgb}.pdf} \end{figure} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{voxels_torus}.pdf} \end{figure} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{voxels_numpy_logo}.pdf} \end{figure} \end{fulllineitems} \index{zaxis\_date() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.zaxis_date}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{zaxis\_date}}}{\emph{tz=None}}{} Sets up z-axis ticks and labels that treat the z data as dates. \sphinxstyleemphasis{tz} is a timezone string or \sphinxcode{\sphinxupquote{tzinfo}} instance. Defaults to rc value. \begin{sphinxadmonition}{note}{Note:} This function is merely provided for completeness. Axes3D objects do not officially support dates for ticks, and so this may or may not work as expected. \end{sphinxadmonition} \DUrole{versionmodified}{New in version 1.1.0: }This function was added, but not tested. Please report any bugs. \end{fulllineitems} \index{zaxis\_inverted() (mpl\_toolkits.mplot3d.axes3d.Axes3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D:mpl_toolkits.mplot3d.axes3d.Axes3D.zaxis_inverted}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{zaxis\_inverted}}}{}{} Returns True if the z-axis is inverted. \DUrole{versionmodified}{New in version 1.1.0: }This function was added, but not tested. Please report any bugs. \end{fulllineitems} \end{fulllineitems} \subsection{\sphinxstyleliteralintitle{\sphinxupquote{axis3d}}} \label{\detokenize{api/toolkits/mplot3d:axis3d}}\label{\detokenize{api/toolkits/mplot3d:toolkit-mplot3d-axisapi}} \begin{sphinxadmonition}{note}{Note:} See \sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.axis3d.\_axinfo}} for a dictionary containing constants that may be modified for controlling the look and feel of mplot3d axes (e.g., label spacing, font colors and panel colors). Historically, axis3d has suffered from having hard-coded constants that precluded user adjustments, and this dictionary was implemented in version 1.1 as a stop-gap measure. \end{sphinxadmonition} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axis3d.Axis:mpl_toolkits.mplot3d.axis3d.Axis}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{axis3d.Axis}}}}}(adir, v\_intervalx, d\_intervalx, …) & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{mpl\_toolkits.mplot3d.axis3d.Axis} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axis3d.Axis:mpl-toolkits-mplot3d-axis3d-axis}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axis3d.Axis::doc}}\index{Axis (class in mpl\_toolkits.mplot3d.axis3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axis3d.Axis:mpl_toolkits.mplot3d.axis3d.Axis}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.axis3d.}}\sphinxbfcode{\sphinxupquote{Axis}}}{\emph{adir}, \emph{v\_intervalx}, \emph{d\_intervalx}, \emph{axes}, \emph{*args}, \emph{**kwargs}}{}~\index{draw() (mpl\_toolkits.mplot3d.axis3d.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axis3d.Axis:mpl_toolkits.mplot3d.axis3d.Axis.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draw the axis lines, grid lines, tick lines and labels \end{fulllineitems} \index{draw\_pane() (mpl\_toolkits.mplot3d.axis3d.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axis3d.Axis:mpl_toolkits.mplot3d.axis3d.Axis.draw_pane}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw\_pane}}}{\emph{renderer}}{}~ \end{fulllineitems} \index{get\_major\_ticks() (mpl\_toolkits.mplot3d.axis3d.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axis3d.Axis:mpl_toolkits.mplot3d.axis3d.Axis.get_major_ticks}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_major\_ticks}}}{\emph{numticks=None}}{} get the tick instances; grow as necessary \end{fulllineitems} \index{get\_rotate\_label() (mpl\_toolkits.mplot3d.axis3d.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axis3d.Axis:mpl_toolkits.mplot3d.axis3d.Axis.get_rotate_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_rotate\_label}}}{\emph{text}}{}~ \end{fulllineitems} \index{get\_tick\_positions() (mpl\_toolkits.mplot3d.axis3d.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axis3d.Axis:mpl_toolkits.mplot3d.axis3d.Axis.get_tick_positions}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_tick\_positions}}}{}{}~ \end{fulllineitems} \index{get\_tightbbox() (mpl\_toolkits.mplot3d.axis3d.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axis3d.Axis:mpl_toolkits.mplot3d.axis3d.Axis.get_tightbbox}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_tightbbox}}}{\emph{renderer}}{} Return a bounding box that encloses the axis. It only accounts tick labels, axis label, and offsetText. \end{fulllineitems} \index{get\_view\_interval() (mpl\_toolkits.mplot3d.axis3d.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axis3d.Axis:mpl_toolkits.mplot3d.axis3d.Axis.get_view_interval}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_view\_interval}}}{}{} return the Interval instance for this 3d axis view limits \end{fulllineitems} \index{init3d() (mpl\_toolkits.mplot3d.axis3d.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axis3d.Axis:mpl_toolkits.mplot3d.axis3d.Axis.init3d}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{init3d}}}{}{}~ \end{fulllineitems} \index{set\_pane\_color() (mpl\_toolkits.mplot3d.axis3d.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axis3d.Axis:mpl_toolkits.mplot3d.axis3d.Axis.set_pane_color}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_pane\_color}}}{\emph{color}}{} Set pane color to a RGBA tuple. \end{fulllineitems} \index{set\_pane\_pos() (mpl\_toolkits.mplot3d.axis3d.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axis3d.Axis:mpl_toolkits.mplot3d.axis3d.Axis.set_pane_pos}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_pane\_pos}}}{\emph{xys}}{}~ \end{fulllineitems} \index{set\_rotate\_label() (mpl\_toolkits.mplot3d.axis3d.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axis3d.Axis:mpl_toolkits.mplot3d.axis3d.Axis.set_rotate_label}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_rotate\_label}}}{\emph{val}}{} Whether to rotate the axis label: True, False or None. If set to None the label will be rotated if longer than 4 chars. \end{fulllineitems} \index{set\_view\_interval() (mpl\_toolkits.mplot3d.axis3d.Axis method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.axis3d.Axis:mpl_toolkits.mplot3d.axis3d.Axis.set_view_interval}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_view\_interval}}}{\emph{vmin}, \emph{vmax}, \emph{ignore=False}}{} If \sphinxstyleemphasis{ignore} is \sphinxstyleemphasis{False}, the order of vmin, vmax does not matter; the original axis orientation will be preserved. In addition, the view limits can be expanded, but will not be reduced. This method is for mpl internal use; for normal use, see {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xlim:matplotlib.axes.Axes.set_xlim}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xlim()}}}}}. \end{fulllineitems} \end{fulllineitems} \subsection{\sphinxstyleliteralintitle{\sphinxupquote{art3d}}} \label{\detokenize{api/toolkits/mplot3d:art3d}}\label{\detokenize{api/toolkits/mplot3d:toolkit-mplot3d-artapi}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Line3D:mpl_toolkits.mplot3d.art3d.Line3D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.Line3D}}}}}(xs, ys, zs, *args, **kwargs) & 3D line object. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Line3DCollection:mpl_toolkits.mplot3d.art3d.Line3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.Line3DCollection}}}}}(segments, *args, **kwargs) & A collection of 3D lines. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3D:mpl_toolkits.mplot3d.art3d.Patch3D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.Patch3D}}}}}(*args, **kwargs) & 3D patch object. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3DCollection:mpl_toolkits.mplot3d.art3d.Patch3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.Patch3DCollection}}}}}(*args, **kwargs) & A collection of 3D patches. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Path3DCollection:mpl_toolkits.mplot3d.art3d.Path3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.Path3DCollection}}}}}(*args, **kwargs) & A collection of 3D paths. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.PathPatch3D:mpl_toolkits.mplot3d.art3d.PathPatch3D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.PathPatch3D}}}}}(path, **kwargs) & 3D PathPatch object. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.Poly3DCollection}}}}}(verts, *args, **kwargs) & A collection of 3D polygons. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Text3D:mpl_toolkits.mplot3d.art3d.Text3D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.Text3D}}}}}({[}x, y, z, text, zdir{]}) & Text object with 3D position and (in the future) direction. \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{mpl\_toolkits.mplot3d.art3d.Line3D} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Line3D:mpl-toolkits-mplot3d-art3d-line3d}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Line3D::doc}}\index{Line3D (class in mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Line3D:mpl_toolkits.mplot3d.art3d.Line3D}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{Line3D}}}{\emph{xs}, \emph{ys}, \emph{zs}, \emph{*args}, \emph{**kwargs}}{} 3D line object. Keyword arguments are passed onto {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D()}}}}}. \index{draw() (mpl\_toolkits.mplot3d.art3d.Line3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Line3D:mpl_toolkits.mplot3d.art3d.Line3D.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} draw the Line with \sphinxcode{\sphinxupquote{renderer}} unless visibility is False \end{fulllineitems} \index{set\_3d\_properties() (mpl\_toolkits.mplot3d.art3d.Line3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Line3D:mpl_toolkits.mplot3d.art3d.Line3D.set_3d_properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_3d\_properties}}}{\emph{zs=0}, \emph{zdir='z'}}{}~ \end{fulllineitems} \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.Line3DCollection} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Line3DCollection:mpl-toolkits-mplot3d-art3d-line3dcollection}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Line3DCollection::doc}}\index{Line3DCollection (class in mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Line3DCollection:mpl_toolkits.mplot3d.art3d.Line3DCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{Line3DCollection}}}{\emph{segments}, \emph{*args}, \emph{**kwargs}}{} A collection of 3D lines. Keyword arguments are passed onto {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection()}}}}}. \index{do\_3d\_projection() (mpl\_toolkits.mplot3d.art3d.Line3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Line3DCollection:mpl_toolkits.mplot3d.art3d.Line3DCollection.do_3d_projection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{do\_3d\_projection}}}{\emph{renderer}}{} Project the points according to renderer matrix. \end{fulllineitems} \index{draw() (mpl\_toolkits.mplot3d.art3d.Line3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Line3DCollection:mpl_toolkits.mplot3d.art3d.Line3DCollection.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}, \emph{project=False}}{} Derived classes drawing method \end{fulllineitems} \index{set\_segments() (mpl\_toolkits.mplot3d.art3d.Line3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Line3DCollection:mpl_toolkits.mplot3d.art3d.Line3DCollection.set_segments}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_segments}}}{\emph{segments}}{} Set 3D segments \end{fulllineitems} \index{set\_sort\_zpos() (mpl\_toolkits.mplot3d.art3d.Line3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Line3DCollection:mpl_toolkits.mplot3d.art3d.Line3DCollection.set_sort_zpos}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sort\_zpos}}}{\emph{val}}{} Set the position to use for z-sorting. \end{fulllineitems} \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.Patch3D} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3D:mpl-toolkits-mplot3d-art3d-patch3d}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3D::doc}}\index{Patch3D (class in mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3D:mpl_toolkits.mplot3d.art3d.Patch3D}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{Patch3D}}}{\emph{*args}, \emph{**kwargs}}{} 3D patch object. \index{do\_3d\_projection() (mpl\_toolkits.mplot3d.art3d.Patch3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3D:mpl_toolkits.mplot3d.art3d.Patch3D.do_3d_projection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{do\_3d\_projection}}}{\emph{renderer}}{}~ \end{fulllineitems} \index{draw() (mpl\_toolkits.mplot3d.art3d.Patch3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3D:mpl_toolkits.mplot3d.art3d.Patch3D.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draw the \sphinxcode{\sphinxupquote{Patch}} to the given \sphinxstyleemphasis{renderer}. \end{fulllineitems} \index{get\_facecolor() (mpl\_toolkits.mplot3d.art3d.Patch3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3D:mpl_toolkits.mplot3d.art3d.Patch3D.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{} Return the face color of the \sphinxcode{\sphinxupquote{Patch}}. \end{fulllineitems} \index{get\_path() (mpl\_toolkits.mplot3d.art3d.Patch3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3D:mpl_toolkits.mplot3d.art3d.Patch3D.get_path}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_path}}}{}{} Return the path of this patch \end{fulllineitems} \index{set\_3d\_properties() (mpl\_toolkits.mplot3d.art3d.Patch3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3D:mpl_toolkits.mplot3d.art3d.Patch3D.set_3d_properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_3d\_properties}}}{\emph{verts}, \emph{zs=0}, \emph{zdir='z'}}{}~ \end{fulllineitems} \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.Patch3DCollection} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3DCollection:mpl-toolkits-mplot3d-art3d-patch3dcollection}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3DCollection::doc}}\index{Patch3DCollection (class in mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3DCollection:mpl_toolkits.mplot3d.art3d.Patch3DCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{Patch3DCollection}}}{\emph{*args}, \emph{**kwargs}}{} A collection of 3D patches. Create a collection of flat 3D patches with its normal vector pointed in \sphinxstyleemphasis{zdir} direction, and located at \sphinxstyleemphasis{zs} on the \sphinxstyleemphasis{zdir} axis. ‘zs’ can be a scalar or an array-like of the same length as the number of patches in the collection. Constructor arguments are the same as for {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PatchCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PatchCollection}}}}}. In addition, keywords \sphinxstyleemphasis{zs=0} and \sphinxstyleemphasis{zdir=’z’} are available. Also, the keyword argument “depthshade” is available to indicate whether or not to shade the patches in order to give the appearance of depth (default is \sphinxstyleemphasis{True}). This is typically desired in scatter plots. \index{do\_3d\_projection() (mpl\_toolkits.mplot3d.art3d.Patch3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3DCollection:mpl_toolkits.mplot3d.art3d.Patch3DCollection.do_3d_projection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{do\_3d\_projection}}}{\emph{renderer}}{}~ \end{fulllineitems} \index{set\_3d\_properties() (mpl\_toolkits.mplot3d.art3d.Patch3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3DCollection:mpl_toolkits.mplot3d.art3d.Patch3DCollection.set_3d_properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_3d\_properties}}}{\emph{zs}, \emph{zdir}}{}~ \end{fulllineitems} \index{set\_sort\_zpos() (mpl\_toolkits.mplot3d.art3d.Patch3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3DCollection:mpl_toolkits.mplot3d.art3d.Patch3DCollection.set_sort_zpos}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sort\_zpos}}}{\emph{val}}{} Set the position to use for z-sorting. \end{fulllineitems} \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.Path3DCollection} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Path3DCollection:mpl-toolkits-mplot3d-art3d-path3dcollection}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Path3DCollection::doc}}\index{Path3DCollection (class in mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Path3DCollection:mpl_toolkits.mplot3d.art3d.Path3DCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{Path3DCollection}}}{\emph{*args}, \emph{**kwargs}}{} A collection of 3D paths. Create a collection of flat 3D paths with its normal vector pointed in \sphinxstyleemphasis{zdir} direction, and located at \sphinxstyleemphasis{zs} on the \sphinxstyleemphasis{zdir} axis. ‘zs’ can be a scalar or an array-like of the same length as the number of paths in the collection. Constructor arguments are the same as for {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PathCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathCollection}}}}}. In addition, keywords \sphinxstyleemphasis{zs=0} and \sphinxstyleemphasis{zdir=’z’} are available. Also, the keyword argument “depthshade” is available to indicate whether or not to shade the patches in order to give the appearance of depth (default is \sphinxstyleemphasis{True}). This is typically desired in scatter plots. \index{do\_3d\_projection() (mpl\_toolkits.mplot3d.art3d.Path3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Path3DCollection:mpl_toolkits.mplot3d.art3d.Path3DCollection.do_3d_projection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{do\_3d\_projection}}}{\emph{renderer}}{}~ \end{fulllineitems} \index{set\_3d\_properties() (mpl\_toolkits.mplot3d.art3d.Path3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Path3DCollection:mpl_toolkits.mplot3d.art3d.Path3DCollection.set_3d_properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_3d\_properties}}}{\emph{zs}, \emph{zdir}}{}~ \end{fulllineitems} \index{set\_sort\_zpos() (mpl\_toolkits.mplot3d.art3d.Path3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Path3DCollection:mpl_toolkits.mplot3d.art3d.Path3DCollection.set_sort_zpos}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sort\_zpos}}}{\emph{val}}{} Set the position to use for z-sorting. \end{fulllineitems} \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.PathPatch3D} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.PathPatch3D:mpl-toolkits-mplot3d-art3d-pathpatch3d}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.PathPatch3D::doc}}\index{PathPatch3D (class in mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.PathPatch3D:mpl_toolkits.mplot3d.art3d.PathPatch3D}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{PathPatch3D}}}{\emph{path}, \emph{**kwargs}}{} 3D PathPatch object. \index{do\_3d\_projection() (mpl\_toolkits.mplot3d.art3d.PathPatch3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.PathPatch3D:mpl_toolkits.mplot3d.art3d.PathPatch3D.do_3d_projection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{do\_3d\_projection}}}{\emph{renderer}}{}~ \end{fulllineitems} \index{set\_3d\_properties() (mpl\_toolkits.mplot3d.art3d.PathPatch3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.PathPatch3D:mpl_toolkits.mplot3d.art3d.PathPatch3D.set_3d_properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_3d\_properties}}}{\emph{path}, \emph{zs=0}, \emph{zdir='z'}}{}~ \end{fulllineitems} \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.Poly3DCollection} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl-toolkits-mplot3d-art3d-poly3dcollection}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection::doc}}\index{Poly3DCollection (class in mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{Poly3DCollection}}}{\emph{verts}, \emph{*args}, \emph{**kwargs}}{} A collection of 3D polygons. Create a Poly3DCollection. \sphinxstyleemphasis{verts} should contain 3D coordinates. Keyword arguments: zsort, see set\_zsort for options. Note that this class does a bit of magic with the \_facecolors and \_edgecolors properties. \index{do\_3d\_projection() (mpl\_toolkits.mplot3d.art3d.Poly3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection.do_3d_projection}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{do\_3d\_projection}}}{\emph{renderer}}{} Perform the 3D projection for this object. \end{fulllineitems} \index{draw() (mpl\_toolkits.mplot3d.art3d.Poly3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Derived classes drawing method \end{fulllineitems} \index{get\_edgecolor() (mpl\_toolkits.mplot3d.art3d.Poly3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection.get_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolor}}}{}{}~ \end{fulllineitems} \index{get\_edgecolors() (mpl\_toolkits.mplot3d.art3d.Poly3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection.get_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_edgecolors}}}{}{}~ \end{fulllineitems} \index{get\_facecolor() (mpl\_toolkits.mplot3d.art3d.Poly3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection.get_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolor}}}{}{}~ \end{fulllineitems} \index{get\_facecolors() (mpl\_toolkits.mplot3d.art3d.Poly3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection.get_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_facecolors}}}{}{}~ \end{fulllineitems} \index{get\_vector() (mpl\_toolkits.mplot3d.art3d.Poly3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection.get_vector}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_vector}}}{\emph{segments3d}}{} Optimize points for projection \end{fulllineitems} \index{set\_3d\_properties() (mpl\_toolkits.mplot3d.art3d.Poly3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_3d_properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_3d\_properties}}}{}{}~ \end{fulllineitems} \index{set\_alpha() (mpl\_toolkits.mplot3d.art3d.Poly3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_alpha}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_alpha}}}{\emph{alpha}}{} Set the alpha tranparencies of the collection. \sphinxstyleemphasis{alpha} must be a float or \sphinxstyleemphasis{None}. ACCEPTS: float or None \end{fulllineitems} \index{set\_edgecolor() (mpl\_toolkits.mplot3d.art3d.Poly3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_edgecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolor}}}{\emph{colors}}{} Set the edgecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘face’, the edge color will always be the same as the face color. If it is ‘none’, the patch boundary will not be drawn. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_edgecolors() (mpl\_toolkits.mplot3d.art3d.Poly3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_edgecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_edgecolors}}}{\emph{colors}}{} Set the edgecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘face’, the edge color will always be the same as the face color. If it is ‘none’, the patch boundary will not be drawn. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_facecolor() (mpl\_toolkits.mplot3d.art3d.Poly3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_facecolor}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolor}}}{\emph{colors}}{} Set the facecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘none’, the patch will not be filled. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_facecolors() (mpl\_toolkits.mplot3d.art3d.Poly3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_facecolors}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_facecolors}}}{\emph{colors}}{} Set the facecolor(s) of the collection. \sphinxstyleemphasis{c} can be a matplotlib color spec (all patches have same color), or a sequence of specs; if it is a sequence the patches will cycle through the sequence. If \sphinxstyleemphasis{c} is ‘none’, the patch will not be filled. ACCEPTS: matplotlib color spec or sequence of specs \end{fulllineitems} \index{set\_sort\_zpos() (mpl\_toolkits.mplot3d.art3d.Poly3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_sort_zpos}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_sort\_zpos}}}{\emph{val}}{} Set the position to use for z-sorting. \end{fulllineitems} \index{set\_verts() (mpl\_toolkits.mplot3d.art3d.Poly3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_verts}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_verts}}}{\emph{verts}, \emph{closed=True}}{} Set 3D vertices. \end{fulllineitems} \index{set\_verts\_and\_codes() (mpl\_toolkits.mplot3d.art3d.Poly3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_verts_and_codes}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_verts\_and\_codes}}}{\emph{verts}, \emph{codes}}{} Sets 3D vertices with path codes \end{fulllineitems} \index{set\_zsort() (mpl\_toolkits.mplot3d.art3d.Poly3DCollection method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Poly3DCollection:mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_zsort}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_zsort}}}{\emph{zsort}}{}~\begin{description} \item[{Set z-sorting behaviour:}] \leavevmode boolean: if True use default ‘average’ string: ‘average’, ‘min’ or ‘max’ \end{description} \end{fulllineitems} \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.Text3D} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Text3D:mpl-toolkits-mplot3d-art3d-text3d}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Text3D::doc}}\index{Text3D (class in mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Text3D:mpl_toolkits.mplot3d.art3d.Text3D}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{Text3D}}}{\emph{x=0}, \emph{y=0}, \emph{z=0}, \emph{text=''}, \emph{zdir='z'}, \emph{**kwargs}}{} Text object with 3D position and (in the future) direction. \sphinxstyleemphasis{x}, \sphinxstyleemphasis{y}, \sphinxstyleemphasis{z} Position of text \sphinxstyleemphasis{text} Text string to display \sphinxstyleemphasis{zdir} Direction of text Keyword arguments are passed onto {\hyperref[\detokenize{api/text_api:matplotlib.text.Text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Text()}}}}}. \index{draw() (mpl\_toolkits.mplot3d.art3d.Text3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Text3D:mpl_toolkits.mplot3d.art3d.Text3D.draw}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{draw}}}{\emph{renderer}}{} Draws the \sphinxcode{\sphinxupquote{Text}} object to the given \sphinxstyleemphasis{renderer}. \end{fulllineitems} \index{set\_3d\_properties() (mpl\_toolkits.mplot3d.art3d.Text3D method)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Text3D:mpl_toolkits.mplot3d.art3d.Text3D.set_3d_properties}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_3d\_properties}}}{\emph{z=0}, \emph{zdir='z'}}{}~ \end{fulllineitems} \end{fulllineitems} \subsection{Art3D Utility Functions} \label{\detokenize{api/toolkits/mplot3d:art3d-utility-functions}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.get_colors:mpl_toolkits.mplot3d.art3d.get_colors}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.get\_colors}}}}}(c, num) & Stretch the color argument to provide the required number num \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.get_dir_vector:mpl_toolkits.mplot3d.art3d.get_dir_vector}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.get\_dir\_vector}}}}}(zdir) & \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.get_patch_verts:mpl_toolkits.mplot3d.art3d.get_patch_verts}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.get\_patch\_verts}}}}}(patch) & Return a list of vertices for the path of a patch. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.juggle_axes:mpl_toolkits.mplot3d.art3d.juggle_axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.juggle\_axes}}}}}(xs, ys, zs, zdir) & Reorder coordinates so that 2D xs, ys can be plotted in the plane orthogonal to zdir. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.line_2d_to_3d:mpl_toolkits.mplot3d.art3d.line_2d_to_3d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.line\_2d\_to\_3d}}}}}(line{[}, zs, zdir{]}) & Convert a 2D line to 3D. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.line_collection_2d_to_3d:mpl_toolkits.mplot3d.art3d.line_collection_2d_to_3d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.line\_collection\_2d\_to\_3d}}}}}(col{[}, zs, zdir{]}) & Convert a LineCollection to a Line3DCollection object. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.norm_angle:mpl_toolkits.mplot3d.art3d.norm_angle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.norm\_angle}}}}}(a) & Return angle between -180 and +180 \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.norm_text_angle:mpl_toolkits.mplot3d.art3d.norm_text_angle}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.norm\_text\_angle}}}}}(a) & Return angle between -90 and +90 \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.patch_2d_to_3d:mpl_toolkits.mplot3d.art3d.patch_2d_to_3d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.patch\_2d\_to\_3d}}}}}(patch{[}, z, zdir{]}) & Convert a Patch to a Patch3D object. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.patch_collection_2d_to_3d:mpl_toolkits.mplot3d.art3d.patch_collection_2d_to_3d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.patch\_collection\_2d\_to\_3d}}}}}(col{[}, zs, …{]}) & Convert a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PatchCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PatchCollection}}}}} into a \sphinxcode{\sphinxupquote{Patch3DCollection}} object (or a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PathCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathCollection}}}}} into a \sphinxcode{\sphinxupquote{Path3DCollection}} object). \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.path_to_3d_segment:mpl_toolkits.mplot3d.art3d.path_to_3d_segment}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.path\_to\_3d\_segment}}}}}(path{[}, zs, zdir{]}) & Convert a path to a 3D segment. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.path_to_3d_segment_with_codes:mpl_toolkits.mplot3d.art3d.path_to_3d_segment_with_codes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.path\_to\_3d\_segment\_with\_codes}}}}}(path{[}, …{]}) & Convert a path to a 3D segment with path codes. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.pathpatch_2d_to_3d:mpl_toolkits.mplot3d.art3d.pathpatch_2d_to_3d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.pathpatch\_2d\_to\_3d}}}}}(pathpatch{[}, z, zdir{]}) & Convert a PathPatch to a PathPatch3D object. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.paths_to_3d_segments:mpl_toolkits.mplot3d.art3d.paths_to_3d_segments}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.paths\_to\_3d\_segments}}}}}(paths{[}, zs, zdir{]}) & Convert paths from a collection object to 3D segments. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.paths_to_3d_segments_with_codes:mpl_toolkits.mplot3d.art3d.paths_to_3d_segments_with_codes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.paths\_to\_3d\_segments\_with\_codes}}}}}(paths) & Convert paths from a collection object to 3D segments with path codes. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.poly_collection_2d_to_3d:mpl_toolkits.mplot3d.art3d.poly_collection_2d_to_3d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.poly\_collection\_2d\_to\_3d}}}}}(col{[}, zs, zdir{]}) & Convert a PolyCollection to a Poly3DCollection object. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.rotate_axes:mpl_toolkits.mplot3d.art3d.rotate_axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.rotate\_axes}}}}}(xs, ys, zs, zdir) & Reorder coordinates so that the axes are rotated with zdir along the original z axis. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.text_2d_to_3d:mpl_toolkits.mplot3d.art3d.text_2d_to_3d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.text\_2d\_to\_3d}}}}}(obj{[}, z, zdir{]}) & Convert a Text to a Text3D object. \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.zalpha:mpl_toolkits.mplot3d.art3d.zalpha}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{art3d.zalpha}}}}}(colors, zs) & Modify the alphas of the color list according to depth \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{mpl\_toolkits.mplot3d.art3d.get\_colors} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.get_colors:mpl-toolkits-mplot3d-art3d-get-colors}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.get_colors::doc}}\index{get\_colors() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.get_colors:mpl_toolkits.mplot3d.art3d.get_colors}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{get\_colors}}}{\emph{c}, \emph{num}}{} Stretch the color argument to provide the required number num \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.get\_dir\_vector} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.get_dir_vector:mpl-toolkits-mplot3d-art3d-get-dir-vector}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.get_dir_vector::doc}}\index{get\_dir\_vector() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.get_dir_vector:mpl_toolkits.mplot3d.art3d.get_dir_vector}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{get\_dir\_vector}}}{\emph{zdir}}{}~ \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.get\_patch\_verts} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.get_patch_verts:mpl-toolkits-mplot3d-art3d-get-patch-verts}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.get_patch_verts::doc}}\index{get\_patch\_verts() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.get_patch_verts:mpl_toolkits.mplot3d.art3d.get_patch_verts}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{get\_patch\_verts}}}{\emph{patch}}{} Return a list of vertices for the path of a patch. \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.juggle\_axes} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.juggle_axes:mpl-toolkits-mplot3d-art3d-juggle-axes}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.juggle_axes::doc}}\index{juggle\_axes() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.juggle_axes:mpl_toolkits.mplot3d.art3d.juggle_axes}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{juggle\_axes}}}{\emph{xs}, \emph{ys}, \emph{zs}, \emph{zdir}}{} Reorder coordinates so that 2D xs, ys can be plotted in the plane orthogonal to zdir. zdir is normally x, y or z. However, if zdir starts with a ‘-‘ it is interpreted as a compensation for rotate\_axes. \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.line\_2d\_to\_3d} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.line_2d_to_3d:mpl-toolkits-mplot3d-art3d-line-2d-to-3d}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.line_2d_to_3d::doc}}\index{line\_2d\_to\_3d() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.line_2d_to_3d:mpl_toolkits.mplot3d.art3d.line_2d_to_3d}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{line\_2d\_to\_3d}}}{\emph{line}, \emph{zs=0}, \emph{zdir='z'}}{} Convert a 2D line to 3D. \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.line\_collection\_2d\_to\_3d} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.line_collection_2d_to_3d:mpl-toolkits-mplot3d-art3d-line-collection-2d-to-3d}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.line_collection_2d_to_3d::doc}}\index{line\_collection\_2d\_to\_3d() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.line_collection_2d_to_3d:mpl_toolkits.mplot3d.art3d.line_collection_2d_to_3d}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{line\_collection\_2d\_to\_3d}}}{\emph{col}, \emph{zs=0}, \emph{zdir='z'}}{} Convert a LineCollection to a Line3DCollection object. \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.norm\_angle} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.norm_angle:mpl-toolkits-mplot3d-art3d-norm-angle}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.norm_angle::doc}}\index{norm\_angle() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.norm_angle:mpl_toolkits.mplot3d.art3d.norm_angle}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{norm\_angle}}}{\emph{a}}{} Return angle between -180 and +180 \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.norm\_text\_angle} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.norm_text_angle:mpl-toolkits-mplot3d-art3d-norm-text-angle}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.norm_text_angle::doc}}\index{norm\_text\_angle() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.norm_text_angle:mpl_toolkits.mplot3d.art3d.norm_text_angle}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{norm\_text\_angle}}}{\emph{a}}{} Return angle between -90 and +90 \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.patch\_2d\_to\_3d} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.patch_2d_to_3d:mpl-toolkits-mplot3d-art3d-patch-2d-to-3d}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.patch_2d_to_3d::doc}}\index{patch\_2d\_to\_3d() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.patch_2d_to_3d:mpl_toolkits.mplot3d.art3d.patch_2d_to_3d}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{patch\_2d\_to\_3d}}}{\emph{patch}, \emph{z=0}, \emph{zdir='z'}}{} Convert a Patch to a Patch3D object. \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.patch\_collection\_2d\_to\_3d} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.patch_collection_2d_to_3d:mpl-toolkits-mplot3d-art3d-patch-collection-2d-to-3d}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.patch_collection_2d_to_3d::doc}}\index{patch\_collection\_2d\_to\_3d() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.patch_collection_2d_to_3d:mpl_toolkits.mplot3d.art3d.patch_collection_2d_to_3d}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{patch\_collection\_2d\_to\_3d}}}{\emph{col}, \emph{zs=0}, \emph{zdir='z'}, \emph{depthshade=True}}{} Convert a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PatchCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PatchCollection}}}}} into a {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Patch3DCollection:mpl_toolkits.mplot3d.art3d.Patch3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Patch3DCollection}}}}} object (or a {\hyperref[\detokenize{api/collections_api:matplotlib.collections.PathCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PathCollection}}}}} into a {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.Path3DCollection:mpl_toolkits.mplot3d.art3d.Path3DCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Path3DCollection}}}}} object). Keywords: \begin{description} \item[{\sphinxstyleemphasis{za} The location or locations to place the patches in the}] \leavevmode collection along the \sphinxstyleemphasis{zdir} axis. Defaults to 0. \end{description} \sphinxstyleemphasis{zdir} The axis in which to place the patches. Default is “z”. \begin{description} \item[{\sphinxstyleemphasis{depthshade} Whether to shade the patches to give a sense of depth.}] \leavevmode Defaults to \sphinxstyleemphasis{True}. \end{description} \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.path\_to\_3d\_segment} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.path_to_3d_segment:mpl-toolkits-mplot3d-art3d-path-to-3d-segment}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.path_to_3d_segment::doc}}\index{path\_to\_3d\_segment() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.path_to_3d_segment:mpl_toolkits.mplot3d.art3d.path_to_3d_segment}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{path\_to\_3d\_segment}}}{\emph{path}, \emph{zs=0}, \emph{zdir='z'}}{} Convert a path to a 3D segment. \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.path\_to\_3d\_segment\_with\_codes} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.path_to_3d_segment_with_codes:mpl-toolkits-mplot3d-art3d-path-to-3d-segment-with-codes}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.path_to_3d_segment_with_codes::doc}}\index{path\_to\_3d\_segment\_with\_codes() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.path_to_3d_segment_with_codes:mpl_toolkits.mplot3d.art3d.path_to_3d_segment_with_codes}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{path\_to\_3d\_segment\_with\_codes}}}{\emph{path}, \emph{zs=0}, \emph{zdir='z'}}{} Convert a path to a 3D segment with path codes. \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.pathpatch\_2d\_to\_3d} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.pathpatch_2d_to_3d:mpl-toolkits-mplot3d-art3d-pathpatch-2d-to-3d}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.pathpatch_2d_to_3d::doc}}\index{pathpatch\_2d\_to\_3d() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.pathpatch_2d_to_3d:mpl_toolkits.mplot3d.art3d.pathpatch_2d_to_3d}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{pathpatch\_2d\_to\_3d}}}{\emph{pathpatch}, \emph{z=0}, \emph{zdir='z'}}{} Convert a PathPatch to a PathPatch3D object. \end{fulllineitems} \paragraph{Examples using \sphinxstyleliteralintitle{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.pathpatch\_2d\_to\_3d}}} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.pathpatch_2d_to_3d:examples-using-mpl-toolkits-mplot3d-art3d-pathpatch-2d-to-3d}} \begin{itemize} \item {} \DUrole{xref,std,std-ref}{sphx\_glr\_gallery\_mplot3d\_pathpatch3d.py} \end{itemize} \subsubsection{mpl\_toolkits.mplot3d.art3d.paths\_to\_3d\_segments} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.paths_to_3d_segments:mpl-toolkits-mplot3d-art3d-paths-to-3d-segments}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.paths_to_3d_segments::doc}}\index{paths\_to\_3d\_segments() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.paths_to_3d_segments:mpl_toolkits.mplot3d.art3d.paths_to_3d_segments}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{paths\_to\_3d\_segments}}}{\emph{paths}, \emph{zs=0}, \emph{zdir='z'}}{} Convert paths from a collection object to 3D segments. \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.paths\_to\_3d\_segments\_with\_codes} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.paths_to_3d_segments_with_codes:mpl-toolkits-mplot3d-art3d-paths-to-3d-segments-with-codes}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.paths_to_3d_segments_with_codes::doc}}\index{paths\_to\_3d\_segments\_with\_codes() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.paths_to_3d_segments_with_codes:mpl_toolkits.mplot3d.art3d.paths_to_3d_segments_with_codes}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{paths\_to\_3d\_segments\_with\_codes}}}{\emph{paths}, \emph{zs=0}, \emph{zdir='z'}}{} Convert paths from a collection object to 3D segments with path codes. \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.poly\_collection\_2d\_to\_3d} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.poly_collection_2d_to_3d:mpl-toolkits-mplot3d-art3d-poly-collection-2d-to-3d}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.poly_collection_2d_to_3d::doc}}\index{poly\_collection\_2d\_to\_3d() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.poly_collection_2d_to_3d:mpl_toolkits.mplot3d.art3d.poly_collection_2d_to_3d}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{poly\_collection\_2d\_to\_3d}}}{\emph{col}, \emph{zs=0}, \emph{zdir='z'}}{} Convert a PolyCollection to a Poly3DCollection object. \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.rotate\_axes} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.rotate_axes:mpl-toolkits-mplot3d-art3d-rotate-axes}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.rotate_axes::doc}}\index{rotate\_axes() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.rotate_axes:mpl_toolkits.mplot3d.art3d.rotate_axes}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{rotate\_axes}}}{\emph{xs}, \emph{ys}, \emph{zs}, \emph{zdir}}{} Reorder coordinates so that the axes are rotated with zdir along the original z axis. Prepending the axis with a ‘-‘ does the inverse transform, so zdir can be x, -x, y, -y, z or -z \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.text\_2d\_to\_3d} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.text_2d_to_3d:mpl-toolkits-mplot3d-art3d-text-2d-to-3d}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.text_2d_to_3d::doc}}\index{text\_2d\_to\_3d() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.text_2d_to_3d:mpl_toolkits.mplot3d.art3d.text_2d_to_3d}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{text\_2d\_to\_3d}}}{\emph{obj}, \emph{z=0}, \emph{zdir='z'}}{} Convert a Text to a Text3D object. \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.art3d.zalpha} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.zalpha:mpl-toolkits-mplot3d-art3d-zalpha}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.zalpha::doc}}\index{zalpha() (in module mpl\_toolkits.mplot3d.art3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.art3d.zalpha:mpl_toolkits.mplot3d.art3d.zalpha}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.art3d.}}\sphinxbfcode{\sphinxupquote{zalpha}}}{\emph{colors}, \emph{zs}}{} Modify the alphas of the color list according to depth \end{fulllineitems} \subsection{\sphinxstyleliteralintitle{\sphinxupquote{proj3d}}} \label{\detokenize{api/toolkits/mplot3d:proj3d}}\label{\detokenize{api/toolkits/mplot3d:toolkit-mplot3d-projapi}} \begin{savenotes}\sphinxatlongtablestart\begin{longtable}{\X{1}{2}\X{1}{2}} \hline \endfirsthead \multicolumn{2}{c}% {\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\ \hline \endhead \hline \multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\ \endfoot \endlastfoot {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.inv_transform:mpl_toolkits.mplot3d.proj3d.inv_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.inv\_transform}}}}}(xs, ys, zs, M) & \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.line2d:mpl_toolkits.mplot3d.proj3d.line2d}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.line2d}}}}}(p0, p1) & Return 2D equation of line in the form ax+by+c = 0 \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.line2d_dist:mpl_toolkits.mplot3d.proj3d.line2d_dist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.line2d\_dist}}}}}(l, p) & Distance from line to point line is a tuple of coefficients a,b,c \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.line2d_seg_dist:mpl_toolkits.mplot3d.proj3d.line2d_seg_dist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.line2d\_seg\_dist}}}}}(p1, p2, p0) & distance(s) from line defined by p1 - p2 to point(s) p0 \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.mod:mpl_toolkits.mplot3d.proj3d.mod}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.mod}}}}}(v) & 3d vector length \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.persp_transformation:mpl_toolkits.mplot3d.proj3d.persp_transformation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.persp\_transformation}}}}}(zfront, zback) & \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_points:mpl_toolkits.mplot3d.proj3d.proj_points}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.proj\_points}}}}}(points, M) & \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_trans_clip_points:mpl_toolkits.mplot3d.proj3d.proj_trans_clip_points}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.proj\_trans\_clip\_points}}}}}(points, M) & \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_trans_points:mpl_toolkits.mplot3d.proj3d.proj_trans_points}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.proj\_trans\_points}}}}}(points, M) & \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_transform:mpl_toolkits.mplot3d.proj3d.proj_transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.proj\_transform}}}}}(xs, ys, zs, M) & Transform the points by the projection matrix \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_transform_clip:mpl_toolkits.mplot3d.proj3d.proj_transform_clip}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.proj\_transform\_clip}}}}}(xs, ys, zs, M) & Transform the points by the projection matrix and return the clipping result returns txs,tys,tzs,tis \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_transform_vec:mpl_toolkits.mplot3d.proj3d.proj_transform_vec}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.proj\_transform\_vec}}}}}(vec, M) & \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_transform_vec_clip:mpl_toolkits.mplot3d.proj3d.proj_transform_vec_clip}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.proj\_transform\_vec\_clip}}}}}(vec, M) & \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.rot_x:mpl_toolkits.mplot3d.proj3d.rot_x}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.rot\_x}}}}}(V, alpha) & \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.transform:mpl_toolkits.mplot3d.proj3d.transform}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.transform}}}}}(xs, ys, zs, M) & Transform the points by the projection matrix \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.vec_pad_ones:mpl_toolkits.mplot3d.proj3d.vec_pad_ones}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.vec\_pad\_ones}}}}}(xs, ys, zs) & \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.view_transformation:mpl_toolkits.mplot3d.proj3d.view_transformation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.view\_transformation}}}}}(E, R, V) & \\ \hline {\hyperref[\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.world_transformation:mpl_toolkits.mplot3d.proj3d.world_transformation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{proj3d.world\_transformation}}}}}(xmin, xmax, …) & \\ \hline \end{longtable}\sphinxatlongtableend\end{savenotes} \subsubsection{mpl\_toolkits.mplot3d.proj3d.inv\_transform} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.inv_transform:mpl-toolkits-mplot3d-proj3d-inv-transform}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.inv_transform::doc}}\index{inv\_transform() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.inv_transform:mpl_toolkits.mplot3d.proj3d.inv_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{inv\_transform}}}{\emph{xs}, \emph{ys}, \emph{zs}, \emph{M}}{}~ \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.proj3d.line2d} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.line2d:mpl-toolkits-mplot3d-proj3d-line2d}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.line2d::doc}}\index{line2d() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.line2d:mpl_toolkits.mplot3d.proj3d.line2d}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{line2d}}}{\emph{p0}, \emph{p1}}{} Return 2D equation of line in the form ax+by+c = 0 \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.proj3d.line2d\_dist} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.line2d_dist:mpl-toolkits-mplot3d-proj3d-line2d-dist}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.line2d_dist::doc}}\index{line2d\_dist() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.line2d_dist:mpl_toolkits.mplot3d.proj3d.line2d_dist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{line2d\_dist}}}{\emph{l}, \emph{p}}{} Distance from line to point line is a tuple of coefficients a,b,c \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.proj3d.line2d\_seg\_dist} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.line2d_seg_dist:mpl-toolkits-mplot3d-proj3d-line2d-seg-dist}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.line2d_seg_dist::doc}}\index{line2d\_seg\_dist() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.line2d_seg_dist:mpl_toolkits.mplot3d.proj3d.line2d_seg_dist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{line2d\_seg\_dist}}}{\emph{p1}, \emph{p2}, \emph{p0}}{} distance(s) from line defined by p1 - p2 to point(s) p0 p0{[}0{]} = x(s) p0{[}1{]} = y(s) intersection point p = p1 + u*(p2-p1) and intersection point lies within segment if u is between 0 and 1 \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.proj3d.mod} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.mod:mpl-toolkits-mplot3d-proj3d-mod}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.mod::doc}}\index{mod() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.mod:mpl_toolkits.mplot3d.proj3d.mod}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{mod}}}{\emph{v}}{} 3d vector length \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.proj3d.persp\_transformation} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.persp_transformation:mpl-toolkits-mplot3d-proj3d-persp-transformation}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.persp_transformation::doc}}\index{persp\_transformation() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.persp_transformation:mpl_toolkits.mplot3d.proj3d.persp_transformation}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{persp\_transformation}}}{\emph{zfront}, \emph{zback}}{}~ \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.proj3d.proj\_points} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_points:mpl-toolkits-mplot3d-proj3d-proj-points}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_points::doc}}\index{proj\_points() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_points:mpl_toolkits.mplot3d.proj3d.proj_points}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{proj\_points}}}{\emph{points}, \emph{M}}{}~ \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.proj3d.proj\_trans\_clip\_points} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_trans_clip_points:mpl-toolkits-mplot3d-proj3d-proj-trans-clip-points}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_trans_clip_points::doc}}\index{proj\_trans\_clip\_points() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_trans_clip_points:mpl_toolkits.mplot3d.proj3d.proj_trans_clip_points}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{proj\_trans\_clip\_points}}}{\emph{points}, \emph{M}}{}~ \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.proj3d.proj\_trans\_points} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_trans_points:mpl-toolkits-mplot3d-proj3d-proj-trans-points}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_trans_points::doc}}\index{proj\_trans\_points() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_trans_points:mpl_toolkits.mplot3d.proj3d.proj_trans_points}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{proj\_trans\_points}}}{\emph{points}, \emph{M}}{}~ \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.proj3d.proj\_transform} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_transform:mpl-toolkits-mplot3d-proj3d-proj-transform}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_transform::doc}}\index{proj\_transform() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_transform:mpl_toolkits.mplot3d.proj3d.proj_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{proj\_transform}}}{\emph{xs}, \emph{ys}, \emph{zs}, \emph{M}}{} Transform the points by the projection matrix \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.proj3d.proj\_transform\_clip} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_transform_clip:mpl-toolkits-mplot3d-proj3d-proj-transform-clip}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_transform_clip::doc}}\index{proj\_transform\_clip() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_transform_clip:mpl_toolkits.mplot3d.proj3d.proj_transform_clip}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{proj\_transform\_clip}}}{\emph{xs}, \emph{ys}, \emph{zs}, \emph{M}}{} Transform the points by the projection matrix and return the clipping result returns txs,tys,tzs,tis \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.proj3d.proj\_transform\_vec} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_transform_vec:mpl-toolkits-mplot3d-proj3d-proj-transform-vec}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_transform_vec::doc}}\index{proj\_transform\_vec() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_transform_vec:mpl_toolkits.mplot3d.proj3d.proj_transform_vec}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{proj\_transform\_vec}}}{\emph{vec}, \emph{M}}{}~ \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.proj3d.proj\_transform\_vec\_clip} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_transform_vec_clip:mpl-toolkits-mplot3d-proj3d-proj-transform-vec-clip}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_transform_vec_clip::doc}}\index{proj\_transform\_vec\_clip() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.proj_transform_vec_clip:mpl_toolkits.mplot3d.proj3d.proj_transform_vec_clip}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{proj\_transform\_vec\_clip}}}{\emph{vec}, \emph{M}}{}~ \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.proj3d.rot\_x} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.rot_x:mpl-toolkits-mplot3d-proj3d-rot-x}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.rot_x::doc}}\index{rot\_x() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.rot_x:mpl_toolkits.mplot3d.proj3d.rot_x}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{rot\_x}}}{\emph{V}, \emph{alpha}}{}~ \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.proj3d.transform} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.transform:mpl-toolkits-mplot3d-proj3d-transform}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.transform::doc}}\index{transform() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.transform:mpl_toolkits.mplot3d.proj3d.transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{transform}}}{\emph{xs}, \emph{ys}, \emph{zs}, \emph{M}}{} Transform the points by the projection matrix \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.proj3d.vec\_pad\_ones} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.vec_pad_ones:mpl-toolkits-mplot3d-proj3d-vec-pad-ones}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.vec_pad_ones::doc}}\index{vec\_pad\_ones() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.vec_pad_ones:mpl_toolkits.mplot3d.proj3d.vec_pad_ones}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{vec\_pad\_ones}}}{\emph{xs}, \emph{ys}, \emph{zs}}{}~ \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.proj3d.view\_transformation} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.view_transformation:mpl-toolkits-mplot3d-proj3d-view-transformation}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.view_transformation::doc}}\index{view\_transformation() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.view_transformation:mpl_toolkits.mplot3d.proj3d.view_transformation}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{view\_transformation}}}{\emph{E}, \emph{R}, \emph{V}}{}~ \end{fulllineitems} \subsubsection{mpl\_toolkits.mplot3d.proj3d.world\_transformation} \label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.world_transformation:mpl-toolkits-mplot3d-proj3d-world-transformation}}\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.world_transformation::doc}}\index{world\_transformation() (in module mpl\_toolkits.mplot3d.proj3d)} \begin{fulllineitems} \phantomsection\label{\detokenize{api/_as_gen/mpl_toolkits.mplot3d.proj3d.world_transformation:mpl_toolkits.mplot3d.proj3d.world_transformation}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{mpl\_toolkits.mplot3d.proj3d.}}\sphinxbfcode{\sphinxupquote{world\_transformation}}}{\emph{xmin}, \emph{xmax}, \emph{ymin}, \emph{ymax}, \emph{zmin}, \emph{zmax}}{}~ \end{fulllineitems} \part{The Matplotlib Developers’ Guide} \label{\detokenize{devel/index:the-matplotlib-developers-guide}}\label{\detokenize{devel/index:developers-guide-index}}\label{\detokenize{devel/index::doc}} \chapter{Contributing} \label{\detokenize{devel/contributing:contributing}}\label{\detokenize{devel/contributing:id1}}\label{\detokenize{devel/contributing::doc}} This project is a community effort, and everyone is welcome to contribute. The project is hosted on \sphinxurl{https://github.com/matplotlib/matplotlib} \section{Submitting a bug report} \label{\detokenize{devel/contributing:submitting-a-bug-report}} If you find a bug in the code or documentation, do not hesitate to submit a ticket to the \sphinxhref{https://github.com/matplotlib/matplotlib/issues}{Bug Tracker}. You are also welcome to post feature requests or pull requests. If you are reporting a bug, please do your best to include the following: \begin{enumerate} \item {} A short, top-level summary of the bug. In most cases, this should be 1-2 sentences. \item {} A short, self-contained code snippet to reproduce the bug, ideally allowing a simple copy and paste to reproduce. Please do your best to reduce the code snippet to the minimum required. \item {} The actual outcome of the code snippet. \item {} The expected outcome of the code snippet. \item {} The Matplotlib version, Python version and platform that you are using. You can grab the version with the following commands: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{\PYGZus{}\PYGZus{}version\PYGZus{}\PYGZus{}} \PYG{g+go}{\PYGZsq{}1.5.3\PYGZsq{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{platform} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{platform}\PYG{o}{.}\PYG{n}{python\PYGZus{}version}\PYG{p}{(}\PYG{p}{)} \PYG{g+go}{\PYGZsq{}2.7.12\PYGZsq{}} \end{sphinxVerbatim} \end{enumerate} We have preloaded the issue creation page with a Markdown template that you can use to organize this information. Thank you for your help in keeping bug reports complete, targeted and descriptive. \section{Retrieving and installing the latest version of the code} \label{\detokenize{devel/contributing:retrieving-and-installing-the-latest-version-of-the-code}}\label{\detokenize{devel/contributing:installing-for-devs}} When developing Matplotlib, sources must be downloaded, built, and installed into a local environment on your machine. Follow the instructions detailed {\hyperref[\detokenize{users/installing:install-from-source}]{\sphinxcrossref{\DUrole{std,std-ref}{here}}}} to set up your environment to build Matplotlib from source. \begin{sphinxadmonition}{warning}{Warning:} When working on Matplotlib sources, having multiple versions installed by different methods into the same environment may not always work as expected. \end{sphinxadmonition} To work on Matplotlib sources, it is strongly recommended to set up an alternative development environment, using the something like \sphinxhref{http://docs.python-guide.org/en/latest/dev/virtualenvs/}{virtual environments in python}, or a \sphinxhref{http://conda.pydata.org/docs/using/envs.html}{conda environment}. If you choose to use an already existing environment, and not a clean virtual or conda environment, uninstall the current version of Matplotlib in that environment using the same method used to install it. If working on Matplotlib documentation only, the above steps are \sphinxstyleemphasis{not} absolutely necessary. We use \sphinxhref{https://git-scm.com/}{Git} for version control and \sphinxhref{https://github.com/}{GitHub} for hosting our main repository. You can check out the latest sources with the command (see {\hyperref[\detokenize{devel/gitwash/set_up_fork:set-up-fork}]{\sphinxcrossref{\DUrole{std,std-ref}{Set up your fork}}}} for more details): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{git} \PYG{n}{clone} \PYG{n}{https}\PYG{p}{:}\PYG{o}{/}\PYG{o}{/}\PYG{n}{github}\PYG{o}{.}\PYG{n}{com}\PYG{o}{/}\PYG{n}{matplotlib}\PYG{o}{/}\PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{git} \end{sphinxVerbatim} and navigate to the \sphinxcode{\sphinxupquote{matplotlib}} directory. If you have the proper privileges, you can use \sphinxcode{\sphinxupquote{git@}} instead of \sphinxcode{\sphinxupquote{https://}}, which works through the ssh protocol and might be easier to use if you are using 2-factor authentication. \subsection{Building Matplotlib for image comparison tests} \label{\detokenize{devel/contributing:building-matplotlib-for-image-comparison-tests}} Matplotlib’s test suite makes heavy use of image comparison tests, meaning the result of a plot is compared against a known good result. Unfortunately, different versions of FreeType produce differently formed characters, causing these image comparisons to fail. To make them reproducible, Matplotlib can be built with a special local copy of FreeType. This is recommended for all Matplotlib developers. Copy \sphinxcode{\sphinxupquote{setup.cfg.template}} to \sphinxcode{\sphinxupquote{setup.cfg}} and edit it to contain: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{[}\PYG{n}{test}\PYG{p}{]} \PYG{n}{local\PYGZus{}freetype} \PYG{o}{=} \PYG{k+kc}{True} \PYG{n}{tests} \PYG{o}{=} \PYG{k+kc}{True} \end{sphinxVerbatim} or set the \sphinxcode{\sphinxupquote{MPLLOCALFREETYPE}} environmental variable to any true value. \subsection{Installing Matplotlib in developer mode} \label{\detokenize{devel/contributing:installing-matplotlib-in-developer-mode}} To install Matplotlib (and compile the c-extensions) run the following command from the top-level directory \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{o}{\PYGZhy{}}\PYG{n}{ve} \PYG{o}{.} \end{sphinxVerbatim} This installs Matplotlib in ‘editable/develop mode’, i.e., builds everything and places the correct link entries in the install directory so that python will be able to import Matplotlib from the source directory. Thus, any changes to the \sphinxcode{\sphinxupquote{*.py}} files will be reflected the next time you import the library. If you change the C-extension source (which might happen if you change branches) you will need to run \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{n}{setup}\PYG{o}{.}\PYG{n}{py} \PYG{n}{build} \end{sphinxVerbatim} or re-run \sphinxcode{\sphinxupquote{python -mpip install -ve .}}. Alternatively, if you do \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{o}{\PYGZhy{}}\PYG{n}{v} \PYG{o}{.} \end{sphinxVerbatim} all of the files will be copied to the installation directory however, you will have to rerun this command every time the source is changed. Additionally you will need to copy \sphinxcode{\sphinxupquote{setup.cfg.template}} to \sphinxcode{\sphinxupquote{setup.cfg}} and edit it to contain \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{[}\PYG{n}{test}\PYG{p}{]} \PYG{n}{local\PYGZus{}freetype} \PYG{o}{=} \PYG{k+kc}{True} \PYG{n}{tests} \PYG{o}{=} \PYG{k+kc}{True} \end{sphinxVerbatim} In either case you can then run the tests to check your work environment is set up properly: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{n}{tests}\PYG{o}{.}\PYG{n}{py} \end{sphinxVerbatim} \begin{sphinxadmonition}{note}{Note:} \sphinxstylestrong{Additional dependencies for testing}: \sphinxhref{http://doc.pytest.org/en/latest/}{pytest} (version 3.1 or later), \sphinxhref{https://docs.python.org/dev/library/unittest.mock.html}{mock} (if Python 2), \sphinxhref{https://www.ghostscript.com/}{Ghostscript}, \sphinxhref{https://inkscape.org\textgreater{}}{Inkscape} \end{sphinxadmonition} \sphinxstrong{See also:} \begin{itemize} \item {} {\hyperref[\detokenize{devel/testing:testing}]{\sphinxcrossref{\DUrole{std,std-ref}{Developer’s tips for testing}}}} \end{itemize} \section{Contributing code} \label{\detokenize{devel/contributing:contributing-code}} \subsection{How to contribute} \label{\detokenize{devel/contributing:how-to-contribute}} The preferred way to contribute to Matplotlib is to fork the \sphinxhref{https://github.com/matplotlib/matplotlib/}{main repository} on GitHub, then submit a “pull request” (PR). The best practices for using GitHub to make PRs to Matplotlib are documented in the {\hyperref[\detokenize{devel/gitwash/development_workflow:development-workflow}]{\sphinxcrossref{\DUrole{std,std-ref}{Development workflow}}}} section. A brief overview is: \begin{enumerate} \item {} \sphinxhref{https://github.com/join}{Create an account} on GitHub if you do not already have one. \item {} Fork the \sphinxhref{https://github.com/matplotlib/matplotlib}{project repository}: click on the ‘Fork’ button near the top of the page. This creates a copy of the code under your account on the GitHub server. \item {} Clone this copy to your local disk: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYGZdl{} git clone https://github.com/YourLogin/matplotlib.git \end{sphinxVerbatim} \item {} Create a branch to hold your changes: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYGZdl{} git checkout \PYGZhy{}b my\PYGZhy{}feature origin/master \end{sphinxVerbatim} and start making changes. Never work in the \sphinxcode{\sphinxupquote{master}} branch! \item {} Work on this copy, on your computer, using Git to do the version control. When you’re done editing e.g., \sphinxcode{\sphinxupquote{lib/matplotlib/collections.py}}, do: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYGZdl{} git add lib/matplotlib/collections.py \PYGZdl{} git commit \end{sphinxVerbatim} to record your changes in Git, then push them to GitHub with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYGZdl{} git push \PYGZhy{}u origin my\PYGZhy{}feature \end{sphinxVerbatim} \end{enumerate} Finally, go to the web page of your fork of the Matplotlib repo, and click ‘Pull request’ to send your changes to the maintainers for review. You may want to consider sending an email to the mailing list for more visibility. \sphinxstrong{See also:} \begin{itemize} \item {} \sphinxhref{https://git-scm.com/documentation}{Git documentation} \item {} {\hyperref[\detokenize{devel/gitwash/development_workflow:development-workflow}]{\sphinxcrossref{\DUrole{std,std-ref}{Development workflow}}}}. \item {} {\hyperref[\detokenize{devel/gitwash/index:using-git}]{\sphinxcrossref{\DUrole{std,std-ref}{Working with Matplotlib source code}}}} \end{itemize} \subsection{Contributing pull requests} \label{\detokenize{devel/contributing:contributing-pull-requests}} It is recommended to check that your contribution complies with the following rules before submitting a pull request: \begin{itemize} \item {} If your pull request addresses an issue, please use the title to describe the issue and mention the issue number in the pull request description to ensure that a link is created to the original issue. \item {} All public methods should have informative docstrings with sample usage when appropriate. Use the \sphinxhref{https://numpydoc.readthedocs.io/en/latest/format.html}{numpy docstring standard}. \item {} Formatting should follow the recommendations of \sphinxhref{https://www.python.org/dev/peps/pep-0008/}{PEP8}. You should consider installing/enabling automatic PEP8 checking in your editor. Part of the test suite is checking PEP8 compliance, things go smoother if the code is mostly PEP8 compliant to begin with. \item {} Each high-level plotting function should have a simple example in the \sphinxcode{\sphinxupquote{Example}} section of the docstring. This should be as simple as possible to demonstrate the method. More complex examples should go in the \sphinxcode{\sphinxupquote{examples}} tree. \item {} Changes (both new features and bugfixes) should be tested. See {\hyperref[\detokenize{devel/testing:testing}]{\sphinxcrossref{\DUrole{std,std-ref}{Developer’s tips for testing}}}} for more details. \item {} Import the following modules using the standard scipy conventions: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{numpy}\PYG{n+nn}{.}\PYG{n+nn}{ma} \PYG{k}{as} \PYG{n+nn}{ma} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{k}{as} \PYG{n+nn}{mpl} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{cbook} \PYG{k}{as} \PYG{n+nn}{cbook} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{patches} \PYG{k}{as} \PYG{n+nn}{mpatches} \end{sphinxVerbatim} \item {} If your change is a major new feature, add an entry to the \sphinxcode{\sphinxupquote{What's new}} section by adding a new file in \sphinxcode{\sphinxupquote{doc/users/next\_whats\_new}} (see \sphinxcode{\sphinxupquote{doc/users/next\_whats\_new/README.rst}} for more information). \item {} If you change the API in a backward-incompatible way, please document it in \sphinxcode{\sphinxupquote{doc/api/api\_changes}}, by adding a new file describing your changes (see \sphinxcode{\sphinxupquote{doc/api/api\_changes/README.rst}} for more information) \item {} See below for additional points about {\hyperref[\detokenize{devel/contributing:keyword-argument-processing}]{\sphinxcrossref{\DUrole{std,std-ref}{Keyword argument processing}}}}, if applicable for your pull request. \end{itemize} In addition, you can check for common programming errors with the following tools: \begin{itemize} \item {} Code with a good unittest coverage (at least 70\%, better 100\%), check with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{n}{coverage} \PYG{n}{python} \PYG{n}{tests}\PYG{o}{.}\PYG{n}{py} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{k}{with}\PYG{o}{\PYGZhy{}}\PYG{n}{coverage} \end{sphinxVerbatim} \item {} No pyflakes warnings, check with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{mpip} \PYG{n}{install} \PYG{n}{pyflakes} \PYG{n}{pyflakes} \PYG{n}{path}\PYG{o}{/}\PYG{n}{to}\PYG{o}{/}\PYG{n}{module}\PYG{o}{.}\PYG{n}{py} \end{sphinxVerbatim} \end{itemize} \begin{sphinxadmonition}{note}{Note:} The current state of the Matplotlib code base is not compliant with all of those guidelines, but we expect that enforcing those constraints on all new contributions will move the overall code base quality in the right direction. \end{sphinxadmonition} \sphinxstrong{See also:} \begin{itemize} \item {} {\hyperref[\detokenize{devel/contributing:coding-guidelines}]{\sphinxcrossref{\DUrole{std,std-ref}{Coding guidelines}}}} \item {} {\hyperref[\detokenize{devel/testing:testing}]{\sphinxcrossref{\DUrole{std,std-ref}{Developer’s tips for testing}}}} \item {} {\hyperref[\detokenize{devel/documenting_mpl:documenting-matplotlib}]{\sphinxcrossref{\DUrole{std,std-ref}{Writing documentation}}}} \end{itemize} \subsection{Issues for New Contributors} \label{\detokenize{devel/contributing:issues-for-new-contributors}}\label{\detokenize{devel/contributing:new-contributors}} New contributors should look for the following tags when looking for issues. We strongly recommend that new contributors tackle issues labeled \sphinxhref{https://github.com/matplotlib/matplotlib/labels/good\%20first\%20issue}{good first issue} as they are easy, well documented issues, that do not require an understanding of the different submodules of Matplotlib. This helps the contributor become familiar with the contribution workflow, and for the core devs to become acquainted with the contributor; besides which, we frequently underestimate how easy an issue is to solve! \section{Other ways to contribute} \label{\detokenize{devel/contributing:other-ways-to-contribute}}\label{\detokenize{devel/contributing:id2}} Code is not the only way to contribute to Matplotlib. For instance, documentation is also a very important part of the project and often doesn’t get as much attention as it deserves. If you find a typo in the documentation, or have made improvements, do not hesitate to send an email to the mailing list or submit a GitHub pull request. Full documentation can be found under the doc/ directory. It also helps us if you spread the word: reference the project from your blog and articles or link to it from your website! \section{Coding guidelines} \label{\detokenize{devel/contributing:coding-guidelines}}\label{\detokenize{devel/contributing:id3}} \subsection{New modules and files: installation} \label{\detokenize{devel/contributing:new-modules-and-files-installation}}\begin{itemize} \item {} If you have added new files or directories, or reorganized existing ones, make sure the new files are included in the match patterns in \sphinxcode{\sphinxupquote{MANIFEST.in}}, and/or in \sphinxcode{\sphinxupquote{package\_data}} in \sphinxcode{\sphinxupquote{setup.py}}. \end{itemize} \subsection{C/C++ extensions} \label{\detokenize{devel/contributing:c-c-extensions}}\begin{itemize} \item {} Extensions may be written in C or C++. \item {} Code style should conform to PEP7 (understanding that PEP7 doesn’t address C++, but most of its admonitions still apply). \item {} Python/C interface code should be kept separate from the core C/C++ code. The interface code should be named \sphinxcode{\sphinxupquote{FOO\_wrap.cpp}} or \sphinxcode{\sphinxupquote{FOO\_wrapper.cpp}}. \item {} Header file documentation (aka docstrings) should be in Numpydoc format. We don’t plan on using automated tools for these docstrings, and the Numpydoc format is well understood in the scientific Python community. \end{itemize} \subsection{Keyword argument processing} \label{\detokenize{devel/contributing:keyword-argument-processing}}\label{\detokenize{devel/contributing:id4}} Matplotlib makes extensive use of \sphinxcode{\sphinxupquote{**kwargs}} for pass-through customizations from one function to another. A typical example is in {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.text:matplotlib.pyplot.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.pyplot.text()}}}}}. The definition of the pylab text function is a simple pass-through to {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.text:matplotlib.axes.Axes.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.text()}}}}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} in pylab.py} \PYG{k}{def} \PYG{n+nf}{text}\PYG{p}{(}\PYG{o}{*}\PYG{n}{args}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ret} \PYG{o}{=} \PYG{n}{gca}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{text}\PYG{p}{(}\PYG{o}{*}\PYG{n}{args}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{n}{draw\PYGZus{}if\PYGZus{}interactive}\PYG{p}{(}\PYG{p}{)} \PYG{k}{return} \PYG{n}{ret} \end{sphinxVerbatim} {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.text:matplotlib.axes.Axes.text}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{text()}}}}} in simplified form looks like this, i.e., it just passes all \sphinxcode{\sphinxupquote{args}} and \sphinxcode{\sphinxupquote{kwargs}} on to \sphinxcode{\sphinxupquote{matplotlib.text.Text.\_\_init\_\_()}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} in axes/\PYGZus{}axes.py} \PYG{k}{def} \PYG{n+nf}{text}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{s}\PYG{p}{,} \PYG{n}{fontdict}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{withdash}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)}\PYG{p}{:} \PYG{n}{t} \PYG{o}{=} \PYG{n}{Text}\PYG{p}{(}\PYG{n}{x}\PYG{o}{=}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{o}{=}\PYG{n}{y}\PYG{p}{,} \PYG{n}{text}\PYG{o}{=}\PYG{n}{s}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} and \sphinxcode{\sphinxupquote{\_\_init\_\_()}} (again with liberties for illustration) just passes them on to the {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.Artist.update:matplotlib.artist.Artist.update}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.Artist.update()}}}}} method: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} in text.py} \PYG{k}{def} \PYG{n+nf}{\PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{x}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{y}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{text}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)}\PYG{p}{:} \PYG{n}{Artist}\PYG{o}{.}\PYG{n+nf+fm}{\PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{update}\PYG{p}{(}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} \sphinxcode{\sphinxupquote{update}} does the work looking for methods named like \sphinxcode{\sphinxupquote{set\_property}} if \sphinxcode{\sphinxupquote{property}} is a keyword argument. i.e., no one looks at the keywords, they just get passed through the API to the artist constructor which looks for suitably named methods and calls them with the value. As a general rule, the use of \sphinxcode{\sphinxupquote{**kwargs}} should be reserved for pass-through keyword arguments, as in the example above. If all the keyword args are to be used in the function, and not passed on, use the key/value keyword args in the function definition rather than the \sphinxcode{\sphinxupquote{**kwargs}} idiom. In some cases, you may want to consume some keys in the local function, and let others pass through. You can \sphinxcode{\sphinxupquote{pop}} the ones to be used locally and pass on the rest. For example, in {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot()}}}}}, \sphinxcode{\sphinxupquote{scalex}} and \sphinxcode{\sphinxupquote{scaley}} are local arguments and the rest are passed on as {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D()}}}}} keyword arguments: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} in axes/\PYGZus{}axes.py} \PYG{k}{def} \PYG{n+nf}{plot}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{o}{*}\PYG{n}{args}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)}\PYG{p}{:} \PYG{n}{scalex} \PYG{o}{=} \PYG{n}{kwargs}\PYG{o}{.}\PYG{n}{pop}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{scalex}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{k+kc}{True}\PYG{p}{)} \PYG{n}{scaley} \PYG{o}{=} \PYG{n}{kwargs}\PYG{o}{.}\PYG{n}{pop}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{scaley}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{k+kc}{True}\PYG{p}{)} \PYG{k}{if} \PYG{o+ow}{not} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{\PYGZus{}hold}\PYG{p}{:} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{cla}\PYG{p}{(}\PYG{p}{)} \PYG{n}{lines} \PYG{o}{=} \PYG{p}{[}\PYG{p}{]} \PYG{k}{for} \PYG{n}{line} \PYG{o+ow}{in} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{\PYGZus{}get\PYGZus{}lines}\PYG{p}{(}\PYG{o}{*}\PYG{n}{args}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)}\PYG{p}{:} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{add\PYGZus{}line}\PYG{p}{(}\PYG{n}{line}\PYG{p}{)} \PYG{n}{lines}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{line}\PYG{p}{)} \end{sphinxVerbatim} Note: there is a use case when \sphinxcode{\sphinxupquote{kwargs}} are meant to be used locally in the function (not passed on), but you still need the \sphinxcode{\sphinxupquote{**kwargs}} idiom. That is when you want to use \sphinxcode{\sphinxupquote{*args}} to allow variable numbers of non-keyword args. In this case, python will not allow you to use named keyword args after the \sphinxcode{\sphinxupquote{*args}} usage, so you will be forced to use \sphinxcode{\sphinxupquote{**kwargs}}. An example is {\hyperref[\detokenize{api/contour_api:matplotlib.contour.ContourLabeler.clabel}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.contour.ContourLabeler.clabel()}}}}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} in contour.py} \PYG{k}{def} \PYG{n+nf}{clabel}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{o}{*}\PYG{n}{args}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)}\PYG{p}{:} \PYG{n}{fontsize} \PYG{o}{=} \PYG{n}{kwargs}\PYG{o}{.}\PYG{n}{get}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{fontsize}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{k+kc}{None}\PYG{p}{)} \PYG{n}{inline} \PYG{o}{=} \PYG{n}{kwargs}\PYG{o}{.}\PYG{n}{get}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{inline}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{fmt} \PYG{o}{=} \PYG{n}{kwargs}\PYG{o}{.}\PYG{n}{get}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{fmt}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+si}{\PYGZpc{}1.3f}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{colors} \PYG{o}{=} \PYG{n}{kwargs}\PYG{o}{.}\PYG{n}{get}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{colors}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{k+kc}{None}\PYG{p}{)} \PYG{k}{if} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{args}\PYG{p}{)} \PYG{o}{==} \PYG{l+m+mi}{0}\PYG{p}{:} \PYG{n}{levels} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{levels} \PYG{n}{indices} \PYG{o}{=} \PYG{n+nb}{range}\PYG{p}{(}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{levels}\PYG{p}{)}\PYG{p}{)} \PYG{k}{elif} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{args}\PYG{p}{)} \PYG{o}{==} \PYG{l+m+mi}{1}\PYG{p}{:} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{n}{etc}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.} \end{sphinxVerbatim} \subsection{Using logging for debug messages} \label{\detokenize{devel/contributing:using-logging-for-debug-messages}}\label{\detokenize{devel/contributing:using-logging}} Matplotlib uses the standard python \sphinxhref{https://docs.python.org/3/library/logging.html\#module-logging}{\sphinxcode{\sphinxupquote{logging}}} library to write verbose warnings, information, and debug messages. Please use it! In all those places you write \sphinxhref{https://docs.python.org/3/library/functions.html\#print}{\sphinxcode{\sphinxupquote{print()}}} statements to do your debugging, try using \sphinxcode{\sphinxupquote{log.debug()}} instead! To include \sphinxhref{https://docs.python.org/3/library/logging.html\#module-logging}{\sphinxcode{\sphinxupquote{logging}}} in your module, at the top of the module, you need to \sphinxcode{\sphinxupquote{import logging}}. Then calls in your code like: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{\PYGZus{}log} \PYG{o}{=} \PYG{n}{logging}\PYG{o}{.}\PYG{n}{getLogger}\PYG{p}{(}\PYG{n+nv+vm}{\PYGZus{}\PYGZus{}name\PYGZus{}\PYGZus{}}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} right after the imports} \PYG{c+c1}{\PYGZsh{} code} \PYG{c+c1}{\PYGZsh{} more code} \PYG{n}{\PYGZus{}log}\PYG{o}{.}\PYG{n}{info}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Here is some information}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{\PYGZus{}log}\PYG{o}{.}\PYG{n}{debug}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Here is some more detailed information}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} will log to a logger named \sphinxcode{\sphinxupquote{matplotlib.yourmodulename}}. If an end-user of Matplotlib sets up \sphinxhref{https://docs.python.org/3/library/logging.html\#module-logging}{\sphinxcode{\sphinxupquote{logging}}} to display at levels more verbose than \sphinxcode{\sphinxupquote{logger.WARNING}} in their code as follows: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{logging} \PYG{n}{fmt} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+si}{\PYGZpc{}(name)s}\PYG{l+s+s1}{:}\PYG{l+s+si}{\PYGZpc{}(lineno)5d}\PYG{l+s+s1}{ \PYGZhy{} }\PYG{l+s+si}{\PYGZpc{}(levelname)s}\PYG{l+s+s1}{ \PYGZhy{} }\PYG{l+s+si}{\PYGZpc{}(message)s}\PYG{l+s+s1}{\PYGZsq{}} \PYG{n}{logging}\PYG{o}{.}\PYG{n}{basicConfig}\PYG{p}{(}\PYG{n}{level}\PYG{o}{=}\PYG{n}{logging}\PYG{o}{.}\PYG{n}{DEBUG}\PYG{p}{,} \PYG{n+nb}{format}\PYG{o}{=}\PYG{n}{fmt}\PYG{p}{)} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \end{sphinxVerbatim} Then they will receive messages like: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{backends}\PYG{p}{:} \PYG{l+m+mi}{89} \PYG{o}{\PYGZhy{}} \PYG{n}{INFO} \PYG{o}{\PYGZhy{}} \PYG{n}{backend} \PYG{n}{MacOSX} \PYG{n}{version} \PYG{n}{unknown} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{yourmodulename}\PYG{p}{:} \PYG{l+m+mi}{347} \PYG{o}{\PYGZhy{}} \PYG{n}{INFO} \PYG{o}{\PYGZhy{}} \PYG{n}{Here} \PYG{o+ow}{is} \PYG{n}{some} \PYG{n}{information} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{yourmodulename}\PYG{p}{:} \PYG{l+m+mi}{348} \PYG{o}{\PYGZhy{}} \PYG{n}{DEBUG} \PYG{o}{\PYGZhy{}} \PYG{n}{Here} \PYG{o+ow}{is} \PYG{n}{some} \PYG{n}{more} \PYG{n}{detailed} \PYG{n}{information} \end{sphinxVerbatim} \subsubsection{Which logging level to use?} \label{\detokenize{devel/contributing:which-logging-level-to-use}} There are five levels at which you can emit messages. \sphinxhref{https://docs.python.org/3/library/logging.html\#logging.critical}{\sphinxcode{\sphinxupquote{logging.critical}}} and \sphinxhref{https://docs.python.org/3/library/logging.html\#logging.error}{\sphinxcode{\sphinxupquote{logging.error}}} are really only there for errors that will end the use of the library but not kill the interpreter. \sphinxhref{https://docs.python.org/3/library/logging.html\#logging.warning}{\sphinxcode{\sphinxupquote{logging.warning}}} overlaps with the \sphinxcode{\sphinxupquote{warnings}} library. The \sphinxhref{https://docs.python.org/3/howto/logging.html\#logging-basic-tutorial}{logging tutorial} suggests that the difference between \sphinxhref{https://docs.python.org/3/library/logging.html\#logging.warning}{\sphinxcode{\sphinxupquote{logging.warning}}} and \sphinxhref{https://docs.python.org/3/library/warnings.html\#warnings.warn}{\sphinxcode{\sphinxupquote{warnings.warn}}} is that \sphinxhref{https://docs.python.org/3/library/warnings.html\#warnings.warn}{\sphinxcode{\sphinxupquote{warnings.warn}}} be used for things the user must change to stop the warning, whereas \sphinxhref{https://docs.python.org/3/library/logging.html\#logging.warning}{\sphinxcode{\sphinxupquote{logging.warning}}} can be more persistent. By default, \sphinxhref{https://docs.python.org/3/library/logging.html\#module-logging}{\sphinxcode{\sphinxupquote{logging}}} displays all log messages at levels higher than \sphinxcode{\sphinxupquote{logging.WARNING}} to \sphinxhref{https://docs.python.org/3/library/sys.html\#sys.stderr}{\sphinxcode{\sphinxupquote{sys.stderr}}}. Calls to \sphinxhref{https://docs.python.org/3/library/logging.html\#logging.info}{\sphinxcode{\sphinxupquote{logging.info}}} are not displayed by default. They are for information that the user may want to know if the program behaves oddly. For instance, if an object isn’t drawn because its position is \sphinxcode{\sphinxupquote{NaN}}, that can usually be ignored, but a mystified user could set \sphinxcode{\sphinxupquote{logging.basicConfig(level=logging.INFO)}} and get an error message that says why. \sphinxhref{https://docs.python.org/3/library/logging.html\#logging.debug}{\sphinxcode{\sphinxupquote{logging.debug}}} is the least likely to be displayed, and hence can be the most verbose. \subsection{Developing a new backend} \label{\detokenize{devel/contributing:developing-a-new-backend}}\label{\detokenize{devel/contributing:custom-backend}} If you are working on a custom backend, the \sphinxstyleemphasis{backend} setting in \sphinxcode{\sphinxupquote{matplotlibrc}} ({\hyperref[\detokenize{tutorials/introductory/customizing:sphx-glr-tutorials-introductory-customizing-py}]{\sphinxcrossref{\DUrole{std,std-ref}{Customizing Matplotlib with style sheets and rcParams}}}}) supports an external backend via the \sphinxcode{\sphinxupquote{module}} directive. If \sphinxcode{\sphinxupquote{my\_backend.py}} is a Matplotlib backend in your \index{PYTHONPATH}\index{environment variable!PYTHONPATH}{\hyperref[\detokenize{faq/environment_variables_faq:envvar-PYTHONPATH}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PYTHONPATH}}}}}, you can set it on one of several ways \begin{itemize} \item {} in \sphinxcode{\sphinxupquote{matplotlibrc}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{backend} \PYG{p}{:} \PYG{n}{module}\PYG{p}{:}\PYG{o}{/}\PYG{o}{/}\PYG{n}{my\PYGZus{}backend} \end{sphinxVerbatim} \item {} with the \index{MPLBACKEND}\index{environment variable!MPLBACKEND}{\hyperref[\detokenize{faq/environment_variables_faq:envvar-MPLBACKEND}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{MPLBACKEND}}}}} environment variable: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{\PYGZgt{}} \PYG{n}{export} \PYG{n}{MPLBACKEND}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{module://my\PYGZus{}backend}\PYG{l+s+s2}{\PYGZdq{}} \PYG{o}{\PYGZgt{}} \PYG{n}{python} \PYG{n}{simple\PYGZus{}plot}\PYG{o}{.}\PYG{n}{py} \end{sphinxVerbatim} \item {} with the use directive in your script: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{use}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{module://my\PYGZus{}backend}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \end{itemize} \subsection{Writing examples} \label{\detokenize{devel/contributing:writing-examples}}\label{\detokenize{devel/contributing:sample-data}} We have hundreds of examples in subdirectories of \sphinxcode{\sphinxupquote{matplotlib/examples}}, and these are automatically generated when the website is built to show up in the \sphinxcode{\sphinxupquote{examples}} section of the website. Any sample data that the example uses should be kept small and distributed with Matplotlib in the \sphinxcode{\sphinxupquote{lib/matplotlib/mpl-data/sample\_data/}} directory. Then in your example code you can load it into a file handle with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{cbook} \PYG{k}{as} \PYG{n+nn}{cbook} \PYG{n}{fh} \PYG{o}{=} \PYG{n}{cbook}\PYG{o}{.}\PYG{n}{get\PYGZus{}sample\PYGZus{}data}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{mydata.dat}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \chapter{Developer’s tips for testing} \label{\detokenize{devel/testing:developer-s-tips-for-testing}}\label{\detokenize{devel/testing:testing}}\label{\detokenize{devel/testing::doc}} Matplotlib’s testing infrastructure depends on \sphinxhref{http://doc.pytest.org/en/latest/}{pytest}. The tests are in \sphinxcode{\sphinxupquote{lib/matplotlib/tests}}, and customizations to the pytest testing infrastructure are in \sphinxcode{\sphinxupquote{matplotlib.testing}}. \section{Requirements} \label{\detokenize{devel/testing:requirements}} Install the latest version of Matplotlib as documented in {\hyperref[\detokenize{devel/contributing:installing-for-devs}]{\sphinxcrossref{\DUrole{std,std-ref}{Retrieving and installing the latest version of the code}}}} In particular, follow the instructions to use a local FreeType build The following software is required to run the tests: \begin{itemize} \item {} \sphinxhref{http://doc.pytest.org/en/latest/}{pytest} (\textgreater{}=3.1) \item {} \sphinxhref{https://docs.python.org/3/library/unittest.mock.html}{mock}, when running Python 2 \item {} \sphinxhref{https://www.ghostscript.com/}{Ghostscript} (to render PDF files) \item {} \sphinxhref{https://inkscape.org}{Inkscape} (to render SVG files) \end{itemize} Optionally you can install: \begin{itemize} \item {} \sphinxhref{https://pytest-cov.readthedocs.io/en/latest/}{pytest-cov} (\textgreater{}=2.3.1) to collect coverage information \item {} \sphinxhref{https://pypi.python.org/pypi/pytest-pep8}{pytest-pep8} to test coding standards \item {} \sphinxhref{https://pypi.python.org/pypi/pytest-timeout}{pytest-timeout} to limit runtime in case of stuck tests \item {} \sphinxhref{https://pypi.python.org/pypi/pytest-xdist}{pytest-xdist} to run tests in parallel \end{itemize} \section{Running the tests} \label{\detokenize{devel/testing:running-the-tests}} Running the tests is simple. Make sure you have pytest installed and run: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{py}\PYG{o}{.}\PYG{n}{test} \end{sphinxVerbatim} or: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{n}{tests}\PYG{o}{.}\PYG{n}{py} \end{sphinxVerbatim} in the root directory of the distribution. The script takes a set of commands, such as: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxcode{\sphinxupquote{-{-}pep8}} & Perform pep8 checks (requires \sphinxhref{https://pypi.python.org/pypi/pytest-pep8}{pytest-pep8}) \\ \hline \sphinxcode{\sphinxupquote{-m "not network"}} & Disable tests that require network access \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} Additional arguments are passed on to pytest. See the pytest documentation for \sphinxhref{http://doc.pytest.org/en/latest/usage.html}{supported arguments}. Some of the more important ones are given here: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline \sphinxcode{\sphinxupquote{-{-}verbose}} & Be more verbose \\ \hline \sphinxcode{\sphinxupquote{-{-}n NUM}} & Run tests in parallel over NUM processes (requires \sphinxhref{https://pypi.python.org/pypi/pytest-xdist}{pytest-xdist}) \\ \hline \sphinxcode{\sphinxupquote{-{-}timeout=SECONDS}} & Set timeout for results from each test process (requires \sphinxhref{https://pypi.python.org/pypi/pytest-timeout}{pytest-timeout}) \\ \hline \sphinxcode{\sphinxupquote{-{-}capture=no}} or \sphinxcode{\sphinxupquote{-s}} & Do not capture stdout \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} To run a single test from the command line, you can provide a file path, optionally followed by the function separated by two colons, e.g., (tests do not need to be installed, but Matplotlib should be): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{py}\PYG{o}{.}\PYG{n}{test} \PYG{n}{lib}\PYG{o}{/}\PYG{n}{matplotlib}\PYG{o}{/}\PYG{n}{tests}\PYG{o}{/}\PYG{n}{test\PYGZus{}simplification}\PYG{o}{.}\PYG{n}{py}\PYG{p}{:}\PYG{p}{:}\PYG{n}{test\PYGZus{}clipping} \end{sphinxVerbatim} or, if tests are installed, a dot-separated path to the module, optionally followed by the function separated by two colons, such as: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{py}\PYG{o}{.}\PYG{n}{test} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{pyargs} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{tests}\PYG{o}{.}\PYG{n}{test\PYGZus{}simplification}\PYG{p}{:}\PYG{p}{:}\PYG{n}{test\PYGZus{}clipping} \end{sphinxVerbatim} If you want to run the full test suite, but want to save wall time try running the tests in parallel: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{py}\PYG{o}{.}\PYG{n}{test} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{verbose} \PYG{o}{\PYGZhy{}}\PYG{n}{n} \PYG{l+m+mi}{5} \end{sphinxVerbatim} Depending on your version of Python and pytest-xdist, you may need to set \sphinxcode{\sphinxupquote{PYTHONHASHSEED}} to a fixed value when running in parallel: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{PYTHONHASHSEED}\PYG{o}{=}\PYG{l+m+mi}{0} \PYG{n}{py}\PYG{o}{.}\PYG{n}{test} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{verbose} \PYG{o}{\PYGZhy{}}\PYG{n}{n} \PYG{l+m+mi}{5} \end{sphinxVerbatim} An alternative implementation that does not look at command line arguments and works from within Python is to run the tests from the Matplotlib library function \sphinxcode{\sphinxupquote{matplotlib.test()}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{n}{matplotlib}\PYG{o}{.}\PYG{n}{test}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \section{Writing a simple test} \label{\detokenize{devel/testing:writing-a-simple-test}} Many elements of Matplotlib can be tested using standard tests. For example, here is a test from \sphinxcode{\sphinxupquote{matplotlib.tests.test\_basic}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{test\PYGZus{}simple}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ very simple example test} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{k}{assert} \PYG{l+m+mi}{1} \PYG{o}{+} \PYG{l+m+mi}{1} \PYG{o}{==} \PYG{l+m+mi}{2} \end{sphinxVerbatim} Pytest determines which functions are tests by searching for files whose names begin with \sphinxcode{\sphinxupquote{"test\_"}} and then within those files for functions beginning with \sphinxcode{\sphinxupquote{"test"}} or classes beginning with \sphinxcode{\sphinxupquote{"Test"}}. Some tests have internal side effects that need to be cleaned up after their execution (such as created figures or modified rc params). The pytest fixture \sphinxcode{\sphinxupquote{mpl\_test\_settings()}} will automatically clean these up; there is no need to do anything further. \section{Random data in tests} \label{\detokenize{devel/testing:random-data-in-tests}} Random data can is a very convenient way to generate data for examples, however the randomness is problematic for testing (as the tests must be deterministic!). To work around this set the seed in each test. For numpy use: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{19680801}\PYG{p}{)} \end{sphinxVerbatim} and Python’s random number generator: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{random} \PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{19680801}\PYG{p}{)} \end{sphinxVerbatim} The seed is John Hunter’s birthday. \section{Writing an image comparison test} \label{\detokenize{devel/testing:writing-an-image-comparison-test}} Writing an image based test is only slightly more difficult than a simple test. The main consideration is that you must specify the “baseline”, or expected, images in the \sphinxcode{\sphinxupquote{image\_comparison()}} decorator. For example, this test generates a single image and automatically tests it: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{testing}\PYG{n+nn}{.}\PYG{n+nn}{decorators} \PYG{k}{import} \PYG{n}{image\PYGZus{}comparison} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n+nd}{@image\PYGZus{}comparison}\PYG{p}{(}\PYG{n}{baseline\PYGZus{}images}\PYG{o}{=}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{spines\PYGZus{}axes\PYGZus{}positions}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{,} \PYG{n}{extensions}\PYG{o}{=}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{png}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{test\PYGZus{}spines\PYGZus{}axes\PYGZus{}positions}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} SF bug 2852168} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{figure}\PYG{p}{(}\PYG{p}{)} \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{,}\PYG{l+m+mi}{100}\PYG{p}{)} \PYG{n}{y} \PYG{o}{=} \PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{add\PYGZus{}subplot}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{centered spines}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,}\PYG{n}{y}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{spines}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}position}\PYG{p}{(}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,}\PYG{l+m+mf}{0.1}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{yaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}ticks\PYGZus{}position}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{right}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{spines}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{top}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}position}\PYG{p}{(}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{axes}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,}\PYG{l+m+mf}{0.25}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{xaxis}\PYG{o}{.}\PYG{n}{set\PYGZus{}ticks\PYGZus{}position}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{top}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{spines}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{left}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}color}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{none}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{spines}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{bottom}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{set\PYGZus{}color}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{none}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} The first time this test is run, there will be no baseline image to compare against, so the test will fail. Copy the output images (in this case \sphinxcode{\sphinxupquote{result\_images/test\_category/spines\_axes\_positions.png}}) to the correct subdirectory of \sphinxcode{\sphinxupquote{baseline\_images}} tree in the source directory (in this case \sphinxcode{\sphinxupquote{lib/matplotlib/tests/baseline\_images/test\_category}}). Put this new file under source code revision control (with \sphinxcode{\sphinxupquote{git add}}). When rerunning the tests, they should now pass. The \sphinxcode{\sphinxupquote{image\_comparison()}} decorator defaults to generating \sphinxcode{\sphinxupquote{png}}, \sphinxcode{\sphinxupquote{pdf}} and \sphinxcode{\sphinxupquote{svg}} output, but in interest of keeping the size of the library from ballooning we should only include the \sphinxcode{\sphinxupquote{svg}} or \sphinxcode{\sphinxupquote{pdf}} outputs if the test is explicitly exercising a feature dependent on that backend. There are two optional keyword arguments to the \sphinxcode{\sphinxupquote{image\_comparison}} decorator: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{extensions}}: If you only wish to test additional image formats (rather than just \sphinxcode{\sphinxupquote{png}}), pass any additional file types in the list of the extensions to test. When copying the new baseline files be sure to only copy the output files, not their conversions to \sphinxcode{\sphinxupquote{png}}. For example only copy the files ending in \sphinxcode{\sphinxupquote{pdf}}, not in \sphinxcode{\sphinxupquote{\_pdf.png}}. \item {} \sphinxcode{\sphinxupquote{tol}}: This is the image matching tolerance, the default \sphinxcode{\sphinxupquote{1e-3}}. If some variation is expected in the image between runs, this value may be adjusted. \end{itemize} \section{Known failing tests} \label{\detokenize{devel/testing:known-failing-tests}} If you’re writing a test, you may mark it as a known failing test with the \sphinxcode{\sphinxupquote{pytest.mark.xfail()}} decorator. This allows the test to be added to the test suite and run on the buildbots without causing undue alarm. For example, although the following test will fail, it is an expected failure: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{pytest} \PYG{n+nd}{@pytest}\PYG{o}{.}\PYG{n}{mark}\PYG{o}{.}\PYG{n}{xfail} \PYG{k}{def} \PYG{n+nf}{test\PYGZus{}simple\PYGZus{}fail}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZsq{}\PYGZsq{}\PYGZsq{}very simple example test that should fail\PYGZsq{}\PYGZsq{}\PYGZsq{}} \PYG{k}{assert} \PYG{l+m+mi}{1} \PYG{o}{+} \PYG{l+m+mi}{1} \PYG{o}{==} \PYG{l+m+mi}{3} \end{sphinxVerbatim} Note that the first argument to the \sphinxcode{\sphinxupquote{xfail()}} decorator is a fail condition, which can be a value such as True, False, or may be a dynamically evaluated expression. If a condition is supplied, then a reason must also be supplied with the \sphinxcode{\sphinxupquote{reason='message'}} keyword argument. \section{Creating a new module in matplotlib.tests} \label{\detokenize{devel/testing:creating-a-new-module-in-matplotlib-tests}} We try to keep the tests categorized by the primary module they are testing. For example, the tests related to the \sphinxcode{\sphinxupquote{mathtext.py}} module are in \sphinxcode{\sphinxupquote{test\_mathtext.py}}. \section{Using Travis CI} \label{\detokenize{devel/testing:using-travis-ci}} \sphinxhref{https://travis-ci.org/}{Travis CI} is a hosted CI system “in the cloud”. Travis is configured to receive notifications of new commits to GitHub repos (via GitHub “service hooks”) and to run builds or tests when it sees these new commits. It looks for a YAML file called \sphinxcode{\sphinxupquote{.travis.yml}} in the root of the repository to see how to test the project. Travis CI is already enabled for the \sphinxhref{https://github.com/matplotlib/matplotlib/}{main matplotlib GitHub repository} \textendash{} for example, see \sphinxhref{https://travis-ci.org/matplotlib/matplotlib}{its Travis page}. If you want to enable Travis CI for your personal Matplotlib GitHub repo, simply enable the repo to use Travis CI in either the Travis CI UI or the GitHub UI (Admin \textbar{} Service Hooks). For details, see \sphinxhref{https://docs.travis-ci.com/user/getting-started/}{the Travis CI Getting Started page}. This generally isn’t necessary, since any pull request submitted against the main Matplotlib repository will be tested. Once this is configured, you can see the Travis CI results at \sphinxurl{https://travis-ci.org/your\_GitHub\_user\_name/matplotlib} \textendash{} here’s \sphinxhref{https://travis-ci.org/msabramo/matplotlib}{an example}. \section{Using tox} \label{\detokenize{devel/testing:using-tox}} \sphinxhref{https://tox.readthedocs.io/en/latest/}{Tox} is a tool for running tests against multiple Python environments, including multiple versions of Python (e.g., 2.7, 3.4, 3.5) and even different Python implementations altogether (e.g., CPython, PyPy, Jython, etc.) Testing all versions of Python (2.6, 2.7, 3.*) requires having multiple versions of Python installed on your system and on the PATH. Depending on your operating system, you may want to use your package manager (such as apt-get, yum or MacPorts) to do this. tox makes it easy to determine if your working copy introduced any regressions before submitting a pull request. Here’s how to use it: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYGZdl{} pip install tox \PYGZdl{} tox \end{sphinxVerbatim} You can also run tox on a subset of environments: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYGZdl{} tox \PYGZhy{}e py26,py27 \end{sphinxVerbatim} Tox processes everything serially so it can take a long time to test several environments. To speed it up, you might try using a new, parallelized version of tox called \sphinxcode{\sphinxupquote{detox}}. Give this a try: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYGZdl{} pip install \PYGZhy{}U \PYGZhy{}i http://pypi.testrun.org detox \PYGZdl{} detox \end{sphinxVerbatim} Tox is configured using a file called \sphinxcode{\sphinxupquote{tox.ini}}. You may need to edit this file if you want to add new environments to test (e.g., \sphinxcode{\sphinxupquote{py33}}) or if you want to tweak the dependencies or the way the tests are run. For more info on the \sphinxcode{\sphinxupquote{tox.ini}} file, see the \sphinxhref{https://tox.readthedocs.io/en/latest/config.html}{Tox Configuration Specification}. \chapter{Writing documentation} \label{\detokenize{devel/documenting_mpl:writing-documentation}}\label{\detokenize{devel/documenting_mpl:documenting-matplotlib}}\label{\detokenize{devel/documenting_mpl::doc}} \section{Getting started} \label{\detokenize{devel/documenting_mpl:getting-started}} \subsection{General file structure} \label{\detokenize{devel/documenting_mpl:general-file-structure}} All documentation is built from the \sphinxcode{\sphinxupquote{doc/}} directory. This directory contains both reStructuredText (\sphinxhref{http://docutils.sourceforge.net/rst.html}{ReST}; \sphinxcode{\sphinxupquote{.rst}}) files that contain pages in the documentation and configuration files for \sphinxhref{http://www.sphinx-doc.org}{Sphinx}. The \sphinxcode{\sphinxupquote{.rst}} files are kept in \sphinxcode{\sphinxupquote{doc/users}}, \sphinxcode{\sphinxupquote{doc/devel}}, \sphinxcode{\sphinxupquote{doc/api}} and \sphinxcode{\sphinxupquote{doc/faq}}. The main entry point is \sphinxcode{\sphinxupquote{doc/index.rst}}, which pulls in the \sphinxcode{\sphinxupquote{index.rst}} file for the users guide, developers guide, api reference, and FAQs. The documentation suite is built as a single document in order to make the most effective use of cross referencing. \sphinxhref{http://www.sphinx-doc.org}{Sphinx} also creates \sphinxcode{\sphinxupquote{.rst}} files that are staged in \sphinxcode{\sphinxupquote{doc/api}} from the docstrings of the classes in the Matplotlib library. Except for \sphinxcode{\sphinxupquote{doc/api/api\_changes/}}, these \sphinxcode{\sphinxupquote{.rst}} files are created when the documentation is built. Similarly, the contents of \sphinxcode{\sphinxupquote{docs/gallery}} and \sphinxcode{\sphinxupquote{docs/tutorials}} are generated by the \sphinxhref{https://sphinx-gallery.readthedocs.io/en/latest/}{Sphinx Gallery} from the sources in \sphinxcode{\sphinxupquote{examples}} and \sphinxcode{\sphinxupquote{tutorials}}. These sources consist of python scripts that have \sphinxhref{http://docutils.sourceforge.net/rst.html}{ReST} documentation built into their comments. Don’t directly edit the \sphinxcode{\sphinxupquote{.rst}} files in \sphinxcode{\sphinxupquote{docs/gallery}} and \sphinxcode{\sphinxupquote{docs/tutorials}} as they are regenerated when the documentation are built. \subsection{Installing dependencies} \label{\detokenize{devel/documenting_mpl:installing-dependencies}} The documentation for Matplotlib is generated from reStructuredText (\sphinxhref{http://docutils.sourceforge.net/rst.html}{ReST}) using the \sphinxhref{http://www.sphinx-doc.org}{Sphinx} documentation generation tool. There are several extra requirements that are needed to build the documentation. They are listed in \sphinxcode{\sphinxupquote{doc-requirements.txt}} and listed below: \begin{itemize} \item {} Sphinx\textgreater{}=1.3, !=1.5.0, !=1.6.4 \item {} colorspacious \item {} IPython \item {} mock \item {} numpydoc\textgreater{}=0.4 \item {} Pillow \item {} sphinx-gallery\textgreater{}=0.1.12 \item {} graphviz \end{itemize} \begin{sphinxadmonition}{note}{Note:}\begin{itemize} \item {} You’ll need a minimal working LaTeX distribution for many examples to run. \item {} \sphinxhref{http://www.graphviz.org/Download.php}{Graphviz} is not a Python package, and needs to be installed separately. \end{itemize} \end{sphinxadmonition} \subsection{Building the docs} \label{\detokenize{devel/documenting_mpl:building-the-docs}} The documentation sources are found in the \sphinxcode{\sphinxupquote{doc/}} directory in the trunk. The configuration file for Sphinx is \sphinxcode{\sphinxupquote{doc/conf.py}}. It controls which directories Sphinx parses, how the docs are built, and how the extensions are used. To build the documentation in html format, cd into \sphinxcode{\sphinxupquote{doc/}} and run: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] make html \end{sphinxVerbatim} Other useful invocations include \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} Delete built files. May help if you get errors about missing paths or} \PYG{c+c1}{\PYGZsh{} broken links.} make clean \PYG{c+c1}{\PYGZsh{} Build pdf docs.} make latexpdf \end{sphinxVerbatim} The \sphinxcode{\sphinxupquote{SPHINXOPTS}} variable is set to \sphinxcode{\sphinxupquote{-W}} by default to turn warnings into errors. To unset it, use \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] make \PYG{n+nv}{SPHINXOPTS}\PYG{o}{=} html \end{sphinxVerbatim} You can use the \sphinxcode{\sphinxupquote{O}} variable to set additional options: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{make O=-j4 html}} runs a parallel build with 4 processes. \item {} \sphinxcode{\sphinxupquote{make O=-Dplot\_formats=png:100 html}} saves figures in low resolution. \item {} \sphinxcode{\sphinxupquote{make O=-Dplot\_gallery=0 html}} skips the gallery build. \end{itemize} Multiple options can be combined using e.g. \sphinxcode{\sphinxupquote{make O='-j4 -Dplot\_gallery=0' html}}. On Windows, options needs to be set as environment variables, e.g. \sphinxcode{\sphinxupquote{set O=-W -j4 \& make html}}. \section{Writing ReST pages} \label{\detokenize{devel/documenting_mpl:writing-rest-pages}}\label{\detokenize{devel/documenting_mpl:id1}} Most documentation is either in the docstring of individual classes and methods, in explicit \sphinxcode{\sphinxupquote{.rst}} files, or in examples and tutorials. All of these use the \sphinxhref{http://docutils.sourceforge.net/rst.html}{ReST} syntax. Users should look at the \sphinxhref{http://docutils.sourceforge.net/rst.html}{ReST} documentation for a full description. But some specific hints and conventions Matplotlib uses are useful for creating documentation. \subsection{Formatting and style conventions} \label{\detokenize{devel/documenting_mpl:formatting-and-style-conventions}} It is useful to strive for consistency in the Matplotlib documentation. Here are some formatting and style conventions that are used. \subsubsection{Section name formatting} \label{\detokenize{devel/documenting_mpl:section-name-formatting}} For everything but top-level chapters, use \sphinxcode{\sphinxupquote{Upper lower}} for section titles, e.g., \sphinxcode{\sphinxupquote{Possible hangups}} rather than \sphinxcode{\sphinxupquote{Possible Hangups}} \subsubsection{Function arguments} \label{\detokenize{devel/documenting_mpl:function-arguments}} Function arguments and keywords within docstrings should be referred to using the \sphinxcode{\sphinxupquote{*emphasis*}} role. This will keep Matplotlib’s documentation consistent with Python’s documentation: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] Here is a description of \PYG{g+ge}{*argument*} \end{sphinxVerbatim} Do not use the \sphinxcode{\sphinxupquote{{}`default role{}`}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] Do not describe \PYG{n+nv}{{}`argument{}`} like this. As per the next section, this syntax will (unsuccessfully) attempt to resolve the argument as a link to a class or method in the library. \end{sphinxVerbatim} nor the \sphinxcode{\sphinxupquote{{}`{}`literal{}`{}`}} role: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] Do not describe \PYG{l+s}{{}`{}`}\PYG{l+s}{argument}\PYG{l+s}{{}`{}`} like this. \end{sphinxVerbatim} \subsection{Referring to other documents and sections} \label{\detokenize{devel/documenting_mpl:referring-to-other-documents-and-sections}}\label{\detokenize{devel/documenting_mpl:internal-section-refs}} \sphinxhref{http://www.sphinx-doc.org}{Sphinx} allows internal \sphinxhref{http://www.sphinx-doc.org/en/stable/markup/inline.html}{references} between documents. Documents can be linked with the \sphinxcode{\sphinxupquote{:doc:}} directive: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] See the \PYG{n+na}{:doc:}\PYG{n+nv}{{}`/faq/installing\PYGZus{}faq{}`} See the tutorial \PYG{n+na}{:doc:}\PYG{n+nv}{{}`/tutorials/introductory/sample\PYGZus{}plots{}`} See the example \PYG{n+na}{:doc:}\PYG{n+nv}{{}`/gallery/lines\PYGZus{}bars\PYGZus{}and\PYGZus{}markers/simple\PYGZus{}plot{}`} \end{sphinxVerbatim} will render as: \begin{quote} See the {\hyperref[\detokenize{faq/installing_faq::doc}]{\sphinxcrossref{\DUrole{doc}{Installation}}}} See the tutorial {\hyperref[\detokenize{tutorials/introductory/sample_plots::doc}]{\sphinxcrossref{\DUrole{doc}{Sample plots in Matplotlib}}}} See the example \DUrole{xref,std,std-doc}{/gallery/lines\_bars\_and\_markers/simple\_plot} \end{quote} Sections can also be given reference names. For instance from the {\hyperref[\detokenize{faq/installing_faq::doc}]{\sphinxcrossref{\DUrole{doc}{Installation}}}} link: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{..} \PYG{n+nt}{\PYGZus{}clean\PYGZhy{}install:} \PYG{g+gh}{How to completely remove Matplotlib} \PYG{g+gh}{===================================} Occasionally, problems with Matplotlib can be solved with a clean... \end{sphinxVerbatim} and refer to it using the standard reference syntax: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] See \PYG{n+na}{:ref:}\PYG{n+nv}{{}`clean\PYGZhy{}install{}`} \end{sphinxVerbatim} will give the following link: {\hyperref[\detokenize{faq/installing_faq:clean-install}]{\sphinxcrossref{\DUrole{std,std-ref}{How to completely remove Matplotlib}}}} To maximize internal consistency in section labeling and references, use hyphen separated, descriptive labels for section references. Keep in mind that contents may be reorganized later, so avoid top level names in references like \sphinxcode{\sphinxupquote{user}} or \sphinxcode{\sphinxupquote{devel}} or \sphinxcode{\sphinxupquote{faq}} unless necessary, because for example the FAQ “what is a backend?” could later become part of the users guide, so the label: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{..} \PYG{n+nt}{\PYGZus{}what\PYGZhy{}is\PYGZhy{}a\PYGZhy{}backend:} \end{sphinxVerbatim} is better than: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{..} \PYG{n+nt}{\PYGZus{}faq\PYGZhy{}backend:} \end{sphinxVerbatim} In addition, since underscores are widely used by Sphinx itself, use hyphens to separate words. \subsection{Referring to other code} \label{\detokenize{devel/documenting_mpl:referring-to-other-code}} To link to other methods, classes, or modules in Matplotlib you can use back ticks, for example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sb}{{}`\PYGZti{}matplotlib.collections.LineCollection{}`} \end{sphinxVerbatim} returns a link to the documentation of {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}}. For the full path of the class to be shown, omit the tilde: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sb}{{}`matplotlib.collections.LineCollection{}`} \end{sphinxVerbatim} to get {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.collections.LineCollection}}}}}. It is often not necessary to fully specify the class hierarchy unless there is a namespace collision between two packages: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sb}{{}`\PYGZti{}.LineCollection{}`} \end{sphinxVerbatim} links just as well: {\hyperref[\detokenize{api/collections_api:matplotlib.collections.LineCollection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{LineCollection}}}}}. Other packages can also be linked via \sphinxcode{\sphinxupquote{intersphinx}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sb}{{}`numpy.mean{}`} \end{sphinxVerbatim} will return this link: \sphinxhref{https://docs.scipy.org/doc/numpy/reference/generated/numpy.mean.html\#numpy.mean}{\sphinxcode{\sphinxupquote{numpy.mean}}}. This works for Python, Numpy, Scipy, and Pandas (full list is in \sphinxcode{\sphinxupquote{doc/conf.py}}). Sometimes it is tricky to get external Sphinx linking to work; to check that a something exists to link to the following shell command outputs a list of all objects that can be referenced (in this case for Numpy): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{m} \PYG{n}{sphinx}\PYG{o}{.}\PYG{n}{ext}\PYG{o}{.}\PYG{n}{intersphinx} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{https://docs.scipy.org/doc/numpy/objects.inv}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} \subsection{Including figures and files} \label{\detokenize{devel/documenting_mpl:including-figures-and-files}}\label{\detokenize{devel/documenting_mpl:rst-figures-and-includes}} Image files can directly included in pages with the \sphinxcode{\sphinxupquote{image::}} directive. e.g., \sphinxcode{\sphinxupquote{users/navigation\_toolbar.rst}} displays the toolbar icons with a call to a static image: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{.}\PYG{o}{.} \PYG{n}{image}\PYG{p}{:}\PYG{p}{:} \PYG{o}{.}\PYG{o}{.}\PYG{o}{/}\PYG{n}{\PYGZus{}static}\PYG{o}{/}\PYG{n}{toolbar}\PYG{o}{.}\PYG{n}{png} \end{sphinxVerbatim} as rendered on the page: {\hyperref[\detokenize{users/navigation_toolbar:navigation-toolbar}]{\sphinxcrossref{\DUrole{std,std-ref}{Interactive navigation}}}}. Files can be included verbatim. For instance the \sphinxcode{\sphinxupquote{matplotlibrc}} file is important for customizing Matplotlib, and is included verbatim in the tutorial in {\hyperref[\detokenize{tutorials/introductory/customizing::doc}]{\sphinxcrossref{\DUrole{doc}{Customizing Matplotlib with style sheets and rcParams}}}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{.}\PYG{o}{.} \PYG{n}{literalinclude}\PYG{p}{:}\PYG{p}{:} \PYG{o}{.}\PYG{o}{.}\PYG{o}{/}\PYG{o}{.}\PYG{o}{.}\PYG{o}{/}\PYG{n}{\PYGZus{}static}\PYG{o}{/}\PYG{n}{matplotlibrc} \end{sphinxVerbatim} This is rendered at the bottom of {\hyperref[\detokenize{tutorials/introductory/customizing::doc}]{\sphinxcrossref{\DUrole{doc}{Customizing Matplotlib with style sheets and rcParams}}}}. Note that this is in a tutorial; see {\hyperref[\detokenize{devel/documenting_mpl:writing-examples-and-tutorials}]{\sphinxcrossref{\DUrole{std,std-ref}{Writing examples and tutorials}}}} below. The examples directory is also copied to \sphinxcode{\sphinxupquote{doc/gallery}} by sphinx-gallery, so plots from the examples directory can be included using \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{..} \PYG{o+ow}{plot}\PYG{p}{::} gallery/pylab\PYGZus{}examples/simple\PYGZus{}plot.py \end{sphinxVerbatim} Note that the python script that generates the plot is referred to, rather than any plot that is created. Sphinx-gallery will provide the correct reference when the documentation is built. \section{Writing docstrings} \label{\detokenize{devel/documenting_mpl:writing-docstrings}}\label{\detokenize{devel/documenting_mpl:id2}} Much of the documentation lives in “docstrings”. These are comment blocks in source code that explain how the code works. All new or edited docstrings should conform to the numpydoc guidelines. These split the docstring into a number of sections - see the \sphinxhref{https://github.com/numpy/numpy/blob/master/doc/HOWTO\_DOCUMENT.rst.txt}{numpy documentation howto} for more details and a guide to how docstrings should be formatted. Much of the \sphinxhref{http://docutils.sourceforge.net/rst.html}{ReST} syntax discussed above (:ref:writing-rest-pages) can be used for links and references. These docstrings eventually populate the \sphinxcode{\sphinxupquote{doc/api}} directory and form the reference documentation for the library. \subsection{Example docstring} \label{\detokenize{devel/documenting_mpl:example-docstring}} An example docstring looks like: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{hlines}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{xmin}\PYG{p}{,} \PYG{n}{xmax}\PYG{p}{,} \PYG{n}{colors}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{k}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{linestyles}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{solid}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{label}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ Plot horizontal lines at each *y* from *xmin* to *xmax*.} \PYG{l+s+sd}{ Parameters} \PYG{l+s+sd}{ \PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}} \PYG{l+s+sd}{ y : scalar or sequence of scalar} \PYG{l+s+sd}{ y\PYGZhy{}indexes where to plot the lines.} \PYG{l+s+sd}{ xmin, xmax : scalar or 1D array\PYGZus{}like} \PYG{l+s+sd}{ Respective beginning and end of each line. If scalars are} \PYG{l+s+sd}{ provided, all lines will have same length.} \PYG{l+s+sd}{ colors : array\PYGZus{}like of colors, optional, default: \PYGZsq{}k\PYGZsq{}} \PYG{l+s+sd}{ linestyles : \PYGZob{}\PYGZsq{}solid\PYGZsq{}, \PYGZsq{}dashed\PYGZsq{}, \PYGZsq{}dashdot\PYGZsq{}, \PYGZsq{}dotted\PYGZsq{}\PYGZcb{}, optional} \PYG{l+s+sd}{ label : string, optional, default: \PYGZsq{}\PYGZsq{}} \PYG{l+s+sd}{ Returns} \PYG{l+s+sd}{ \PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}} \PYG{l+s+sd}{ lines : {}`\PYGZti{}matplotlib.collections.LineCollection{}`} \PYG{l+s+sd}{ Other Parameters} \PYG{l+s+sd}{ \PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}} \PYG{l+s+sd}{ **kwargs : {}`\PYGZti{}matplotlib.collections.LineCollection{}` properties.} \PYG{l+s+sd}{ See also} \PYG{l+s+sd}{ \PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}} \PYG{l+s+sd}{ vlines : vertical lines} \PYG{l+s+sd}{ axhline: horizontal line across the axes} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \end{sphinxVerbatim} See the {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.hlines:matplotlib.axes.Axes.hlines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{hlines}}}}} documentation for how this renders. The \sphinxhref{http://www.sphinx-doc.org}{Sphinx} website also contains plenty of \sphinxhref{http://www.sphinx-doc.org/contents.html}{documentation} concerning ReST markup and working with Sphinx in general. \begin{sphinxadmonition}{note}{Note:} Some parts of the documentation do not yet conform to the current documentation style. If in doubt, follow the rules given here and not what you may see in the source code. Pull requests updating docstrings to the current style are very welcome. \end{sphinxadmonition} \subsection{Formatting conventions} \label{\detokenize{devel/documenting_mpl:formatting-conventions}} The basic docstring conventions are covered in the \sphinxhref{https://github.com/numpy/numpy/blob/master/doc/HOWTO\_DOCUMENT.rst.txt}{numpy documentation howto} and the \sphinxhref{http://www.sphinx-doc.org}{Sphinx} documentation. Some Matplotlib-specific formatting conventions to keep in mind: \begin{itemize} \item {} Matplotlib does not have a convention whether to use single-quotes or double-quotes. There is a mixture of both in the current code. \item {} Long parameter lists should be wrapped using a \sphinxcode{\sphinxupquote{\textbackslash{}}} for continuation and starting on the new line without any indent: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{add\PYGZus{}axes}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{o}{*}\PYG{n}{args}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ ...} \PYG{l+s+sd}{ Parameters} \PYG{l+s+sd}{ \PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}} \PYG{l+s+sd}{ projection :} \PYG{l+s+sd}{ \PYGZob{}\PYGZsq{}aitoff\PYGZsq{}, \PYGZsq{}hammer\PYGZsq{}, \PYGZsq{}lambert\PYGZsq{}, \PYGZsq{}mollweide\PYGZsq{}, \PYGZsq{}polar\PYGZsq{}, \PYGZbs{}} \PYG{l+s+sd}{\PYGZsq{}rectilinear\PYGZsq{}\PYGZcb{}, optional} \PYG{l+s+sd}{ The projection type of the axes.} \PYG{l+s+sd}{ ...} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \end{sphinxVerbatim} Alternatively, you can describe the valid parameter values in a dedicated section of the docstring. \item {} Generally, do not add markup to types for \sphinxcode{\sphinxupquote{Parameters}} and \sphinxcode{\sphinxupquote{Returns}}. This is usually not needed because Sphinx will link them automatically and would unnecessarily clutter the docstring. However, it does seem to fail in some situations. If you encounter such a case, you are allowed to add markup: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gh}{Returns} \PYG{g+gh}{\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}} lines : \PYG{n+nv}{{}`\PYGZti{}matplotlib.collections.LineCollection{}`} \end{sphinxVerbatim} \item {} rcParams can be referenced with the custom \sphinxcode{\sphinxupquote{:rc:}} role: \sphinxcode{\sphinxupquote{:rc:{}`foo{}`}} yields \sphinxcode{\sphinxupquote{rcParams{[}"foo"{]}}}. \end{itemize} \subsection{Deprecated formatting conventions} \label{\detokenize{devel/documenting_mpl:deprecated-formatting-conventions}}\begin{itemize} \item {} Formerly, we have used square brackets for explicit parameter lists \sphinxcode{\sphinxupquote{{[}'solid' \textbar{} 'dashed' \textbar{} 'dotted'{]}}}. With numpydoc we have switched to their standard using curly braces \sphinxcode{\sphinxupquote{\{'solid', 'dashed', 'dotted'\}}}. \end{itemize} \subsection{Linking to other code} \label{\detokenize{devel/documenting_mpl:linking-to-other-code}} To link to other methods, classes, or modules in Matplotlib you can encase the name to refer to in back ticks, for example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sb}{{}`\PYGZti{}matplotlib.collections.LineCollection{}`} \end{sphinxVerbatim} It is also possible to add links to code in Python, Numpy, Scipy, or Pandas. Sometimes it is tricky to get external Sphinx linking to work; to check that a something exists to link to the following shell command outputs a list of all objects that can be referenced (in this case for Numpy): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{python} \PYG{o}{\PYGZhy{}}\PYG{n}{m} \PYG{n}{sphinx}\PYG{o}{.}\PYG{n}{ext}\PYG{o}{.}\PYG{n}{intersphinx} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{https://docs.scipy.org/doc/numpy/objects.inv}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} \subsection{Function arguments} \label{\detokenize{devel/documenting_mpl:id3}} Function arguments and keywords within docstrings should be referred to using the \sphinxcode{\sphinxupquote{*emphasis*}} role. This will keep Matplotlib’s documentation consistent with Python’s documentation: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] Here is a description of \PYG{g+ge}{*argument*} \end{sphinxVerbatim} Do not use the \sphinxcode{\sphinxupquote{{}`default role{}`}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] Do not describe \PYG{n+nv}{{}`argument{}`} like this. \end{sphinxVerbatim} nor the \sphinxcode{\sphinxupquote{{}`{}`literal{}`{}`}} role: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] Do not describe \PYG{l+s}{{}`{}`}\PYG{l+s}{argument}\PYG{l+s}{{}`{}`} like this. \end{sphinxVerbatim} \subsection{Setters and getters} \label{\detokenize{devel/documenting_mpl:setters-and-getters}} Artist properties are implemented using setter and getter methods (because Matplotlib predates the introductions of the \sphinxhref{https://docs.python.org/3/library/functions.html\#property}{\sphinxcode{\sphinxupquote{property}}} decorator in Python). By convention, these setters and getters are named \sphinxcode{\sphinxupquote{set\_PROPERTYNAME}} and \sphinxcode{\sphinxupquote{get\_PROPERTYNAME}}; the list of properties thusly defined on an artist and their values can be listed by the {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.setp:matplotlib.pyplot.setp}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{setp}}}}} and \sphinxcode{\sphinxupquote{getp}} functions. Property setter methods should indicate the values they accept using a (legacy) special block in the docstring, starting with \sphinxcode{\sphinxupquote{ACCEPTS}}, as follows: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} in lines.py} \PYG{k}{def} \PYG{n+nf}{set\PYGZus{}linestyle}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{linestyle}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ Set the linestyle of the line} \PYG{l+s+sd}{ ACCEPTS: [ \PYGZsq{}\PYGZhy{}\PYGZsq{} \textbar{} \PYGZsq{}\PYGZhy{}\PYGZhy{}\PYGZsq{} \textbar{} \PYGZsq{}\PYGZhy{}.\PYGZsq{} \textbar{} \PYGZsq{}:\PYGZsq{} \textbar{} \PYGZsq{}steps\PYGZsq{} \textbar{} \PYGZsq{}None\PYGZsq{} \textbar{} \PYGZsq{} \PYGZsq{} \textbar{} \PYGZsq{}\PYGZsq{} ]} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \end{sphinxVerbatim} The ACCEPTS block is used to render a table of all properties and their acceptable values in the docs; it can also be displayed using, e.g., \sphinxcode{\sphinxupquote{plt.setp(Line2D)}} (all properties) or \sphinxcode{\sphinxupquote{plt.setp(Line2D, 'linestyle')}} (just one property). There are cases in which the ACCEPTS string is not useful in the generated Sphinx documentation, e.g. if the valid parameters are already defined in the numpydoc parameter list. You can hide the ACCEPTS string from Sphinx by making it a ReST comment (i.e. use \sphinxcode{\sphinxupquote{.. ACCEPTS:}}): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{set\PYGZus{}linestyle}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{linestyle}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ An ACCEPTS string invisible to Sphinx.} \PYG{l+s+sd}{ .. ACCEPTS: [ \PYGZsq{}\PYGZhy{}\PYGZsq{} \textbar{} \PYGZsq{}\PYGZhy{}\PYGZhy{}\PYGZsq{} \textbar{} \PYGZsq{}\PYGZhy{}.\PYGZsq{} \textbar{} \PYGZsq{}:\PYGZsq{} \textbar{} \PYGZsq{}steps\PYGZsq{} \textbar{} \PYGZsq{}None\PYGZsq{} \textbar{} \PYGZsq{} \PYGZsq{} \textbar{} \PYGZsq{}\PYGZsq{} ]} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \end{sphinxVerbatim} \subsection{Keyword arguments} \label{\detokenize{devel/documenting_mpl:keyword-arguments}} \begin{sphinxadmonition}{note}{Note:} The information in this section is being actively discussed by the development team, so use the docstring interpolation only if necessary. This section has been left in place for now because this interpolation is part of the existing documentation. \end{sphinxadmonition} Since Matplotlib uses a lot of pass-through \sphinxcode{\sphinxupquote{kwargs}}, e.g., in every function that creates a line ({\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.plot:matplotlib.pyplot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.semilogx:matplotlib.pyplot.semilogx}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{semilogx}}}}}, {\hyperref[\detokenize{api/_as_gen/matplotlib.pyplot.semilogy:matplotlib.pyplot.semilogy}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{semilogy}}}}}, etc…), it can be difficult for the new user to know which \sphinxcode{\sphinxupquote{kwargs}} are supported. Matplotlib uses a docstring interpolation scheme to support documentation of every function that takes a \sphinxcode{\sphinxupquote{**kwargs}}. The requirements are: \begin{enumerate} \item {} single point of configuration so changes to the properties don’t require multiple docstring edits. \item {} as automated as possible so that as properties change, the docs are updated automatically. \end{enumerate} The function {\hyperref[\detokenize{api/_as_gen/matplotlib.artist.kwdoc:matplotlib.artist.kwdoc}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.artist.kwdoc}}}}} and the decorator \sphinxcode{\sphinxupquote{matplotlib.docstring.dedent\_interpd}} facilitate this. They combine Python string interpolation in the docstring with the Matplotlib artist introspection facility that underlies \sphinxcode{\sphinxupquote{setp}} and \sphinxcode{\sphinxupquote{getp}}. The \sphinxcode{\sphinxupquote{kwdoc}} function gives the list of properties as a docstring. In order to use this in another docstring, first update the \sphinxcode{\sphinxupquote{matplotlib.docstring.interpd}} object, as seen in this example from {\hyperref[\detokenize{api/lines_api:module-matplotlib.lines}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.lines}}}}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} in lines.py} \PYG{n}{docstring}\PYG{o}{.}\PYG{n}{interpd}\PYG{o}{.}\PYG{n}{update}\PYG{p}{(}\PYG{n}{Line2D}\PYG{o}{=}\PYG{n}{artist}\PYG{o}{.}\PYG{n}{kwdoc}\PYG{p}{(}\PYG{n}{Line2D}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} Then in any function accepting {\hyperref[\detokenize{api/_as_gen/matplotlib.lines.Line2D:matplotlib.lines.Line2D}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Line2D}}}}} pass-through \sphinxcode{\sphinxupquote{kwargs}}, e.g., {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.plot:matplotlib.axes.Axes.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes.plot}}}}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} in axes.py} \PYG{n+nd}{@docstring.dedent\PYGZus{}interpd} \PYG{k}{def} \PYG{n+nf}{plot}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{o}{*}\PYG{n}{args}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ Some stuff omitted} \PYG{l+s+sd}{ The kwargs are Line2D properties:} \PYG{l+s+sd}{ \PYGZpc{}(Line2D)s} \PYG{l+s+sd}{ kwargs scalex and scaley, if defined, are passed on} \PYG{l+s+sd}{ to autoscale\PYGZus{}view to determine whether the x and y axes are} \PYG{l+s+sd}{ autoscaled; default True. See Axes.autoscale\PYGZus{}view for more} \PYG{l+s+sd}{ information} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \end{sphinxVerbatim} Note there is a problem for {\hyperref[\detokenize{api/artist_api:matplotlib.artist.Artist}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Artist}}}}} \sphinxcode{\sphinxupquote{\_\_init\_\_}} methods, e.g., \sphinxcode{\sphinxupquote{matplotlib.patches.Patch.\_\_init\_\_}}, which supports \sphinxcode{\sphinxupquote{Patch}} \sphinxcode{\sphinxupquote{kwargs}}, since the artist inspector cannot work until the class is fully defined and we can’t modify the \sphinxcode{\sphinxupquote{Patch.\_\_init\_\_.\_\_doc\_\_}} docstring outside the class definition. There are some some manual hacks in this case, violating the “single entry point” requirement above \textendash{} see the \sphinxcode{\sphinxupquote{docstring.interpd.update}} calls in {\hyperref[\detokenize{api/patches_api:module-matplotlib.patches}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.patches}}}}}. \subsection{Adding figures} \label{\detokenize{devel/documenting_mpl:adding-figures}}\label{\detokenize{devel/documenting_mpl:docstring-adding-figures}} As above (see {\hyperref[\detokenize{devel/documenting_mpl:rst-figures-and-includes}]{\sphinxcrossref{\DUrole{std,std-ref}{Including figures and files}}}}), figures in the examples gallery can be referenced with a \sphinxcode{\sphinxupquote{:plot:}} directive pointing to the python script that created the figure. For instance the {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.legend:matplotlib.axes.Axes.legend}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{legend}}}}} docstring references the file \sphinxcode{\sphinxupquote{examples/api/legend.py}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ ...} \PYG{l+s+sd}{Examples} \PYG{l+s+sd}{\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}} \PYG{l+s+sd}{.. plot:: gallery/api/legend.py} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \end{sphinxVerbatim} Note that \sphinxcode{\sphinxupquote{examples/api/legend.py}} has been mapped to \sphinxcode{\sphinxupquote{gallery/api/legend.py}}, a redirection that may be fixed in future re-organization of the docs. Plots can also be directly placed inside docstrings. Details are in {\hyperref[\detokenize{devel/plot_directive::doc}]{\sphinxcrossref{\DUrole{doc}{Plot directive documentation}}}}. A short example is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ ...} \PYG{l+s+sd}{Examples} \PYG{l+s+sd}{\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}\PYGZhy{}} \PYG{l+s+sd}{.. plot::} \PYG{l+s+sd}{ import matplotlib.image as mpimg} \PYG{l+s+sd}{ img = mpimg.imread(\PYGZsq{}\PYGZus{}static/stinkbug.png\PYGZsq{})} \PYG{l+s+sd}{ imgplot = plt.imshow(img)} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \end{sphinxVerbatim} An advantage of this style over referencing an example script is that the code will also appear in interactive docstrings. \section{Writing examples and tutorials} \label{\detokenize{devel/documenting_mpl:writing-examples-and-tutorials}}\label{\detokenize{devel/documenting_mpl:id4}} Examples and tutorials are python scripts that are run by \sphinxhref{https://sphinx-gallery.readthedocs.io/en/latest/}{Sphinx Gallery} to create a gallery of images in the \sphinxcode{\sphinxupquote{/doc/gallery}} and \sphinxcode{\sphinxupquote{/doc/tutorials}} directories respectively. To exclude an example from having an plot generated insert “sgskip” somewhere in the filename. The format of these files is relatively straightforward. Properly formatted comment blocks are treated as \sphinxhref{http://docutils.sourceforge.net/rst.html}{ReST} text, the code is displayed, and figures are put into the built page. For instance the example \DUrole{xref,std,std-doc}{/gallery/lines\_bars\_and\_markers/simple\_plot} example is generated from \sphinxcode{\sphinxupquote{/examples/lines\_bars\_and\_markers/simple\_plot.py}}, which looks like: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{===========} \PYG{l+s+sd}{Simple Plot} \PYG{l+s+sd}{===========} \PYG{l+s+sd}{Create a simple plot.} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{c+c1}{\PYGZsh{} Data for plotting} \PYG{n}{t} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mf}{0.0}\PYG{p}{,} \PYG{l+m+mf}{2.0}\PYG{p}{,} \PYG{l+m+mf}{0.01}\PYG{p}{)} \PYG{n}{s} \PYG{o}{=} \PYG{l+m+mi}{1} \PYG{o}{+} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{l+m+mi}{2} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{pi} \PYG{o}{*} \PYG{n}{t}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} Note that using plt.subplots below is equivalent to using} \PYG{c+c1}{\PYGZsh{} fig = plt.figure and then ax = fig.add\PYGZus{}subplot(111)} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{t}\PYG{p}{,} \PYG{n}{s}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set}\PYG{p}{(}\PYG{n}{xlabel}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{time (s)}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{ylabel}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{voltage (mV)}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{title}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{About as simple as it gets, folks}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{grid}\PYG{p}{(}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} The first comment block is treated as \sphinxhref{http://docutils.sourceforge.net/rst.html}{ReST} text. The other comment blocks render as comments in \DUrole{xref,std,std-doc}{/gallery/lines\_bars\_and\_markers/simple\_plot}. Tutorials are made with the exact same mechanism, except they are longer, and typically have more than one comment block (i.e. {\hyperref[\detokenize{tutorials/introductory/usage::doc}]{\sphinxcrossref{\DUrole{doc}{Usage Guide}}}}). The first comment block can be the same as the example above. Subsequent blocks of ReST text are delimited by a line of \sphinxcode{\sphinxupquote{\#\#\#}} characters: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{===========} \PYG{l+s+sd}{Simple Plot} \PYG{l+s+sd}{===========} \PYG{l+s+sd}{Create a simple plot.} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{grid}\PYG{p}{(}\PYG{p}{)} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}\PYGZsh{}} \PYG{c+c1}{\PYGZsh{} Second plot} \PYG{c+c1}{\PYGZsh{} ===========} \PYG{c+c1}{\PYGZsh{}} \PYG{c+c1}{\PYGZsh{} This is a second plot that is very nice} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{50}\PYG{p}{)}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} In this way text, code, and figures are output in a “notebook” style. \section{Miscellaneous} \label{\detokenize{devel/documenting_mpl:miscellaneous}} \subsection{Adding animations} \label{\detokenize{devel/documenting_mpl:adding-animations}} There is a Matplotlib Google/Gmail account with username \sphinxcode{\sphinxupquote{mplgithub}} which was used to setup the github account but can be used for other purposes, like hosting Google docs or Youtube videos. You can embed a Matplotlib animation in the docs by first saving the animation as a movie using {\hyperref[\detokenize{api/_as_gen/matplotlib.animation.Animation:matplotlib.animation.Animation.save}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.animation.Animation.save()}}}}}, and then uploading to \sphinxhref{https://www.youtube.com/user/matplotlib}{matplotlib’s Youtube channel} and inserting the embedding string youtube provides like: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{..} \PYG{o+ow}{raw}\PYG{p}{::} html \PYGZlt{}iframe width=\PYGZdq{}420\PYGZdq{} height=\PYGZdq{}315\PYGZdq{} src=\PYGZdq{}http://www.youtube.com/embed/32cjc6V0OZY\PYGZdq{} frameborder=\PYGZdq{}0\PYGZdq{} allowfullscreen\PYGZgt{} \PYGZlt{}/iframe\PYGZgt{} \end{sphinxVerbatim} An example save command to generate a movie looks like this \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ani} \PYG{o}{=} \PYG{n}{animation}\PYG{o}{.}\PYG{n}{FuncAnimation}\PYG{p}{(}\PYG{n}{fig}\PYG{p}{,} \PYG{n}{animate}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{y}\PYG{p}{)}\PYG{p}{)}\PYG{p}{,} \PYG{n}{interval}\PYG{o}{=}\PYG{l+m+mi}{25}\PYG{p}{,} \PYG{n}{blit}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{,} \PYG{n}{init\PYGZus{}func}\PYG{o}{=}\PYG{n}{init}\PYG{p}{)} \PYG{n}{ani}\PYG{o}{.}\PYG{n}{save}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{double\PYGZus{}pendulum.mp4}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{fps}\PYG{o}{=}\PYG{l+m+mi}{15}\PYG{p}{)} \end{sphinxVerbatim} Contact Michael Droettboom for the login password to upload youtube videos of google docs to the mplgithub account. \subsection{Generating inheritance diagrams} \label{\detokenize{devel/documenting_mpl:generating-inheritance-diagrams}}\label{\detokenize{devel/documenting_mpl:inheritance-diagrams}} Class inheritance diagrams can be generated with the \sphinxcode{\sphinxupquote{inheritance-diagram}} directive. To use it, provide the directive with a number of class or module names (separated by whitespace). If a module name is provided, all classes in that module will be used. All of the ancestors of these classes will be included in the inheritance diagram. A single option is available: \sphinxstyleemphasis{parts} controls how many of parts in the path to the class are shown. For example, if \sphinxstyleemphasis{parts} == 1, the class \sphinxcode{\sphinxupquote{matplotlib.patches.Patch}} is shown as \sphinxcode{\sphinxupquote{Patch}}. If \sphinxstyleemphasis{parts} == 2, it is shown as \sphinxcode{\sphinxupquote{patches.Patch}}. If \sphinxstyleemphasis{parts} == 0, the full path is shown. Example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{..} \PYG{o+ow}{inheritance\PYGZhy{}diagram}\PYG{p}{::} matplotlib.patches matplotlib.lines matplotlib.text \PYG{n+nc}{:parts:} \PYG{n+nf}{2} \end{sphinxVerbatim} \sphinxincludegraphics[]{inheritance-0afe4e1df66c168deea1fd37e1fc92e5f5de747c.pdf} \subsection{Emacs helpers} \label{\detokenize{devel/documenting_mpl:emacs-helpers}}\label{\detokenize{devel/documenting_mpl:id5}} There is an emacs mode \sphinxhref{http://docutils.sourceforge.net/tools/editors/emacs/rst.el}{rst.el} which automates many important ReST tasks like building and updating table-of-contents, and promoting or demoting section headings. Here is the basic \sphinxcode{\sphinxupquote{.emacs}} configuration: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{(}\PYG{n+nb}{require} \PYG{l+s+ss}{\PYGZsq{}rst}\PYG{p}{)} \PYG{p}{(}\PYG{k}{setq} \PYG{n+nv}{auto\PYGZhy{}mode\PYGZhy{}alist} \PYG{p}{(}\PYG{n+nb}{append} \PYG{o}{\PYGZsq{}}\PYG{p}{(}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}\PYGZbs{}\PYGZbs{}.txt\PYGZdl{}\PYGZdq{}} \PYG{o}{.} \PYG{n+nv}{rst\PYGZhy{}mode}\PYG{p}{)} \PYG{p}{(}\PYG{l+s}{\PYGZdq{}\PYGZbs{}\PYGZbs{}.rst\PYGZdl{}\PYGZdq{}} \PYG{o}{.} \PYG{n+nv}{rst\PYGZhy{}mode}\PYG{p}{)} \PYG{p}{(}\PYG{l+s}{\PYGZdq{}\PYGZbs{}\PYGZbs{}.rest\PYGZdl{}\PYGZdq{}} \PYG{o}{.} \PYG{n+nv}{rst\PYGZhy{}mode}\PYG{p}{)}\PYG{p}{)} \PYG{n+nv}{auto\PYGZhy{}mode\PYGZhy{}alist}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} Some helpful functions: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{C}\PYG{o}{\PYGZhy{}}\PYG{n}{c} \PYG{n}{TAB} \PYG{o}{\PYGZhy{}} \PYG{n}{rst}\PYG{o}{\PYGZhy{}}\PYG{n}{toc}\PYG{o}{\PYGZhy{}}\PYG{n}{insert} \PYG{n}{Insert} \PYG{n}{table} \PYG{n}{of} \PYG{n}{contents} \PYG{n}{at} \PYG{n}{point} \PYG{n}{C}\PYG{o}{\PYGZhy{}}\PYG{n}{c} \PYG{n}{C}\PYG{o}{\PYGZhy{}}\PYG{n}{u} \PYG{o}{\PYGZhy{}} \PYG{n}{rst}\PYG{o}{\PYGZhy{}}\PYG{n}{toc}\PYG{o}{\PYGZhy{}}\PYG{n}{update} \PYG{n}{Update} \PYG{n}{the} \PYG{n}{table} \PYG{n}{of} \PYG{n}{contents} \PYG{n}{at} \PYG{n}{point} \PYG{n}{C}\PYG{o}{\PYGZhy{}}\PYG{n}{c} \PYG{n}{C}\PYG{o}{\PYGZhy{}}\PYG{n}{l} \PYG{n}{rst}\PYG{o}{\PYGZhy{}}\PYG{n}{shift}\PYG{o}{\PYGZhy{}}\PYG{n}{region}\PYG{o}{\PYGZhy{}}\PYG{n}{left} \PYG{n}{Shift} \PYG{n}{region} \PYG{n}{to} \PYG{n}{the} \PYG{n}{left} \PYG{n}{C}\PYG{o}{\PYGZhy{}}\PYG{n}{c} \PYG{n}{C}\PYG{o}{\PYGZhy{}}\PYG{n}{r} \PYG{n}{rst}\PYG{o}{\PYGZhy{}}\PYG{n}{shift}\PYG{o}{\PYGZhy{}}\PYG{n}{region}\PYG{o}{\PYGZhy{}}\PYG{n}{right} \PYG{n}{Shift} \PYG{n}{region} \PYG{n}{to} \PYG{n}{the} \PYG{n}{right} \end{sphinxVerbatim} \chapter{Plot directive documentation} \label{\detokenize{devel/plot_directive:module-matplotlib.sphinxext.plot_directive}}\label{\detokenize{devel/plot_directive:plot-directive-documentation}}\label{\detokenize{devel/plot_directive::doc}}\index{matplotlib.sphinxext.plot\_directive (module)} A directive for including a matplotlib plot in a Sphinx document. By default, in HTML output, \sphinxcode{\sphinxupquote{plot}} will include a .png file with a link to a high-res .png and .pdf. In LaTeX output, it will include a .pdf. The source code for the plot may be included in one of three ways: \begin{enumerate} \item {} \sphinxstylestrong{A path to a source file} as the argument to the directive: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{.}\PYG{o}{.} \PYG{n}{plot}\PYG{p}{:}\PYG{p}{:} \PYG{n}{path}\PYG{o}{/}\PYG{n}{to}\PYG{o}{/}\PYG{n}{plot}\PYG{o}{.}\PYG{n}{py} \end{sphinxVerbatim} When a path to a source file is given, the content of the directive may optionally contain a caption for the plot: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{.}\PYG{o}{.} \PYG{n}{plot}\PYG{p}{:}\PYG{p}{:} \PYG{n}{path}\PYG{o}{/}\PYG{n}{to}\PYG{o}{/}\PYG{n}{plot}\PYG{o}{.}\PYG{n}{py} \PYG{n}{This} \PYG{o+ow}{is} \PYG{n}{the} \PYG{n}{caption} \PYG{k}{for} \PYG{n}{the} \PYG{n}{plot} \end{sphinxVerbatim} Additionally, one may specify the name of a function to call (with no arguments) immediately after importing the module: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{.}\PYG{o}{.} \PYG{n}{plot}\PYG{p}{:}\PYG{p}{:} \PYG{n}{path}\PYG{o}{/}\PYG{n}{to}\PYG{o}{/}\PYG{n}{plot}\PYG{o}{.}\PYG{n}{py} \PYG{n}{plot\PYGZus{}function1} \end{sphinxVerbatim} \item {} Included as \sphinxstylestrong{inline content} to the directive: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{.}\PYG{o}{.} \PYG{n}{plot}\PYG{p}{:}\PYG{p}{:} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{image} \PYG{k}{as} \PYG{n+nn}{mpimg} \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{n}{img} \PYG{o}{=} \PYG{n}{mpimg}\PYG{o}{.}\PYG{n}{imread}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZus{}static/stinkbug.png}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{imgplot} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{imshow}\PYG{p}{(}\PYG{n}{img}\PYG{p}{)} \end{sphinxVerbatim} \item {} Using \sphinxstylestrong{doctest} syntax: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{.}\PYG{o}{.} \PYG{n}{plot}\PYG{p}{:}\PYG{p}{:} \PYG{n}{A} \PYG{n}{plotting} \PYG{n}{example}\PYG{p}{:} \PYG{o}{\PYGZgt{}\PYGZgt{}}\PYG{o}{\PYGZgt{}} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{o}{\PYGZgt{}\PYGZgt{}}\PYG{o}{\PYGZgt{}} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{l+m+mi}{4}\PYG{p}{,}\PYG{l+m+mi}{5}\PYG{p}{,}\PYG{l+m+mi}{6}\PYG{p}{]}\PYG{p}{)} \end{sphinxVerbatim} \end{enumerate} \section{Options} \label{\detokenize{devel/plot_directive:options}} The \sphinxcode{\sphinxupquote{plot}} directive supports the following options: \begin{quote} \begin{description} \item[{format}] \leavevmode{[}\{‘python’, ‘doctest’\}{]} Specify the format of the input \item[{include-source}] \leavevmode{[}bool{]} Whether to display the source code. The default can be changed using the \sphinxcode{\sphinxupquote{plot\_include\_source}} variable in conf.py \item[{encoding}] \leavevmode{[}str{]} If this source file is in a non-UTF8 or non-ASCII encoding, the encoding must be specified using the \sphinxcode{\sphinxupquote{:encoding:}} option. The encoding will not be inferred using the \sphinxcode{\sphinxupquote{-*- coding -*-}} metacomment. \item[{context}] \leavevmode{[}bool or str{]} If provided, the code will be run in the context of all previous plot directives for which the \sphinxcode{\sphinxupquote{:context:}} option was specified. This only applies to inline code plot directives, not those run from files. If the \sphinxcode{\sphinxupquote{:context: reset}} option is specified, the context is reset for this and future plots, and previous figures are closed prior to running the code. \sphinxcode{\sphinxupquote{:context:close-figs}} keeps the context but closes previous figures before running the code. \item[{nofigs}] \leavevmode{[}bool{]} If specified, the code block will be run, but no figures will be inserted. This is usually useful with the \sphinxcode{\sphinxupquote{:context:}} option. \end{description} \end{quote} Additionally, this directive supports all of the options of the \sphinxcode{\sphinxupquote{image}} directive, except for \sphinxcode{\sphinxupquote{target}} (since plot will add its own target). These include \sphinxcode{\sphinxupquote{alt}}, \sphinxcode{\sphinxupquote{height}}, \sphinxcode{\sphinxupquote{width}}, \sphinxcode{\sphinxupquote{scale}}, \sphinxcode{\sphinxupquote{align}} and \sphinxcode{\sphinxupquote{class}}. \section{Configuration options} \label{\detokenize{devel/plot_directive:configuration-options}} The plot directive has the following configuration options: \begin{quote} \begin{description} \item[{plot\_include\_source}] \leavevmode Default value for the include-source option \item[{plot\_html\_show\_source\_link}] \leavevmode Whether to show a link to the source in HTML. \item[{plot\_pre\_code}] \leavevmode Code that should be executed before each plot. If not specified or None it will default to a string containing: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib} \PYG{k}{import} \PYG{n}{pyplot} \PYG{k}{as} \PYG{n}{plt} \end{sphinxVerbatim} \item[{plot\_basedir}] \leavevmode Base directory, to which \sphinxcode{\sphinxupquote{plot::}} file names are relative to. (If None or empty, file names are relative to the directory where the file containing the directive is.) \item[{plot\_formats}] \leavevmode File formats to generate. List of tuples or strings: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{[}\PYG{p}{(}\PYG{n}{suffix}\PYG{p}{,} \PYG{n}{dpi}\PYG{p}{)}\PYG{p}{,} \PYG{n}{suffix}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{]} \end{sphinxVerbatim} that determine the file format and the DPI. For entries whose DPI was omitted, sensible defaults are chosen. When passing from the command line through sphinx\_build the list should be passed as suffix:dpi,suffix:dpi, …. \item[{plot\_html\_show\_formats}] \leavevmode Whether to show links to the files in HTML. \item[{plot\_rcparams}] \leavevmode A dictionary containing any non-standard rcParams that should be applied before each plot. \item[{plot\_apply\_rcparams}] \leavevmode By default, rcParams are applied when \sphinxcode{\sphinxupquote{context}} option is not used in a plot directive. This configuration option overrides this behavior and applies rcParams before each plot. \item[{plot\_working\_directory}] \leavevmode By default, the working directory will be changed to the directory of the example, so the code can get at its data files, if any. Also its path will be added to \sphinxhref{https://docs.python.org/3/library/sys.html\#sys.path}{\sphinxcode{\sphinxupquote{sys.path}}} so it can import any helper modules sitting beside it. This configuration option can be used to specify a central directory (also added to \sphinxhref{https://docs.python.org/3/library/sys.html\#sys.path}{\sphinxcode{\sphinxupquote{sys.path}}}) where data files and helper modules for all code are located. \item[{plot\_template}] \leavevmode Provide a customized template for preparing restructured text. \end{description} \end{quote} \index{PlotError} \begin{fulllineitems} \phantomsection\label{\detokenize{devel/plot_directive:matplotlib.sphinxext.plot_directive.PlotError}}\pysigline{\sphinxbfcode{\sphinxupquote{exception }}\sphinxcode{\sphinxupquote{matplotlib.sphinxext.plot\_directive.}}\sphinxbfcode{\sphinxupquote{PlotError}}}~ \end{fulllineitems} \index{mark\_plot\_labels() (in module matplotlib.sphinxext.plot\_directive)} \begin{fulllineitems} \phantomsection\label{\detokenize{devel/plot_directive:matplotlib.sphinxext.plot_directive.mark_plot_labels}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.sphinxext.plot\_directive.}}\sphinxbfcode{\sphinxupquote{mark\_plot\_labels}}}{\emph{app}, \emph{document}}{} To make plots referenceable, we need to move the reference from the “htmlonly” (or “latexonly”) node to the actual figure node itself. \end{fulllineitems} \index{out\_of\_date() (in module matplotlib.sphinxext.plot\_directive)} \begin{fulllineitems} \phantomsection\label{\detokenize{devel/plot_directive:matplotlib.sphinxext.plot_directive.out_of_date}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.sphinxext.plot\_directive.}}\sphinxbfcode{\sphinxupquote{out\_of\_date}}}{\emph{original}, \emph{derived}}{} Returns True if derivative is out-of-date wrt original, both of which are full file paths. \end{fulllineitems} \index{plot\_directive() (in module matplotlib.sphinxext.plot\_directive)} \begin{fulllineitems} \phantomsection\label{\detokenize{devel/plot_directive:matplotlib.sphinxext.plot_directive.plot_directive}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.sphinxext.plot\_directive.}}\sphinxbfcode{\sphinxupquote{plot\_directive}}}{\emph{name}, \emph{arguments}, \emph{options}, \emph{content}, \emph{lineno}, \emph{content\_offset}, \emph{block\_text}, \emph{state}, \emph{state\_machine}}{} Implementation of the \sphinxcode{\sphinxupquote{.. plot::}} directive. See the module docstring for details. \end{fulllineitems} \index{remove\_coding() (in module matplotlib.sphinxext.plot\_directive)} \begin{fulllineitems} \phantomsection\label{\detokenize{devel/plot_directive:matplotlib.sphinxext.plot_directive.remove_coding}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.sphinxext.plot\_directive.}}\sphinxbfcode{\sphinxupquote{remove\_coding}}}{\emph{text}}{} Remove the coding comment, which six.exec\_ doesn’t like. \end{fulllineitems} \index{render\_figures() (in module matplotlib.sphinxext.plot\_directive)} \begin{fulllineitems} \phantomsection\label{\detokenize{devel/plot_directive:matplotlib.sphinxext.plot_directive.render_figures}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.sphinxext.plot\_directive.}}\sphinxbfcode{\sphinxupquote{render\_figures}}}{\emph{code}, \emph{code\_path}, \emph{output\_dir}, \emph{output\_base}, \emph{context}, \emph{function\_name}, \emph{config}, \emph{context\_reset=False}, \emph{close\_figs=False}}{} Run a pyplot script and save the images in \sphinxstyleemphasis{output\_dir}. Save the images under \sphinxstyleemphasis{output\_dir} with file names derived from \sphinxstyleemphasis{output\_base} \end{fulllineitems} \index{run\_code() (in module matplotlib.sphinxext.plot\_directive)} \begin{fulllineitems} \phantomsection\label{\detokenize{devel/plot_directive:matplotlib.sphinxext.plot_directive.run_code}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.sphinxext.plot\_directive.}}\sphinxbfcode{\sphinxupquote{run\_code}}}{\emph{code}, \emph{code\_path}, \emph{ns=None}, \emph{function\_name=None}}{} Import a Python module from a path, and run the function given by name, if function\_name is not None. \end{fulllineitems} \index{split\_code\_at\_show() (in module matplotlib.sphinxext.plot\_directive)} \begin{fulllineitems} \phantomsection\label{\detokenize{devel/plot_directive:matplotlib.sphinxext.plot_directive.split_code_at_show}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.sphinxext.plot\_directive.}}\sphinxbfcode{\sphinxupquote{split\_code\_at\_show}}}{\emph{text}}{} Split code at plt.show() \end{fulllineitems} \index{unescape\_doctest() (in module matplotlib.sphinxext.plot\_directive)} \begin{fulllineitems} \phantomsection\label{\detokenize{devel/plot_directive:matplotlib.sphinxext.plot_directive.unescape_doctest}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{matplotlib.sphinxext.plot\_directive.}}\sphinxbfcode{\sphinxupquote{unescape\_doctest}}}{\emph{text}}{} Extract code from a piece of text, which contains either Python code or doctests. \end{fulllineitems} \chapter{Developer’s guide for creating scales and transformations} \label{\detokenize{devel/add_new_projection:developer-s-guide-for-creating-scales-and-transformations}}\label{\detokenize{devel/add_new_projection:adding-new-scales}}\label{\detokenize{devel/add_new_projection::doc}} Matplotlib supports the addition of custom procedures that transform the data before it is displayed. There is an important distinction between two kinds of transformations. Separable transformations, working on a single dimension, are called “scales”, and non-separable transformations, that handle data in two or more dimensions at a time, are called “projections”. From the user’s perspective, the scale of a plot can be set with {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_xscale:matplotlib.axes.Axes.set_xscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_xscale()}}}}} and {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.set_yscale:matplotlib.axes.Axes.set_yscale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{set\_yscale()}}}}}. Projections can be chosen using the \sphinxcode{\sphinxupquote{projection}} keyword argument to the \sphinxcode{\sphinxupquote{plot()}} or \sphinxcode{\sphinxupquote{subplot()}} functions, e.g.: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{projection}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{custom}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} \end{sphinxVerbatim} This document is intended for developers and advanced users who need to create new scales and projections for matplotlib. The necessary code for scales and projections can be included anywhere: directly within a plot script, in third-party code, or in the matplotlib source tree itself. \section{Creating a new scale} \label{\detokenize{devel/add_new_projection:creating-a-new-scale}}\label{\detokenize{devel/add_new_projection:creating-new-scale}} Adding a new scale consists of defining a subclass of {\hyperref[\detokenize{api/scale_api:matplotlib.scale.ScaleBase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale.ScaleBase}}}}}, that includes the following elements: \begin{itemize} \item {} A transformation from data coordinates into display coordinates. \item {} An inverse of that transformation. This is used, for example, to convert mouse positions from screen space back into data space. \item {} A function to limit the range of the axis to acceptable values (\sphinxcode{\sphinxupquote{limit\_range\_for\_scale()}}). A log scale, for instance, would prevent the range from including values less than or equal to zero. \item {} Locators (major and minor) that determine where to place ticks in the plot, and optionally, how to adjust the limits of the plot to some “good” values. Unlike \sphinxcode{\sphinxupquote{limit\_range\_for\_scale()}}, which is always enforced, the range setting here is only used when automatically setting the range of the plot. \item {} Formatters (major and minor) that specify how the tick labels should be drawn. \end{itemize} Once the class is defined, it must be registered with matplotlib so that the user can select it. A full-fledged and heavily annotated example is in \sphinxcode{\sphinxupquote{examples/api/custom\_scale\_example.py}}. There are also some classes in {\hyperref[\detokenize{api/scale_api:module-matplotlib.scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale}}}}} that may be used as starting points. \section{Creating a new projection} \label{\detokenize{devel/add_new_projection:creating-a-new-projection}}\label{\detokenize{devel/add_new_projection:creating-new-projection}} Adding a new projection consists of defining a projection axes which subclasses {\hyperref[\detokenize{api/axes_api:matplotlib.axes.Axes}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.axes.Axes}}}}} and includes the following elements: \begin{itemize} \item {} A transformation from data coordinates into display coordinates. \item {} An inverse of that transformation. This is used, for example, to convert mouse positions from screen space back into data space. \item {} Transformations for the gridlines, ticks and ticklabels. Custom projections will often need to place these elements in special locations, and matplotlib has a facility to help with doing so. \item {} Setting up default values (overriding {\hyperref[\detokenize{api/_as_gen/matplotlib.axes.Axes.cla:matplotlib.axes.Axes.cla}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{cla()}}}}}), since the defaults for a rectilinear axes may not be appropriate. \item {} Defining the shape of the axes, for example, an elliptical axes, that will be used to draw the background of the plot and for clipping any data elements. \item {} Defining custom locators and formatters for the projection. For example, in a geographic projection, it may be more convenient to display the grid in degrees, even if the data is in radians. \item {} Set up interactive panning and zooming. This is left as an “advanced” feature left to the reader, but there is an example of this for polar plots in {\hyperref[\detokenize{api/projections_api:module-matplotlib.projections.polar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.projections.polar}}}}}. \item {} Any additional methods for additional convenience or features. \end{itemize} Once the projection axes is defined, it can be used in one of two ways: \begin{itemize} \item {} By defining the class attribute \sphinxcode{\sphinxupquote{name}}, the projection axes can be registered with {\hyperref[\detokenize{api/projections_api:matplotlib.projections.register_projection}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.projections.register\_projection()}}}}} and subsequently simply invoked by name: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{axes}\PYG{p}{(}\PYG{n}{projection}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{my\PYGZus{}proj\PYGZus{}name}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} \item {} For more complex, parameterisable projections, a generic “projection” object may be defined which includes the method \sphinxcode{\sphinxupquote{\_as\_mpl\_axes}}. \sphinxcode{\sphinxupquote{\_as\_mpl\_axes}} should take no arguments and return the projection’s axes subclass and a dictionary of additional arguments to pass to the subclass’ \sphinxcode{\sphinxupquote{\_\_init\_\_}} method. Subsequently a parameterised projection can be initialised with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{plt}\PYG{o}{.}\PYG{n}{axes}\PYG{p}{(}\PYG{n}{projection}\PYG{o}{=}\PYG{n}{MyProjection}\PYG{p}{(}\PYG{n}{param1}\PYG{o}{=}\PYG{n}{param1\PYGZus{}value}\PYG{p}{)}\PYG{p}{)} \end{sphinxVerbatim} where MyProjection is an object which implements a \sphinxcode{\sphinxupquote{\_as\_mpl\_axes}} method. \end{itemize} A full-fledged and heavily annotated example is in \sphinxcode{\sphinxupquote{examples/api/custom\_projection\_example.py}}. The polar plot functionality in {\hyperref[\detokenize{api/projections_api:module-matplotlib.projections.polar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.projections.polar}}}}} may also be of interest. \section{API documentation} \label{\detokenize{devel/add_new_projection:api-documentation}}\begin{itemize} \item {} {\hyperref[\detokenize{api/scale_api:module-matplotlib.scale}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.scale}}}}} \item {} {\hyperref[\detokenize{api/projections_api:module-matplotlib.projections}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.projections}}}}} \item {} {\hyperref[\detokenize{api/projections_api:module-matplotlib.projections.polar}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{matplotlib.projections.polar}}}}} \end{itemize} \chapter{Developer’s tips for writing code for Python 2 and 3} \label{\detokenize{devel/portable_code:developer-s-tips-for-writing-code-for-python-2-and-3}}\label{\detokenize{devel/portable_code:portable-code}}\label{\detokenize{devel/portable_code::doc}} As of matplotlib 1.4, the \sphinxhref{http://pythonhosted.org/six/}{six} library is used to support Python 2 and 3 from a single code base. The \sphinxcode{\sphinxupquote{2to3}} tool is no longer used. This document describes some of the issues with that approach and some recommended solutions. It is not a complete guide to Python 2 and 3 compatibility. \section{Welcome to the \sphinxstyleliteralintitle{\sphinxupquote{\_\_future\_\_}}} \label{\detokenize{devel/portable_code:welcome-to-the-future}} The top of every \sphinxcode{\sphinxupquote{py}} file should include the following: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{from} \PYG{n+nn}{\PYGZus{}\PYGZus{}future\PYGZus{}\PYGZus{}} \PYG{k}{import} \PYG{p}{(}\PYG{n}{absolute\PYGZus{}import}\PYG{p}{,} \PYG{n}{division}\PYG{p}{,} \PYG{n}{print\PYGZus{}function}\PYG{p}{,} \PYG{n}{unicode\PYGZus{}literals}\PYG{p}{)} \PYG{k+kn}{import} \PYG{n+nn}{six} \end{sphinxVerbatim} This will make the Python 2 interpreter behave as close to Python 3 as possible. All matplotlib files should also import \sphinxcode{\sphinxupquote{six}}, whether they are using it or not, just to make moving code between modules easier, as \sphinxcode{\sphinxupquote{six}} gets used \sphinxstyleemphasis{a lot}. \section{Finding places to use six} \label{\detokenize{devel/portable_code:finding-places-to-use-six}} The only way to make sure code works on both Python 2 and 3 is to make sure it is covered by unit tests. However, the \sphinxcode{\sphinxupquote{2to3}} commandline tool can also be used to locate places that require special handling with \sphinxcode{\sphinxupquote{six}}. (The \sphinxhref{https://pypi.python.org/pypi/modernize}{modernize} tool may also be handy, though I’ve never used it personally). The \sphinxhref{http://pythonhosted.org/six/}{six} documentation serves as a good reference for the sorts of things that need to be updated. \section{The dreaded \sphinxstyleliteralintitle{\sphinxupquote{\textbackslash{}u}} escapes} \label{\detokenize{devel/portable_code:the-dreaded-u-escapes}} When \sphinxcode{\sphinxupquote{from \_\_future\_\_ import unicode\_literals}} is used, all string literals (not preceded with a \sphinxcode{\sphinxupquote{b}}) will become unicode literals. Normally, one would use “raw” string literals to encode strings that contain a lot of slashes that we don’t want Python to interpret as special characters. A common example in matplotlib is when it deals with TeX and has to represent things like \sphinxcode{\sphinxupquote{r"\textbackslash{}usepackage\{foo\}"}}. Unfortunately, on Python 2there is no way to represent \sphinxcode{\sphinxupquote{u}} in a raw unicode string literal, since it will always be interpreted as the start of a unicode character escape, such as \sphinxcode{\sphinxupquote{u20af}}. The only solution is to use a regular (non-raw) string literal and repeat all slashes, e.g. \sphinxcode{\sphinxupquote{"\textbackslash{}\textbackslash{}usepackage\{foo\}"}}. The following shows the problem on Python 2: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{l+s+sa}{ur}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{u}\PYG{l+s+s1}{\PYGZsq{}} File \PYG{n+nb}{\PYGZdq{}\PYGZlt{}stdin\PYGZgt{}\PYGZdq{}}, line \PYG{l+m}{1} \PYG{g+gr}{SyntaxError}: \PYG{n}{(unicode error) \PYGZsq{}rawunicodeescape\PYGZsq{} codec can\PYGZsq{}t decode bytes in} \PYG{g+go}{position 0\PYGZhy{}1: truncated \PYGZbs{}uXXXX} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{l+s+sa}{ur}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+se}{\PYGZbs{}\PYGZbs{}}\PYG{l+s+s1}{u}\PYG{l+s+s1}{\PYGZsq{}} \PYG{g+go}{u\PYGZsq{}\PYGZbs{}\PYGZbs{}\PYGZbs{}\PYGZbs{}u\PYGZsq{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{l+s+sa}{u}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{u}\PYG{l+s+s1}{\PYGZsq{}} File \PYG{n+nb}{\PYGZdq{}\PYGZlt{}stdin\PYGZgt{}\PYGZdq{}}, line \PYG{l+m}{1} \PYG{g+gr}{SyntaxError}: \PYG{n}{(unicode error) \PYGZsq{}unicodeescape\PYGZsq{} codec can\PYGZsq{}t decode bytes in} \PYG{g+go}{position 0\PYGZhy{}1: truncated \PYGZbs{}uXXXX escape} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{l+s+sa}{u}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+se}{\PYGZbs{}\PYGZbs{}}\PYG{l+s+s1}{u}\PYG{l+s+s1}{\PYGZsq{}} \PYG{g+go}{u\PYGZsq{}\PYGZbs{}\PYGZbs{}u\PYGZsq{}} \end{sphinxVerbatim} This bug has been fixed in Python 3, however, we can’t take advantage of that and still support Python 2: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{u}\PYG{l+s+s1}{\PYGZsq{}} \PYG{g+go}{\PYGZsq{}\PYGZbs{}\PYGZbs{}u\PYGZsq{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+se}{\PYGZbs{}\PYGZbs{}}\PYG{l+s+s1}{u}\PYG{l+s+s1}{\PYGZsq{}} \PYG{g+go}{\PYGZsq{}\PYGZbs{}\PYGZbs{}\PYGZbs{}\PYGZbs{}u\PYGZsq{}} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{u}\PYG{l+s+s1}{\PYGZsq{}} File \PYG{n+nb}{\PYGZdq{}\PYGZlt{}stdin\PYGZgt{}\PYGZdq{}}, line \PYG{l+m}{1} \PYG{g+gr}{SyntaxError}: \PYG{n}{(unicode error) \PYGZsq{}unicodeescape\PYGZsq{} codec can\PYGZsq{}t decode bytes in} \PYG{g+go}{position 0\PYGZhy{}1: truncated \PYGZbs{}uXXXX escape} \PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+se}{\PYGZbs{}\PYGZbs{}}\PYG{l+s+s1}{u}\PYG{l+s+s1}{\PYGZsq{}} \PYG{g+go}{\PYGZsq{}\PYGZbs{}\PYGZbs{}u\PYGZsq{}} \end{sphinxVerbatim} \section{Iteration} \label{\detokenize{devel/portable_code:iteration}} The behavior of the methods for iterating over the items, values and keys of a dictionary has changed in Python 3. Additionally, other built-in functions such as \sphinxhref{https://docs.python.org/3/library/functions.html\#zip}{\sphinxcode{\sphinxupquote{zip}}}, \sphinxhref{https://docs.python.org/3/library/stdtypes.html\#range}{\sphinxcode{\sphinxupquote{range}}} and \sphinxhref{https://docs.python.org/3/library/functions.html\#map}{\sphinxcode{\sphinxupquote{map}}} have changed to return iterators rather than temporary lists. In many cases, the performance implications of iterating vs. creating a temporary list won’t matter, so it’s tempting to use the form that is simplest to read. However, that results in code that behaves differently on Python 2 and 3, leading to subtle bugs that may not be detected by the regression tests. Therefore, unless the loop in question is provably simple and doesn’t call into other code, the \sphinxcode{\sphinxupquote{six}} versions that ensure the same behavior on both Python 2 and 3 should be used. The following table shows the mapping of equivalent semantics between Python 2, 3 and six for \sphinxcode{\sphinxupquote{dict.items()}}: \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily Python 2 &\sphinxstyletheadfamily Python 3 &\sphinxstyletheadfamily six \\ \hline \sphinxcode{\sphinxupquote{d.items()}} & \sphinxcode{\sphinxupquote{list(d.items())}} & \sphinxcode{\sphinxupquote{list(six.iteritems(d))}} \\ \hline \sphinxcode{\sphinxupquote{d.iteritems()}} & \sphinxcode{\sphinxupquote{d.items()}} & \sphinxcode{\sphinxupquote{six.iteritems(d)}} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \section{Numpy-specific things} \label{\detokenize{devel/portable_code:numpy-specific-things}} When specifying dtypes, all strings must be byte strings on Python 2 and unicode strings on Python 3. The best way to handle this is to force cast them using \sphinxcode{\sphinxupquote{str()}}. The same is true of structure specifiers in the \sphinxhref{https://docs.python.org/3/library/struct.html\#module-struct}{\sphinxcode{\sphinxupquote{struct}}} built-in module. \chapter{Working with \sphinxstyleemphasis{Matplotlib} source code} \label{\detokenize{devel/gitwash/index:working-with-matplotlib-source-code}}\label{\detokenize{devel/gitwash/index:using-git}}\label{\detokenize{devel/gitwash/index::doc}} Contents: \section{Introduction} \label{\detokenize{devel/gitwash/git_intro:introduction}}\label{\detokenize{devel/gitwash/git_intro::doc}} These pages describe a \sphinxhref{https://git-scm.com/}{git} and \sphinxhref{https://github.com}{github} workflow for the \sphinxhref{http://matplotlib.org}{Matplotlib} project. There are several different workflows here, for different ways of working with \sphinxstyleemphasis{Matplotlib}. This is not a comprehensive git reference, it’s just a workflow for our own project. It’s tailored to the github hosting service. You may well find better or quicker ways of getting stuff done with git, but these should get you started. For general resources for learning git, see {\hyperref[\detokenize{devel/gitwash/git_resources:git-resources}]{\sphinxcrossref{\DUrole{std,std-ref}{git resources}}}}. \section{Install git} \label{\detokenize{devel/gitwash/git_install:install-git}}\label{\detokenize{devel/gitwash/git_install:id1}}\label{\detokenize{devel/gitwash/git_install::doc}} \subsection{Overview} \label{\detokenize{devel/gitwash/git_install:overview}} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|} \hline Debian / Ubuntu & \sphinxcode{\sphinxupquote{sudo apt-get install git}} \\ \hline Fedora & \sphinxcode{\sphinxupquote{sudo yum install git}} \\ \hline Windows & Download and install \sphinxhref{https://git-scm.com/download/win}{msysGit} \\ \hline OS X & Use the \sphinxhref{https://git-scm.com/download/mac}{git-osx-installer} \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \subsection{In detail} \label{\detokenize{devel/gitwash/git_install:in-detail}} See the git page for the most recent information. Have a look at the github install help pages available from \sphinxhref{https://help.github.com}{github help} There are good instructions here: \sphinxurl{https://git-scm.com/book/en/v2/Getting-Started-Installing-Git} \section{Following the latest source} \label{\detokenize{devel/gitwash/following_latest:following-the-latest-source}}\label{\detokenize{devel/gitwash/following_latest:following-latest}}\label{\detokenize{devel/gitwash/following_latest::doc}} These are the instructions if you just want to follow the latest \sphinxstyleemphasis{Matplotlib} source, but you don’t need to do any development for now. The steps are: \begin{itemize} \item {} {\hyperref[\detokenize{devel/gitwash/git_install:install-git}]{\sphinxcrossref{\DUrole{std,std-ref}{Install git}}}} \item {} get local copy of the \sphinxhref{https://github.com/matplotlib/matplotlib}{Matplotlib github} git repository \item {} update local copy from time to time \end{itemize} \subsection{Get the local copy of the code} \label{\detokenize{devel/gitwash/following_latest:get-the-local-copy-of-the-code}} From the command line: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git clone git://github.com/matplotlib/matplotlib.git \end{sphinxVerbatim} You now have a copy of the code tree in the new \sphinxcode{\sphinxupquote{matplotlib}} directory. \subsection{Updating the code} \label{\detokenize{devel/gitwash/following_latest:updating-the-code}} From time to time you may want to pull down the latest code. Do this with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n+nb}{cd} matplotlib git pull \end{sphinxVerbatim} The tree in \sphinxcode{\sphinxupquote{matplotlib}} will now have the latest changes from the initial repository. \section{Making a patch} \label{\detokenize{devel/gitwash/patching:making-a-patch}}\label{\detokenize{devel/gitwash/patching::doc}} You’ve discovered a bug or something else you want to change in \sphinxhref{http://matplotlib.org}{Matplotlib} .. — excellent! You’ve worked out a way to fix it — even better! You want to tell us about it — best of all! The easiest way is to make a \sphinxstyleemphasis{patch} or set of patches. Here we explain how. Making a patch is the simplest and quickest, but if you’re going to be doing anything more than simple quick things, please consider following the {\hyperref[\detokenize{devel/gitwash/git_development:git-development}]{\sphinxcrossref{\DUrole{std,std-ref}{Git for development}}}} model instead. \subsection{Making patches} \label{\detokenize{devel/gitwash/patching:making-patches}}\label{\detokenize{devel/gitwash/patching:id1}} \subsubsection{Overview} \label{\detokenize{devel/gitwash/patching:overview}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} tell git who you are} git config \PYGZhy{}\PYGZhy{}global user.email you@yourdomain.example.com git config \PYGZhy{}\PYGZhy{}global user.name \PYG{l+s+s2}{\PYGZdq{}Your Name Comes Here\PYGZdq{}} \PYG{c+c1}{\PYGZsh{} get the repository if you don\PYGZsq{}t have it} git clone git://github.com/matplotlib/matplotlib.git \PYG{c+c1}{\PYGZsh{} make a branch for your patching} \PYG{n+nb}{cd} matplotlib git branch the\PYGZhy{}fix\PYGZhy{}im\PYGZhy{}thinking\PYGZhy{}of git checkout the\PYGZhy{}fix\PYGZhy{}im\PYGZhy{}thinking\PYGZhy{}of \PYG{c+c1}{\PYGZsh{} hack, hack, hack} \PYG{c+c1}{\PYGZsh{} Tell git about any new files you\PYGZsq{}ve made} git add somewhere/tests/test\PYGZus{}my\PYGZus{}bug.py \PYG{c+c1}{\PYGZsh{} commit work in progress as you go} git commit \PYGZhy{}am \PYG{l+s+s1}{\PYGZsq{}BF \PYGZhy{} added tests for Funny bug\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} hack hack, hack} git commit \PYGZhy{}am \PYG{l+s+s1}{\PYGZsq{}BF \PYGZhy{} added fix for Funny bug\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} make the patch files} git format\PYGZhy{}patch \PYGZhy{}M \PYGZhy{}C master \end{sphinxVerbatim} Then, send the generated patch files to the \sphinxhref{https://mail.python.org/mailman/listinfo/matplotlib-devel}{Matplotlib mailing list} — where we will thank you warmly. \subsubsection{In detail} \label{\detokenize{devel/gitwash/patching:in-detail}}\begin{enumerate} \item {} Tell git who you are so it can label the commits you’ve made: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git config \PYGZhy{}\PYGZhy{}global user.email you@yourdomain.example.com git config \PYGZhy{}\PYGZhy{}global user.name \PYG{l+s+s2}{\PYGZdq{}Your Name Comes Here\PYGZdq{}} \end{sphinxVerbatim} \item {} If you don’t already have one, clone a copy of the \sphinxhref{http://matplotlib.org}{Matplotlib} repository: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git clone git://github.com/matplotlib/matplotlib.git \PYG{n+nb}{cd} matplotlib \end{sphinxVerbatim} \item {} Make a ‘feature branch’. This will be where you work on your bug fix. It’s nice and safe and leaves you with access to an unmodified copy of the code in the main branch: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git branch the\PYGZhy{}fix\PYGZhy{}im\PYGZhy{}thinking\PYGZhy{}of git checkout the\PYGZhy{}fix\PYGZhy{}im\PYGZhy{}thinking\PYGZhy{}of \end{sphinxVerbatim} \item {} Do some edits, and commit them as you go: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} hack, hack, hack} \PYG{c+c1}{\PYGZsh{} Tell git about any new files you\PYGZsq{}ve made} git add somewhere/tests/test\PYGZus{}my\PYGZus{}bug.py \PYG{c+c1}{\PYGZsh{} commit work in progress as you go} git commit \PYGZhy{}am \PYG{l+s+s1}{\PYGZsq{}BF \PYGZhy{} added tests for Funny bug\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} hack hack, hack} git commit \PYGZhy{}am \PYG{l+s+s1}{\PYGZsq{}BF \PYGZhy{} added fix for Funny bug\PYGZsq{}} \end{sphinxVerbatim} Note the \sphinxcode{\sphinxupquote{-am}} options to \sphinxcode{\sphinxupquote{commit}}. The \sphinxcode{\sphinxupquote{m}} flag just signals that you’re going to type a message on the command line. The \sphinxcode{\sphinxupquote{a}} flag — you can just take on faith — or see \sphinxhref{http://gitready.com/beginner/2009/01/18/the-staging-area.html}{why the -a flag?}. \item {} When you have finished, check you have committed all your changes: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git status \end{sphinxVerbatim} \item {} Finally, make your commits into patches. You want all the commits since you branched from the \sphinxcode{\sphinxupquote{master}} branch: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git format\PYGZhy{}patch \PYGZhy{}M \PYGZhy{}C master \end{sphinxVerbatim} You will now have several files named for the commits: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] 0001\PYGZhy{}BF\PYGZhy{}added\PYGZhy{}tests\PYGZhy{}for\PYGZhy{}Funny\PYGZhy{}bug.patch 0002\PYGZhy{}BF\PYGZhy{}added\PYGZhy{}fix\PYGZhy{}for\PYGZhy{}Funny\PYGZhy{}bug.patch \end{sphinxVerbatim} Send these files to the \sphinxhref{https://mail.python.org/mailman/listinfo/matplotlib-devel}{Matplotlib mailing list}. \end{enumerate} When you are done, to switch back to the main copy of the code, just return to the \sphinxcode{\sphinxupquote{master}} branch: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git checkout master \end{sphinxVerbatim} \subsection{Moving from patching to development} \label{\detokenize{devel/gitwash/patching:moving-from-patching-to-development}} If you find you have done some patches, and you have one or more feature branches, you will probably want to switch to development mode. You can do this with the repository you have. Fork the \sphinxhref{http://matplotlib.org}{Matplotlib} repository on github — {\hyperref[\detokenize{devel/gitwash/forking_hell:forking}]{\sphinxcrossref{\DUrole{std,std-ref}{Making your own copy (fork) of Matplotlib}}}}. Then: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} checkout and refresh master branch from main repo} git checkout master git pull origin master \PYG{c+c1}{\PYGZsh{} rename pointer to main repository to \PYGZsq{}upstream\PYGZsq{}} git remote rename origin upstream \PYG{c+c1}{\PYGZsh{} point your repo to default read / write to your fork on github} git remote add origin git@github.com:your\PYGZhy{}user\PYGZhy{}name/matplotlib.git \PYG{c+c1}{\PYGZsh{} push up any branches you\PYGZsq{}ve made and want to keep} git push origin the\PYGZhy{}fix\PYGZhy{}im\PYGZhy{}thinking\PYGZhy{}of \end{sphinxVerbatim} Then you can, if you want, follow the {\hyperref[\detokenize{devel/gitwash/development_workflow:development-workflow}]{\sphinxcrossref{\DUrole{std,std-ref}{Development workflow}}}}. \section{Git for development} \label{\detokenize{devel/gitwash/git_development:git-for-development}}\label{\detokenize{devel/gitwash/git_development:git-development}}\label{\detokenize{devel/gitwash/git_development::doc}} Contents: \subsection{Making your own copy (fork) of Matplotlib} \label{\detokenize{devel/gitwash/forking_hell:making-your-own-copy-fork-of-matplotlib}}\label{\detokenize{devel/gitwash/forking_hell:forking}}\label{\detokenize{devel/gitwash/forking_hell::doc}} You need to do this only once. The instructions here are very similar to the instructions at \sphinxurl{https://help.github.com/forking/} — please see that page for more detail. We’re repeating some of it here just to give the specifics for the \sphinxhref{http://matplotlib.org}{Matplotlib} project, and to suggest some default names. \subsubsection{Set up and configure a github account} \label{\detokenize{devel/gitwash/forking_hell:set-up-and-configure-a-github-account}} If you don’t have a github account, go to the github page, and make one. You then need to configure your account to allow write access — see the \sphinxcode{\sphinxupquote{Generating SSH keys}} help on \sphinxhref{https://help.github.com}{github help}. \subsubsection{Create your own forked copy of Matplotlib} \label{\detokenize{devel/gitwash/forking_hell:create-your-own-forked-copy-of-matplotlib}}\begin{enumerate} \item {} Log into your github account. \item {} Go to the \sphinxhref{http://matplotlib.org}{Matplotlib} github home at \sphinxhref{https://github.com/matplotlib/matplotlib}{Matplotlib github}. \item {} Click on the \sphinxstyleemphasis{fork} button: \noindent\sphinxincludegraphics{{forking_button}.png} Now, after a short pause, you should find yourself at the home page for your own forked copy of \sphinxhref{http://matplotlib.org}{Matplotlib}. \end{enumerate} \subsection{Set up your fork} \label{\detokenize{devel/gitwash/set_up_fork:set-up-your-fork}}\label{\detokenize{devel/gitwash/set_up_fork:set-up-fork}}\label{\detokenize{devel/gitwash/set_up_fork::doc}} First you follow the instructions for {\hyperref[\detokenize{devel/gitwash/forking_hell:forking}]{\sphinxcrossref{\DUrole{std,std-ref}{Making your own copy (fork) of Matplotlib}}}}. \subsubsection{Overview} \label{\detokenize{devel/gitwash/set_up_fork:overview}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git clone https://github.com/your\PYGZhy{}user\PYGZhy{}name/matplotlib.git \PYG{n+nb}{cd} matplotlib git remote add upstream git://github.com/matplotlib/matplotlib.git \end{sphinxVerbatim} \subsubsection{In detail} \label{\detokenize{devel/gitwash/set_up_fork:in-detail}} \paragraph{Clone your fork} \label{\detokenize{devel/gitwash/set_up_fork:clone-your-fork}}\begin{enumerate} \item {} Clone your fork to the local computer with \sphinxcode{\sphinxupquote{git clone https://github.com/your-user-name/matplotlib.git}} \item {} Investigate. Change directory to your new repo: \sphinxcode{\sphinxupquote{cd matplotlib}}. Then \sphinxcode{\sphinxupquote{git branch -a}} to show you all branches. You’ll get something like: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] * master remotes/origin/master \end{sphinxVerbatim} This tells you that you are currently on the \sphinxcode{\sphinxupquote{master}} branch, and that you also have a \sphinxcode{\sphinxupquote{remote}} connection to \sphinxcode{\sphinxupquote{origin/master}}. What remote repository is \sphinxcode{\sphinxupquote{remote/origin}}? Try \sphinxcode{\sphinxupquote{git remote -v}} to see the URLs for the remote. They will point to your github fork. Now you want to connect to the upstream \sphinxhref{https://github.com/matplotlib/matplotlib}{Matplotlib github} repository, so you can merge in changes from trunk. \end{enumerate} \paragraph{Linking your repository to the upstream repo} \label{\detokenize{devel/gitwash/set_up_fork:linking-your-repository-to-the-upstream-repo}}\label{\detokenize{devel/gitwash/set_up_fork:linking-to-upstream}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n+nb}{cd} matplotlib git remote add upstream git://github.com/matplotlib/matplotlib.git \end{sphinxVerbatim} \sphinxcode{\sphinxupquote{upstream}} here is just the arbitrary name we’re using to refer to the main \sphinxhref{http://matplotlib.org}{Matplotlib} repository at \sphinxhref{https://github.com/matplotlib/matplotlib}{Matplotlib github}. Note that we’ve used \sphinxcode{\sphinxupquote{git://}} for the URL rather than \sphinxcode{\sphinxupquote{https://}} or \sphinxcode{\sphinxupquote{git@}}. The \sphinxcode{\sphinxupquote{git://}} URL is read only. This means we that we can’t accidentally (or deliberately) write to the upstream repo, and we are only going to use it to merge into our own code. Just for your own satisfaction, show yourself that you now have a new ‘remote’, with \sphinxcode{\sphinxupquote{git remote -v show}}, giving you something like: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] upstream git://github.com/matplotlib/matplotlib.git (fetch) upstream git://github.com/matplotlib/matplotlib.git (push) origin https://github.com/your\PYGZhy{}user\PYGZhy{}name/matplotlib.git (fetch) origin https://github.com/your\PYGZhy{}user\PYGZhy{}name/matplotlib.git (push) \end{sphinxVerbatim} \subsection{Configure git} \label{\detokenize{devel/gitwash/configure_git:configure-git}}\label{\detokenize{devel/gitwash/configure_git:id1}}\label{\detokenize{devel/gitwash/configure_git::doc}} \subsubsection{Overview} \label{\detokenize{devel/gitwash/configure_git:overview}}\label{\detokenize{devel/gitwash/configure_git:git-config-basic}} Your personal git configurations are saved in the \sphinxcode{\sphinxupquote{.gitconfig}} file in your home directory. Here is an example \sphinxcode{\sphinxupquote{.gitconfig}} file: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] [user] name = Your Name email = you@yourdomain.example.com [alias] ci = commit \PYGZhy{}a co = checkout st = status stat = status br = branch wdiff = diff \PYGZhy{}\PYGZhy{}color\PYGZhy{}words [core] editor = vim [merge] summary = true \end{sphinxVerbatim} You can edit this file directly or you can use the \sphinxcode{\sphinxupquote{git config -{-}global}} command: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git config \PYGZhy{}\PYGZhy{}global user.name \PYG{l+s+s2}{\PYGZdq{}Your Name\PYGZdq{}} git config \PYGZhy{}\PYGZhy{}global user.email you@yourdomain.example.com git config \PYGZhy{}\PYGZhy{}global alias.ci \PYG{l+s+s2}{\PYGZdq{}commit \PYGZhy{}a\PYGZdq{}} git config \PYGZhy{}\PYGZhy{}global alias.co checkout git config \PYGZhy{}\PYGZhy{}global alias.st \PYG{l+s+s2}{\PYGZdq{}status \PYGZhy{}a\PYGZdq{}} git config \PYGZhy{}\PYGZhy{}global alias.stat \PYG{l+s+s2}{\PYGZdq{}status \PYGZhy{}a\PYGZdq{}} git config \PYGZhy{}\PYGZhy{}global alias.br branch git config \PYGZhy{}\PYGZhy{}global alias.wdiff \PYG{l+s+s2}{\PYGZdq{}diff \PYGZhy{}\PYGZhy{}color\PYGZhy{}words\PYGZdq{}} git config \PYGZhy{}\PYGZhy{}global core.editor vim git config \PYGZhy{}\PYGZhy{}global merge.summary \PYG{n+nb}{true} \end{sphinxVerbatim} To set up on another computer, you can copy your \sphinxcode{\sphinxupquote{\textasciitilde{}/.gitconfig}} file, or run the commands above. \subsubsection{In detail} \label{\detokenize{devel/gitwash/configure_git:in-detail}} \paragraph{user.name and user.email} \label{\detokenize{devel/gitwash/configure_git:user-name-and-user-email}} It is good practice to tell \sphinxhref{https://git-scm.com/}{git} who you are, for labeling any changes you make to the code. The simplest way to do this is from the command line: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git config \PYGZhy{}\PYGZhy{}global user.name \PYG{l+s+s2}{\PYGZdq{}Your Name\PYGZdq{}} git config \PYGZhy{}\PYGZhy{}global user.email you@yourdomain.example.com \end{sphinxVerbatim} This will write the settings into your git configuration file, which should now contain a user section with your name and email: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] [user] name = Your Name email = you@yourdomain.example.com \end{sphinxVerbatim} Of course you’ll need to replace \sphinxcode{\sphinxupquote{Your Name}} and \sphinxcode{\sphinxupquote{you@yourdomain.example.com}} with your actual name and email address. \paragraph{Aliases} \label{\detokenize{devel/gitwash/configure_git:aliases}} You might well benefit from some aliases to common commands. For example, you might well want to be able to shorten \sphinxcode{\sphinxupquote{git checkout}} to \sphinxcode{\sphinxupquote{git co}}. Or you may want to alias \sphinxcode{\sphinxupquote{git diff -{-}color-words}} (which gives a nicely formatted output of the diff) to \sphinxcode{\sphinxupquote{git wdiff}} The following \sphinxcode{\sphinxupquote{git config -{-}global}} commands: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git config \PYGZhy{}\PYGZhy{}global alias.ci \PYG{l+s+s2}{\PYGZdq{}commit \PYGZhy{}a\PYGZdq{}} git config \PYGZhy{}\PYGZhy{}global alias.co checkout git config \PYGZhy{}\PYGZhy{}global alias.st \PYG{l+s+s2}{\PYGZdq{}status \PYGZhy{}a\PYGZdq{}} git config \PYGZhy{}\PYGZhy{}global alias.stat \PYG{l+s+s2}{\PYGZdq{}status \PYGZhy{}a\PYGZdq{}} git config \PYGZhy{}\PYGZhy{}global alias.br branch git config \PYGZhy{}\PYGZhy{}global alias.wdiff \PYG{l+s+s2}{\PYGZdq{}diff \PYGZhy{}\PYGZhy{}color\PYGZhy{}words\PYGZdq{}} \end{sphinxVerbatim} will create an \sphinxcode{\sphinxupquote{alias}} section in your \sphinxcode{\sphinxupquote{.gitconfig}} file with contents like this: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] [alias] ci = commit \PYGZhy{}a co = checkout st = status \PYGZhy{}a stat = status \PYGZhy{}a br = branch wdiff = diff \PYGZhy{}\PYGZhy{}color\PYGZhy{}words \end{sphinxVerbatim} \paragraph{Editor} \label{\detokenize{devel/gitwash/configure_git:editor}} You may also want to make sure that your editor of choice is used \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git config \PYGZhy{}\PYGZhy{}global core.editor vim \end{sphinxVerbatim} \paragraph{Merging} \label{\detokenize{devel/gitwash/configure_git:merging}} To enforce summaries when doing merges (\sphinxcode{\sphinxupquote{\textasciitilde{}/.gitconfig}} file again): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] [merge] log = true \end{sphinxVerbatim} Or from the command line: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git config \PYGZhy{}\PYGZhy{}global merge.log \PYG{n+nb}{true} \end{sphinxVerbatim} \paragraph{Fancy log output} \label{\detokenize{devel/gitwash/configure_git:fancy-log-output}}\label{\detokenize{devel/gitwash/configure_git:fancy-log}} This is a very nice alias to get a fancy log output; it should go in the \sphinxcode{\sphinxupquote{alias}} section of your \sphinxcode{\sphinxupquote{.gitconfig}} file: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] lg = log \PYGZhy{}\PYGZhy{}graph \PYGZhy{}\PYGZhy{}pretty=format:\PYGZsq{}\PYGZpc{}Cred\PYGZpc{}h\PYGZpc{}Creset \PYGZhy{}\PYGZpc{}C(yellow)\PYGZpc{}d\PYGZpc{}Creset \PYGZpc{}s \PYGZpc{}Cgreen(\PYGZpc{}cr) \PYGZpc{}C(bold blue)[\PYGZpc{}an]\PYGZpc{}Creset\PYGZsq{} \PYGZhy{}\PYGZhy{}abbrev\PYGZhy{}commit \PYGZhy{}\PYGZhy{}date=relative \end{sphinxVerbatim} You use the alias with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git lg \end{sphinxVerbatim} and it gives graph / text output something like this (but with color!): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] * 6d8e1ee \PYGZhy{} (HEAD, origin/my\PYGZhy{}fancy\PYGZhy{}feature, my\PYGZhy{}fancy\PYGZhy{}feature) NF \PYGZhy{} a fancy file (45 minutes ago) [Matthew Brett] * d304a73 \PYGZhy{} (origin/placeholder, placeholder) Merge pull request \PYGZsh{}48 from hhuuggoo/master (2 weeks ago) [Jonathan Terhorst] \textbar{}\PYGZbs{} \textbar{} * 4aff2a8 \PYGZhy{} fixed bug 35, and added a test in test\PYGZus{}bugfixes (2 weeks ago) [Hugo] \textbar{}/ * a7ff2e5 \PYGZhy{} Added notes on discussion/proposal made during Data Array Summit. (2 weeks ago) [Corran Webster] * 68f6752 \PYGZhy{} Initial implimentation of AxisIndexer \PYGZhy{} uses \PYGZsq{}index\PYGZus{}by\PYGZsq{} which needs to be changed to a call on an Axes object \PYGZhy{} this is all very sketchy right now. (2 weeks ago) [Corr * 376adbd \PYGZhy{} Merge pull request \PYGZsh{}46 from terhorst/master (2 weeks ago) [Jonathan Terhorst] \textbar{}\PYGZbs{} \textbar{} * b605216 \PYGZhy{} updated joshu example to current api (3 weeks ago) [Jonathan Terhorst] \textbar{} * 2e991e8 \PYGZhy{} add testing for outer ufunc (3 weeks ago) [Jonathan Terhorst] \textbar{} * 7beda5a \PYGZhy{} prevent axis from throwing an exception if testing equality with non\PYGZhy{}axis object (3 weeks ago) [Jonathan Terhorst] \textbar{} * 65af65e \PYGZhy{} convert unit testing code to assertions (3 weeks ago) [Jonathan Terhorst] \textbar{} * 956fbab \PYGZhy{} Merge remote\PYGZhy{}tracking branch \PYGZsq{}upstream/master\PYGZsq{} (3 weeks ago) [Jonathan Terhorst] \textbar{} \textbar{}\PYGZbs{} \textbar{} \textbar{}/ \end{sphinxVerbatim} Thanks to Yury V. Zaytsev for posting it. \subsection{Development workflow} \label{\detokenize{devel/gitwash/development_workflow:development-workflow}}\label{\detokenize{devel/gitwash/development_workflow:id1}}\label{\detokenize{devel/gitwash/development_workflow::doc}} You already have your own forked copy of the \sphinxhref{http://matplotlib.org}{Matplotlib} repository, by following {\hyperref[\detokenize{devel/gitwash/forking_hell:forking}]{\sphinxcrossref{\DUrole{std,std-ref}{Making your own copy (fork) of Matplotlib}}}}. You have {\hyperref[\detokenize{devel/gitwash/set_up_fork:set-up-fork}]{\sphinxcrossref{\DUrole{std,std-ref}{Set up your fork}}}}. You have configured git by following {\hyperref[\detokenize{devel/gitwash/configure_git:configure-git}]{\sphinxcrossref{\DUrole{std,std-ref}{Configure git}}}}. Now you are ready for some real work. \subsubsection{Workflow summary} \label{\detokenize{devel/gitwash/development_workflow:workflow-summary}} In what follows we’ll refer to the upstream Matplotlib \sphinxcode{\sphinxupquote{master}} branch, as “trunk”. \begin{itemize} \item {} Don’t use your \sphinxcode{\sphinxupquote{master}} branch for anything. Consider deleting it. \item {} When you are starting a new set of changes, fetch any changes from trunk, and start a new \sphinxstyleemphasis{feature branch} from that. \item {} Make a new branch for each separable set of changes — “one task, one branch” (\sphinxhref{https://mail.scipy.org/pipermail/ipython-dev/2010-October/006746.html}{ipython git workflow}). \item {} Name your branch for the purpose of the changes - e.g. \sphinxcode{\sphinxupquote{bugfix-for-issue-14}} or \sphinxcode{\sphinxupquote{refactor-database-code}}. \item {} If you can possibly avoid it, avoid merging trunk or any other branches into your feature branch while you are working. \item {} If you do find yourself merging from trunk, consider {\hyperref[\detokenize{devel/gitwash/development_workflow:rebase-on-trunk}]{\sphinxcrossref{\DUrole{std,std-ref}{Rebasing on trunk}}}} \item {} Ask on the \sphinxhref{https://mail.python.org/mailman/listinfo/matplotlib-devel}{Matplotlib mailing list} if you get stuck. \item {} Ask for code review! \end{itemize} This way of working helps to keep work well organized, with readable history. This in turn makes it easier for project maintainers (that might be you) to see what you’ve done, and why you did it. See \sphinxhref{https://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg39091.html}{linux git workflow} and \sphinxhref{https://mail.scipy.org/pipermail/ipython-dev/2010-October/006746.html}{ipython git workflow} for some explanation. \subsubsection{Consider deleting your master branch} \label{\detokenize{devel/gitwash/development_workflow:consider-deleting-your-master-branch}} It may sound strange, but deleting your own \sphinxcode{\sphinxupquote{master}} branch can help reduce confusion about which branch you are on. See \sphinxhref{https://matthew-brett.github.io/pydagogue/gh\_delete\_master.html}{deleting master on github} for details. \subsubsection{Update the mirror of trunk} \label{\detokenize{devel/gitwash/development_workflow:update-the-mirror-of-trunk}}\label{\detokenize{devel/gitwash/development_workflow:update-mirror-trunk}} First make sure you have done {\hyperref[\detokenize{devel/gitwash/set_up_fork:linking-to-upstream}]{\sphinxcrossref{\DUrole{std,std-ref}{Linking your repository to the upstream repo}}}}. From time to time you should fetch the upstream (trunk) changes from github: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git fetch upstream \end{sphinxVerbatim} This will pull down any commits you don’t have, and set the remote branches to point to the right commit. For example, ‘trunk’ is the branch referred to by (remote/branchname) \sphinxcode{\sphinxupquote{upstream/master}} - and if there have been commits since you last checked, \sphinxcode{\sphinxupquote{upstream/master}} will change after you do the fetch. \subsubsection{Make a new feature branch} \label{\detokenize{devel/gitwash/development_workflow:make-a-new-feature-branch}}\label{\detokenize{devel/gitwash/development_workflow:make-feature-branch}} When you are ready to make some changes to the code, you should start a new branch. Branches that are for a collection of related edits are often called ‘feature branches’. Making an new branch for each set of related changes will make it easier for someone reviewing your branch to see what you are doing. Choose an informative name for the branch to remind yourself and the rest of us what the changes in the branch are for. For example \sphinxcode{\sphinxupquote{add-ability-to-fly}}, or \sphinxcode{\sphinxupquote{buxfix-for-issue-42}}. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} Update the mirror of trunk} git fetch upstream \PYG{c+c1}{\PYGZsh{} Make new feature branch starting at current trunk} git branch my\PYGZhy{}new\PYGZhy{}feature upstream/master git checkout my\PYGZhy{}new\PYGZhy{}feature \end{sphinxVerbatim} Generally, you will want to keep your feature branches on your public \sphinxhref{https://github.com}{github} fork of \sphinxhref{http://matplotlib.org}{Matplotlib}. To do this, you \sphinxhref{https://schacon.github.io/git/git-push.html}{git push} this new branch up to your github repo. Generally (if you followed the instructions in these pages, and by default), git will have a link to your github repo, called \sphinxcode{\sphinxupquote{origin}}. You push up to your own repo on github with: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git push origin my\PYGZhy{}new\PYGZhy{}feature \end{sphinxVerbatim} In git \textgreater{}= 1.7 you can ensure that the link is correctly set by using the \sphinxcode{\sphinxupquote{-{-}set-upstream}} option: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git push \PYGZhy{}\PYGZhy{}set\PYGZhy{}upstream origin my\PYGZhy{}new\PYGZhy{}feature \end{sphinxVerbatim} From now on git will know that \sphinxcode{\sphinxupquote{my-new-feature}} is related to the \sphinxcode{\sphinxupquote{my-new-feature}} branch in the github repo. \subsubsection{The editing workflow} \label{\detokenize{devel/gitwash/development_workflow:the-editing-workflow}}\label{\detokenize{devel/gitwash/development_workflow:edit-flow}} \paragraph{Overview} \label{\detokenize{devel/gitwash/development_workflow:overview}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} hack hack} git add my\PYGZus{}new\PYGZus{}file git commit \PYGZhy{}am \PYG{l+s+s1}{\PYGZsq{}NF \PYGZhy{} some message\PYGZsq{}} git push \end{sphinxVerbatim} \paragraph{In more detail} \label{\detokenize{devel/gitwash/development_workflow:in-more-detail}}\begin{enumerate} \item {} Make some changes \item {} See which files have changed with \sphinxcode{\sphinxupquote{git status}} (see \sphinxhref{https://schacon.github.io/git/git-status.html}{git status}). You’ll see a listing like this one: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYGZsh{} On branch ny\PYGZhy{}new\PYGZhy{}feature \PYGZsh{} Changed but not updated: \PYGZsh{} (use \PYGZdq{}git add \PYGZlt{}file\PYGZgt{}...\PYGZdq{} to update what will be committed) \PYGZsh{} (use \PYGZdq{}git checkout \PYGZhy{}\PYGZhy{} \PYGZlt{}file\PYGZgt{}...\PYGZdq{} to discard changes in working directory) \PYGZsh{} \PYGZsh{} modified: README \PYGZsh{} \PYGZsh{} Untracked files: \PYGZsh{} (use \PYGZdq{}git add \PYGZlt{}file\PYGZgt{}...\PYGZdq{} to include in what will be committed) \PYGZsh{} \PYGZsh{} INSTALL no changes added to commit (use \PYGZdq{}git add\PYGZdq{} and/or \PYGZdq{}git commit \PYGZhy{}a\PYGZdq{}) \end{sphinxVerbatim} \item {} Check what the actual changes are with \sphinxcode{\sphinxupquote{git diff}} (\sphinxhref{https://schacon.github.io/git/git-diff.html}{git diff}). \item {} Add any new files to version control \sphinxcode{\sphinxupquote{git add new\_file\_name}} (see \sphinxhref{https://schacon.github.io/git/git-add.html}{git add}). \item {} To commit all modified files into the local copy of your repo,, do \sphinxcode{\sphinxupquote{git commit -am 'A commit message'}}. Note the \sphinxcode{\sphinxupquote{-am}} options to \sphinxcode{\sphinxupquote{commit}}. The \sphinxcode{\sphinxupquote{m}} flag just signals that you’re going to type a message on the command line. The \sphinxcode{\sphinxupquote{a}} flag — you can just take on faith — or see \sphinxhref{http://gitready.com/beginner/2009/01/18/the-staging-area.html}{why the -a flag?} — and the helpful use-case description in the \sphinxhref{http://2ndscale.com/rtomayko/2008/the-thing-about-git}{tangled working copy problem}. The \sphinxhref{https://schacon.github.io/git/git-commit.html}{git commit} manual page might also be useful. \item {} To push the changes up to your forked repo on github, do a \sphinxcode{\sphinxupquote{git push}} (see \sphinxhref{https://schacon.github.io/git/git-push.html}{git push}). \end{enumerate} \subsubsection{Ask for your changes to be reviewed or merged} \label{\detokenize{devel/gitwash/development_workflow:ask-for-your-changes-to-be-reviewed-or-merged}} When you are ready to ask for someone to review your code and consider a merge: \begin{enumerate} \item {} Go to the URL of your forked repo, say \sphinxcode{\sphinxupquote{https://github.com/your-user-name/matplotlib}}. \item {} Use the ‘Switch Branches’ dropdown menu near the top left of the page to select the branch with your changes: \noindent\sphinxincludegraphics{{branch_dropdown}.png} \item {} Click on the ‘Pull request’ button: \noindent\sphinxincludegraphics{{pull_button}.png} Enter a title for the set of changes, and some explanation of what you’ve done. Say if there is anything you’d like particular attention for - like a complicated change or some code you are not happy with. If you don’t think your request is ready to be merged, just say so in your pull request message. This is still a good way of getting some preliminary code review. \end{enumerate} \subsubsection{Some other things you might want to do} \label{\detokenize{devel/gitwash/development_workflow:some-other-things-you-might-want-to-do}} \paragraph{Delete a branch on github} \label{\detokenize{devel/gitwash/development_workflow:delete-a-branch-on-github}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git checkout master \PYG{c+c1}{\PYGZsh{} delete branch locally} git branch \PYGZhy{}D my\PYGZhy{}unwanted\PYGZhy{}branch \PYG{c+c1}{\PYGZsh{} delete branch on github} git push origin :my\PYGZhy{}unwanted\PYGZhy{}branch \end{sphinxVerbatim} Note the colon \sphinxcode{\sphinxupquote{:}} before \sphinxcode{\sphinxupquote{my-unwanted-branch}}. See also: \sphinxurl{https://help.github.com/articles/pushing-to-a-remote/\#deleting-a-remote-branch-or-tag} \paragraph{Several people sharing a single repository} \label{\detokenize{devel/gitwash/development_workflow:several-people-sharing-a-single-repository}} If you want to work on some stuff with other people, where you are all committing into the same repository, or even the same branch, then just share it via github. First fork Matplotlib into your account, as from {\hyperref[\detokenize{devel/gitwash/forking_hell:forking}]{\sphinxcrossref{\DUrole{std,std-ref}{Making your own copy (fork) of Matplotlib}}}}. Then, go to your forked repository github page, say \sphinxcode{\sphinxupquote{https://github.com/your-user-name/matplotlib}} Click on the ‘Admin’ button, and add anyone else to the repo as a collaborator: \begin{quote} \noindent\sphinxincludegraphics{{pull_button}.png} \end{quote} Now all those people can do: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git clone https://github.com/your\PYGZhy{}user\PYGZhy{}name/matplotlib.git \end{sphinxVerbatim} Remember that links starting with \sphinxcode{\sphinxupquote{https}} or \sphinxcode{\sphinxupquote{git@}} are read-write, and that \sphinxcode{\sphinxupquote{git@}} uses the ssh protocol; links starting with \sphinxcode{\sphinxupquote{git://}} are read-only. Your collaborators can then commit directly into that repo with the usual: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git commit \PYGZhy{}am \PYG{l+s+s1}{\PYGZsq{}ENH \PYGZhy{} much better code\PYGZsq{}} git push origin master \PYG{c+c1}{\PYGZsh{} pushes directly into your repo} \end{sphinxVerbatim} \paragraph{Explore your repository} \label{\detokenize{devel/gitwash/development_workflow:explore-your-repository}} To see a graphical representation of the repository branches and commits: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] gitk \PYGZhy{}\PYGZhy{}all \end{sphinxVerbatim} To see a linear list of commits for this branch: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git log \end{sphinxVerbatim} You can also look at the \sphinxhref{https://github.com/blog/39-say-hello-to-the-network-graph-visualizer}{network graph visualizer} for your github repo. Finally the {\hyperref[\detokenize{devel/gitwash/configure_git:fancy-log}]{\sphinxcrossref{\DUrole{std,std-ref}{Fancy log output}}}} \sphinxcode{\sphinxupquote{lg}} alias will give you a reasonable text-based graph of the repository. \paragraph{Rebasing on trunk} \label{\detokenize{devel/gitwash/development_workflow:rebasing-on-trunk}}\label{\detokenize{devel/gitwash/development_workflow:rebase-on-trunk}} Let’s say you thought of some work you’d like to do. You {\hyperref[\detokenize{devel/gitwash/development_workflow:update-mirror-trunk}]{\sphinxcrossref{\DUrole{std,std-ref}{Update the mirror of trunk}}}} and {\hyperref[\detokenize{devel/gitwash/development_workflow:make-feature-branch}]{\sphinxcrossref{\DUrole{std,std-ref}{Make a new feature branch}}}} called \sphinxcode{\sphinxupquote{cool-feature}}. At this stage trunk is at some commit, let’s call it E. Now you make some new commits on your \sphinxcode{\sphinxupquote{cool-feature}} branch, let’s call them A, B, C. Maybe your changes take a while, or you come back to them after a while. In the meantime, trunk has progressed from commit E to commit (say) G: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] A\PYGZhy{}\PYGZhy{}\PYGZhy{}B\PYGZhy{}\PYGZhy{}\PYGZhy{}C cool\PYGZhy{}feature / D\PYGZhy{}\PYGZhy{}\PYGZhy{}E\PYGZhy{}\PYGZhy{}\PYGZhy{}F\PYGZhy{}\PYGZhy{}\PYGZhy{}G trunk \end{sphinxVerbatim} At this stage you consider merging trunk into your feature branch, and you remember that this here page sternly advises you not to do that, because the history will get messy. Most of the time you can just ask for a review, and not worry that trunk has got a little ahead. But sometimes, the changes in trunk might affect your changes, and you need to harmonize them. In this situation you may prefer to do a rebase. rebase takes your changes (A, B, C) and replays them as if they had been made to the current state of \sphinxcode{\sphinxupquote{trunk}}. In other words, in this case, it takes the changes represented by A, B, C and replays them on top of G. After the rebase, your history will look like this: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] A\PYGZsq{}\PYGZhy{}\PYGZhy{}B\PYGZsq{}\PYGZhy{}\PYGZhy{}C\PYGZsq{} cool\PYGZhy{}feature / D\PYGZhy{}\PYGZhy{}\PYGZhy{}E\PYGZhy{}\PYGZhy{}\PYGZhy{}F\PYGZhy{}\PYGZhy{}\PYGZhy{}G trunk \end{sphinxVerbatim} See \sphinxhref{https://matthew-brett.github.io/pydagogue/rebase\_without\_tears.html}{rebase without tears} for more detail. To do a rebase on trunk: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} Update the mirror of trunk} git fetch upstream \PYG{c+c1}{\PYGZsh{} go to the feature branch} git checkout cool\PYGZhy{}feature \PYG{c+c1}{\PYGZsh{} make a backup in case you mess up} git branch tmp cool\PYGZhy{}feature \PYG{c+c1}{\PYGZsh{} rebase cool\PYGZhy{}feature onto trunk} git rebase \PYGZhy{}\PYGZhy{}onto upstream/master upstream/master cool\PYGZhy{}feature \end{sphinxVerbatim} In this situation, where you are already on branch \sphinxcode{\sphinxupquote{cool-feature}}, the last command can be written more succinctly as: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git rebase upstream/master \end{sphinxVerbatim} When all looks good you can delete your backup branch: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git branch \PYGZhy{}D tmp \end{sphinxVerbatim} If it doesn’t look good you may need to have a look at {\hyperref[\detokenize{devel/gitwash/development_workflow:recovering-from-mess-up}]{\sphinxcrossref{\DUrole{std,std-ref}{Recovering from mess-ups}}}}. If you have made changes to files that have also changed in trunk, this may generate merge conflicts that you need to resolve - see the \sphinxhref{https://schacon.github.io/git/git-rebase.html}{git rebase} man page for some instructions at the end of the “Description” section. There is some related help on merging in the git user manual - see \sphinxhref{https://schacon.github.io/git/user-manual.html\#resolving-a-merge}{resolving a merge}. \paragraph{Recovering from mess-ups} \label{\detokenize{devel/gitwash/development_workflow:recovering-from-mess-ups}}\label{\detokenize{devel/gitwash/development_workflow:recovering-from-mess-up}} Sometimes, you mess up merges or rebases. Luckily, in git it is relatively straightforward to recover from such mistakes. If you mess up during a rebase: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git rebase \PYGZhy{}\PYGZhy{}abort \end{sphinxVerbatim} If you notice you messed up after the rebase: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} reset branch back to the saved point} git reset \PYGZhy{}\PYGZhy{}hard tmp \end{sphinxVerbatim} If you forgot to make a backup branch: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} look at the reflog of the branch} git reflog show cool\PYGZhy{}feature \PYG{l+m}{8630830} cool\PYGZhy{}feature@\PYG{o}{\PYGZob{}}\PYG{l+m}{0}\PYG{o}{\PYGZcb{}}: commit: BUG: io: close file handles immediately 278dd2a cool\PYGZhy{}feature@\PYG{o}{\PYGZob{}}\PYG{l+m}{1}\PYG{o}{\PYGZcb{}}: rebase finished: refs/heads/my\PYGZhy{}feature\PYGZhy{}branch onto 11ee694744f2552d 26aa21a cool\PYGZhy{}feature@\PYG{o}{\PYGZob{}}\PYG{l+m}{2}\PYG{o}{\PYGZcb{}}: commit: BUG: lib: make seek\PYGZus{}gzip\PYGZus{}factory not leak gzip obj ... \PYG{c+c1}{\PYGZsh{} reset the branch to where it was before the botched rebase} git reset \PYGZhy{}\PYGZhy{}hard cool\PYGZhy{}feature@\PYG{o}{\PYGZob{}}\PYG{l+m}{2}\PYG{o}{\PYGZcb{}} \end{sphinxVerbatim} \paragraph{Rewriting commit history} \label{\detokenize{devel/gitwash/development_workflow:rewriting-commit-history}}\label{\detokenize{devel/gitwash/development_workflow:id2}} \begin{sphinxadmonition}{note}{Note:} Do this only for your own feature branches. \end{sphinxadmonition} There’s an embarrassing typo in a commit you made? Or perhaps the you made several false starts you would like the posterity not to see. This can be done via \sphinxstyleemphasis{interactive rebasing}. Suppose that the commit history looks like this: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git log \PYGZhy{}\PYGZhy{}oneline eadc391 Fix some remaining bugs a815645 Modify it so that it works 2dec1ac Fix a few bugs + disable 13d7934 First implementation 6ad92e5 * masked is now an instance of a new object, MaskedConstant 29001ed Add pre\PYGZhy{}nep \PYG{k}{for} a copule of structured\PYGZus{}array\PYGZus{}extensions. ... \end{sphinxVerbatim} and \sphinxcode{\sphinxupquote{6ad92e5}} is the last commit in the \sphinxcode{\sphinxupquote{cool-feature}} branch. Suppose we want to make the following changes: \begin{itemize} \item {} Rewrite the commit message for \sphinxcode{\sphinxupquote{13d7934}} to something more sensible. \item {} Combine the commits \sphinxcode{\sphinxupquote{2dec1ac}}, \sphinxcode{\sphinxupquote{a815645}}, \sphinxcode{\sphinxupquote{eadc391}} into a single one. \end{itemize} We do as follows: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} make a backup of the current state} git branch tmp HEAD \PYG{c+c1}{\PYGZsh{} interactive rebase} git rebase \PYGZhy{}i 6ad92e5 \end{sphinxVerbatim} This will open an editor with the following text in it: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] pick 13d7934 First implementation pick 2dec1ac Fix a few bugs + disable pick a815645 Modify it so that it works pick eadc391 Fix some remaining bugs \PYG{c+c1}{\PYGZsh{} Rebase 6ad92e5..eadc391 onto 6ad92e5} \PYG{c+c1}{\PYGZsh{}} \PYG{c+c1}{\PYGZsh{} Commands:} \PYG{c+c1}{\PYGZsh{} p, pick = use commit} \PYG{c+c1}{\PYGZsh{} r, reword = use commit, but edit the commit message} \PYG{c+c1}{\PYGZsh{} e, edit = use commit, but stop for amending} \PYG{c+c1}{\PYGZsh{} s, squash = use commit, but meld into previous commit} \PYG{c+c1}{\PYGZsh{} f, fixup = like \PYGZdq{}squash\PYGZdq{}, but discard this commit\PYGZsq{}s log message} \PYG{c+c1}{\PYGZsh{}} \PYG{c+c1}{\PYGZsh{} If you remove a line here THAT COMMIT WILL BE LOST.} \PYG{c+c1}{\PYGZsh{} However, if you remove everything, the rebase will be aborted.} \PYG{c+c1}{\PYGZsh{}} \end{sphinxVerbatim} To achieve what we want, we will make the following changes to it: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] r 13d7934 First implementation pick 2dec1ac Fix a few bugs + disable f a815645 Modify it so that it works f eadc391 Fix some remaining bugs \end{sphinxVerbatim} This means that (i) we want to edit the commit message for \sphinxcode{\sphinxupquote{13d7934}}, and (ii) collapse the last three commits into one. Now we save and quit the editor. Git will then immediately bring up an editor for editing the commit message. After revising it, we get the output: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{o}{[}detached HEAD 721fc64\PYG{o}{]} FOO: First implementation \PYG{l+m}{2} files changed, \PYG{l+m}{199} insertions\PYG{o}{(}+\PYG{o}{)}, \PYG{l+m}{66} deletions\PYG{o}{(}\PYGZhy{}\PYG{o}{)} \PYG{o}{[}detached HEAD 0f22701\PYG{o}{]} Fix a few bugs + disable \PYG{l+m}{1} files changed, \PYG{l+m}{79} insertions\PYG{o}{(}+\PYG{o}{)}, \PYG{l+m}{61} deletions\PYG{o}{(}\PYGZhy{}\PYG{o}{)} Successfully rebased and updated refs/heads/my\PYGZhy{}feature\PYGZhy{}branch. \end{sphinxVerbatim} and the history looks now like this: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] 0f22701 Fix a few bugs + disable 721fc64 ENH: Sophisticated feature 6ad92e5 * masked is now an instance of a new object, MaskedConstant \end{sphinxVerbatim} If it went wrong, recovery is again possible as explained {\hyperref[\detokenize{devel/gitwash/development_workflow:recovering-from-mess-up}]{\sphinxcrossref{\DUrole{std,std-ref}{above}}}}. \subsection{Maintainer workflow} \label{\detokenize{devel/gitwash/maintainer_workflow:maintainer-workflow}}\label{\detokenize{devel/gitwash/maintainer_workflow:id1}}\label{\detokenize{devel/gitwash/maintainer_workflow::doc}} This page is for maintainers — those of us who merge our own or other peoples’ changes into the upstream repository. Being as how you’re a maintainer, you are completely on top of the basic stuff in {\hyperref[\detokenize{devel/gitwash/development_workflow:development-workflow}]{\sphinxcrossref{\DUrole{std,std-ref}{Development workflow}}}}. The instructions in {\hyperref[\detokenize{devel/gitwash/set_up_fork:linking-to-upstream}]{\sphinxcrossref{\DUrole{std,std-ref}{Linking your repository to the upstream repo}}}} add a remote that has read-only access to the upstream repo. Being a maintainer, you’ve got read-write access. It’s good to have your upstream remote have a scary name, to remind you that it’s a read-write remote: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git remote add upstream\PYGZhy{}rw git@github.com:matplotlib/matplotlib.git git fetch upstream\PYGZhy{}rw \end{sphinxVerbatim} \subsubsection{Integrating changes} \label{\detokenize{devel/gitwash/maintainer_workflow:integrating-changes}} Let’s say you have some changes that need to go into trunk (\sphinxcode{\sphinxupquote{upstream-rw/master}}). The changes are in some branch that you are currently on. For example, you are looking at someone’s changes like this: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git remote add someone git://github.com/someone/matplotlib.git git fetch someone git branch cool\PYGZhy{}feature \PYGZhy{}\PYGZhy{}track someone/cool\PYGZhy{}feature git checkout cool\PYGZhy{}feature \end{sphinxVerbatim} So now you are on the branch with the changes to be incorporated upstream. The rest of this section assumes you are on this branch. \paragraph{A few commits} \label{\detokenize{devel/gitwash/maintainer_workflow:a-few-commits}} If there are only a few commits, consider rebasing to upstream: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} Fetch upstream changes} git fetch upstream\PYGZhy{}rw \PYG{c+c1}{\PYGZsh{} rebase} git rebase upstream\PYGZhy{}rw/master \end{sphinxVerbatim} Remember that, if you do a rebase, and push that, you’ll have to close any github pull requests manually, because github will not be able to detect the changes have already been merged. \paragraph{A long series of commits} \label{\detokenize{devel/gitwash/maintainer_workflow:a-long-series-of-commits}} If there are a longer series of related commits, consider a merge instead: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git fetch upstream\PYGZhy{}rw git merge \PYGZhy{}\PYGZhy{}no\PYGZhy{}ff upstream\PYGZhy{}rw/master \end{sphinxVerbatim} The merge will be detected by github, and should close any related pull requests automatically. Note the \sphinxcode{\sphinxupquote{-{-}no-ff}} above. This forces git to make a merge commit, rather than doing a fast-forward, so that these set of commits branch off trunk then rejoin the main history with a merge, rather than appearing to have been made directly on top of trunk. \paragraph{Check the history} \label{\detokenize{devel/gitwash/maintainer_workflow:check-the-history}} Now, in either case, you should check that the history is sensible and you have the right commits: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git log \PYGZhy{}\PYGZhy{}oneline \PYGZhy{}\PYGZhy{}graph git log \PYGZhy{}p upstream\PYGZhy{}rw/master.. \end{sphinxVerbatim} The first line above just shows the history in a compact way, with a text representation of the history graph. The second line shows the log of commits excluding those that can be reached from trunk (\sphinxcode{\sphinxupquote{upstream-rw/master}}), and including those that can be reached from current HEAD (implied with the \sphinxcode{\sphinxupquote{..}} at the end). So, it shows the commits unique to this branch compared to trunk. The \sphinxcode{\sphinxupquote{-p}} option shows the diff for these commits in patch form. \paragraph{Push to trunk} \label{\detokenize{devel/gitwash/maintainer_workflow:push-to-trunk}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git push upstream\PYGZhy{}rw my\PYGZhy{}new\PYGZhy{}feature:master \end{sphinxVerbatim} This pushes the \sphinxcode{\sphinxupquote{my-new-feature}} branch in this repository to the \sphinxcode{\sphinxupquote{master}} branch in the \sphinxcode{\sphinxupquote{upstream-rw}} repository. \section{git resources} \label{\detokenize{devel/gitwash/git_resources:git-resources}}\label{\detokenize{devel/gitwash/git_resources:id1}}\label{\detokenize{devel/gitwash/git_resources::doc}} \subsection{Tutorials and summaries} \label{\detokenize{devel/gitwash/git_resources:tutorials-and-summaries}}\begin{itemize} \item {} \sphinxhref{https://help.github.com}{github help} has an excellent series of how-to guides. \item {} The \sphinxhref{https://git-scm.com/book/en/v2}{pro git book} is a good in-depth book on git. \item {} A \sphinxhref{https://help.github.com/git-cheat-sheets/}{git cheat sheet} is a page giving summaries of common commands. \item {} The \sphinxhref{https://schacon.github.io/git/user-manual.html}{git user manual} \item {} The \sphinxhref{https://schacon.github.io/git/gittutorial.html}{git tutorial} \item {} The \sphinxhref{https://git-scm.com/book/en/v2}{git community book} \item {} \sphinxhref{http://gitready.com/}{git ready} — a nice series of tutorials \item {} \sphinxhref{http://www-cs-students.stanford.edu/~blynn/gitmagic/index.html}{git magic} — extended introduction with intermediate detail \item {} The \sphinxhref{http://tom.preston-werner.com/2009/05/19/the-git-parable.html}{git parable} is an easy read explaining the concepts behind git. \item {} \sphinxhref{https://matthew-brett.github.io/pydagogue/foundation.html}{git foundation} expands on the \sphinxhref{http://tom.preston-werner.com/2009/05/19/the-git-parable.html}{git parable}. \item {} Fernando Perez’ git page — \sphinxhref{http://www.fperez.org/py4science/git.html}{Fernando’s git page} — many links and tips \item {} A good but technical page on \sphinxhref{https://www.sbf5.com/~cduan/technical/git/}{git concepts} \item {} \sphinxhref{https://git-scm.com/course/svn.html}{git svn crash course}: git for those of us used to \sphinxhref{http://subversion.tigris.org/}{subversion} \end{itemize} \subsection{Advanced git workflow} \label{\detokenize{devel/gitwash/git_resources:advanced-git-workflow}} There are many ways of working with git; here are some posts on the rules of thumb that other projects have come up with: \begin{itemize} \item {} Linus Torvalds on \sphinxhref{https://web.archive.org/web/20090224195437/http://kerneltrap.org/Linux/Git\_Management}{git management} \item {} Linus Torvalds on \sphinxhref{https://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg39091.html}{linux git workflow} . Summary; use the git tools to make the history of your edits as clean as possible; merge from upstream edits as little as possible in branches where you are doing active development. \end{itemize} \subsection{Manual pages online} \label{\detokenize{devel/gitwash/git_resources:manual-pages-online}} You can get these on your own machine with (e.g) \sphinxcode{\sphinxupquote{git help push}} or (same thing) \sphinxcode{\sphinxupquote{git push -{-}help}}, but, for convenience, here are the online manual pages for some common commands: \begin{itemize} \item {} \sphinxhref{https://schacon.github.io/git/git-add.html}{git add} \item {} \sphinxhref{https://schacon.github.io/git/git-branch.html}{git branch} \item {} \sphinxhref{https://schacon.github.io/git/git-checkout.html}{git checkout} \item {} \sphinxhref{https://schacon.github.io/git/git-clone.html}{git clone} \item {} \sphinxhref{https://schacon.github.io/git/git-commit.html}{git commit} \item {} \sphinxhref{https://schacon.github.io/git/git-config.html}{git config} \item {} \sphinxhref{https://schacon.github.io/git/git-diff.html}{git diff} \item {} \sphinxhref{https://schacon.github.io/git/git-log.html}{git log} \item {} \sphinxhref{https://schacon.github.io/git/git-pull.html}{git pull} \item {} \sphinxhref{https://schacon.github.io/git/git-push.html}{git push} \item {} \sphinxhref{https://schacon.github.io/git/git-remote.html}{git remote} \item {} \sphinxhref{https://schacon.github.io/git/git-status.html}{git status} \end{itemize} \section{Two and three dots in difference specs} \label{\detokenize{devel/gitwash/dot2_dot3:two-and-three-dots-in-difference-specs}}\label{\detokenize{devel/gitwash/dot2_dot3:dot2-dot3}}\label{\detokenize{devel/gitwash/dot2_dot3::doc}} Thanks to Yarik Halchenko for this explanation. Imagine a series of commits A, B, C, D… Imagine that there are two branches, \sphinxstyleemphasis{topic} and \sphinxstyleemphasis{master}. You branched \sphinxstyleemphasis{topic} off \sphinxstyleemphasis{master} when \sphinxstyleemphasis{master} was at commit ‘E’. The graph of the commits looks like this: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{A}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{B}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{C} \PYG{n}{topic} \PYG{o}{/} \PYG{n}{D}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{E}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{F}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{G} \PYG{n}{master} \end{sphinxVerbatim} Then: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{git} \PYG{n}{diff} \PYG{n}{master}\PYG{o}{.}\PYG{o}{.}\PYG{n}{topic} \end{sphinxVerbatim} will output the difference from G to C (i.e. with effects of F and G), while: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{git} \PYG{n}{diff} \PYG{n}{master}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{n}{topic} \end{sphinxVerbatim} would output just differences in the topic branch (i.e. only A, B, and C). \chapter{Reviewers guideline} \label{\detokenize{devel/coding_guide:reviewers-guideline}}\label{\detokenize{devel/coding_guide:reviewers-guide}}\label{\detokenize{devel/coding_guide::doc}} \section{Pull request checklist} \label{\detokenize{devel/coding_guide:pull-request-checklist}}\label{\detokenize{devel/coding_guide:id1}} \subsection{Branch selection} \label{\detokenize{devel/coding_guide:branch-selection}} In general target the master branch for all new features and bug-fixes. PRs may target maintenance or doc branches on a case-by-case basis. \subsection{Documentation} \label{\detokenize{devel/coding_guide:documentation}}\begin{itemize} \item {} Every new feature should be documented. If it’s a new module, don’t forget to add a new rst file to the API docs. \item {} Each high-level plotting function should have a small example in the \sphinxcode{\sphinxupquote{Example}} section of the docstring. This should be as simple as possible to demonstrate the method. More complex examples should go in the \sphinxcode{\sphinxupquote{examples}} section of the documentation. \item {} Build the docs and make sure all formatting warnings are addressed. \item {} See {\hyperref[\detokenize{devel/documenting_mpl:documenting-matplotlib}]{\sphinxcrossref{\DUrole{std,std-ref}{Writing documentation}}}} for our documentation style guide. \item {} If your change is a major new feature, add an entry to \sphinxcode{\sphinxupquote{doc/users/whats\_new.rst}}. \item {} If you change the API in a backward-incompatible way, please document it in \sphinxcode{\sphinxupquote{doc/api/api\_changes.rst}}. \end{itemize} \section{PR Review guidelines} \label{\detokenize{devel/coding_guide:pr-review-guidelines}}\begin{itemize} \item {} If you have commit rights, then you are trusted to use them. Please help review and merge PRs! \item {} For code changes (anything in \sphinxcode{\sphinxupquote{src}} or \sphinxcode{\sphinxupquote{lib}}) two developers (those with commit rights) should review all pull requests. If you are the first to review a PR and approve of the changes use the github \sphinxhref{https://help.github.com/articles/reviewing-changes-in-pull-requests/}{‘approve review’} tool to mark it as such. If you are a subsequent reviewer and you approve, either merge (and backport if needed) or select \sphinxcode{\sphinxupquote{'approve review'}}. Ensure that all API changes are documented in \sphinxcode{\sphinxupquote{doc/api/api\_changes}} and significant new features have and entry in \sphinxcode{\sphinxupquote{doc/user/whats\_new}}. \item {} Documentation and examples may be merged by the first reviewer. Use the threshold “is this better than it was?” as the review criteria. \item {} Make sure the Travis, Appvyor, and codecov tests are passing before merging. \begin{itemize} \item {} Whenever a pull request is created or updated, Travis and Appveyor automatically runs the test suite on all versions of Python supported by Matplotlib. The \sphinxcode{\sphinxupquote{tox}} support in Matplotlib may be useful for testing locally. \end{itemize} \item {} Do not self merge, except for ‘small’ patches to un-break the CI. \item {} Squashing is case-by-case. The balance is between burden on the contributor, keeping a relatively clean history, and keeping a history usable for bisecting. The only time we are really strict about it is to eliminate binary files (ex multiple test image re-generations) and to remove upstream merges. \item {} Be patient with contributors. \item {} Do not let perfect be the enemy of the good, particularly for documentation or example PRs. If you find yourself making many small suggestions, either open a PR against the original branch or merge the PR and then open a new PR against upstream. \end{itemize} \section{Branches and Backports} \label{\detokenize{devel/coding_guide:branches-and-backports}} The current active branches are \begin{description} \item[{\sphinxstyleemphasis{master}}] \leavevmode This will be Matplotlib 3.0. Supports Python 3.5+. \item[{\sphinxstyleemphasis{v2.2.x}}] \leavevmode Maintenance branch for Matplotlib 2.2 LTS. Supports Python 2.7, 3.4+ \item[{\sphinxstyleemphasis{v2.2.N-doc}}] \leavevmode Documentation for the current release. On a patch release, this will be replaced by a properly named branch for the new release. \end{description} We always will backport to 2.2.x \begin{itemize} \item {} critical bug fixes (segfault, failure to import, things that the user can not work around) \item {} fixes for regressions against 2.0 or 2.1 \end{itemize} Everything else (regressions against 1.x versions, bugs/api inconsistencies the user can work around in their code) are on a case-by-case basis, should be low-risk, and need someone to advocate for and shepherd through the backport. The only changes to be backported to 2.2.N-doc are changes to \sphinxcode{\sphinxupquote{doc}}, \sphinxcode{\sphinxupquote{examples}}, or \sphinxcode{\sphinxupquote{tutorials}}. Any changes to \sphinxcode{\sphinxupquote{lib}} or \sphinxcode{\sphinxupquote{src}} should not be backported to this branch. \subsection{Automated backports} \label{\detokenize{devel/coding_guide:automated-backports}} We use meeseeksdev bot to automatically backport merges to the correct maintenance branch base on the milestone. To work properly the milestone must be set before merging. If you have commit rights, the bot can also be manually triggered after a merge by leaving a message \sphinxcode{\sphinxupquote{@meeseeksdev backport to BRANCH}} on the PR. If there are conflicts meeseekdevs will inform you that the backport needs to be done manually. The target branch is configured by putting \sphinxcode{\sphinxupquote{on-merge: backport to TARGETBRANCH}} in the milestone description on it’s own line. If the bot is not working as expected, please report issues to \sphinxhref{https://github.com/MeeseeksBox/MeeseeksDev}{Meeseeksdev}. \subsection{Manual backports} \label{\detokenize{devel/coding_guide:manual-backports}} When doing backports please copy the form used by meeseekdev, \sphinxcode{\sphinxupquote{Backport PR \#XXXX: TITLE OF PR}}. If you need to manually resolve conflicts make note of them and how you resolved them in the commit message. We do a backport from master to v2.2.x assuming: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{matplotlib}} is a read-only remote branch of the matplotlib/matplotlib repo \end{itemize} The \sphinxcode{\sphinxupquote{TARGET\_SHA}} is the hash of the merge commit you would like to backport. This can be read off of the github PR page (in the UI with the merge notification) or through the git CLI tools. Assuming that you already have a local branch \sphinxcode{\sphinxupquote{v2.2.x}} (if not, then \sphinxcode{\sphinxupquote{git checkout -b v2.2.x}}), and that your remote pointing to \sphinxcode{\sphinxupquote{https://github.com/matplotlib/matplotlib}} is called \sphinxcode{\sphinxupquote{upstream}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{git} \PYG{n}{fetch} \PYG{n}{upstream} \PYG{n}{git} \PYG{n}{checkout} \PYG{n}{v2}\PYG{o}{.}\PYG{l+m+mf}{2.}\PYG{n}{x} \PYG{c+c1}{\PYGZsh{} or include \PYGZhy{}b if you don\PYGZsq{}t already have this.} \PYG{n}{git} \PYG{n}{reset} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{hard} \PYG{n}{upstream}\PYG{o}{/}\PYG{n}{v2}\PYG{o}{.}\PYG{l+m+mf}{2.}\PYG{n}{x} \PYG{n}{git} \PYG{n}{cherry}\PYG{o}{\PYGZhy{}}\PYG{n}{pick} \PYG{o}{\PYGZhy{}}\PYG{n}{m} \PYG{l+m+mi}{1} \PYG{n}{TARGET\PYGZus{}SHA} \PYG{c+c1}{\PYGZsh{} resolve conflicts and commit if required} \end{sphinxVerbatim} Files with conflicts can be listed by \sphinxcode{\sphinxupquote{git status}}, and will have to be fixed by hand (search on \sphinxcode{\sphinxupquote{\textgreater{}\textgreater{}\textgreater{}\textgreater{}\textgreater{}}}). Once the conflict is resolved, you will have to re-add the file(s) to the branch and then continue the cherry pick: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{git} \PYG{n}{add} \PYG{n}{lib}\PYG{o}{/}\PYG{n}{matplotlib}\PYG{o}{/}\PYG{n}{conflicted\PYGZus{}file}\PYG{o}{.}\PYG{n}{py} \PYG{n}{git} \PYG{n}{add} \PYG{n}{lib}\PYG{o}{/}\PYG{n}{matplotlib}\PYG{o}{/}\PYG{n}{conflicted\PYGZus{}file2}\PYG{o}{.}\PYG{n}{py} \PYG{n}{git} \PYG{n}{cherry}\PYG{o}{\PYGZhy{}}\PYG{n}{pick} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{k}{continue} \end{sphinxVerbatim} Use your discretion to push directly to upstream or to open a PR; be sure to push or PR against the \sphinxcode{\sphinxupquote{v2.2.x}} upstream branch, not \sphinxcode{\sphinxupquote{master}}! \chapter{Release Guide} \label{\detokenize{devel/release_guide:release-guide}}\label{\detokenize{devel/release_guide:id1}}\label{\detokenize{devel/release_guide::doc}} A guide for developers who are doing a matplotlib release. \section{All Releases} \label{\detokenize{devel/release_guide:all-releases}} \subsection{Testing} \label{\detokenize{devel/release_guide:testing}}\label{\detokenize{devel/release_guide:release-testing}} We use \sphinxhref{https://travis-ci.org/matplotlib/matplotlib}{travis-ci} for continuous integration. When preparing for a release, the final tagged commit should be tested locally before it is uploaded: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] python tests.py \PYGZhy{}\PYGZhy{}processes\PYG{o}{=}\PYG{l+m}{8} \PYGZhy{}\PYGZhy{}process\PYGZhy{}timeout\PYG{o}{=}\PYG{l+m}{300} \end{sphinxVerbatim} In addition the following two tests should be run and manually inspected: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] python unit/memleak\PYGZus{}hawaii3.py \PYG{n+nb}{pushd} examples/tests/ python backend\PYGZus{}driver.py \PYG{n+nb}{popd} \end{sphinxVerbatim} \subsection{GitHub Stats} \label{\detokenize{devel/release_guide:github-stats}}\label{\detokenize{devel/release_guide:release-ghstats}} We automatically extract GitHub issue, PRs, and authors from GitHub via the API: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] python tools/github\PYGZus{}stats.py \PYGZhy{}\PYGZhy{}since\PYGZhy{}tag \PYG{n+nv}{\PYGZdl{}TAG} \PYGZhy{}\PYGZhy{}project \PYG{l+s+s1}{\PYGZsq{}matplotlib/matplotlib\PYGZsq{}} \PYGZhy{}\PYGZhy{}links \PYGZgt{} doc/users/github\PYGZus{}stats.rst \end{sphinxVerbatim} Review and commit changes. Some issue/PR titles may not be valid rst (the most common issue is \sphinxcode{\sphinxupquote{*}} which is interpreted as unclosed markup). \subsection{Check Docs} \label{\detokenize{devel/release_guide:check-docs}}\label{\detokenize{devel/release_guide:release-chkdocs}} Before tagging, update the what’s new listing in \sphinxcode{\sphinxupquote{doc/users/whats\_new.rst}} by merging all files in \sphinxcode{\sphinxupquote{doc/users/next\_whats\_new/}} coherently. Also, temporarily comment out the include and toctree glob; re-instate these after a release. Finally, make sure that the docs build cleanly \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] make \PYGZhy{}Cdoc \PYG{n+nv}{O}\PYG{o}{=}\PYGZhy{}n\PYG{k}{\PYGZdl{}(}nproc\PYG{k}{)} html latexpdf \end{sphinxVerbatim} After the docs are built, check that all of the links, internal and external, are still valid. We use \sphinxcode{\sphinxupquote{linkchecker}} for this, which has not been ported to python3 yet. You will need to create a python2 environment with \sphinxcode{\sphinxupquote{requests==2.9.0}} and linkchecker \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] conda create \PYGZhy{}p /tmp/lnkchk \PYG{n+nv}{python}\PYG{o}{=}\PYG{l+m}{2} \PYG{n+nv}{requests}\PYG{o}{=}\PYG{o}{=}\PYG{l+m}{2}.9.0 \PYG{n+nb}{source} activate /tmp/lnkchk pip install linkchecker \PYG{n+nb}{pushd} doc/build/html linkchecker index.html \PYGZhy{}\PYGZhy{}check\PYGZhy{}extern \end{sphinxVerbatim} Address any issues which may arise. The internal links are checked on travis, this should only flag failed external links. \subsection{Create release commit and tag} \label{\detokenize{devel/release_guide:create-release-commit-and-tag}}\label{\detokenize{devel/release_guide:release-tag}} To create the tag, first create an empty commit with a very terse set of the release notes in the commit message \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git commit \PYGZhy{}\PYGZhy{}allow\PYGZhy{}empty \end{sphinxVerbatim} and then create a signed, annotated tag with the same text in the body message \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git tag \PYGZhy{}a \PYGZhy{}s v2.0.0 \end{sphinxVerbatim} which will prompt you for your gpg key password and an annotation. For pre releases it is important to follow \index{Python Enhancement Proposals!PEP 440}\sphinxhref{https://www.python.org/dev/peps/pep-0440}{\sphinxstylestrong{PEP 440}} so that the build artifacts will sort correctly in pypi. Finally, push the tag to GitHub \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git push \PYGZhy{}t DANGER v2.0.0 \end{sphinxVerbatim} Congratulations, the scariest part is done! To prevent issues with any down-stream builders which download the tarball from GitHub it is important to move all branches away from the commit with the tag % \begin{footnote}[1]\sphinxAtStartFootnote The tarball that is provided by GitHub is produced using \sphinxhref{https://git-scm.com/docs/git-archive}{git archive}. We use \sphinxhref{https://github.com/warner/python-versioneer}{versioneer} which uses a format string in \sphinxcode{\sphinxupquote{lib/matplotlib/\_version.py}} to have \sphinxcode{\sphinxupquote{git}} insert a list of references to exported commit (see \sphinxcode{\sphinxupquote{.gitattributes}} for the configuration). This string is then used by \sphinxcode{\sphinxupquote{versioneer}} to produce the correct version, based on the git tag, when users install from the tarball. However, if there is a branch pointed at the tagged commit, then the branch name will also be included in the tarball. When the branch eventually moves, anyone how checked the hash of the tarball before the branch moved will have an incorrect hash. To generate the file that GitHub does use \sphinxSetupCodeBlockInFootnote \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git archive v2.0.0 \PYGZhy{}o matplotlib\PYGZhy{}2.0.0.tar.gz \PYGZhy{}\PYGZhy{}prefix\PYG{o}{=}matplotlib\PYGZhy{}2.0.0/ \end{sphinxVerbatim} % \end{footnote}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git commit \PYGZhy{}\PYGZhy{}allow\PYGZhy{}empty git push DANGER master \end{sphinxVerbatim} If this is a final release, also create a ‘doc’ branch (this is not done for pre-releases): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git branch v2.0.0\PYGZhy{}doc git push DANGER v2.0.0\PYGZhy{}doc \end{sphinxVerbatim} and if this is a major or minor release, also create a bug-fix branch (a micro release will be cut off of this branch): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git branch v2.0.x git push DANGER v2.0.x \end{sphinxVerbatim} \subsection{Release Management / DOI} \label{\detokenize{devel/release_guide:release-management-doi}}\label{\detokenize{devel/release_guide:release-doi}} Via the GitHub UI (chase down link), turn the newly pushed tag into a release. If this is a pre-release remember to mark it as such. For final releases also get a DOI from \sphinxhref{https://zenodo.org/}{zenodo} and edit \sphinxcode{\sphinxupquote{doc/\_templates/citing.html}} with DOI link and commit to the VER-doc branch and push to GitHub \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git checkout v2.0.0\PYGZhy{}doc emacs doc/\PYGZus{}templates/citing.html git push DANGER v2.0.0\PYGZhy{}doc:v2.0.0\PYGZhy{}doc \end{sphinxVerbatim} \subsection{Building binaries} \label{\detokenize{devel/release_guide:building-binaries}}\label{\detokenize{devel/release_guide:release-bld-bin}} We distribute mac, windows, and many linux wheels as well as a source tarball via pypi. Before uploading anything, contact the various builders. Mac and manylinux wheels are built on travis . You need to edit the \sphinxcode{\sphinxupquote{.travis.yml}} file and push to master of \sphinxhref{https://github.com/MacPython/matplotlib-wheels}{the build project}. Update the \sphinxcode{\sphinxupquote{master}} branch (for pre-releases the \sphinxcode{\sphinxupquote{devel}} branch) of the \sphinxhref{https://github.com/conda-forge/matplotlib-feedstock}{conda-forge feedstock} via pull request. If this is a final release the following downstream packagers should be contacted: \begin{itemize} \item {} Debian \item {} Fedora \item {} Arch \item {} Gentoo \item {} Macports \item {} Homebrew \item {} Christoph Gohlke \item {} Continuum \item {} Enthought \end{itemize} This can be done ahead of collecting all of the binaries and uploading to pypi. \subsection{make distribution and upload to pypi / SF} \label{\detokenize{devel/release_guide:make-distribution-and-upload-to-pypi-sf}}\label{\detokenize{devel/release_guide:release-upload-bin}} Once you have collected all of the wheels, generate the tarball \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git checkout v2.0.0 git clean \PYGZhy{}xfd python setup.py sdist \end{sphinxVerbatim} and copy all of the wheels into \sphinxcode{\sphinxupquote{dist}} directory. You should use \sphinxcode{\sphinxupquote{twine}} to upload all of the files to pypi \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] twine upload \PYGZhy{}s dist/matplotlib*tar.gz twine upload dist/*whl \end{sphinxVerbatim} Congratulations, you have now done the second scariest part! Additionally, for a final release, upload all of the files to sourceforge. \subsection{Build and Deploy Documentation} \label{\detokenize{devel/release_guide:build-and-deploy-documentation}}\label{\detokenize{devel/release_guide:release-docs}} To build the documentation you must have the tagged version installed, but build the docs from the \sphinxcode{\sphinxupquote{ver-doc}} branch. An easy way to arrange this is: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] pip install matplotlib pip install \PYGZhy{}r doc\PYGZhy{}requirements.txt git checkout v2.0.0\PYGZhy{}doc git clean \PYGZhy{}xfd \PYG{n+nb}{cd} doc make \PYG{n+nv}{O}\PYG{o}{=}\PYGZhy{}n\PYG{k}{\PYGZdl{}(}nproc\PYG{k}{)} html latexpdf \end{sphinxVerbatim} which will build both the html and pdf version of the documentation. The built documentation exists in the \sphinxhref{https://github.com/matplotlib/matplotlib.github.com/}{matplotlib.github.com} repository. Pushing changes to master automatically updates the website. The documentation is organized by version. At the root of the tree is always the documentation for the latest stable release. Under that, there are directories containing the documentation for older versions. The documentation for current master are built on travis and push to the \sphinxhref{https://github.com/matplotlib/devdocs/}{devdocs} repository. These are available at \sphinxhref{http://matplotlib.org/devdocs}{matplotlib.org/devdocs}. Assuming you have this repository checked out in the same directory as matplotlib \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n+nb}{cd} ../matplotlib.github.com mkdir \PYG{l+m}{2}.0.0 rsync \PYGZhy{}a ../matplotlib/doc/build/html/* \PYG{l+m}{2}.0.0 cp ../matplotlib/doc/build/latex/Matplotlib.pdf \PYG{l+m}{2}.0.0 \end{sphinxVerbatim} which will copy the built docs over. If this is a final release, also replace the top-level docs \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] rsync \PYGZhy{}a \PYG{l+m}{2}.0.0/* ./ \end{sphinxVerbatim} You will need to manually edit \sphinxcode{\sphinxupquote{versions.html}} to show the last 3 tagged versions. Now commit and push everything to GitHub \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] git add * git commit \PYGZhy{}a \PYGZhy{}m \PYG{l+s+s1}{\PYGZsq{}Updating docs for v2.0.0\PYGZsq{}} git push DANGER master \end{sphinxVerbatim} Congratulations you have now done the third scariest part! It typically takes about 5-10 minutes for GitHub to process the push and update the live web page (remember to clear your browser cache). \subsection{Announcing} \label{\detokenize{devel/release_guide:announcing}} The final step is to announce the release to the world. A short version of the release notes along with acknowledgments should be sent to \begin{itemize} \item {} \sphinxhref{mailto:matplotlib-user@python.org}{matplotlib-user@python.org} \item {} \sphinxhref{mailto:matplotlib-devel@python.org}{matplotlib-devel@python.org} \item {} \sphinxhref{mailto:matplotlib-announce@python.org}{matplotlib-announce@python.org} \end{itemize} For final releases announcements should also be sent to the numpy/scipy/jupyter mailing lists and python-announce. In addition, announcements should be made on social networks (twitter, g+, FB). For major release, \sphinxhref{http://www.numfocus.org/}{NumFOCUS} should be contacted for inclusion in their newsletter and maybe to have something posted on their blog. \chapter{Minimum Version of Dependencies Policy} \label{\detokenize{devel/min_dep_policy:minimum-version-of-dependencies-policy}}\label{\detokenize{devel/min_dep_policy:min-deps-policy}}\label{\detokenize{devel/min_dep_policy::doc}} \section{Python and numpy} \label{\detokenize{devel/min_dep_policy:python-and-numpy}}\begin{itemize} \item {} support minor versions of \sphinxcode{\sphinxupquote{Python}} initially released in the previous 3 years \item {} support minor versions of \sphinxcode{\sphinxupquote{numpy}} initially released in the previous 3 years or oldest that supports the minimum python version (which ever is higher) \end{itemize} We will bump the minimum python and numpy versions as we can every minor and major release, but never on a patch release. \section{Python Dependencies} \label{\detokenize{devel/min_dep_policy:python-dependencies}} For python dependencies we should support at least \begin{description} \item[{with compiled extensions}] \leavevmode minor versions released in the last 3 years or the oldest that support our minimum python + numpy \item[{without complied extensions}] \leavevmode minor versions released in the last 2 years or the oldest that supports our minimum python. \end{description} We will only bump these dependencies as we need new features or the old versions no longer support our minimum numpy or python. \section{System and C-dependencies} \label{\detokenize{devel/min_dep_policy:system-and-c-dependencies}} For system or c-dependencies (libpng, freetype, GUI frameworks, latex, gs, ffmpeg) support as old as practical. These can be difficult to install for end-users and we want to be usable on as many systems as possible. We will bump these on a case-by-case basis. \chapter{Matplotlib Enhancement Proposals} \label{\detokenize{devel/MEP/index:matplotlib-enhancement-proposals}}\label{\detokenize{devel/MEP/index::doc}} Matplotlib Enhancement Proposals (MEP), inspired by cpython’s \sphinxhref{https://www.python.org/dev/peps/}{PEP’s} but less formal, are design documents for large or controversial changes to Matplotilb. These documents should provide a discussion of both why and how the changes should be made. To create a new MEP open a pull request (PR) adding a file based on {\hyperref[\detokenize{devel/MEP/template:mep-template}]{\sphinxcrossref{\DUrole{std,std-ref}{the template}}}} to this the MEP directory. For the initial PR only a rough description is required and it should be merged quickly. Further detailed discussion can happen in follow on PRs. \section{MEP Template} \label{\detokenize{devel/MEP/template:mep-template}}\label{\detokenize{devel/MEP/template:id1}}\label{\detokenize{devel/MEP/template::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/template:id2}}{\hyperref[\detokenize{devel/MEP/template:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/template:id3}}{\hyperref[\detokenize{devel/MEP/template:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/template:id4}}{\hyperref[\detokenize{devel/MEP/template:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/template:id5}}{\hyperref[\detokenize{devel/MEP/template:detailed-description}]{\sphinxcrossref{Detailed description}}} \item {} \phantomsection\label{\detokenize{devel/MEP/template:id6}}{\hyperref[\detokenize{devel/MEP/template:implementation}]{\sphinxcrossref{Implementation}}} \item {} \phantomsection\label{\detokenize{devel/MEP/template:id7}}{\hyperref[\detokenize{devel/MEP/template:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \item {} \phantomsection\label{\detokenize{devel/MEP/template:id8}}{\hyperref[\detokenize{devel/MEP/template:alternatives}]{\sphinxcrossref{Alternatives}}} \end{itemize} \end{sphinxShadowBox} This MEP template is a guideline of the sections that a MEP should contain. Extra sections may be added if appropriate, and unnecessary sections may be noted as such. \subsection{Status} \label{\detokenize{devel/MEP/template:status}} MEPs go through a number of phases in their lifetime: \begin{itemize} \item {} \sphinxstylestrong{Discussion}: The MEP is being actively discussed on the mailing list and it is being improved by its author. The mailing list discussion of the MEP should include the MEP number (MEPxxx) in the subject line so they can be easily related to the MEP. \item {} \sphinxstylestrong{Progress}: Consensus was reached and implementation work has begun. \item {} \sphinxstylestrong{Completed}: The implementation has been merged into master. \item {} \sphinxstylestrong{Superseded}: This MEP has been abandoned in favor of another approach. \item {} \sphinxstylestrong{Rejected}: There are currently no plans to implement the proposal. \end{itemize} \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/template:branches-and-pull-requests}} All development branches containing work on this MEP should be linked to from here. All pull requests submitted relating to this MEP should be linked to from here. (A MEP does not need to be implemented in a single pull request if it makes sense to implement it in discrete phases). \subsection{Abstract} \label{\detokenize{devel/MEP/template:abstract}} The abstract should be a short description of what the MEP will achieve. \subsection{Detailed description} \label{\detokenize{devel/MEP/template:detailed-description}} This section describes the need for the MEP. It should describe the existing problem that it is trying to solve and why this MEP makes the situation better. It should include examples of how the new functionality would be used and perhaps some use cases. \subsection{Implementation} \label{\detokenize{devel/MEP/template:implementation}} This section lists the major steps required to implement the MEP. Where possible, it should be noted where one step is dependent on another, and which steps may be optionally omitted. Where it makes sense, each step should include a link related pull requests as the implementation progresses. \subsection{Backward compatibility} \label{\detokenize{devel/MEP/template:backward-compatibility}} This section describes the ways in which the MEP breaks backward incompatibility. \subsection{Alternatives} \label{\detokenize{devel/MEP/template:alternatives}} If there were any alternative solutions to solving the same problem, they should be discussed here, along with a justification for the chosen approach. \section{MEP8: PEP8} \label{\detokenize{devel/MEP/MEP08:mep8-pep8}}\label{\detokenize{devel/MEP/MEP08::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP08:id1}}{\hyperref[\detokenize{devel/MEP/MEP08:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP08:id2}}{\hyperref[\detokenize{devel/MEP/MEP08:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP08:id3}}{\hyperref[\detokenize{devel/MEP/MEP08:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP08:id4}}{\hyperref[\detokenize{devel/MEP/MEP08:detailed-description}]{\sphinxcrossref{Detailed description}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP08:id5}}{\hyperref[\detokenize{devel/MEP/MEP08:implementation}]{\sphinxcrossref{Implementation}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP08:id6}}{\hyperref[\detokenize{devel/MEP/MEP08:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP08:id7}}{\hyperref[\detokenize{devel/MEP/MEP08:alternatives}]{\sphinxcrossref{Alternatives}}} \end{itemize} \end{sphinxShadowBox} \subsection{Status} \label{\detokenize{devel/MEP/MEP08:status}} \sphinxstylestrong{Completed} We are currently enforcing a sub-set of pep8 on new code contributions. \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP08:branches-and-pull-requests}} None so far. \subsection{Abstract} \label{\detokenize{devel/MEP/MEP08:abstract}} The matplotlib codebase predates PEP8, and therefore is less than consistent style-wise in some areas. Bringing the codebase into compliance with PEP8 would go a long way to improving its legibility. \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP08:detailed-description}} Some files use four space indentation, some use three. Some use different levels in the same file. For the most part, class/function/variable naming follows PEP8, but it wouldn’t hurt to fix where necessary. \subsection{Implementation} \label{\detokenize{devel/MEP/MEP08:implementation}} The implementation should be fairly mechanical: running the pep8 tool over the code and fixing where appropriate. This should be merged in after the 2.0 release, since the changes will likely make merging any pending pull requests more difficult. Additionally, and optionally, PEP8 compliance could be tracked by an automated build system. \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP08:backward-compatibility}} Public names of classes and functions that require change (there shouldn’t be many of these) should first be deprecated and then removed in the next release cycle. \subsection{Alternatives} \label{\detokenize{devel/MEP/MEP08:alternatives}} PEP8 is a popular standard for Python code style, blessed by the Python core developers, making any alternatives less desirable. \section{MEP9: Global interaction manager} \label{\detokenize{devel/MEP/MEP09:mep9-global-interaction-manager}}\label{\detokenize{devel/MEP/MEP09::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP09:id1}}{\hyperref[\detokenize{devel/MEP/MEP09:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP09:id2}}{\hyperref[\detokenize{devel/MEP/MEP09:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP09:id3}}{\hyperref[\detokenize{devel/MEP/MEP09:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP09:id4}}{\hyperref[\detokenize{devel/MEP/MEP09:detailed-description}]{\sphinxcrossref{Detailed description}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP09:id5}}{\hyperref[\detokenize{devel/MEP/MEP09:implementation}]{\sphinxcrossref{Implementation}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP09:id6}}{\hyperref[\detokenize{devel/MEP/MEP09:current-summary-of-the-mixin}]{\sphinxcrossref{Current summary of the mixin}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP09:id7}}{\hyperref[\detokenize{devel/MEP/MEP09:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP09:id8}}{\hyperref[\detokenize{devel/MEP/MEP09:alternatives}]{\sphinxcrossref{Alternatives}}} \end{itemize} \end{sphinxShadowBox} Add a global manager for all user interactivity with artists; make any artist resizeable, moveable, highlightable, and selectable as desired by the user. \subsection{Status} \label{\detokenize{devel/MEP/MEP09:status}} \sphinxstylestrong{Discussion} \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP09:branches-and-pull-requests}} \sphinxurl{https://github.com/dhyams/matplotlib/tree/MEP9} \subsection{Abstract} \label{\detokenize{devel/MEP/MEP09:abstract}} The goal is to be able to interact with matplotlib artists in a very similar way as drawing programs do. When appropriate, the user should be able to move, resize, or select an artist that is already on the canvas. Of course, the script writer is ultimately in control of whether an artist is able to be interacted with, or whether it is static. This code to do this has already been privately implemented and tested, and would need to be migrated from its current “mixin” implementation, to a bona-fide part of matplotlib. The end result would be to have four new keywords available to matplotlib.artist.Artist: \_moveable\_, \_resizeable\_, \_selectable\_, and \_highlightable\_. Setting any one of these keywords to True would activate interactivity for that artist. In effect, this MEP is a logical extension of event handling in matplotlib; matplotlib already supports “low level” interactions like left mouse presses, a key press, or similar. The MEP extends the support to the logical level, where callbacks are performed on the artists when certain interactive gestures from the user are detected. \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP09:detailed-description}} This new functionality would be used to allow the end-user to better interact with the graph. Many times, a graph is almost what the user wants, but a small repositioning and/or resizing of components is necessary. Rather than force the user to go back to the script to trial-and-error the location, and simple drag and drop would be appropriate. Also, this would better support applications that use matplotlib; here, the end-user has no reasonable access or desire to edit the underlying source in order to fine-tune a plot. Here, if matplotlib offered the capability, one could move or resize artists on the canvas to suit their needs. Also, the user should be able to highlight (with a mouse over) an artist, and select it with a double-click, if the application supports that sort of thing. In this MEP, we also want to support the highlighting and selection natively; it is up to application to handle what happens when the artist is selected. A typical handling would be to display a dialog to edit the properties of the artist. In the future, as well (this is not part of this MEP), matplotlib could offer backend-specific property dialogs for each artist, which are raised on artist selection. This MEP would be a necessary stepping stone for that sort of capability. There are currently a few interactive capabilities in matplotlib (e.g. legend.draggable()), but they tend to be scattered and are not available for all artists. This MEP seeks to unify the interactive interface and make it work for all artists. The current MEP also includes grab handles for resizing artists, and appropriate boxes drawn when artists are moved or resized. \subsection{Implementation} \label{\detokenize{devel/MEP/MEP09:implementation}}\begin{itemize} \item {} Add appropriate methods to the “tree” of artists so that the interactivity manager has a consistent interface for the interactivity manager to deal with. The proposed methods to add to the artists, if they are to support interactivity, are: \begin{itemize} \item {} get\_pixel\_position\_ll(self): get the pixel position of the lower left corner of the artist’s bounding box \item {} get\_pixel\_size(self): get the size of the artist’s bounding box, in pixels \item {} set\_pixel\_position\_and\_size(self,x,y,dx,dy): set the new size of the artist, such that it fits within the specified bounding box. \end{itemize} \item {} add capability to the backends to 1) provide cursors, since these are needed for visual indication of moving/resizing, and 2) provide a function that gets the current mouse position \item {} Implement the manager. This has already been done privately (by dhyams) as a mixin, and has been tested quite a bit. The goal would be to move the functionality of the manager into the artists so that it is in matplotlib properly, and not as a “monkey patch” as I currently have it coded. \end{itemize} \subsection{Current summary of the mixin} \label{\detokenize{devel/MEP/MEP09:current-summary-of-the-mixin}} (Note that this mixin is for now just private code, but can be added to a branch obviously) InteractiveArtistMixin: Mixin class to make any generic object that is drawn on a matplotlib canvas moveable and possibly resizeable. The Powerpoint model is followed as closely as possible; not because I’m enamoured with Powerpoint, but because that’s what most people understand. An artist can also be selectable, which means that the artist will receive the on\_activated() callback when double clicked. Finally, an artist can be highlightable, which means that a highlight is drawn on the artist whenever the mouse passes over. Typically, highlightable artists will also be selectable, but that is left up to the user. So, basically there are four attributes that can be set by the user on a per-artist basis: \begin{itemize} \item {} highlightable \item {} selectable \item {} moveable \item {} resizeable \end{itemize} To be moveable (draggable) or resizeable, the object that is the target of the mixin must support the following protocols: \begin{itemize} \item {} get\_pixel\_position\_ll(self) \item {} get\_pixel\_size(self) \item {} set\_pixel\_position\_and\_size(self,x,y,sx,sy) \end{itemize} Note that nonresizeable objects are free to ignore the sx and sy parameters. To be highlightable, the object that is the target of the mixin must also support the following protocol: \begin{itemize} \item {} get\_highlight(self) \end{itemize} Which returns a list of artists that will be used to draw the highlight. If the object that is the target of the mixin is not an matplotlib artist, the following protocols must also be implemented. Doing so is usually fairly trivial, as there has to be an artist \sphinxstyleemphasis{somewhere} that is being drawn. Typically your object would just route these calls to that artist. \begin{itemize} \item {} get\_figure(self) \item {} get\_axes(self) \item {} contains(self,event) \item {} set\_animated(self,flag) \item {} draw(self,renderer) \item {} get\_visible(self) \end{itemize} The following notifications are called on the artist, and the artist can optionally implement these. \begin{itemize} \item {} on\_select\_begin(self) \item {} on\_select\_end(self) \item {} on\_drag\_begin(self) \item {} on\_drag\_end(self) \item {} on\_activated(self) \item {} on\_highlight(self) \item {} on\_right\_click(self,event) \item {} on\_left\_click(self,event) \item {} on\_middle\_click(self,event) \item {} on\_context\_click(self,event) \item {} on\_key\_up(self,event) \item {} on\_key\_down(self,event) \end{itemize} The following notifications are called on the canvas, if no interactive artist handles the event: \begin{itemize} \item {} on\_press(self,event) \item {} on\_left\_click(self,event) \item {} on\_middle\_click(self,event) \item {} on\_right\_click(self,event) \item {} on\_context\_click(self,event) \item {} on\_key\_up(self,event) \item {} on\_key\_down(self,event) \end{itemize} The following functions, if present, can be used to modify the behavior of the interactive object: \begin{itemize} \item {} press\_filter(self,event) \# determines if the object wants to have the press event routed to it \item {} handle\_unpicked\_cursor() \# can be used by the object to set a cursor as the cursor passes over the object when it is unpicked. \end{itemize} Supports multiple canvases, maintaining a drag lock, motion notifier, and a global “enabled” flag per canvas. Supports fixed aspect ratio resizings by holding the shift key during the resize. Known problems: \begin{itemize} \item {} Zorder is not obeyed during the selection/drag operations. Because of the blit technique used, I do not believe this can be fixed. The only way I can think of is to search for all artists that have a zorder greater then me, set them all to animated, and then redraw them all on top during each drag refresh. This might be very slow; need to try. \item {} the mixin only works for wx backends because of two things: 1) the cursors are hardcoded, and 2) there is a call to wx.GetMousePosition() Both of these shortcomings are reasonably fixed by having each backend supply these things. \end{itemize} \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP09:backward-compatibility}} No problems with backward compatibility, although once this is in place, it would be appropriate to obsolete some of the existing interactive functions (like legend.draggable()) \subsection{Alternatives} \label{\detokenize{devel/MEP/MEP09:alternatives}} None that I know of. \section{MEP10: Docstring consistency} \label{\detokenize{devel/MEP/MEP10:mep10-docstring-consistency}}\label{\detokenize{devel/MEP/MEP10::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP10:id2}}{\hyperref[\detokenize{devel/MEP/MEP10:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP10:id3}}{\hyperref[\detokenize{devel/MEP/MEP10:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP10:id4}}{\hyperref[\detokenize{devel/MEP/MEP10:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP10:id5}}{\hyperref[\detokenize{devel/MEP/MEP10:detailed-description}]{\sphinxcrossref{Detailed description}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP10:id6}}{\hyperref[\detokenize{devel/MEP/MEP10:numpy-docstring-format}]{\sphinxcrossref{Numpy docstring format}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP10:id7}}{\hyperref[\detokenize{devel/MEP/MEP10:cross-references}]{\sphinxcrossref{Cross references}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP10:id8}}{\hyperref[\detokenize{devel/MEP/MEP10:overriding-signatures}]{\sphinxcrossref{Overriding signatures}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP10:id9}}{\hyperref[\detokenize{devel/MEP/MEP10:linking-rather-than-duplicating}]{\sphinxcrossref{Linking rather than duplicating}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP10:id10}}{\hyperref[\detokenize{devel/MEP/MEP10:autosummary-extension}]{\sphinxcrossref{autosummary extension}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP10:id11}}{\hyperref[\detokenize{devel/MEP/MEP10:examples-linking-to-relevant-documentation}]{\sphinxcrossref{Examples linking to relevant documentation}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP10:id12}}{\hyperref[\detokenize{devel/MEP/MEP10:documentation-using-help-vs-a-browser}]{\sphinxcrossref{Documentation using help() vs a browser}}} \end{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP10:id13}}{\hyperref[\detokenize{devel/MEP/MEP10:implementation}]{\sphinxcrossref{Implementation}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP10:id14}}{\hyperref[\detokenize{devel/MEP/MEP10:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP10:id15}}{\hyperref[\detokenize{devel/MEP/MEP10:alternatives}]{\sphinxcrossref{Alternatives}}} \end{itemize} \end{sphinxShadowBox} \subsection{Status} \label{\detokenize{devel/MEP/MEP10:status}} \sphinxstylestrong{Progress} This is still an on-going effort \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP10:branches-and-pull-requests}} \subsection{Abstract} \label{\detokenize{devel/MEP/MEP10:abstract}} matplotlib has a great deal of inconsistency between docstrings. This not only makes the docs harder to read, but it is harder on contributors, because they don’t know which specifications to follow. There should be a clear docstring convention that is followed consistently. The organization of the API documentation is difficult to follow. Some pages, such as pyplot and axes, are enormous and hard to browse. There should instead be short summary tables that link to detailed documentation. In addition, some of the docstrings themselves are quite long and contain redundant information. Building the documentation takes a long time and uses a \sphinxcode{\sphinxupquote{make.py}} script rather than a Makefile. \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP10:detailed-description}} There are number of new tools and conventions available since matplotlib started using Sphinx that make life easier. The following is a list of proposed changes to docstrings, most of which involve these new features. \subsubsection{Numpy docstring format} \label{\detokenize{devel/MEP/MEP10:numpy-docstring-format}} \sphinxhref{https://github.com/numpy/numpy/blob/master/doc/HOWTO\_DOCUMENT.rst.txt}{Numpy docstring format}: This format divides the docstring into clear sections, each having different parsing rules that make the docstring easy to read both as raw text and as HTML. We could consider alternatives, or invent our own, but this is a strong choice, as it’s well used and understood in the Numpy/Scipy community. \subsubsection{Cross references} \label{\detokenize{devel/MEP/MEP10:cross-references}} Most of the docstrings in matplotlib use explicit “roles” when linking to other items, for example: \sphinxcode{\sphinxupquote{:func:{}`myfunction{}`}}. As of Sphinx 0.4, there is a “default\_role” that can be set to “obj”, which will polymorphically link to a Python object of any type. This allows one to write \sphinxcode{\sphinxupquote{{}`myfunction{}`}} instead. This makes docstrings much easier to read and edit as raw text. Additionally, Sphinx allows for setting a current module, so links like \sphinxcode{\sphinxupquote{{}`\textasciitilde{}matplotlib.axes.Axes.set\_xlim{}`}} could be written as \sphinxcode{\sphinxupquote{{}`\textasciitilde{}axes.Axes.set\_xlim{}`}}. \subsubsection{Overriding signatures} \label{\detokenize{devel/MEP/MEP10:overriding-signatures}} Many methods in matplotlib use the \sphinxcode{\sphinxupquote{*args}} and \sphinxcode{\sphinxupquote{**kwargs}} syntax to dynamically handle the keyword arguments that are accepted by the function, or to delegate on to another function. This, however, is often not useful as a signature in the documentation. For this reason, many matplotlib methods include something like: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{annotate}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{o}{*}\PYG{n}{args}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ Create an annotation: a piece of text referring to a data} \PYG{l+s+sd}{ point.} \PYG{l+s+sd}{ Call signature::} \PYG{l+s+sd}{ annotate(s, xy, xytext=None, xycoords=\PYGZsq{}data\PYGZsq{},} \PYG{l+s+sd}{ textcoords=\PYGZsq{}data\PYGZsq{}, arrowprops=None, **kwargs)} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \end{sphinxVerbatim} This can’t be parsed by Sphinx, and is rather verbose in raw text. As of Sphinx 1.1, if the \sphinxcode{\sphinxupquote{autodoc\_docstring\_signature}} config value is set to True, Sphinx will extract a replacement signature from the first line of the docstring, allowing this: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{annotate}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{o}{*}\PYG{n}{args}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ annotate(s, xy, xytext=None, xycoords=\PYGZsq{}data\PYGZsq{},} \PYG{l+s+sd}{ textcoords=\PYGZsq{}data\PYGZsq{}, arrowprops=None, **kwargs)} \PYG{l+s+sd}{ Create an annotation: a piece of text referring to a data} \PYG{l+s+sd}{ point.} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \end{sphinxVerbatim} The explicit signature will replace the actual Python one in the generated documentation. \subsubsection{Linking rather than duplicating} \label{\detokenize{devel/MEP/MEP10:linking-rather-than-duplicating}} Many of the docstrings include long lists of accepted keywords by interpolating things into the docstring at load time. This makes the docstrings very long. Also, since these tables are the same across many docstrings, it inserts a lot of redundant information in the docs \textendash{} particularly a problem in the printed version. These tables should be moved to docstrings on functions whose only purpose is for help. The docstrings that refer to these tables should link to them, rather than including them verbatim. \subsubsection{autosummary extension} \label{\detokenize{devel/MEP/MEP10:autosummary-extension}} The Sphinx autosummary extension should be used to generate summary tables, that link to separate pages of documentation. Some classes that have many methods (e.g. \sphinxcode{\sphinxupquote{Axes.axes}}) should be documented with one method per page, whereas smaller classes should have all of their methods together. \subsubsection{Examples linking to relevant documentation} \label{\detokenize{devel/MEP/MEP10:examples-linking-to-relevant-documentation}} The examples, while helpful at illustrating how to use a feature, do not link back to the relevant docstrings. This could be addressed by adding module-level docstrings to the examples, and then including that docstring in the parsed content on the example page. These docstrings could easily include references to any other part of the documentation. \subsubsection{Documentation using help() vs a browser} \label{\detokenize{devel/MEP/MEP10:documentation-using-help-vs-a-browser}} Using Sphinx markup in the source allows for good-looking docs in your browser, but the markup also makes the raw text returned using help() look terrible. One of the aims of improving the docstrings should be to make both methods of accessing the docs look good. \subsection{Implementation} \label{\detokenize{devel/MEP/MEP10:implementation}}\begin{enumerate} \item {} The numpydoc extensions should be turned on for matplotlib. There is an important question as to whether these should be included in the matplotlib source tree, or used as a dependency. Installing Numpy is not sufficient to get the numpydoc extensions \textendash{} it’s a separate install procedure. In any case, to the extent that they require customization for our needs, we should endeavor to submit those changes upstream and not fork them. \item {} Manually go through all of the docstrings and update them to the new format and conventions. Updating the cross references (from \sphinxcode{\sphinxupquote{{}`:func:{}`myfunc{}`}} to \sphinxcode{\sphinxupquote{{}`func{}`}}) may be able to be semi-automated. This is a lot of busy work, and perhaps this labor should be divided on a per-module basis so no single developer is over-burdened by it. \item {} Reorganize the API docs using autosummary and \sphinxcode{\sphinxupquote{sphinx-autogen}}. This should hopefully have minimal impact on the narrative documentation. \item {} Modify the example page generator (\sphinxcode{\sphinxupquote{gen\_rst.py}}) so that it extracts the module docstring from the example and includes it in a non-literal part of the example page. \item {} Use \sphinxcode{\sphinxupquote{sphinx-quickstart}} to generate a new-style Sphinx Makefile. The following features in the current \sphinxcode{\sphinxupquote{make.py}} will have to be addressed in some other way: \begin{itemize} \item {} Copying of some static content \item {} Specifying a “small” build (only low-resolution PNG files for examples) \end{itemize} \end{enumerate} Steps 1, 2, and 3 are interdependent. 4 and 5 may be done independently, though 5 has some dependency on 3. \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP10:backward-compatibility}} As this mainly involves docstrings, there should be minimal impact on backward compatibility. \subsection{Alternatives} \label{\detokenize{devel/MEP/MEP10:alternatives}} None yet discussed. \section{MEP11: Third-party dependencies} \label{\detokenize{devel/MEP/MEP11:mep11-third-party-dependencies}}\label{\detokenize{devel/MEP/MEP11::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP11:id1}}{\hyperref[\detokenize{devel/MEP/MEP11:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP11:id2}}{\hyperref[\detokenize{devel/MEP/MEP11:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP11:id3}}{\hyperref[\detokenize{devel/MEP/MEP11:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP11:id4}}{\hyperref[\detokenize{devel/MEP/MEP11:detailed-description}]{\sphinxcrossref{Detailed description}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP11:id5}}{\hyperref[\detokenize{devel/MEP/MEP11:current-behavior}]{\sphinxcrossref{Current behavior}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP11:id6}}{\hyperref[\detokenize{devel/MEP/MEP11:desired-behavior}]{\sphinxcrossref{Desired behavior}}} \end{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP11:id7}}{\hyperref[\detokenize{devel/MEP/MEP11:implementation}]{\sphinxcrossref{Implementation}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP11:id8}}{\hyperref[\detokenize{devel/MEP/MEP11:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP11:id9}}{\hyperref[\detokenize{devel/MEP/MEP11:alternatives}]{\sphinxcrossref{Alternatives}}} \end{itemize} \end{sphinxShadowBox} This MEP attempts to improve the way in which third-party dependencies in matplotlib are handled. \subsection{Status} \label{\detokenize{devel/MEP/MEP11:status}} \sphinxstylestrong{Completed} \textendash{} needs to be merged \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP11:branches-and-pull-requests}} \#1157: Use automatic dependency resolution \#1290: Debundle pyparsing \#1261: Update six to 1.2 \subsection{Abstract} \label{\detokenize{devel/MEP/MEP11:abstract}} One of the goals of matplotlib has been to keep it as easy to install as possible. To that end, some third-party dependencies are included in the source tree and, under certain circumstances, installed alongside matplotlib. This MEP aims to resolve some problems with that approach, bring some consistency, while continuing to make installation convenient. At the time that was initially done, \sphinxcode{\sphinxupquote{setuptools}}, \sphinxcode{\sphinxupquote{easy\_install}} and \sphinxcode{\sphinxupquote{PyPI}} were not mature enough to be relied on. However, at present, we should be able to safely leverage the “modern” versions of those tools, \sphinxcode{\sphinxupquote{distribute}} and \sphinxcode{\sphinxupquote{pip}}. While matplotlib has dependencies on both Python libraries and C/C++ libraries, this MEP addresses only the Python libraries so as to not confuse the issue. C libraries represent a larger and mostly orthogonal set of problems. \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP11:detailed-description}} matplotlib depends on the following third-party Python libraries: \begin{itemize} \item {} Numpy \item {} dateutil (pure Python) \item {} pytz (pure Python) \item {} six \textendash{} required by dateutil (pure Python) \item {} pyparsing (pure Python) \item {} PIL (optional) \item {} GUI frameworks: pygtk, gobject, tkinter, PySide, PyQt4, wx (all optional, but one is required for an interactive GUI) \end{itemize} \subsubsection{Current behavior} \label{\detokenize{devel/MEP/MEP11:current-behavior}} When installing from source, a \sphinxcode{\sphinxupquote{git}} checkout or \sphinxcode{\sphinxupquote{pip}}: \begin{itemize} \item {} \sphinxcode{\sphinxupquote{setup.py}} attempts to \sphinxcode{\sphinxupquote{import numpy}}. If this fails, the installation fails. \item {} For each of \sphinxcode{\sphinxupquote{dateutil}}, \sphinxcode{\sphinxupquote{pytz}} and \sphinxcode{\sphinxupquote{six}}, \sphinxcode{\sphinxupquote{setup.py}} attempts to import them (from the top-level namespace). If that fails, matplotlib installs its local copy of the library into the top-level namespace. \item {} \sphinxcode{\sphinxupquote{pyparsing}} is always installed inside of the matplotlib namespace. \end{itemize} This behavior is most surprising when used with \sphinxcode{\sphinxupquote{pip}}, because no \sphinxcode{\sphinxupquote{pip}} dependency resolution is performed, even though it is likely to work for all of these packages. The fact that \sphinxcode{\sphinxupquote{pyparsing}} is installed in the matplotlib namespace has reportedly (\#1290) confused some users into thinking it is a matplotlib-related module and import it from there rather than the top-level. When installing using the Windows installer, \sphinxcode{\sphinxupquote{dateutil}}, \sphinxcode{\sphinxupquote{pytz}} and \sphinxcode{\sphinxupquote{six}} are installed at the top-level \sphinxstyleemphasis{always}, potentially overwriting already installed copies of those libraries. TODO: Describe behavior with the OS-X installer. When installing using a package manager (Debian, RedHat, MacPorts etc.), this behavior actually does the right thing, and there are no special patches in the matplotlib packages to deal with the fact that we handle \sphinxcode{\sphinxupquote{dateutil}}, \sphinxcode{\sphinxupquote{pytz}} and \sphinxcode{\sphinxupquote{six}} in this way. However, care should be taken that whatever approach we move to continues to work in that context. Maintaining these packages in the matplotlib tree and making sure they are up-to-date is a maintenance burden. Advanced new features that may require a third-party pure Python library have a higher barrier to inclusion because of this burden. \subsubsection{Desired behavior} \label{\detokenize{devel/MEP/MEP11:desired-behavior}} Third-party dependencies are downloaded and installed from their canonical locations by leveraging \sphinxcode{\sphinxupquote{pip}}, \sphinxcode{\sphinxupquote{distribute}} and \sphinxcode{\sphinxupquote{PyPI}}. \sphinxcode{\sphinxupquote{dateutil}}, \sphinxcode{\sphinxupquote{pytz}}, and \sphinxcode{\sphinxupquote{pyparsing}} should be made into optional dependencies \textendash{} though obviously some features would fail if they aren’t installed. This will allow the user to decide whether they want to bother installing a particular feature. \subsection{Implementation} \label{\detokenize{devel/MEP/MEP11:implementation}} For installing from source, and assuming the user has all of the C-level compilers and dependencies, this can be accomplished fairly easily using \sphinxcode{\sphinxupquote{distribute}} and following the instructions \sphinxhref{https://pypi.python.org/pypi/distribute}{here}. The only anticipated change to the matplotlib library code will be to import \sphinxcode{\sphinxupquote{pyparsing}} from the top-level namespace rather than from within matplotlib. Note that \sphinxcode{\sphinxupquote{distribute}} will also allow us to remove the direct dependency on \sphinxcode{\sphinxupquote{six}}, since it is, strictly speaking, only a direct dependency of \sphinxcode{\sphinxupquote{dateutil}}. For binary installations, there are a number of alternatives (here ordered from best/hardest to worst/easiest): \begin{enumerate} \item {} The distutils wininst installer allows a post-install script to run. It might be possible to get this script to run \sphinxcode{\sphinxupquote{pip}} to install the other dependencies. (See \sphinxhref{http://grokbase.com/t/python/distutils-sig/109bdnfhp4/distutils-ann-setuptools-post-install-script-for-bdist-wininst}{this thread} for someone who has trod that ground before). \item {} Continue to ship \sphinxcode{\sphinxupquote{dateutil}}, \sphinxcode{\sphinxupquote{pytz}}, \sphinxcode{\sphinxupquote{six}} and \sphinxcode{\sphinxupquote{pyparsing}} in our installer, but use the post-install-script to install them \sphinxstyleemphasis{only} if they can not already be found. \item {} Move all of these packages inside a (new) \sphinxcode{\sphinxupquote{matplotlib.extern}} namespace so it is clear for outside users that these are external packages. Add some conditional imports in the core matplotlib codebase so \sphinxcode{\sphinxupquote{dateutil}} (at the top-level) is tried first, and failing that \sphinxcode{\sphinxupquote{matplotlib.extern.dateutil}} is used. \end{enumerate} 2 and 3 are undesirable as they still require maintaining copies of these packages in our tree \textendash{} and this is exacerbated by the fact that they are used less \textendash{} only in the binary installers. None of these 3 approaches address Numpy, which will still have to be manually installed using an installer. TODO: How does this relate to the Mac OS-X installer? \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP11:backward-compatibility}} At present, matplotlib can be installed from source on a machine without the third party dependencies and without an internet connection. After this change, an internet connection (and a working PyPI) will be required to install matplotlib for the first time. (Subsequent matplotlib updates or development work will run without accessing the network). \subsection{Alternatives} \label{\detokenize{devel/MEP/MEP11:alternatives}} Distributing binary \sphinxcode{\sphinxupquote{eggs}} doesn’t feel like a usable solution. That requires getting \sphinxcode{\sphinxupquote{easy\_install}} installed first, and Windows users generally prefer the well known \sphinxcode{\sphinxupquote{exe}} or \sphinxcode{\sphinxupquote{msi}} installer that works out of the box. \section{MEP12: Improve Gallery and Examples} \label{\detokenize{devel/MEP/MEP12:mep12-improve-gallery-and-examples}}\label{\detokenize{devel/MEP/MEP12::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP12:id5}}{\hyperref[\detokenize{devel/MEP/MEP12:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP12:id6}}{\hyperref[\detokenize{devel/MEP/MEP12:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP12:id7}}{\hyperref[\detokenize{devel/MEP/MEP12:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP12:id8}}{\hyperref[\detokenize{devel/MEP/MEP12:detailed-description}]{\sphinxcrossref{Detailed description}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP12:id9}}{\hyperref[\detokenize{devel/MEP/MEP12:implementation}]{\sphinxcrossref{Implementation}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP12:id10}}{\hyperref[\detokenize{devel/MEP/MEP12:gallery-sections}]{\sphinxcrossref{Gallery sections}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP12:id11}}{\hyperref[\detokenize{devel/MEP/MEP12:clean-up-guidelines}]{\sphinxcrossref{Clean up guidelines}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP12:id12}}{\hyperref[\detokenize{devel/MEP/MEP12:additional-suggestions}]{\sphinxcrossref{Additional suggestions}}} \end{itemize} \end{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP12:id13}}{\hyperref[\detokenize{devel/MEP/MEP12:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP12:id14}}{\hyperref[\detokenize{devel/MEP/MEP12:alternatives}]{\sphinxcrossref{Alternatives}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP12:id15}}{\hyperref[\detokenize{devel/MEP/MEP12:tags}]{\sphinxcrossref{Tags}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \subsection{Status} \label{\detokenize{devel/MEP/MEP12:status}} \sphinxstylestrong{Progress} Initial changes added in 1.3. Conversion of the gallery is on-going. 29 September 2015 - The last \sphinxcode{\sphinxupquote{pylab\_examples}} where \sphinxcode{\sphinxupquote{pylab}} is imported has been converted over to use \sphinxcode{\sphinxupquote{matplotlib pyplot}} and \sphinxhref{https://docs.scipy.org/doc/numpy/reference/index.html\#module-numpy}{\sphinxcode{\sphinxupquote{numpy}}}. \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP12:branches-and-pull-requests}} \#1623, \#1924, \#2181 PR \sphinxcode{\sphinxupquote{\#2474 \textless{}https://github.com/matplotlib/matplotlib/pull/2474}}\textgreater{}\_ demonstrates a single example being cleaned up and moved to the appropriate section. \subsection{Abstract} \label{\detokenize{devel/MEP/MEP12:abstract}} Reorganizing the matplotlib plot gallery would greatly simplify navigation of the gallery. In addition, examples should be cleaned-up and simplified for clarity. \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP12:detailed-description}} The matplotlib gallery was recently set up to split examples up into sections. As discussed in that PR % \begin{footnote}[1]\sphinxAtStartFootnote \sphinxurl{https://github.com/matplotlib/matplotlib/pull/714} % \end{footnote}, the current example sections (\sphinxcode{\sphinxupquote{api}}, \sphinxcode{\sphinxupquote{pylab\_examples}}) aren’t terribly useful to users: New sections in the gallery would help users find relevant examples. These sections would also guide a cleanup of the examples: Initially, all the current examples would remain and be listed under their current directories. Over time, these examples could be cleaned up and moved into one of the new sections. This process allows users to easily identify examples that need to be cleaned up; i.e. anything in the \sphinxcode{\sphinxupquote{api}} and \sphinxcode{\sphinxupquote{pylab\_examples}} directories. \subsection{Implementation} \label{\detokenize{devel/MEP/MEP12:implementation}}\begin{enumerate} \item {} Create new gallery sections. {[}Done{]} \item {} Clean up examples and move them to the new gallery sections (over the course of many PRs and with the help of many users/developers). {[}In progress{]} \end{enumerate} \subsubsection{Gallery sections} \label{\detokenize{devel/MEP/MEP12:gallery-sections}} The naming of sections is critical and will guide the clean-up effort. The current sections are: \begin{itemize} \item {} Lines, bars, and markers (more-or-less 1D data) \item {} Shapes and collections \item {} Statistical plots \item {} Images, contours, and fields \item {} Pie and polar charts: Round things \item {} Color \item {} Text, labels, and annotations \item {} Ticks and spines \item {} Subplots, axes, and figures \item {} Specialty plots (e.g., sankey, radar, tornado) \item {} Showcase (plots with tweaks to make them publication-quality) \item {} separate sections for toolboxes (already exists: ‘mplot3d’, ‘axes\_grid’, ‘units’, ‘widgets’) \end{itemize} These names are certainly up for debate. As these sections grow, we should reevaluate them and split them up as necessary. \subsubsection{Clean up guidelines} \label{\detokenize{devel/MEP/MEP12:clean-up-guidelines}} The current examples in the \sphinxcode{\sphinxupquote{api}} and \sphinxcode{\sphinxupquote{pylab\_examples}} sections of the gallery would remain in those directories until they are cleaned up. After clean-up, they would be moved to one of the new gallery sections described above. “Clean-up” should involve: \begin{itemize} \item {} \sphinxhref{https://sphinx-gallery.readthedocs.io/en/latest/}{sphinx-gallery docstrings}: a title and a description of the example formatted as follows, at the top of the example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{===============================} \PYG{l+s+sd}{Colormaps alter your perception} \PYG{l+s+sd}{===============================} \PYG{l+s+sd}{Here I plot the function} \PYG{l+s+sd}{.. math:: f(x, y) = \PYGZbs{}sin(x) + \PYGZbs{}cos(y)} \PYG{l+s+sd}{with different colormaps. Look at how colormaps alter your perception!} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \end{sphinxVerbatim} \item {} \sphinxhref{https://www.python.org/dev/peps/pep-0008/}{PEP8} clean-ups (running \sphinxhref{https://pypi.python.org/pypi/flake8}{flake8}, or a similar checker, is highly recommended) \item {} Commented-out code should be removed. \item {} Replace uses of \sphinxcode{\sphinxupquote{pylab}} interface with \sphinxcode{\sphinxupquote{pyplot}} (+ \sphinxcode{\sphinxupquote{numpy}}, etc.). See \sphinxhref{https://github.com/tonysyu/matplotlib/commit/c25ef1e02b3a0ecb279492409dac0de9b3d2c0e2}{c25ef1e} \item {} Remove shebang line, e.g.: \begin{quote} \#!/usr/bin/env python \end{quote} \item {} Use consistent imports. In particular: \begin{quote} import numpy as np import matplotlib.pyplot as plt \end{quote} Avoid importing specific functions from these modules (e.g. \sphinxcode{\sphinxupquote{from numpy import sin}}) \item {} Each example should focus on a specific feature (excluding \sphinxcode{\sphinxupquote{showcase}} examples, which will show more “polished” plots). Tweaking unrelated to that feature should be removed. See \sphinxhref{https://github.com/tonysyu/matplotlib/commit/f7b2217a1f92343e8aca0684d19c9915cc2e8674}{f7b2217}, \sphinxhref{https://github.com/tonysyu/matplotlib/commit/e57b5fc31fbad83ed9c43c77ef15368efdcb9ec1}{e57b5fc}, and \sphinxhref{https://github.com/tonysyu/matplotlib/commit/1458aa87c5eae9dd99e141956a6adf7a0f3c6707}{1458aa8} \end{itemize} Use of \sphinxcode{\sphinxupquote{pylab}} should be demonstrated/discussed on a dedicated help page instead of the gallery examples. \sphinxstylestrong{Note:} When moving an existing example, you should search for references to that example. For example, the API documentation for \sphinxcode{\sphinxupquote{axes.py}} and \sphinxcode{\sphinxupquote{pyplot.py}} may use these examples to generate plots. Use your favorite search tool (e.g., grep, ack, \sphinxhref{https://pypi.python.org/pypi/grin}{grin}, \sphinxhref{https://pypi.python.org/pypi/pss}{pss}) to search the matplotlib package. See \sphinxhref{https://github.com/tonysyu/matplotlib/commit/2dc9a4651e5e566afc0866c603aa8d06aaf32b71}{2dc9a46} and \sphinxhref{https://github.com/tonysyu/matplotlib/commit/aa6b410f9fa085ccf5f4f962a6f26af5beeae7af}{aa6b410} \paragraph{Additional suggestions} \label{\detokenize{devel/MEP/MEP12:additional-suggestions}}\begin{itemize} \item {} Provide links (both ways) between examples and API docs for the methods/objects used. (issue \sphinxhref{https://github.com/matplotlib/matplotlib/issues/2222}{\#2222}) \item {} Use \sphinxcode{\sphinxupquote{plt.subplots}} (note trailing “s”) in preference over \sphinxcode{\sphinxupquote{plt.subplot}}. \item {} Rename the example to clarify it’s purpose. For example, the most basic demo of \sphinxcode{\sphinxupquote{imshow}} might be \sphinxcode{\sphinxupquote{imshow\_demo.py}}, and one demonstrating different interpolation settings would be \sphinxcode{\sphinxupquote{imshow\_demo\_interpolation.py}} (\sphinxstyleemphasis{not} \sphinxcode{\sphinxupquote{imshow\_demo2.py}}). \item {} Split up examples that try to do too much. See \sphinxhref{https://github.com/tonysyu/matplotlib/commit/509967518ce5ce5ba31edf12486ffaa344e748f2}{5099675} and \sphinxhref{https://github.com/tonysyu/matplotlib/commit/fc2ab07cc586abba4c024d8c0d841c4357a3936f}{fc2ab07} \item {} Delete examples that don’t show anything new. \item {} Some examples exercise esoteric features for unit testing. These tweaks should be moved out of the gallery to an example in the \sphinxcode{\sphinxupquote{unit}} directory located in the root directory of the package. \item {} Add plot titles to clarify intent of the example. See \sphinxhref{https://github.com/tonysyu/matplotlib/commit/bd2b13c54bf4aa2058781b9a805d68f2feab5ba5}{bd2b13c} \end{itemize} \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP12:backward-compatibility}} The website for each Matplotlib version is readily accessible, so users who want to refer to old examples can still do so. \subsection{Alternatives} \label{\detokenize{devel/MEP/MEP12:alternatives}} \subsubsection{Tags} \label{\detokenize{devel/MEP/MEP12:tags}} Tagging examples will also help users search the example gallery. Although tags would be a big win for users with specific goals, the plot gallery will remain the entry point to these examples, and sections could really help users navigate the gallery. Thus, tags are complementary to this reorganization. \section{MEP13: Use properties for Artists} \label{\detokenize{devel/MEP/MEP13:mep13-use-properties-for-artists}}\label{\detokenize{devel/MEP/MEP13::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP13:id1}}{\hyperref[\detokenize{devel/MEP/MEP13:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP13:id2}}{\hyperref[\detokenize{devel/MEP/MEP13:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP13:id3}}{\hyperref[\detokenize{devel/MEP/MEP13:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP13:id4}}{\hyperref[\detokenize{devel/MEP/MEP13:detailed-description}]{\sphinxcrossref{Detailed description}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP13:id5}}{\hyperref[\detokenize{devel/MEP/MEP13:implementation}]{\sphinxcrossref{Implementation}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP13:id6}}{\hyperref[\detokenize{devel/MEP/MEP13:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP13:id7}}{\hyperref[\detokenize{devel/MEP/MEP13:examples}]{\sphinxcrossref{Examples}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP13:id8}}{\hyperref[\detokenize{devel/MEP/MEP13:axes-axes-set-axis-off-set-axis-on}]{\sphinxcrossref{axes.Axes.set\_axis\_off/set\_axis\_on}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP13:id9}}{\hyperref[\detokenize{devel/MEP/MEP13:axes-axes-get-xlim-set-xlim-and-get-autoscalex-on-set-autoscalex-on}]{\sphinxcrossref{axes.Axes.get\_xlim/set\_xlim and get\_autoscalex\_on/set\_autoscalex\_on}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP13:id10}}{\hyperref[\detokenize{devel/MEP/MEP13:axes-axes-get-title-set-title}]{\sphinxcrossref{axes.Axes.get\_title/set\_title}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP13:id11}}{\hyperref[\detokenize{devel/MEP/MEP13:axes-axes-get-xticklabels-set-xticklabels}]{\sphinxcrossref{axes.Axes.get\_xticklabels/set\_xticklabels}}} \end{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP13:id12}}{\hyperref[\detokenize{devel/MEP/MEP13:alternatives}]{\sphinxcrossref{Alternatives}}} \end{itemize} \end{sphinxShadowBox} \subsection{Status} \label{\detokenize{devel/MEP/MEP13:status}}\begin{itemize} \item {} \sphinxstylestrong{Discussion} \end{itemize} \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP13:branches-and-pull-requests}} None \subsection{Abstract} \label{\detokenize{devel/MEP/MEP13:abstract}} Wrap all of the matplotlib getter and setter methods with python \sphinxhref{https://docs.python.org/3/library/functions.html\#property}{properties}, allowing them to be read and written like class attributes. \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP13:detailed-description}} Currently matplotlib uses getter and setter functions (usually prefixed with get\_ and set\_, respectively) for reading and writing data related to classes. However, since 2.6 python supports properties, which allow such setter and getter functions to be accessed as though they were attributes. This proposal would implement all existing setter and getter methods as properties. \subsection{Implementation} \label{\detokenize{devel/MEP/MEP13:implementation}}\begin{enumerate} \item {} All existing getter and setter methods will need to have two aliases, one with the get\_ or set\_ prefix and one without. Getter methods that currently lack prefixes should be recording in a text file. \item {} Classes should be reorganized so setter and getter methods are sequential in the code, with getter methods first. \item {} Getter and setter methods the provide additional optional optional arguments should have those arguments accessible in another manner, either as additional getter or setter methods or attributes of other classes. If those classes are not accessible, getters for them should be added. \item {} Property decorators will be added to the setter and getter methods without the prefix. Those with the prefix will be marked as deprecated. \item {} Docstrings will need to be rewritten so the getter with the prefix has the current docstring and the getter without the prefix has a generic docstring appropriate for an attribute. \item {} Automatic alias generation will need to be modified so it will also create aliases for the properties. \item {} All instances of getter and setter method calls will need to be changed to attribute access. \item {} All setter and getter aliases with prefixes will be removed \end{enumerate} The following steps can be done simultaneously: 1, 2, and 3; 4 and 5; 6 and 7. Only the following steps must be done in the same release: 4, 5, and 6. All other changes can be done in separate releases. 8 should be done several major releases after everything else. \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP13:backward-compatibility}} All existing getter methods that do not have a prefix (such as get\_) will need to be changed from function calls to attribute access. In most cases this will only require removing the parenthesis. setter and getter methods that have additional optional arguments will need to have those arguments implemented in another way, either as a separate property in the same class or as attributes or properties of another class. Cases where the setter returns a value will need to be changed to using the setter followed by the getter. Cases where there are set\_ATTR\_on() and set\_ATTR\_off() methods will be changed to ATTR\_on properties. \subsection{Examples} \label{\detokenize{devel/MEP/MEP13:examples}} \subsubsection{axes.Axes.set\_axis\_off/set\_axis\_on} \label{\detokenize{devel/MEP/MEP13:axes-axes-set-axis-off-set-axis-on}} Current implementation: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{set\PYGZus{}axis\PYGZus{}off}\PYG{p}{(}\PYG{p}{)} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{set\PYGZus{}axis\PYGZus{}on}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} New implementation: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kc}{True} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{axis\PYGZus{}on} \PYG{k+kc}{False} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{axis\PYGZus{}on} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{axis\PYGZus{}on} \PYG{o}{=} \PYG{k+kc}{True} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{axis\PYGZus{}on} \PYG{o}{=} \PYG{k+kc}{False} \end{sphinxVerbatim} \subsubsection{axes.Axes.get\_xlim/set\_xlim and get\_autoscalex\_on/set\_autoscalex\_on} \label{\detokenize{devel/MEP/MEP13:axes-axes-get-xlim-set-xlim-and-get-autoscalex-on-set-autoscalex-on}} Current implementation: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{[}\PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{p}{]} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{get\PYGZus{}xlim}\PYG{p}{(}\PYG{p}{)} \PYG{n}{auto} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{get\PYGZus{}autoscalex\PYGZus{}on}\PYG{p}{(}\PYG{p}{)} \PYG{p}{[}\PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{p}{]} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{n}{left}\PYG{o}{=}\PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{o}{=}\PYG{n}{right}\PYG{p}{,} \PYG{n}{emit}\PYG{o}{=}\PYG{n}{emit}\PYG{p}{,} \PYG{n}{auto}\PYG{o}{=}\PYG{n}{auto}\PYG{p}{)} \PYG{p}{[}\PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{p}{]} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{n}{left}\PYG{o}{=}\PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{emit}\PYG{o}{=}\PYG{n}{emit}\PYG{p}{,} \PYG{n}{auto}\PYG{o}{=}\PYG{n}{auto}\PYG{p}{)} \PYG{p}{[}\PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{p}{]} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{n}{left}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{right}\PYG{o}{=}\PYG{n}{right}\PYG{p}{,} \PYG{n}{emit}\PYG{o}{=}\PYG{n}{emit}\PYG{p}{,} \PYG{n}{auto}\PYG{o}{=}\PYG{n}{auto}\PYG{p}{)} \PYG{p}{[}\PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{p}{]} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{n}{left}\PYG{o}{=}\PYG{n}{left}\PYG{p}{,} \PYG{n}{emit}\PYG{o}{=}\PYG{n}{emit}\PYG{p}{,} \PYG{n}{auto}\PYG{o}{=}\PYG{n}{auto}\PYG{p}{)} \PYG{p}{[}\PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{p}{]} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{n}{right}\PYG{o}{=}\PYG{n}{right}\PYG{p}{,} \PYG{n}{emit}\PYG{o}{=}\PYG{n}{emit}\PYG{p}{,} \PYG{n}{auto}\PYG{o}{=}\PYG{n}{auto}\PYG{p}{)} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{set\PYGZus{}autoscalex\PYGZus{}on}\PYG{p}{(}\PYG{n}{auto}\PYG{p}{)} \end{sphinxVerbatim} New implementation: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{[}\PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{p}{]} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{axes\PYGZus{}xlim} \PYG{n}{auto} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{autoscalex\PYGZus{}on} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{axes\PYGZus{}xlim} \PYG{o}{=} \PYG{p}{[}\PYG{n}{left}\PYG{p}{,} \PYG{n}{right}\PYG{p}{]} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{axes\PYGZus{}xlim} \PYG{o}{=} \PYG{p}{[}\PYG{n}{left}\PYG{p}{,} \PYG{k+kc}{None}\PYG{p}{]} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{axes\PYGZus{}xlim} \PYG{o}{=} \PYG{p}{[}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{right}\PYG{p}{]} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{axes\PYGZus{}xlim}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{n}{left} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{axes\PYGZus{}xlim}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{=} \PYG{n}{right} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{autoscalex\PYGZus{}on} \PYG{o}{=} \PYG{n}{auto} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{emit\PYGZus{}xlim} \PYG{o}{=} \PYG{n}{emit} \end{sphinxVerbatim} \subsubsection{axes.Axes.get\_title/set\_title} \label{\detokenize{devel/MEP/MEP13:axes-axes-get-title-set-title}} Current implementation: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{string} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{get\PYGZus{}title}\PYG{p}{(}\PYG{p}{)} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{set\PYGZus{}title}\PYG{p}{(}\PYG{n}{string}\PYG{p}{,} \PYG{n}{fontdict}\PYG{o}{=}\PYG{n}{fontdict}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} New implementation: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{string} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{title} \PYG{n}{string} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{title\PYGZus{}text}\PYG{o}{.}\PYG{n}{text} \PYG{n}{text}\PYG{o}{.}\PYG{n}{Text} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{title\PYGZus{}text} \PYG{n}{text}\PYG{o}{.}\PYG{n}{Text}\PYG{o}{.}\PYG{o}{\PYGZlt{}}\PYG{n}{attribute}\PYG{o}{\PYGZgt{}} \PYG{o}{=} \PYG{n}{attribute} \PYG{n}{text}\PYG{o}{.}\PYG{n}{Text}\PYG{o}{.}\PYG{n}{fontdict} \PYG{o}{=} \PYG{n}{fontdict} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{title} \PYG{o}{=} \PYG{n}{string} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{title} \PYG{o}{=} \PYG{n}{text}\PYG{o}{.}\PYG{n}{Text} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{title\PYGZus{}text} \PYG{o}{=} \PYG{n}{string} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{title\PYGZus{}text} \PYG{o}{=} \PYG{n}{text}\PYG{o}{.}\PYG{n}{Text} \end{sphinxVerbatim} \subsubsection{axes.Axes.get\_xticklabels/set\_xticklabels} \label{\detokenize{devel/MEP/MEP13:axes-axes-get-xticklabels-set-xticklabels}} Current implementation: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{[}\PYG{n}{text}\PYG{o}{.}\PYG{n}{Text}\PYG{p}{]} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{get\PYGZus{}xticklabels}\PYG{p}{(}\PYG{p}{)} \PYG{p}{[}\PYG{n}{text}\PYG{o}{.}\PYG{n}{Text}\PYG{p}{]} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{get\PYGZus{}xticklabels}\PYG{p}{(}\PYG{n}{minor}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{)} \PYG{p}{[}\PYG{n}{text}\PYG{o}{.}\PYG{n}{Text}\PYG{p}{]} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{get\PYGZus{}xticklabels}\PYG{p}{(}\PYG{n}{minor}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{)} \PYG{p}{[}\PYG{n}{text}\PYG{o}{.}\PYG{n}{Text}\PYG{p}{]} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{p}{(}\PYG{p}{[}\PYG{n}{string}\PYG{p}{]}\PYG{p}{,} \PYG{n}{fontdict}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{p}{[}\PYG{n}{text}\PYG{o}{.}\PYG{n}{Text}\PYG{p}{]} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{p}{(}\PYG{p}{[}\PYG{n}{string}\PYG{p}{]}\PYG{p}{,} \PYG{n}{fontdict}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{minor}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \PYG{p}{[}\PYG{n}{text}\PYG{o}{.}\PYG{n}{Text}\PYG{p}{]} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{p}{(}\PYG{p}{[}\PYG{n}{string}\PYG{p}{]}\PYG{p}{,} \PYG{n}{fontdict}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{minor}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} \end{sphinxVerbatim} New implementation: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{p}{[}\PYG{n}{text}\PYG{o}{.}\PYG{n}{Text}\PYG{p}{]} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{xticklabels} \PYG{p}{[}\PYG{n}{text}\PYG{o}{.}\PYG{n}{Text}\PYG{p}{]} \PYG{o}{=} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{xminorticklabels} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{xticklabels} \PYG{o}{=} \PYG{p}{[}\PYG{n}{string}\PYG{p}{]} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{xminorticklabels} \PYG{o}{=} \PYG{p}{[}\PYG{n}{string}\PYG{p}{]} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{xticklabels} \PYG{o}{=} \PYG{p}{[}\PYG{n}{text}\PYG{o}{.}\PYG{n}{Text}\PYG{p}{]} \PYG{n}{axes}\PYG{o}{.}\PYG{n}{Axes}\PYG{o}{.}\PYG{n}{xminorticklabels} \PYG{o}{=} \PYG{p}{[}\PYG{n}{text}\PYG{o}{.}\PYG{n}{Text}\PYG{p}{]} \end{sphinxVerbatim} \subsection{Alternatives} \label{\detokenize{devel/MEP/MEP13:alternatives}} Instead of using decorators, it is also possible to use the property function. This would change the procedure so that all getter methods that lack a prefix will need to be renamed or removed. This makes handling docstrings more difficult and harder to read. It is not necessary to deprecate the setter and getter methods, but leaving them in will complicate the code. This could also serve as an opportunity to rewrite or even remove automatic alias generation. Another alternate proposal: Convert \sphinxcode{\sphinxupquote{set\_xlim}}, \sphinxcode{\sphinxupquote{set\_xlabel}}, \sphinxcode{\sphinxupquote{set\_title}}, etc. to \sphinxcode{\sphinxupquote{xlim}}, \sphinxcode{\sphinxupquote{xlabel}}, \sphinxcode{\sphinxupquote{title}},… to make the transition from \sphinxcode{\sphinxupquote{plt}} functions to \sphinxcode{\sphinxupquote{axes}} methods significantly simpler. These would still be methods, not properties, but it’s still a great usability enhancement while retaining the interface. \section{MEP14: Text handling} \label{\detokenize{devel/MEP/MEP14:mep14-text-handling}}\label{\detokenize{devel/MEP/MEP14::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP14:id2}}{\hyperref[\detokenize{devel/MEP/MEP14:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP14:id3}}{\hyperref[\detokenize{devel/MEP/MEP14:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP14:id4}}{\hyperref[\detokenize{devel/MEP/MEP14:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP14:id5}}{\hyperref[\detokenize{devel/MEP/MEP14:detailed-description}]{\sphinxcrossref{Detailed description}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP14:id6}}{\hyperref[\detokenize{devel/MEP/MEP14:implementation}]{\sphinxcrossref{Implementation}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP14:id7}}{\hyperref[\detokenize{devel/MEP/MEP14:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP14:id8}}{\hyperref[\detokenize{devel/MEP/MEP14:alternatives}]{\sphinxcrossref{Alternatives}}} \end{itemize} \end{sphinxShadowBox} \subsection{Status} \label{\detokenize{devel/MEP/MEP14:status}}\begin{itemize} \item {} \sphinxstylestrong{Discussion} \end{itemize} \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP14:branches-and-pull-requests}} Issue \#253 demonstrates a bug where using the bounding box rather than the advance width of text results in misaligned text. This is a minor point in the grand scheme of things, but it should be addressed as part of this MEP. \subsection{Abstract} \label{\detokenize{devel/MEP/MEP14:abstract}} By reorganizing how text is handled, this MEP aims to: \begin{itemize} \item {} improve support for Unicode and non-ltr languages \item {} improve text layout (especially multi-line text) \item {} allow support for more fonts, especially non-Apple-format TrueType fonts and OpenType fonts. \item {} make the font configuration easier and more transparent \end{itemize} \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP14:detailed-description}} \sphinxstylestrong{Text layout} At present, matplotlib has two different ways to render text: “built-in” (based on FreeType and our own Python code), and “usetex” (based on calling out to a TeX installation). Adjunct to the “built-in” renderer there is also the Python-based “mathtext” system for rendering mathematical equations using a subset of the TeX language without having a TeX installation available. Support for these two engines in strewn about many source files, including every backend, where one finds clauses like \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{if} \PYG{n}{rcParams}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{text.usetex}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{:} \PYG{c+c1}{\PYGZsh{} do one thing else: \PYGZsh{} do another} \end{sphinxVerbatim} Adding a third text rendering approach (more on that later) would require editing all of these places as well, and therefore doesn’t scale. Instead, this MEP proposes adding a concept of “text engines”, where the user could select one of many different approaches for rendering text. The implementations of each of these would be localized to their own set of modules, and not have little pieces around the whole source tree. Why add more text rendering engines? The “built-in” text rendering has a number of shortcomings. \begin{itemize} \item {} It only handles right-to-left languages, and doesn’t handle many special features of Unicode, such as combining diacriticals. \item {} The multiline support is imperfect and only supports manual line-breaking \textendash{} it can not break up a paragraph into lines of a certain length. \item {} It also does not handle inline formatting changes in order to support something like Markdown, reStructuredText or HTML. (Though rich-text formatting is contemplated in this MEP, since we want to make sure this design allows it, the specifics of a rich-text formatting implementation is outside of the scope of this MEP.) \end{itemize} Supporting these things is difficult, and is the “full-time job” of a number of other projects: \begin{itemize} \item {} \sphinxhref{http://www.pango.org/}{pango}/\sphinxhref{https://www.freedesktop.org/wiki/Software/HarfBuzz/}{harfbuzz} \item {} \sphinxhref{http://doc.qt.io/qt-4.8/qtextlayout.html}{QtTextLayout} \item {} \sphinxhref{https://msdn.microsoft.com/en-us/library/windows/desktop/dd371554(v=vs.85).aspx}{Microsoft DirectWrite} \item {} \sphinxhref{https://developer.apple.com/library/content/documentation/StringsTextFonts/Conceptual/CoreText\_Programming/Overview/Overview.html}{Apple Core Text} \end{itemize} Of the above options, it should be noted that \sphinxcode{\sphinxupquote{harfbuzz}} is designed from the start as a cross platform option with minimal dependencies, so therefore is a good candidate for a single option to support. Additionally, for supporting rich text, we could consider using \sphinxhref{https://webkit.org/}{WebKit}, and possibly whether than represents a good single cross-platform option. Again, however, rich text formatting is outside of the scope of this project. Rather than trying to reinvent the wheel and add these features to matplotlib’s “built-in” text renderer, we should provide a way to leverage these projects to get more powerful text layout. The “built-in” renderer will still need to exist for reasons of ease of installation, but its feature set will be more limited compared to the others. {[}TODO: This MEP should clearly decide what those limited features are, and fix any bugs to bring the implementation into a state of working correctly in all cases that we want it to work. I know @leejjoon has some thoughts on this.{]} \sphinxstylestrong{Font selection} Going from an abstract description of a font to a file on disk is the task of the font selection algorithm \textendash{} it turns out to be much more complicated than it seems at first. The “built-in” and “usetex” renderers have very different ways of handling font selection, given their different technologies. TeX requires the installation of TeX-specific font packages, for example, and can not use TrueType fonts directly. Unfortunately, despite the different semantics for font selection, the same set of font properties are used for each. This is true of both the \sphinxcode{\sphinxupquote{FontProperties}} class and the font-related \sphinxcode{\sphinxupquote{rcParams}} (which basically share the same code underneath). Instead, we should define a core set of font selection parameters that will work across all text engines, and have engine-specific configuration to allow the user to do engine-specific things when required. For example, it is possible to directly select a font by name in the “built-in” using \sphinxcode{\sphinxupquote{font.family}}, but the same is not possible with “usetex”. It may be possible to make it easier to use TrueType fonts by using XeTeX, but users will still want to use the traditional metafonts through TeX font packages. So the issue still stands that different text engines will need engine-specific configuration, and it should be more obvious to the user which configuration will work across text engines and which are engine-specific. Note that even excluding “usetex”, there are different ways to find fonts. The default is to use the font list cache in \sphinxcode{\sphinxupquote{font\_manager.py}} which matches fonts using our own algorithm based on the \sphinxhref{http://www.w3.org/TR/CSS2/fonts.html\#algorithm}{CSS font matching algorithm}. It doesn’t always do the same thing as the native font selection algorithms on Linux (\sphinxhref{https://www.freedesktop.org/wiki/Software/fontconfig/}{fontconfig}), Mac and Windows, and it doesn’t always find all of the fonts on the system that the OS would normally pick up. However, it is cross-platform, and always finds the fonts that ship with matplotlib. The Cairo and MacOSX backends (and presumably a future HTML5-based backend) currently bypass this mechanism and use the OS-native ones. The same is true when not embedding fonts in SVG, PS or PDF files and opening them in a third-party viewer. A downside there is that (at least with Cairo, need to confirm with MacOSX) they don’t always find the fonts we ship with matplotlib. (It may be possible to add the fonts to their search path, though, or we may need to find a way to install our fonts to a location the OS expects to find them). There are also special modes in the PS and PDF to only use the core fonts that are always available to those formats. There, the font lookup mechanism must only match against those fonts. It is unclear whether the OS-native font lookup systems can handle this case. There is also experimental support for using \sphinxhref{https://www.freedesktop.org/wiki/Software/fontconfig/}{fontconfig} for font selection in matplotlib, turned off by default. fontconfig is the native font selection algorithm on Linux, but is also cross platform and works well on the other platforms (though obviously is an additional dependency there). Many of the text layout libraries proposed above (pango, QtTextLayout, DirectWrite and CoreText etc.) insist on using the font selection library from their own ecosystem. All of the above seems to suggest that we should move away from our self-written font selection algorithm and use the native APIs where possible. That’s what Cairo and MacOSX backends already want to use, and it will be a requirement of any complex text layout library. On Linux, we already have the bones of a \sphinxcode{\sphinxupquote{fontconfig}} implementation (which could also be accessed through pango). On Windows and Mac we may need to write custom wrappers. The nice thing is that the API for font lookup is relatively small, and essentially consist of “given a dictionary of font properties, give me a matching font file”. \sphinxstylestrong{Font subsetting} Font subsetting is currently handled using ttconv. ttconv was a standalone commandline utility for converting TrueType fonts to subsetted Type 3 fonts (among other features) written in 1995, which matplotlib (well, I) forked in order to make it work as a library. It only handles Apple-style TrueType fonts, not ones with the Microsoft (or other vendor) encodings. It doesn’t handle OpenType fonts at all. This means that even though the STIX fonts come as .otf files, we have to convert them to .ttf files to ship them with matplotlib. The Linux packagers hate this \textendash{} they’d rather just depend on the upstream STIX fonts. ttconv has also been shown to have a few bugs that have been difficult to fix over time. Instead, we should be able to use FreeType to get the font outlines and write our own code (probably in Python) to output subsetted fonts (Type 3 on PS and PDF and SVGFonts or paths on SVG). Freetype, as a popular and well-maintained project, handles a wide variety of fonts in the wild. This would remove a lot of custom C code, and remove some code duplication between backends. Note that subsetting fonts this way, while the easiest route, does lose the hinting in the font, so we will need to continue, as we do now, provide a way to embed the entire font in the file where possible. Alternative font subsetting options include using the subsetting built-in to Cairo (not clear if it can be used without the rest of Cairo), or using \sphinxcode{\sphinxupquote{fontforge}} (which is a heavy and not terribly cross-platform dependency). \sphinxstylestrong{Freetype wrappers} Our FreeType wrapper could really use a reworking. It defines its own image buffer class (when a Numpy array would be easier). While FreeType can handle a huge diversity of font files, there are limitations to our wrapper that make it much harder to support non-Apple-vendor TrueType files, and certain features of OpenType files. (See \#2088 for a terrible result of this, just to support the fonts that ship with Windows 7 and 8). I think a fresh rewrite of this wrapper would go a long way. \sphinxstylestrong{Text anchoring and alignment and rotation} The handling of baselines was changed in 1.3.0 such that the backends are now given the location of the baseline of the text, not the bottom of the text. This is probably the correct behavior, and the MEP refactoring should also follow this convention. In order to support alignment on multi-line text, it should be the responsibility of the (proposed) text engine to handle text alignment. For a given chunk of text, each engine calculates a bounding box for that text and the offset of the anchor point within that box. Therefore, if the va of a block was “top”, the anchor point would be at the top of the box. Rotating of text should always be around the anchor point. I’m not sure that lines up with current behavior in matplotlib, but it seems like the sanest/least surprising choice. {[}This could be revisited once we have something working{]}. Rotation of text should not be handled by the text engine \textendash{} that should be handled by a layer between the text engine and the rendering backend so it can be handled in a uniform way. {[}I don’t see any advantage to rotation being handled by the text engines individually…{]} There are other problems with text alignment and anchoring that should be resolved as part of this work. {[}TODO: enumerate these{]}. \sphinxstylestrong{Other minor problems to fix} The mathtext code has backend-specific code \textendash{} it should instead provide its output as just another text engine. However, it’s still desirable to have mathtext layout inserted as part of a larger layout performed by another text engine, so it should be possible to do this. It’s an open question whether embedding the text layout of an arbitrary text engine in another should be possible. The text mode is currently set by a global rcParam (“text.usetex”) so it’s either all on or all off. We should continue to have a global rcParam to choose the text engine (“text.layout\_engine”), but it should under the hood be an overridable property on the \sphinxcode{\sphinxupquote{Text}} object, so the same figure can combine the results of multiple text layout engines if necessary. \subsection{Implementation} \label{\detokenize{devel/MEP/MEP14:implementation}} A concept of a “text engine” will be introduced. Each text engine will implement a number of abstract classes. The \sphinxcode{\sphinxupquote{TextFont}} interface will represent text for a given set of font properties. It isn’t necessarily limited to a single font file \textendash{} if the layout engine supports rich text, it may handle a number of font files in a family. Given a \sphinxcode{\sphinxupquote{TextFont}} instance, the user can get a \sphinxcode{\sphinxupquote{TextLayout}} instance, which represents the layout for a given string of text in a given font. From a \sphinxcode{\sphinxupquote{TextLayout}}, an iterator over \sphinxcode{\sphinxupquote{TextSpans}} is returned so the engine can output raw editable text using as few spans as possible. If the engine would rather get individual characters, they can be obtained from the \sphinxcode{\sphinxupquote{TextSpan}} instance: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{class} \PYG{n+nc}{TextFont}\PYG{p}{(}\PYG{n}{TextFontBase}\PYG{p}{)}\PYG{p}{:} \PYG{k}{def} \PYG{n+nf}{\PYGZus{}\PYGZus{}init\PYGZus{}\PYGZus{}}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{font\PYGZus{}properties}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ Create a new object for rendering text using the given font properties.} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{k}{pass} \PYG{k}{def} \PYG{n+nf}{get\PYGZus{}layout}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{s}\PYG{p}{,} \PYG{n}{ha}\PYG{p}{,} \PYG{n}{va}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ Get the TextLayout for the given string in the given font and} \PYG{l+s+sd}{ the horizontal (left, center, right) and verticalalignment (top,} \PYG{l+s+sd}{ center, baseline, bottom)} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{k}{pass} \PYG{k}{class} \PYG{n+nc}{TextLayout}\PYG{p}{(}\PYG{n}{TextLayoutBase}\PYG{p}{)}\PYG{p}{:} \PYG{k}{def} \PYG{n+nf}{get\PYGZus{}metrics}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ Return the bounding box of the layout, anchored at (0, 0).} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{k}{pass} \PYG{k}{def} \PYG{n+nf}{get\PYGZus{}spans}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ Returns an iterator over the spans of different in the layout.} \PYG{l+s+sd}{ This is useful for backends that want to editable raw text as} \PYG{l+s+sd}{ individual lines. For rich text where the font may change,} \PYG{l+s+sd}{ each span of different font type will have its own span.} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{k}{pass} \PYG{k}{def} \PYG{n+nf}{get\PYGZus{}image}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ Returns a rasterized image of the text. Useful for raster backends,} \PYG{l+s+sd}{ like Agg.} \PYG{l+s+sd}{ In all likelihood, this will be overridden in the backend, as it can} \PYG{l+s+sd}{ be created from get\PYGZus{}layout(), but certain backends may want to} \PYG{l+s+sd}{ override it if their library provides it (as freetype does).} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{k}{pass} \PYG{k}{def} \PYG{n+nf}{get\PYGZus{}rectangles}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ Returns an iterator over the filled black rectangles in the layout.} \PYG{l+s+sd}{ Used by TeX and mathtext for drawing, for example, fraction lines.} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{k}{pass} \PYG{k}{def} \PYG{n+nf}{get\PYGZus{}path}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ Returns a single Path object of the entire laid out text.} \PYG{l+s+sd}{ [Not strictly necessary, but might be useful for textpath} \PYG{l+s+sd}{ functionality]} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{k}{pass} \PYG{k}{class} \PYG{n+nc}{TextSpan}\PYG{p}{(}\PYG{n}{TextSpanBase}\PYG{p}{)}\PYG{p}{:} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y} \PYG{c+c1}{\PYGZsh{} Position of the span \PYGZhy{}\PYGZhy{} relative to the text layout as a whole} \PYG{c+c1}{\PYGZsh{} where (0, 0) is the anchor. y is the baseline of the span.} \PYG{n}{fontfile} \PYG{c+c1}{\PYGZsh{} The font file to use for the span} \PYG{n}{text} \PYG{c+c1}{\PYGZsh{} The text content of the span} \PYG{k}{def} \PYG{n+nf}{get\PYGZus{}path}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{)}\PYG{p}{:} \PYG{k}{pass} \PYG{c+c1}{\PYGZsh{} See TextLayout.get\PYGZus{}path} \PYG{k}{def} \PYG{n+nf}{get\PYGZus{}chars}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ Returns an iterator over the characters in the span.} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{k}{pass} \PYG{k}{class} \PYG{n+nc}{TextChar}\PYG{p}{(}\PYG{n}{TextCharBase}\PYG{p}{)}\PYG{p}{:} \PYG{n}{x}\PYG{p}{,} \PYG{n}{y} \PYG{c+c1}{\PYGZsh{} Position of the character \PYGZhy{}\PYGZhy{} relative to the text layout as} \PYG{c+c1}{\PYGZsh{} a whole, where (0, 0) is the anchor. y is in the baseline} \PYG{c+c1}{\PYGZsh{} of the character.} \PYG{n}{codepoint} \PYG{c+c1}{\PYGZsh{} The unicode code point of the character \PYGZhy{}\PYGZhy{} only for informational} \PYG{c+c1}{\PYGZsh{} purposes, since the mapping of codepoint to glyph\PYGZus{}id may have been} \PYG{c+c1}{\PYGZsh{} handled in a complex way by the layout engine. This is an int} \PYG{c+c1}{\PYGZsh{} to avoid problems on narrow Unicode builds.} \PYG{n}{glyph\PYGZus{}id} \PYG{c+c1}{\PYGZsh{} The index of the glyph within the font} \PYG{n}{fontfile} \PYG{c+c1}{\PYGZsh{} The font file to use for the char} \PYG{k}{def} \PYG{n+nf}{get\PYGZus{}path}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{)}\PYG{p}{:} \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{l+s+sd}{ Get the path for the character.} \PYG{l+s+sd}{ \PYGZdq{}\PYGZdq{}\PYGZdq{}} \PYG{k}{pass} \end{sphinxVerbatim} Graphic backends that want to output subset of fonts would likely build up a file-global dictionary of characters where the keys are (fontname, glyph\_id) and the values are the paths so that only one copy of the path for each character will be stored in the file. Special casing: The “usetex” functionality currently is able to get Postscript directly from TeX to insert directly in a Postscript file, but for other backends, parses a DVI file and generates something more abstract. For a case like this, \sphinxcode{\sphinxupquote{TextLayout}} would implement \sphinxcode{\sphinxupquote{get\_spans}} for most backends, but add \sphinxcode{\sphinxupquote{get\_ps}} for the Postscript backend, which would look for the presence of this method and use it if available, or fall back to \sphinxcode{\sphinxupquote{get\_spans}}. This kind of special casing may also be necessary, for example, when the graphics backend and text engine belong to the same ecosystem, e.g. Cairo and Pango, or MacOSX and CoreText. There are three main pieces to the implementation: \begin{enumerate} \item {} Rewriting the freetype wrapper, and removing ttconv. \end{enumerate} \begin{enumerate} \item {} Once (1) is done, as a proof of concept, we can move to the upstream STIX .otf fonts \item {} Add support for web fonts loaded from a remote URL. (Enabled by using freetype for font subsetting). \end{enumerate} \begin{enumerate} \setcounter{enumi}{1} \item {} Refactoring the existing “builtin” and “usetex” code into separate text engines and to follow the API outlined above. \item {} Implementing support for advanced text layout libraries. \end{enumerate} (1) and (2) are fairly independent, though having (1) done first will allow (2) to be simpler. (3) is dependent on (1) and (2), but even if it doesn’t get done (or is postponed), completing (1) and (2) will make it easier to move forward with improving the “builtin” text engine. \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP14:backward-compatibility}} The layout of text with respect to its anchor and rotation will change in hopefully small, but improved, ways. The layout of multiline text will be much better, as it will respect horizontal alignment. The layout of bidirectional text or other advanced Unicode features will now work inherently, which may break some things if users are currently using their own workarounds. Fonts will be selected differently. Hacks that used to sort of work between the “builtin” and “usetex” text rendering engines may no longer work. Fonts found by the OS that weren’t previously found by matplotlib may be selected. \subsection{Alternatives} \label{\detokenize{devel/MEP/MEP14:alternatives}} TBD \section{MEP15 - Fix axis autoscaling when limits are specified for one axis only} \label{\detokenize{devel/MEP/MEP15:mep15-fix-axis-autoscaling-when-limits-are-specified-for-one-axis-only}}\label{\detokenize{devel/MEP/MEP15::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP15:id1}}{\hyperref[\detokenize{devel/MEP/MEP15:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP15:id2}}{\hyperref[\detokenize{devel/MEP/MEP15:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP15:id3}}{\hyperref[\detokenize{devel/MEP/MEP15:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP15:id4}}{\hyperref[\detokenize{devel/MEP/MEP15:detailed-description}]{\sphinxcrossref{Detailed description}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP15:id5}}{\hyperref[\detokenize{devel/MEP/MEP15:implementation}]{\sphinxcrossref{Implementation}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP15:id6}}{\hyperref[\detokenize{devel/MEP/MEP15:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP15:id7}}{\hyperref[\detokenize{devel/MEP/MEP15:alternatives}]{\sphinxcrossref{Alternatives}}} \end{itemize} \end{sphinxShadowBox} \subsection{Status} \label{\detokenize{devel/MEP/MEP15:status}} \sphinxstylestrong{Discussion} \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP15:branches-and-pull-requests}} None so far. \subsection{Abstract} \label{\detokenize{devel/MEP/MEP15:abstract}} When one axis of a 2-dimensional plot if overridden via \sphinxcode{\sphinxupquote{xlim}} or \sphinxcode{\sphinxupquote{ylim}}, automatic scaling of the remaining axis should be based on the data that falls within the specified limits of the first axis. \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP15:detailed-description}} When axis limits for a 2-D plot are specified for one axis only (via \sphinxcode{\sphinxupquote{xlim}} or \sphinxcode{\sphinxupquote{ylim}}), matplotlib currently does not currently rescale the other axis. The result is that the displayed curves or symbols may be compressed into a tiny portion of the available area, so that the final plot conveys much less information than it would with appropriate axis scaling. The proposed change of behavior would make matplotlib choose the scale for the remaining axis using only the data that falls within the limits for the axis where limits were specified. \subsection{Implementation} \label{\detokenize{devel/MEP/MEP15:implementation}} I don’t know enough about the internals of matplotlib to be able to suggest an implementation. \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP15:backward-compatibility}} From the standpoint of software interfaces, there would be no break in backward compatibility. Some outputs would be different, but if the user truly desires the previous behavior, he/she can achieve this by overriding the axis scaling for both axes. \subsection{Alternatives} \label{\detokenize{devel/MEP/MEP15:alternatives}} The only alternative that I can see is to maintain the status quo. \section{MEP19: Continuous Integration} \label{\detokenize{devel/MEP/MEP19:mep19-continuous-integration}}\label{\detokenize{devel/MEP/MEP19::doc}} \subsection{Status} \label{\detokenize{devel/MEP/MEP19:status}} \sphinxstylestrong{Completed} \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP19:branches-and-pull-requests}} \subsection{Abstract} \label{\detokenize{devel/MEP/MEP19:abstract}} matplotlib could benefit from better and more reliable continuous integration, both for testing and building installers and documentation. \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP19:detailed-description}} \subsubsection{Current state-of-the-art} \label{\detokenize{devel/MEP/MEP19:current-state-of-the-art}} \sphinxstylestrong{Testing} matplotlib currently uses Travis-CI for automated tests. While Travis-CI should be praised for how much it does as a free service, it has a number of shortcomings: \begin{itemize} \item {} It often fails due to network timeouts when installing dependencies. \item {} It often fails for inexplicable reasons. \item {} build or test products can only be saved from build off of branches on the main repo, not pull requests, so it is often difficult to “post mortem” analyse what went wrong. This is particularly frustrating when the failure can not be subsequently reproduced locally. \item {} It is not extremely fast. matplotlib’s cpu and memory requirements for testing are much higher than the average Python project. \item {} It only tests on Ubuntu Linux, and we have only minimal control over the specifics of the platform. It can be upgraded at any time outside of our control, causing unexpected delays at times that may not be convenient in our release schedule. \end{itemize} On the plus side, Travis-CI’s integration with github \textendash{} automatically testing all pending pull requests \textendash{} is exceptional. \sphinxstylestrong{Builds} There is no centralized effort for automated binary builds for matplotlib. However, the following disparate things are being done {[}If the authors mentioned here could fill in detail, that would be great!{]}: \begin{itemize} \item {} @sandrotosi: builds Debian packages \item {} @takluyver: Has automated Ubuntu builds on Launchpad \item {} @cgohlke: Makes Windows builds (don’t know how automated that is) \item {} @r-owen: Makes OS-X builds (don’t know how automated that is) \end{itemize} \sphinxstylestrong{Documentation} Documentation of master is now built by travis and uploaded to \sphinxurl{http://matplotlib.org/devdocs/index.html} @NelleV, I believe, generates the docs automatically and posts them on the web to chart MEP10 progress. \subsubsection{Peculiarities of matplotlib} \label{\detokenize{devel/MEP/MEP19:peculiarities-of-matplotlib}} matplotlib has complex requirements that make testing and building more taxing than many other Python projects. \begin{itemize} \item {} The CPU time to run the tests is quite high. It puts us beyond the free accounts of many CI services (e.g. ShiningPanda) \item {} It has a large number of dependencies, and testing the full matrix of all combinations is impractical. We need to be clever about what space we test and guarantee to support. \end{itemize} \subsubsection{Requirements} \label{\detokenize{devel/MEP/MEP19:requirements}} This section outlines the requirements that we would like to have. \begin{enumerate} \item {} Testing all pull requests by hooking into the Github API, as Travis-CI does \item {} Testing on all major platforms: Linux, Mac OS-X, MS Windows (in that order of priority, based on user survey) \item {} Retain the last n days worth of build and test products, to aid in post-mortem debugging. \item {} Automated nightly binary builds, so that users can test the bleeding edge without installing a complete compilation environment. \item {} Automated benchmarking. It would be nice to have a standard benchmark suite (separate from the tests) whose performance could be tracked over time, in different backends and platforms. While this is separate from building and testing, ideally it would run on the same infrastructure. \item {} Automated nightly building and publishing of documentation (or as part of testing, to ensure PRs don’t introduce documentation bugs). (This would not replace the static documentation for stable releases as a default). \item {} The test systems should be manageable by multiple developers, so that no single person becomes a bottleneck. (Travis-CI’s design does this well \textendash{} storing build configuration in the git repository, rather than elsewhere, is a very good design.) \item {} Make it easy to test a large but sparse matrix of different versions of matplotlib’s dependencies. The matplotlib user survey provides some good data as to where to focus our efforts: \sphinxurl{https://docs.google.com/spreadsheet/ccc?key=0AjrPjlTMRTwTdHpQS25pcTZIRWdqX0pNckNSU01sMHc\#gid=0} \item {} Nice to have: A decentralized design so that those with more obscure platforms can publish build results to a central dashboard. \end{enumerate} \subsection{Implementation} \label{\detokenize{devel/MEP/MEP19:implementation}} This part is yet-to-be-written. However, ideally, the implementation would be a third-party service, to avoid adding system administration to our already stretched time. As we have some donated funds, this service may be a paid one if it offers significant time-saving advantages over free offerings. \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP19:backward-compatibility}} Backward compatibility is not a major concern for this MEP. We will replace current tools and procedures with something better and throw out the old. \subsection{Alternatives} \label{\detokenize{devel/MEP/MEP19:alternatives}} \subsection{Hangout Notes} \label{\detokenize{devel/MEP/MEP19:hangout-notes}} \subsubsection{CI Infrastructure} \label{\detokenize{devel/MEP/MEP19:ci-infrastructure}}\begin{itemize} \item {} We like Travis and it will probably remain part of our arsenal in any event. The reliability issues are being looked into. \item {} Enable Amazon S3 uploads of testing products on Travis. This will help with post-mortem of failures (@mdboom is looking into this now). \item {} We want Mac coverage. The best bet is probably to push Travis to enable it for our project by paying them for a Pro account (since they don’t otherwise allow testing on both Linux and Mac). \item {} We want Windows coverage. Shining Panda is an option there. \item {} Investigate finding or building a tool that would collect and synthesize test results from a number of sources and post it to Github using the Github API. This may be of general use to the Scipy community. \item {} For both Windows and Mac, we should document (or better yet, script) the process of setting up the machine for a build, and how to build binaries and installers. This may require getting information from Russel Owen and Christoph Gohlke. This is a necessary step for doing automated builds, but would also be valuable for a number of other reasons. \end{itemize} \subsubsection{The test framework itself} \label{\detokenize{devel/MEP/MEP19:the-test-framework-itself}}\begin{itemize} \item {} We should investigate ways to make it take less time \begin{itemize} \item {} Eliminating redundant tests, if possible \item {} General performance improvements to matplotlib will help \end{itemize} \item {} We should be covering more things, particularly more backends \item {} We should have more unit tests, fewer integration tests, if possible \end{itemize} \section{MEP21: color and cm refactor} \label{\detokenize{devel/MEP/MEP21:mep21-color-and-cm-refactor}}\label{\detokenize{devel/MEP/MEP21::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP21:id1}}{\hyperref[\detokenize{devel/MEP/MEP21:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP21:id2}}{\hyperref[\detokenize{devel/MEP/MEP21:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP21:id3}}{\hyperref[\detokenize{devel/MEP/MEP21:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP21:id4}}{\hyperref[\detokenize{devel/MEP/MEP21:detailed-description}]{\sphinxcrossref{Detailed description}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP21:id5}}{\hyperref[\detokenize{devel/MEP/MEP21:implementation}]{\sphinxcrossref{Implementation}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP21:id6}}{\hyperref[\detokenize{devel/MEP/MEP21:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP21:id7}}{\hyperref[\detokenize{devel/MEP/MEP21:alternatives}]{\sphinxcrossref{Alternatives}}} \end{itemize} \end{sphinxShadowBox} \subsection{Status} \label{\detokenize{devel/MEP/MEP21:status}}\begin{itemize} \item {} \sphinxstylestrong{Discussion}: This MEP has not commenced yet, but here are some ongoing ideas which may become a part of this MEP: \end{itemize} \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP21:branches-and-pull-requests}} \subsection{Abstract} \label{\detokenize{devel/MEP/MEP21:abstract}}\begin{itemize} \item {} color \begin{itemize} \item {} tidy up the namespace \item {} Define a “Color” class \item {} make it easy to convert from one color type to another \sphinxcode{\sphinxupquote{{}`hex -\textgreater{} RGB{}`}}, \sphinxcode{\sphinxupquote{{}`RGB -\textgreater{} hex{}`}}, \sphinxcode{\sphinxupquote{{}`HSV -\textgreater{} RGB{}`}} etc. \item {} improve the construction of a colormap - the dictionary approach is archaic and overly complex (though incredibly powerful) \item {} make it possible to interpolate between two or more color types in different modes, especially useful for construction of colormaps in HSV space for instance \end{itemize} \item {} cm \begin{itemize} \item {} rename the module to something more descriptive - mappables? \end{itemize} \end{itemize} Overall, there are a lot of improvements that can be made with matplotlib color handling - managing backwards compatibility will be difficult as there are some badly named variables/modules which really shouldn’t exist - but a clear path and message for migration should be available, with a large amount of focus on this in the API changes documentation. \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP21:detailed-description}} \subsection{Implementation} \label{\detokenize{devel/MEP/MEP21:implementation}} \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP21:backward-compatibility}} \subsection{Alternatives} \label{\detokenize{devel/MEP/MEP21:alternatives}} \section{MEP22: Toolbar rewrite} \label{\detokenize{devel/MEP/MEP22:mep22-toolbar-rewrite}}\label{\detokenize{devel/MEP/MEP22::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP22:id1}}{\hyperref[\detokenize{devel/MEP/MEP22:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP22:id2}}{\hyperref[\detokenize{devel/MEP/MEP22:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP22:id3}}{\hyperref[\detokenize{devel/MEP/MEP22:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP22:id4}}{\hyperref[\detokenize{devel/MEP/MEP22:detailed-description}]{\sphinxcrossref{Detailed description}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP22:id5}}{\hyperref[\detokenize{devel/MEP/MEP22:implementation}]{\sphinxcrossref{Implementation}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP22:id6}}{\hyperref[\detokenize{devel/MEP/MEP22:toolbase-object}]{\sphinxcrossref{ToolBase(object)}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP22:id7}}{\hyperref[\detokenize{devel/MEP/MEP22:tooltogglebase-toolbase}]{\sphinxcrossref{ToolToggleBase(ToolBase)}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP22:id8}}{\hyperref[\detokenize{devel/MEP/MEP22:navigationbase}]{\sphinxcrossref{NavigationBase}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP22:id9}}{\hyperref[\detokenize{devel/MEP/MEP22:toolbarbase}]{\sphinxcrossref{ToolbarBase}}} \end{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP22:id10}}{\hyperref[\detokenize{devel/MEP/MEP22:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \end{itemize} \end{sphinxShadowBox} \subsection{Status} \label{\detokenize{devel/MEP/MEP22:status}} \sphinxstylestrong{Progress} \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP22:branches-and-pull-requests}}\begin{description} \item[{Previous work}] \leavevmode\begin{itemize} \item {} \sphinxurl{https://github.com/matplotlib/matplotlib/pull/1849} \item {} \sphinxurl{https://github.com/matplotlib/matplotlib/pull/2557} \item {} \sphinxurl{https://github.com/matplotlib/matplotlib/pull/2465} \end{itemize} \item[{Pull Requests:}] \leavevmode\begin{itemize} \item {} Removing the NavigationToolbar classes \sphinxurl{https://github.com/matplotlib/matplotlib/pull/2740} \sphinxstylestrong{CLOSED} \item {} Keeping the NavigationToolbar classes \sphinxurl{https://github.com/matplotlib/matplotlib/pull/2759} \sphinxstylestrong{CLOSED} \item {} Navigation by events: \sphinxurl{https://github.com/matplotlib/matplotlib/pull/3652} \end{itemize} \end{description} \subsection{Abstract} \label{\detokenize{devel/MEP/MEP22:abstract}} The main goal of this MEP is to make it easier to modify (add, change, remove) the way the user interacts with the figures. The user interaction with the figure is deeply integrated within the Canvas and Toolbar. Making extremely difficult to do any modification. This MEP proposes the separation of this interaction into Toolbar, Navigation and Tools to provide independent access and reconfiguration. This approach will make easier to create and share tools among users. In the far future, we can even foresee a kind of Marketplace for \sphinxcode{\sphinxupquote{Tools}} where the most popular can be added into the main distribution. \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP22:detailed-description}} The reconfiguration of the Toolbar is complex, most of the time it requires a custom backend. The creation of custom Tools sometimes interferes with the Toolbar, as example see \sphinxurl{https://github.com/matplotlib/matplotlib/issues/2694} also the shortcuts are hardcoded and again not easily modifiable \sphinxurl{https://github.com/matplotlib/matplotlib/issues/2699} The proposed solution is to take the actions out of the \sphinxcode{\sphinxupquote{Toolbar}} and the shortcuts out of the \sphinxcode{\sphinxupquote{Canvas}}. This actions and shortcuts will be in the form of \sphinxcode{\sphinxupquote{Tools}}. A new class \sphinxcode{\sphinxupquote{Navigation}} will be the bridge between the events from the \sphinxcode{\sphinxupquote{Canvas}} and \sphinxcode{\sphinxupquote{Toolbar}} and redirect them to the appropriate \sphinxcode{\sphinxupquote{Tool}}. At the end the user interaction will be divided into three classes: \begin{itemize} \item {} NavigationBase: This class is instantiated for each FigureManager and connect the all user interactions with the Tools \item {} ToolbarBase: This existing class is relegated only as a GUI access to Tools. \item {} ToolBase: Is the basic definition of Tools. \end{itemize} \subsection{Implementation} \label{\detokenize{devel/MEP/MEP22:implementation}} \subsubsection{ToolBase(object)} \label{\detokenize{devel/MEP/MEP22:toolbase-object}} Tools can have a graphical representation as the \sphinxcode{\sphinxupquote{SubplotTool}} or not even be present in the Toolbar as \sphinxcode{\sphinxupquote{Quit}} The \sphinxcode{\sphinxupquote{ToolBase}} has the following class attributes for configuration at definition time \begin{itemize} \item {} keymap = None: Key(s) to be used to trigger the tool \item {} description = ‘’: Small description of the tool \item {} image = None: Image that is used in the toolbar \end{itemize} \begin{description} \item[{The following instance attributes are set at instantiation:}] \leavevmode\begin{itemize} \item {} name \item {} navigation \end{itemize} \item[{\sphinxstylestrong{Methods}}] \leavevmode\begin{itemize} \item {} trigger(self, event): This is the main method of the Tool, it is called when the Tool is triggered by: * Toolbar button click * keypress associated with the Tool Keymap * Call to navigation.trigger\_tool(name) \item {} set\_figure(self, figure): Set the figure and navigation attributes \item {} \sphinxcode{\sphinxupquote{destroy(self, *args)}}: Destroy the \sphinxcode{\sphinxupquote{Tool}} graphical interface (if exists) \end{itemize} \item[{\sphinxstylestrong{Available Tools}}] \leavevmode\begin{itemize} \item {} ToolQuit \item {} ToolEnableAllNavigation \item {} ToolEnableNavigation \item {} ToolToggleGrid \item {} ToolToggleFullScreen \item {} ToolToggleYScale \item {} ToolToggleXScale \item {} ToolHome \item {} ToolBack \item {} ToolForward \item {} SaveFigureBase \item {} ConfigureSubplotsBase \end{itemize} \end{description} \subsubsection{ToolToggleBase(ToolBase)} \label{\detokenize{devel/MEP/MEP22:tooltogglebase-toolbase}} The \sphinxcode{\sphinxupquote{ToolToggleBase}} has the following class attributes for configuration at definition time \begin{itemize} \item {} radio\_group = None: Attribute to group ‘radio’ like tools (mutually exclusive) \item {} cursor = None: Cursor to use when the tool is active \end{itemize} The \sphinxstylestrong{Toggleable} Tools, can capture keypress, mouse moves, and mouse button press \begin{description} \item[{It defines the following methods}] \leavevmode\begin{itemize} \item {} enable(self, event): Called by \sphinxcode{\sphinxupquote{ToolToggleBase.trigger}} method \item {} disable(self, event): Called when the tool is untoggled \item {} toggled : \sphinxstylestrong{Property} True or False \end{itemize} \item[{\sphinxstylestrong{Available Tools}}] \leavevmode\begin{itemize} \item {} ToolZoom \item {} ToolPan \end{itemize} \end{description} \subsubsection{NavigationBase} \label{\detokenize{devel/MEP/MEP22:navigationbase}}\begin{description} \item[{Defines the following attributes}] \leavevmode\begin{itemize} \item {} canvas: \item {} \begin{description} \item[{keypresslock: Lock to know if the \sphinxcode{\sphinxupquote{canvas}} key\_press\_event{}` is}] \leavevmode available and process it \end{description} \item {} messagelock: Lock to know if the message is available to write \end{itemize} \item[{Public methods for \sphinxstylestrong{User use}:}] \leavevmode\begin{itemize} \item {} nav\_connect(self, s, func): Connect to to navigation for events \item {} nav\_disconnect(self, cid): Disconnect from navigation event \item {} message\_event(self, message, sender=None): Emit a tool\_message\_event event \item {} active\_toggle(self): \sphinxstylestrong{Property} The currently toggled tools or None \item {} get\_tool\_keymap(self, name): Return a list of keys that are associated with the tool \item {} set\_tool\_keymap(self, name, \sphinxcode{\sphinxupquote{*keys}}): Set the keys for the given tool \item {} remove\_tool(self, name): Removes tool from the navigation control. \item {} add\_tools(self, tools): Add multiple tools to \sphinxcode{\sphinxupquote{Navigation}} \item {} add\_tool(self, name, tool, group=None, position=None): Add a tool to the Navigation \item {} tool\_trigger\_event(self, name, sender=None, canvasevent=None, data=None): Trigger a tool and fire the event \item {} tools(self) \sphinxstylestrong{Property}: Return a dict with available tools with corresponding keymaps, descriptions and objects \item {} get\_tool(self, name): Return the tool object \end{itemize} \end{description} \subsubsection{ToolbarBase} \label{\detokenize{devel/MEP/MEP22:toolbarbase}}\begin{description} \item[{Methods for \sphinxstylestrong{Backend implementation}}] \leavevmode\begin{itemize} \item {} add\_toolitem(self, name, group, position, image, description, toggle): Add a toolitem to the toolbar. This method is a callback from \sphinxcode{\sphinxupquote{tool\_added\_event}} (emitted by navigation) \item {} set\_message(self, s): Display a message on toolbar or in status bar \item {} toggle\_toolitem(self, name): Toggle the toolitem without firing event. \item {} remove\_toolitem(self, name): Remove a toolitem from the \sphinxcode{\sphinxupquote{Toolbar}} \end{itemize} \end{description} \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP22:backward-compatibility}} For backward compatibility added a ‘navigation’ key to \sphinxcode{\sphinxupquote{rcsetup.validate\_toolbar}}, that is used for Navigation classes instantiation instead of the NavigationToolbar classes With this parameter, it makes it transparent to anyone using the existing backends. {[}@pelson comment: This also gives us an opportunity to avoid needing to implement all of this in the same PR - some backends can potentially exist without the new functionality for a short while (but it must be done at some point).{]} \section{MEP23: Multiple Figures per GUI window} \label{\detokenize{devel/MEP/MEP23:mep23-multiple-figures-per-gui-window}}\label{\detokenize{devel/MEP/MEP23::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP23:id1}}{\hyperref[\detokenize{devel/MEP/MEP23:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP23:id2}}{\hyperref[\detokenize{devel/MEP/MEP23:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP23:id3}}{\hyperref[\detokenize{devel/MEP/MEP23:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP23:id4}}{\hyperref[\detokenize{devel/MEP/MEP23:detailed-description}]{\sphinxcrossref{Detailed description}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP23:id5}}{\hyperref[\detokenize{devel/MEP/MEP23:implementation}]{\sphinxcrossref{Implementation}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP23:id6}}{\hyperref[\detokenize{devel/MEP/MEP23:figuremanagerbase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{FigureManagerBase}}}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP23:id7}}{\hyperref[\detokenize{devel/MEP/MEP23:new-figure-manager}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{new\_figure\_manager}}}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP23:id8}}{\hyperref[\detokenize{devel/MEP/MEP23:new-figure-manager-given-figure}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{new\_figure\_manager\_given\_figure}}}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP23:id9}}{\hyperref[\detokenize{devel/MEP/MEP23:navigationbase}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{NavigationBase}}}}} \end{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP23:id10}}{\hyperref[\detokenize{devel/MEP/MEP23:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP23:id11}}{\hyperref[\detokenize{devel/MEP/MEP23:alternatives}]{\sphinxcrossref{Alternatives}}} \end{itemize} \end{sphinxShadowBox} \subsection{Status} \label{\detokenize{devel/MEP/MEP23:status}} \sphinxstylestrong{Discussion} \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP23:branches-and-pull-requests}} \sphinxstylestrong{Previous work} - \sphinxurl{https://github.com/matplotlib/matplotlib/pull/2465} \sphinxstylestrong{To-delete} \subsection{Abstract} \label{\detokenize{devel/MEP/MEP23:abstract}} Add the possibility to have multiple figures grouped under the same \sphinxcode{\sphinxupquote{FigureManager}} \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP23:detailed-description}} Under the current structure, every canvas has its own window. This is and may continue to be the desired method of operation for most use cases. Sometimes when there are too many figures open at the same time, it is desirable to be able to group these under the same window {[}see{]}(\sphinxurl{https://github.com/matplotlib/matplotlib/issues/2194}). The proposed solution modifies \sphinxcode{\sphinxupquote{FigureManagerBase}} to contain and manage more than one \sphinxcode{\sphinxupquote{canvas}}. The settings parameter \sphinxcode{\sphinxupquote{rcParams{[}"backend.multifigure"{]}}} control when the \sphinxstylestrong{MultiFigure} behaviour is desired. \sphinxstylestrong{Note} It is important to note, that the proposed solution, assumes that the {[}MEP22{]}(\sphinxurl{https://github.com/matplotlib/matplotlib/wiki/Mep22}) is already in place. This is simply because the actual implementation of the \sphinxcode{\sphinxupquote{Toolbar}} makes it pretty hard to switch between canvases. \subsection{Implementation} \label{\detokenize{devel/MEP/MEP23:implementation}} The first implementation will be done in \sphinxcode{\sphinxupquote{GTK3}} using a Notebook as canvas container. \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{FigureManagerBase}}} \label{\detokenize{devel/MEP/MEP23:figuremanagerbase}} will add the following new methods \begin{itemize} \item {} \sphinxcode{\sphinxupquote{add\_canvas}}: To add a canvas to an existing \sphinxcode{\sphinxupquote{FigureManager}} object \item {} \sphinxcode{\sphinxupquote{remove\_canvas}}: To remove a canvas from a \sphinxcode{\sphinxupquote{FigureManager}} object, if it is the last one, it will be destroyed \item {} \sphinxcode{\sphinxupquote{move\_canvas}}: To move a canvas from one \sphinxcode{\sphinxupquote{FigureManager}} to another. \item {} \sphinxcode{\sphinxupquote{set\_canvas\_title}}: To change the title associated with a specific canvas container \item {} \sphinxcode{\sphinxupquote{get\_canvas\_title}}: To get the title associated with a specific canvas container \item {} \sphinxcode{\sphinxupquote{get\_active\_canvas}}: To get the canvas that is in the foreground and is subject to the gui events. There is no \sphinxcode{\sphinxupquote{set\_active\_canvas}} because the active canvas, is defined when \sphinxcode{\sphinxupquote{show}} is called on a \sphinxcode{\sphinxupquote{Canvas}} object. \end{itemize} \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{new\_figure\_manager}}} \label{\detokenize{devel/MEP/MEP23:new-figure-manager}} To control which \sphinxcode{\sphinxupquote{FigureManager}} will contain the new figures, an extra optional parameter \sphinxcode{\sphinxupquote{figuremanager}} will be added, this parameter value will be passed to \sphinxcode{\sphinxupquote{new\_figure\_manager\_given\_figure}} \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{new\_figure\_manager\_given\_figure}}} \label{\detokenize{devel/MEP/MEP23:new-figure-manager-given-figure}}\begin{itemize} \item {} If \sphinxcode{\sphinxupquote{figuremanager}} parameter is give, this \sphinxcode{\sphinxupquote{FigureManager}} object will be used instead of creating a new one. \item {} If \sphinxcode{\sphinxupquote{rcParams{[}'backend.multifigure'{]} == True}}: The last \sphinxcode{\sphinxupquote{FigureManager}} object will be used instead of creating a new one. \end{itemize} \subsubsection{\sphinxstyleliteralintitle{\sphinxupquote{NavigationBase}}} \label{\detokenize{devel/MEP/MEP23:navigationbase}} Modifies the \sphinxcode{\sphinxupquote{NavigationBase}} to keep a list of canvases, directing the actions to the active one \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP23:backward-compatibility}} For the \sphinxstylestrong{MultiFigure} properties to be visible, the user has to activate them directly setting \sphinxcode{\sphinxupquote{rcParams{[}'backend.multifigure'{]} = True}} It should be backwards compatible for backends that adhere to the current \sphinxcode{\sphinxupquote{FigureManagerBase}} structure even if they have not implemented the \sphinxstylestrong{MultiFigure} magic yet. \subsection{Alternatives} \label{\detokenize{devel/MEP/MEP23:alternatives}} Insted of modifying the \sphinxcode{\sphinxupquote{FigureManagerBase}} it could be possible to add a parallel class, that handles the cases where \sphinxcode{\sphinxupquote{rcParams{[}'backend.multifigure'{]} = True}}. This will warranty that there won’t be any problems with custom made backends, but also makes bigger the code, and more things to maintain. \section{MEP24: negative radius in polar plots} \label{\detokenize{devel/MEP/MEP24:mep24-negative-radius-in-polar-plots}}\label{\detokenize{devel/MEP/MEP24::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP24:id1}}{\hyperref[\detokenize{devel/MEP/MEP24:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP24:id2}}{\hyperref[\detokenize{devel/MEP/MEP24:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP24:id3}}{\hyperref[\detokenize{devel/MEP/MEP24:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP24:id4}}{\hyperref[\detokenize{devel/MEP/MEP24:detailed-description}]{\sphinxcrossref{Detailed description}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP24:id5}}{\hyperref[\detokenize{devel/MEP/MEP24:implementation}]{\sphinxcrossref{Implementation}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP24:id6}}{\hyperref[\detokenize{devel/MEP/MEP24:related-issues}]{\sphinxcrossref{Related Issues}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP24:id7}}{\hyperref[\detokenize{devel/MEP/MEP24:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP24:id8}}{\hyperref[\detokenize{devel/MEP/MEP24:alternatives}]{\sphinxcrossref{Alternatives}}} \end{itemize} \end{sphinxShadowBox} \subsection{Status} \label{\detokenize{devel/MEP/MEP24:status}} \sphinxstyleemphasis{Discussion} \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP24:branches-and-pull-requests}} None \subsection{Abstract} \label{\detokenize{devel/MEP/MEP24:abstract}} It is clear that polar plots need to be able to gracefully handle negative r values (not by clipping or reflection). \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP24:detailed-description}} One obvious application that we should support is bB plots (see \sphinxurl{https://github.com/matplotlib/matplotlib/issues/1730\#issuecomment-40815837}), but this seems more generally useful (for example growth rate as a function of angle). The assumption in the current code (as I understand it) is that the center of the graph is \sphinxcode{\sphinxupquote{r==0}}, however it would be good to be able to set the center to be at any \sphinxcode{\sphinxupquote{r}} (with any value less than the off set clipped). \subsection{Implementation} \label{\detokenize{devel/MEP/MEP24:implementation}} \subsection{Related Issues} \label{\detokenize{devel/MEP/MEP24:related-issues}} \#1730, \#1603, \#2203, \#2133 \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP24:backward-compatibility}} \subsection{Alternatives} \label{\detokenize{devel/MEP/MEP24:alternatives}} \section{MEP25: Serialization} \label{\detokenize{devel/MEP/MEP25:mep25-serialization}}\label{\detokenize{devel/MEP/MEP25::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP25:id1}}{\hyperref[\detokenize{devel/MEP/MEP25:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP25:id2}}{\hyperref[\detokenize{devel/MEP/MEP25:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP25:id3}}{\hyperref[\detokenize{devel/MEP/MEP25:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP25:id4}}{\hyperref[\detokenize{devel/MEP/MEP25:detailed-description}]{\sphinxcrossref{Detailed description}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP25:id5}}{\hyperref[\detokenize{devel/MEP/MEP25:examples}]{\sphinxcrossref{Examples}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP25:id6}}{\hyperref[\detokenize{devel/MEP/MEP25:implementation}]{\sphinxcrossref{Implementation}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP25:id7}}{\hyperref[\detokenize{devel/MEP/MEP25:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP25:id8}}{\hyperref[\detokenize{devel/MEP/MEP25:alternatives}]{\sphinxcrossref{Alternatives}}} \end{itemize} \end{sphinxShadowBox} \subsection{Status} \label{\detokenize{devel/MEP/MEP25:status}} \sphinxstylestrong{Discussion} \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP25:branches-and-pull-requests}}\begin{itemize} \item {} development branches: \item {} related pull requests: \end{itemize} \subsection{Abstract} \label{\detokenize{devel/MEP/MEP25:abstract}} This MEP aims at adding a serializable \sphinxcode{\sphinxupquote{Controller}} objects to act as an \sphinxcode{\sphinxupquote{Artist}} managers. Users would then communicate changes to an \sphinxcode{\sphinxupquote{Artist}} via a \sphinxcode{\sphinxupquote{Controller}}. In this way, functionality of the \sphinxcode{\sphinxupquote{Controller}} objects may be added incrementally since each \sphinxcode{\sphinxupquote{Artist}} is still responsible for drawing everything. The goal is to create an API that is usable both by graphing libraries requiring high-level descriptions of figures and libraries requiring low-level interpretations. \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP25:detailed-description}} Matplotlib is a core plotting engine with an API that many users already understand. It’s difficult/impossible for other graphing libraries to (1) get a complete figure description, (2) output raw data from the figure object as the user has provided it, (3) understand the semantics of the figure objects without heuristics, and (4) give matplotlib a complete figure description to visualize. In addition, because an \sphinxcode{\sphinxupquote{Artist}} has no conception of its own semantics within the figure, it’s difficult to interact with them in a natural way. In this sense, matplotlib will adopt a standard Model-View-Controller (MVC) framework. The \sphinxstyleemphasis{Model} will be the user defined data, style, and semantics. The \sphinxstyleemphasis{Views} are the ensemble of each individual \sphinxcode{\sphinxupquote{Artist}}, which are responsible for producing the final image based on the \sphinxstyleemphasis{model}. The \sphinxstyleemphasis{Controller} will be the \sphinxcode{\sphinxupquote{Controller}} object managing its set of \sphinxcode{\sphinxupquote{Artist}} objects. The \sphinxcode{\sphinxupquote{Controller}} must be able to export the information that it’s carrying about the figure on command, perhaps via a \sphinxcode{\sphinxupquote{to\_json}} method or similar. Because it would be extremely extraneous to duplicate all of the information in the model with the controller, only user-specified information (data + style) are explicitly kept. If a user wants more information (defaults) from the view/model, it should be able to query for it. \begin{itemize} \item {} This might be annoying to do, non-specified kwargs are pulled from the rcParams object which is in turn created from reading a user specified file and can be dynamically changed at run time. I suppose we could keep a dict of default defaults and compare against that. Not clear how this will interact with the style sheet {[}{[}MEP26{]}{]} - @tacaswell \end{itemize} Additional Notes: \begin{itemize} \item {} The \sphinxcode{\sphinxupquote{raw data}} does not necessarily need to be a \sphinxcode{\sphinxupquote{list}}, \sphinxcode{\sphinxupquote{ndarray}}, etc. Rather, it can more abstractly just have a method to yield data when needed. \item {} Because the \sphinxcode{\sphinxupquote{Controller}} will contain extra information that users may not want to keep around, it should \sphinxstyleemphasis{not} be created by default. You should be able to both (a) instantiate a \sphinxcode{\sphinxupquote{Controller}} with a figure and (b) build a figure with a \sphinxcode{\sphinxupquote{Controller}}. \end{itemize} Use Cases: \begin{itemize} \item {} Export all necessary informat \item {} Serializing a matplotlib figure, saving it, and being able to rerun later. \item {} Any other source sending an appropriately formatted representation to matplotlib to open \end{itemize} \subsection{Examples} \label{\detokenize{devel/MEP/MEP25:examples}} Here are some examples of what the controllers should be able to do. \begin{enumerate} \item {} Instantiate a matplotlib figure from a serialized representation (e.g., JSON): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{json} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{controllers} \PYG{k}{import} \PYG{n}{Controller} \PYG{k}{with} \PYG{n+nb}{open}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{my\PYGZus{}figure}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k}{as} \PYG{n}{f}\PYG{p}{:} \PYG{n}{o} \PYG{o}{=} \PYG{n}{json}\PYG{o}{.}\PYG{n}{load}\PYG{p}{(}\PYG{n}{f}\PYG{p}{)} \PYG{n}{c} \PYG{o}{=} \PYG{n}{Controller}\PYG{p}{(}\PYG{n}{o}\PYG{p}{)} \PYG{n}{fig} \PYG{o}{=} \PYG{n}{c}\PYG{o}{.}\PYG{n}{figure} \end{sphinxVerbatim} \item {} Manage artists from the controller (e.g., Line2D): \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{c+c1}{\PYGZsh{} not really sure how this should look} \PYG{n}{c}\PYG{o}{.}\PYG{n}{axes}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{lines}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{color} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{b}\PYG{l+s+s1}{\PYGZsq{}} \PYG{c+c1}{\PYGZsh{} ?} \end{sphinxVerbatim} \item {} Export serializable figure representation: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{o} \PYG{o}{=} \PYG{n}{c}\PYG{o}{.}\PYG{n}{to\PYGZus{}json}\PYG{p}{(}\PYG{p}{)} \PYG{c+c1}{\PYGZsh{} or... we should be able to throw a figure object in there too} \PYG{n}{o} \PYG{o}{=} \PYG{n}{Controller}\PYG{o}{.}\PYG{n}{to\PYGZus{}json}\PYG{p}{(}\PYG{n}{mpl\PYGZus{}fig}\PYG{p}{)} \end{sphinxVerbatim} \end{enumerate} \subsection{Implementation} \label{\detokenize{devel/MEP/MEP25:implementation}}\begin{enumerate} \item {} Create base \sphinxcode{\sphinxupquote{Controller}} objects that are able to manage \sphinxcode{\sphinxupquote{Artist}} objects (e.g., \sphinxcode{\sphinxupquote{Hist}}) \begin{quote} Comments: \begin{itemize} \item {} initialization should happen via unpacking \sphinxcode{\sphinxupquote{**}}, so we need a copy of call signature parameter for the \sphinxcode{\sphinxupquote{Artist}} we’re ultimately trying to control. Unfortunate hard-coded repetition… \item {} should the additional \sphinxcode{\sphinxupquote{**kwargs}} accepted by each \sphinxcode{\sphinxupquote{Artist}} be tracked at the \sphinxcode{\sphinxupquote{Controller}} \item {} how does a \sphinxcode{\sphinxupquote{Controller}} know which artist belongs where? E.g., do we need to pass \sphinxcode{\sphinxupquote{axes}} references? \end{itemize} Progress: \begin{itemize} \item {} A simple NB demonstrating some functionality for \sphinxcode{\sphinxupquote{Line2DController}} objects: \sphinxurl{https://nbviewer.jupyter.org/gist/theengineear/f0aa8d79f64325e767c0} \end{itemize} \end{quote} \item {} Write in protocols for the \sphinxcode{\sphinxupquote{Controller}} to \sphinxstyleemphasis{update} the model. \begin{quote} Comments: \begin{itemize} \item {} how should containers be dealt with? E.g., what happens to old patches when we re-bin a histogram? \item {} in the link from (1), the old line is completely destroyed and redrawn, what if something is referencing it? \end{itemize} \end{quote} \item {} Create method by which a json object can be assembled from the \sphinxcode{\sphinxupquote{Controllers}} \item {} Deal with serializing the unserializable aspects of a figure (e.g., non-affine transforms?) \item {} Be able to instantiate from a serialized representation \item {} Reimplement the existing pyplot and Axes method, e.g. \sphinxcode{\sphinxupquote{pyplot.hist}} and \sphinxcode{\sphinxupquote{Axes.hist}} in terms of the new controller class. \end{enumerate} \textgreater{} @theengineer: in \#2 above, what do you mean by \sphinxstyleemphasis{get updates} from each \sphinxcode{\sphinxupquote{Artist}}? \textasciicircum{} Yup. The \sphinxcode{\sphinxupquote{Controller}} \sphinxstyleemphasis{shouldn’t} need to get updated. This just happens in \#3. Delete comments when you see this. \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP25:backward-compatibility}}\begin{itemize} \item {} pickling will change \item {} non-affine transformations will require a defined pickling method \end{itemize} \subsection{Alternatives} \label{\detokenize{devel/MEP/MEP25:alternatives}} PR \#3150 suggested adding semantics by parasitically attaching extra containers to axes objects. This is a more complete solution with what should be a more developed/flexible/powerful framework. \section{MEP26: Artist styling} \label{\detokenize{devel/MEP/MEP26:mep26-artist-styling}}\label{\detokenize{devel/MEP/MEP26::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP26:id1}}{\hyperref[\detokenize{devel/MEP/MEP26:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP26:id2}}{\hyperref[\detokenize{devel/MEP/MEP26:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP26:id3}}{\hyperref[\detokenize{devel/MEP/MEP26:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP26:id4}}{\hyperref[\detokenize{devel/MEP/MEP26:detailed-description}]{\sphinxcrossref{Detailed description}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP26:id5}}{\hyperref[\detokenize{devel/MEP/MEP26:implementation}]{\sphinxcrossref{Implementation}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP26:id6}}{\hyperref[\detokenize{devel/MEP/MEP26:bnf-grammar}]{\sphinxcrossref{BNF Grammar}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP26:id7}}{\hyperref[\detokenize{devel/MEP/MEP26:syntax}]{\sphinxcrossref{Syntax}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP26:id8}}{\hyperref[\detokenize{devel/MEP/MEP26:selectors}]{\sphinxcrossref{Selectors}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP26:id9}}{\hyperref[\detokenize{devel/MEP/MEP26:gid-selector}]{\sphinxcrossref{GID selector}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP26:id10}}{\hyperref[\detokenize{devel/MEP/MEP26:attributes-and-values}]{\sphinxcrossref{Attributes and values}}} \end{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP26:id11}}{\hyperref[\detokenize{devel/MEP/MEP26:parsing}]{\sphinxcrossref{Parsing}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP26:id12}}{\hyperref[\detokenize{devel/MEP/MEP26:visitor-pattern-for-matplotlib-figure}]{\sphinxcrossref{Visitor pattern for matplotlib figure}}} \end{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP26:id13}}{\hyperref[\detokenize{devel/MEP/MEP26:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP26:id14}}{\hyperref[\detokenize{devel/MEP/MEP26:alternatives}]{\sphinxcrossref{Alternatives}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP26:id15}}{\hyperref[\detokenize{devel/MEP/MEP26:appendix}]{\sphinxcrossref{Appendix}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP26:id16}}{\hyperref[\detokenize{devel/MEP/MEP26:matplotlib-primitives}]{\sphinxcrossref{Matplotlib primitives}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \subsection{Status} \label{\detokenize{devel/MEP/MEP26:status}} \sphinxstylestrong{Rejected} \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP26:branches-and-pull-requests}} \subsection{Abstract} \label{\detokenize{devel/MEP/MEP26:abstract}} This MEP proposes a new stylesheet implementation to allow more comprehensive and dynamic styling of artists. The current version of matplotlib (1.4.0) allows stylesheets based on the rcParams syntax to be applied before creation of a plot. The methodology below proposes a new syntax, based on CSS, which would allow styling of individual artists and properties, which can be applied dynamically to existing objects. This is related to (and makes steps toward) the overall goal of moving to a DOM/tree-like architecture. \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP26:detailed-description}} Currently, the look and appearance of existing artist objects (figure, axes, Line2D etc…) can only be updated via \sphinxcode{\sphinxupquote{set\_}} and \sphinxcode{\sphinxupquote{get\_}} methods on the artist object, which is quite laborious, especially if no reference to the artist(s) has been stored. The new style sheets introduced in 1.4 allow styling before a plot is created, but do not offer any means to dynamically update plots or distinguish between artists of the same type (i.e. to specify the \sphinxcode{\sphinxupquote{line color}} and \sphinxcode{\sphinxupquote{line style}} separately for differing \sphinxcode{\sphinxupquote{Line2D}} objects). The initial development should concentrate on allowing styling of artist primitives (those \sphinxcode{\sphinxupquote{artists}} that do not contain other \sphinxcode{\sphinxupquote{artists}}), and further development could expand the CSS syntax rules and parser to allow more complex styling. See the appendix for a list of primitives. The new methodology would require development of a number of steps: \begin{itemize} \item {} A new stylesheet syntax (likely based on CSS) to allow selection of artists by type, class, id etc… \item {} A mechanism by which to parse a stylesheet into a tree \item {} A mechanism by which to translate the parse-tree into something which can be used to update the properties of relevant artists. Ideally this would implement a method by which to traverse the artists in a tree-like structure. \item {} A mechanism by which to generate a stylesheet from existing artist properties. This would be useful to allow a user to export a stylesheet from an existing figure (where the appearance may have been set using the matplotlib API)… \end{itemize} \subsection{Implementation} \label{\detokenize{devel/MEP/MEP26:implementation}} It will be easiest to allow a ‘3rd party’ to modify/set the style of an artist if the ‘style’ is created as a separate class and store against the artist as a property. The \sphinxcode{\sphinxupquote{GraphicsContext}} class already provides a the basis of a \sphinxcode{\sphinxupquote{Style}} class and an artists \sphinxcode{\sphinxupquote{draw}} method can be refactored to use the \sphinxcode{\sphinxupquote{Style}} class rather than setting up it’s own \sphinxcode{\sphinxupquote{GraphicsContext}} and transferring it’s style-related properties to it. A minimal example of how this could be implemented is shown here: \sphinxurl{https://github.com/JamesRamm/mpl\_experiment} IMO, this will also make the API and code base much neater as individual get/set methods for artist style properties are now redundant… Indirectly related would be a general drive to replace get/set methods with properties. Implementing the style class with properties would be a big stride toward this… For initial development, I suggest developing a syntax based on a much (much much) simplified version of CSS. I am in favour of dubbing this Artist Style Sheets :+1: : \subsubsection{BNF Grammar} \label{\detokenize{devel/MEP/MEP26:bnf-grammar}} I propose a very simple syntax to implement initially (like a proof of concept), which can be expanded upon in the future. The BNF form of the syntax is given below and then explained \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{RuleSet} \PYG{p}{:}\PYG{p}{:}\PYG{o}{=} \PYG{n}{SelectorSequence} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZob{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{n}{Declaration}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZcb{}}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{SelectorSequence} \PYG{p}{:}\PYG{p}{:} \PYG{o}{=} \PYG{n}{Selector} \PYG{p}{\PYGZob{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{,}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{Selector}\PYG{p}{\PYGZcb{}} \PYG{n}{Declaration} \PYG{p}{:}\PYG{p}{:}\PYG{o}{=} \PYG{n}{propName}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{:}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{propValue}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{;}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{Selector} \PYG{p}{:}\PYG{p}{:}\PYG{o}{=} \PYG{n}{ArtistIdent}\PYG{p}{\PYGZob{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZsh{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{n}{Ident}\PYG{p}{\PYGZcb{}} \PYG{n}{propName} \PYG{p}{:}\PYG{p}{:}\PYG{o}{=} \PYG{n}{Ident} \PYG{n}{propValue} \PYG{p}{:}\PYG{p}{:}\PYG{o}{=} \PYG{n}{Ident} \PYG{o}{\textbar{}} \PYG{n}{Number} \PYG{o}{\textbar{}} \PYG{n}{Colour} \PYG{o}{\textbar{}} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{None}\PYG{l+s+s2}{\PYGZdq{}} \end{sphinxVerbatim} \sphinxcode{\sphinxupquote{ArtistIdent}}, \sphinxcode{\sphinxupquote{Ident}}, \sphinxcode{\sphinxupquote{Number}} and \sphinxcode{\sphinxupquote{Colour}} are tokens (the basic building blocks of the expression) which are defined by regular expressions. \subsubsection{Syntax} \label{\detokenize{devel/MEP/MEP26:syntax}} A CSS stylesheet consists of a series of \sphinxstylestrong{rule sets} in hierarchical order (rules are applied from top to bottom). Each rule follows the syntax \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{selector} \PYG{p}{\PYGZob{}}\PYG{n}{attribute}\PYG{p}{:} \PYG{n}{value}\PYG{p}{;}\PYG{p}{\PYGZcb{}} \end{sphinxVerbatim} Each rule can have any number of \sphinxcode{\sphinxupquote{attribute}}: \sphinxcode{\sphinxupquote{value}} pairs, and a stylesheet can have any number of rules. The initial syntax is designed only for \sphinxcode{\sphinxupquote{artist}} primitives. It does not address the question of how to set properties on \sphinxcode{\sphinxupquote{container}} types (whose properties may themselves be \sphinxcode{\sphinxupquote{artists}} with settable properties), however, a future solution to this could simply be nested \sphinxcode{\sphinxupquote{RuleSet}} s \paragraph{Selectors} \label{\detokenize{devel/MEP/MEP26:selectors}} Selectors define the object to which the attribute updates should be applied. As a starting point, I propose just 2 selectors to use in initial development: Artist Type Selector Select an \sphinxcode{\sphinxupquote{artist}} by it’s type. E.g \sphinxcode{\sphinxupquote{Line2D}} or \sphinxcode{\sphinxupquote{Text}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{Line2D} \PYG{p}{\PYGZob{}}\PYG{n}{attribute}\PYG{p}{:} \PYG{n}{value}\PYG{p}{\PYGZcb{}} \end{sphinxVerbatim} The regex for matching the artist type selector (\sphinxcode{\sphinxupquote{ArtistIdent}} in the BNF grammar) would be: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{ArtistIdent} \PYG{o}{=} \PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{(?P\PYGZlt{}ArtistIdent\PYGZgt{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{bLine2D}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{b\textbar{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{bText}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{b\textbar{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{bAxesImage}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{b\textbar{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{bFigureImage}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{b\textbar{}}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{bPatch}\PYG{l+s+s1}{\PYGZbs{}}\PYG{l+s+s1}{b)}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} \paragraph{GID selector} \label{\detokenize{devel/MEP/MEP26:gid-selector}} Select an \sphinxcode{\sphinxupquote{artist}} by its \sphinxcode{\sphinxupquote{gid}}: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{Line2D}\PYG{c+c1}{\PYGZsh{}myGID \PYGZob{}attribute: value\PYGZcb{}} \end{sphinxVerbatim} A \sphinxcode{\sphinxupquote{gid}} can be any string, so the regex could be as follows: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{Ident} \PYG{o}{=} \PYG{l+s+sa}{r}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{(?P\PYGZlt{}Ident\PYGZgt{}[a\PYGZhy{}zA\PYGZhy{}Z\PYGZus{}][a\PYGZhy{}zA\PYGZhy{}Z\PYGZus{}0\PYGZhy{}9]*)}\PYG{l+s+s1}{\PYGZsq{}} \end{sphinxVerbatim} The above selectors roughly correspond to their CSS counterparts (\sphinxurl{http://www.w3.org/TR/CSS21/selector.html}) \paragraph{Attributes and values} \label{\detokenize{devel/MEP/MEP26:attributes-and-values}}\begin{itemize} \item {} \sphinxcode{\sphinxupquote{Attributes}} are any valid (settable) property for the \sphinxcode{\sphinxupquote{artist}} in question. \item {} \sphinxcode{\sphinxupquote{Values}} are any valid value for the property (Usually a string, or number). \end{itemize} \subsubsection{Parsing} \label{\detokenize{devel/MEP/MEP26:parsing}} Parsing would consist of breaking the stylesheet into tokens (the python cookbook gives a nice tokenizing recipe on page 66), applying the syntax rules and constructing a \sphinxcode{\sphinxupquote{Tree}}. This requires defining the grammar of the stylesheet (again, we can borrow from CSS) and writing a parser. Happily, there is a recipe for this in the python cookbook aswell. \subsubsection{Visitor pattern for matplotlib figure} \label{\detokenize{devel/MEP/MEP26:visitor-pattern-for-matplotlib-figure}} In order to apply the stylesheet rules to the relevant artists, we need to ‘visit’ each artist in a figure and apply the relevant rule. Here is a visitor class (again, thanks to python cookbook), where each \sphinxcode{\sphinxupquote{node}} would be an artist in the figure. A \sphinxcode{\sphinxupquote{visit\_}} method would need to be implemented for each mpl artist, to handle the different properties for each \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{class} \PYG{n+nc}{Visitor}\PYG{p}{:} \PYG{k}{def} \PYG{n+nf}{visit}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{node}\PYG{p}{)}\PYG{p}{:} \PYG{n}{name} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{visit\PYGZus{}}\PYG{l+s+s1}{\PYGZsq{}} \PYG{o}{+} \PYG{n+nb}{type}\PYG{p}{(}\PYG{n}{node}\PYG{p}{)}\PYG{o}{.}\PYG{n+nv+vm}{\PYGZus{}\PYGZus{}name\PYGZus{}\PYGZus{}} \PYG{n}{meth} \PYG{o}{=} \PYG{n+nb}{getattr}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{,} \PYG{n}{name}\PYG{p}{,} \PYG{k+kc}{None}\PYG{p}{)} \PYG{k}{if} \PYG{n}{meth} \PYG{o+ow}{is} \PYG{k+kc}{None}\PYG{p}{:} \PYG{k}{raise} \PYG{n+ne}{NotImplementedError} \PYG{k}{return} \PYG{n}{meth}\PYG{p}{(}\PYG{n}{node}\PYG{p}{)} \end{sphinxVerbatim} An \sphinxcode{\sphinxupquote{evaluator}} class would then take the stylesheet rules and implement the visitor on each one of them. \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP26:backward-compatibility}} Implementing a separate \sphinxcode{\sphinxupquote{Style}} class would break backward compatibility as many get/set methods on an artist would become redundant. While it would be possible to alter these methods to hook into the \sphinxcode{\sphinxupquote{Style}} class (stored as a property against the artist), I would be in favor of simply removing them to both neaten/simplify the codebase and to provide a simple, uncluttered API… \subsection{Alternatives} \label{\detokenize{devel/MEP/MEP26:alternatives}} No alternatives, but some of the ground covered here overlaps with MEP25, which may assist in this development \subsection{Appendix} \label{\detokenize{devel/MEP/MEP26:appendix}} \subsubsection{Matplotlib primitives} \label{\detokenize{devel/MEP/MEP26:matplotlib-primitives}} This will form the initial selectors which stylesheets can use. \begin{itemize} \item {} Line2D \item {} Text \item {} AxesImage \item {} FigureImage \item {} Patch \end{itemize} \section{MEP27: decouple pyplot from backends} \label{\detokenize{devel/MEP/MEP27:mep27-decouple-pyplot-from-backends}}\label{\detokenize{devel/MEP/MEP27::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP27:id1}}{\hyperref[\detokenize{devel/MEP/MEP27:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP27:id2}}{\hyperref[\detokenize{devel/MEP/MEP27:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP27:id3}}{\hyperref[\detokenize{devel/MEP/MEP27:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP27:id4}}{\hyperref[\detokenize{devel/MEP/MEP27:detailed-description}]{\sphinxcrossref{Detailed description}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP27:id5}}{\hyperref[\detokenize{devel/MEP/MEP27:implementation}]{\sphinxcrossref{Implementation}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP27:id6}}{\hyperref[\detokenize{devel/MEP/MEP27:future-compatibility}]{\sphinxcrossref{Future compatibility}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP27:id7}}{\hyperref[\detokenize{devel/MEP/MEP27:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP27:id8}}{\hyperref[\detokenize{devel/MEP/MEP27:alternatives}]{\sphinxcrossref{Alternatives}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP27:id9}}{\hyperref[\detokenize{devel/MEP/MEP27:questions}]{\sphinxcrossref{Questions}}} \end{itemize} \end{sphinxShadowBox} \subsection{Status} \label{\detokenize{devel/MEP/MEP27:status}} \sphinxstylestrong{Progress} \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP27:branches-and-pull-requests}} Main PR (including GTK3): + \sphinxurl{https://github.com/matplotlib/matplotlib/pull/4143} Backend specific branch diffs: + \sphinxhref{https://github.com/OceanWolf/matplotlib/compare/backend-refactor...OceanWolf:backend-refactor-tkagg}{https://github.com/OceanWolf/matplotlib/compare/backend-refactor…OceanWolf:backend-refactor-tkagg} + \sphinxhref{https://github.com/OceanWolf/matplotlib/compare/backend-refactor...OceanWolf:backend-refactor-qt}{https://github.com/OceanWolf/matplotlib/compare/backend-refactor…OceanWolf:backend-refactor-qt} + \sphinxhref{https://github.com/OceanWolf/matplotlib/compare/backend-refactor...backend-refactor-wx}{https://github.com/OceanWolf/matplotlib/compare/backend-refactor…backend-refactor-wx} \subsection{Abstract} \label{\detokenize{devel/MEP/MEP27:abstract}} This MEP refactors the backends to give a more structured and consistent API, removing generic code and consolidate existing code. To do this we propose splitting: \begin{enumerate} \item {} \sphinxcode{\sphinxupquote{FigureManagerBase}} and its derived classes into the core functionality class \sphinxcode{\sphinxupquote{FigureManager}} and a backend specific class \sphinxcode{\sphinxupquote{WindowBase}} and \item {} \sphinxcode{\sphinxupquote{ShowBase}} and its derived classes into \sphinxcode{\sphinxupquote{Gcf.show\_all}} and \sphinxcode{\sphinxupquote{MainLoopBase}}. \end{enumerate} \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP27:detailed-description}} This MEP aims to consolidate the backends API into one single uniform API, removing generic code out of the backend (which includes \sphinxcode{\sphinxupquote{\_pylab\_helpers}} and \sphinxcode{\sphinxupquote{Gcf}}), and push code to a more appropriate level in matplotlib. With this we automatically remove inconsistencies that appear in the backends, such as \sphinxcode{\sphinxupquote{FigureManagerBase.resize(w, h)}} which sometimes sets the canvas, and other times set the entire window to the dimensions given, depending on the backend. Two main places for generic code appear in the classes derived from \sphinxcode{\sphinxupquote{FigureManagerBase}} and \sphinxcode{\sphinxupquote{ShowBase}}. \begin{enumerate} \item {} \sphinxcode{\sphinxupquote{FigureManagerBase}} has \sphinxstylestrong{three} jobs at the moment: \begin{enumerate} \item {} The documentation describes it as a \sphinxstyleemphasis{{}`{}`Helper class for pyplot mode, wraps everything up into a neat bundle’‘} \item {} But it doesn’t just wrap the canvas and toolbar, it also does all of the windowing tasks itself. The conflation of these two tasks gets seen the best in the following line: \sphinxcode{\sphinxupquote{{}`python self.set\_window\_title("Figure \%d" \% num) {}`}} This combines backend specific code \sphinxcode{\sphinxupquote{self.set\_window\_title(title)}} with matplotlib generic code \sphinxcode{\sphinxupquote{title = "Figure \%d" \% num}}. \item {} Currently the backend specific subclass of \sphinxcode{\sphinxupquote{FigureManager}} decides when to end the mainloop. This also seems very wrong as the figure should have no control over the other figures. \end{enumerate} \item {} \sphinxcode{\sphinxupquote{ShowBase}} has two jobs: \begin{enumerate} \item {} It has the job of going through all figure managers registered in \sphinxcode{\sphinxupquote{\_pylab\_helpers.Gcf}} and telling them to show themselves. \item {} And secondly it has the job of performing the backend specific \sphinxcode{\sphinxupquote{mainloop}} to block the main programme and thus keep the figures from dying. \end{enumerate} \end{enumerate} \subsection{Implementation} \label{\detokenize{devel/MEP/MEP27:implementation}} The description of this MEP gives us most of the solution: \begin{enumerate} \item {} To remove the windowing aspect out of \sphinxcode{\sphinxupquote{FigureManagerBase}} letting it simply wrap this new class along with the other backend classes. Create a new \sphinxcode{\sphinxupquote{WindowBase}} class that can handle this functionality, with pass-through methods (:arrow\_right:) to \sphinxcode{\sphinxupquote{WindowBase}}. Classes that subclass \sphinxcode{\sphinxupquote{WindowBase}} should also subclass the GUI specific window class to ensure backward compatibility (\sphinxcode{\sphinxupquote{manager.window == manager.window}}). \item {} Refactor the mainloop of \sphinxcode{\sphinxupquote{ShowBase}} into \sphinxcode{\sphinxupquote{MainLoopBase}}, which encapsulates the end of the loop as well. We give an instance of \sphinxcode{\sphinxupquote{MainLoop}} to \sphinxcode{\sphinxupquote{FigureManager}} as a key unlock the exit method (requiring all keys returned before the loop can die). Note this opens the possibility for multiple backends to run concurrently. \item {} Now that \sphinxcode{\sphinxupquote{FigureManagerBase}} has no backend specifics in it, to rename it to \sphinxcode{\sphinxupquote{FigureManager}}, and move to a new file \sphinxcode{\sphinxupquote{backend\_managers.py}} noting that: \begin{enumerate} \item {} This allows us to break up the conversion of backends into separate PRs as we can keep the existing \sphinxcode{\sphinxupquote{FigureManagerBase}} class and its dependencies intact. \item {} and this also anticipates MEP22 where the new \sphinxcode{\sphinxupquote{NavigationBase}} has morphed into a backend independent \sphinxcode{\sphinxupquote{ToolManager}}. \end{enumerate} \end{enumerate} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|T|} \hline \sphinxstyletheadfamily FigureManagerBase(canvas, num) &\sphinxstyletheadfamily FigureManager(figure, num) &\sphinxstyletheadfamily \sphinxcode{\sphinxupquote{WindowBase(title)}} &\sphinxstyletheadfamily Notes \\ \hline show && show &\\ \hline destroy & calls destroy on all components & destroy &\\ \hline full\_screen\_toggle & handles logic & set\_fullscreen &\\ \hline resize && resize &\\ \hline key\_press & key\_press &&\\ \hline get\_window\_title && get\_window\_title &\\ \hline set\_window\_title && set\_window\_title &\\ \hline& \_get\_toolbar && A common method to all subclasses of FigureManagerBase \\ \hline&& set\_default\_size &\\ \hline&& add\_element\_to\_window &\\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily ShowBase &\sphinxstyletheadfamily MainLoopBase &\sphinxstyletheadfamily Notes \\ \hline mainloop & begin &\\ \hline& end & Gets called automagically when no more instances of the subclass exist \\ \hline \_\_call\_\_ && Method moved to Gcf.show\_all \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \subsection{Future compatibility} \label{\detokenize{devel/MEP/MEP27:future-compatibility}} As eluded to above when discussing MEP 22, this refactor makes it easy to add in new generic features. At the moment, MEP 22 has to make ugly hacks to each class extending from \sphinxcode{\sphinxupquote{FigureManagerBase}}. With this code, this only needs to get made in the single \sphinxcode{\sphinxupquote{FigureManager}} class. This also makes the later deprecation of \sphinxcode{\sphinxupquote{NavigationToolbar2}} very straightforward, only needing to touch the single \sphinxcode{\sphinxupquote{FigureManager}} class MEP 23 makes for another use case where this refactored code will come in very handy. \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP27:backward-compatibility}} As we leave all backend code intact, only adding missing methods to existing classes, this should work seamlessly for all use cases. The only difference will lie for backends that used \sphinxcode{\sphinxupquote{FigureManager.resize}} to resize the canvas and not the window, due to the standardisation of the API. I would envision that the classes made obsolete by this refactor get deprecated and removed on the same timetable as \sphinxcode{\sphinxupquote{NavigationToolbar2}}, also note that the change in call signature to the \sphinxcode{\sphinxupquote{FigureCanvasWx}} constructor, while backward compatible, I think the old (imho ugly style) signature should get deprecated and removed in the same manner as everything else. \begin{savenotes}\sphinxattablestart \centering \begin{tabulary}{\linewidth}[t]{|T|T|T|} \hline \sphinxstyletheadfamily backend &\sphinxstyletheadfamily manager.resize(w,h) &\sphinxstyletheadfamily Extra \\ \hline gtk3 & window &\\ \hline Tk & canvas &\\ \hline Qt & window &\\ \hline Wx & canvas & FigureManagerWx had \sphinxcode{\sphinxupquote{frame}} as an alias to window, so this also breaks BC. \\ \hline \end{tabulary} \par \sphinxattableend\end{savenotes} \subsection{Alternatives} \label{\detokenize{devel/MEP/MEP27:alternatives}} If there were any alternative solutions to solving the same problem, they should be discussed here, along with a justification for the chosen approach. \subsection{Questions} \label{\detokenize{devel/MEP/MEP27:questions}} Mdehoon: Can you elaborate on how to run multiple backends concurrently? OceanWolf: @mdehoon, as I say, not for this MEP, but I see this MEP opens it up as a future possibility. Basically the \sphinxcode{\sphinxupquote{MainLoopBase}} class acts a per backend Gcf, in this MEP it tracks the number of figures open per backend, and manages the mainloops for those backends. It closes the backend specific mainloop when it detects that no figures remain open for that backend. Because of this I imagine that with only a small amount of tweaking that we can do full-multi-backend matplotlib. No idea yet why one would want to, but I leave the possibility there in MainLoopBase. With all the backend-code specifics refactored out of \sphinxcode{\sphinxupquote{FigureManager}} also aids in this, one manager to rule them (the backends) all. Mdehoon: @OceanWolf, OK, thanks for the explanation. Having a uniform API for the backends is very important for the maintainability of matplotlib. I think this MEP is a step in the right direction. \section{MEP28: Remove Complexity from Axes.boxplot} \label{\detokenize{devel/MEP/MEP28:mep28-remove-complexity-from-axes-boxplot}}\label{\detokenize{devel/MEP/MEP28::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP28:id1}}{\hyperref[\detokenize{devel/MEP/MEP28:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP28:id2}}{\hyperref[\detokenize{devel/MEP/MEP28:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP28:id3}}{\hyperref[\detokenize{devel/MEP/MEP28:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP28:id4}}{\hyperref[\detokenize{devel/MEP/MEP28:detailed-description}]{\sphinxcrossref{Detailed description}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP28:id5}}{\hyperref[\detokenize{devel/MEP/MEP28:importance}]{\sphinxcrossref{Importance}}} \end{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP28:id6}}{\hyperref[\detokenize{devel/MEP/MEP28:implementation}]{\sphinxcrossref{Implementation}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP28:id7}}{\hyperref[\detokenize{devel/MEP/MEP28:passing-transform-functions-to-cbook-boxplots-stats}]{\sphinxcrossref{Passing transform functions to \sphinxcode{\sphinxupquote{cbook.boxplots\_stats}}}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP28:id8}}{\hyperref[\detokenize{devel/MEP/MEP28:simplifications-to-the-axes-boxplot-api-and-other-functions}]{\sphinxcrossref{Simplifications to the \sphinxcode{\sphinxupquote{Axes.boxplot}} API and other functions}}} \end{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP28:id9}}{\hyperref[\detokenize{devel/MEP/MEP28:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP28:id10}}{\hyperref[\detokenize{devel/MEP/MEP28:schedule}]{\sphinxcrossref{Schedule}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP28:id11}}{\hyperref[\detokenize{devel/MEP/MEP28:anticipated-impacts-to-users}]{\sphinxcrossref{Anticipated Impacts to Users}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP28:id12}}{\hyperref[\detokenize{devel/MEP/MEP28:anticipated-impacts-to-downstream-libraries}]{\sphinxcrossref{Anticipated Impacts to Downstream Libraries}}} \end{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP28:id13}}{\hyperref[\detokenize{devel/MEP/MEP28:alternatives}]{\sphinxcrossref{Alternatives}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP28:id14}}{\hyperref[\detokenize{devel/MEP/MEP28:variations-on-the-theme}]{\sphinxcrossref{Variations on the theme}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP28:id15}}{\hyperref[\detokenize{devel/MEP/MEP28:doing-less}]{\sphinxcrossref{Doing less}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP28:id16}}{\hyperref[\detokenize{devel/MEP/MEP28:doing-nothing}]{\sphinxcrossref{Doing nothing}}} \end{itemize} \end{itemize} \end{sphinxShadowBox} \subsection{Status} \label{\detokenize{devel/MEP/MEP28:status}} \sphinxstylestrong{Discussion} \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP28:branches-and-pull-requests}} The following lists any open PRs or branches related to this MEP: \begin{enumerate} \item {} Deprecate redundant statistical kwargs in \sphinxcode{\sphinxupquote{Axes.boxplot}}: \sphinxurl{https://github.com/phobson/matplotlib/tree/MEP28-initial-deprecations} \item {} Deprecate redundant style options in \sphinxcode{\sphinxupquote{Axes.boxplot}}: \sphinxurl{https://github.com/phobson/matplotlib/tree/MEP28-initial-deprecations} \item {} Deprecate passings 2D numpy arrays as input: None \item {} Add pre- \& post-processing options to \sphinxcode{\sphinxupquote{cbook.boxplot\_stats}}: \sphinxurl{https://github.com/phobson/matplotlib/tree/boxplot-stat-transforms} \item {} Exposing \sphinxcode{\sphinxupquote{cbook.boxplot\_stats}} through \sphinxcode{\sphinxupquote{Axes.boxplot}} kwargs: None \item {} Remove redundant statistical kwargs in \sphinxcode{\sphinxupquote{Axes.boxplot}}: None \item {} Remove redundant style options in \sphinxcode{\sphinxupquote{Axes.boxplot}}: None \item {} Remaining items that arise through discussion: None \end{enumerate} \subsection{Abstract} \label{\detokenize{devel/MEP/MEP28:abstract}} Over the past few releases, the \sphinxcode{\sphinxupquote{Axes.boxplot}} method has grown in complexity to support fully customizable artist styling and statistical computation. This lead to \sphinxcode{\sphinxupquote{Axes.boxplot}} being split off into multiple parts. The statistics needed to draw a boxplot are computed in \sphinxcode{\sphinxupquote{cbook.boxplot\_stats}}, while the actual artists are drawn by \sphinxcode{\sphinxupquote{Axes.bxp}}. The original method, \sphinxcode{\sphinxupquote{Axes.boxplot}} remains as the most public API that handles passing the user-supplied data to \sphinxcode{\sphinxupquote{cbook.boxplot\_stats}}, feeding the results to \sphinxcode{\sphinxupquote{Axes.bxp}}, and pre-processing style information for each facet of the boxplot plots. This MEP will outline a path forward to rollback the added complexity and simplify the API while maintaining reasonable backwards compatibility. \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP28:detailed-description}} Currently, the \sphinxcode{\sphinxupquote{Axes.boxplot}} method accepts parameters that allow the users to specify medians and confidence intervals for each box that will be drawn in the plot. These were provided so that avdanced users could provide statistics computed in a different fashion that the simple method provided by matplotlib. However, handling this input requires complex logic to make sure that the forms of the data structure match what needs to be drawn. At the moment, that logic contains 9 separate if/else statements nested up to 5 levels deep with a for loop, and may raise up to 2 errors. These parameters were added prior to the creation of the \sphinxcode{\sphinxupquote{Axes.bxp}} method, which draws boxplots from a list of dictionaries containing the relevant statistics. Matplotlib also provides a function that computes these statistics via \sphinxcode{\sphinxupquote{cbook.boxplot\_stats}}. Note that advanced users can now either a) write their own function to compute the stats required by \sphinxcode{\sphinxupquote{Axes.bxp}}, or b) modify the output returned by \sphinxcode{\sphinxupquote{cbook.boxplots\_stats}} to fully customize the position of the artists of the plots. With this flexibility, the parameters to manually specify only the medians and their confidences intervals remain for backwards compatibility. Around the same time that the two roles of \sphinxcode{\sphinxupquote{Axes.boxplot}} were split into \sphinxcode{\sphinxupquote{cbook.boxplot\_stats}} for computation and \sphinxcode{\sphinxupquote{Axes.bxp}} for drawing, both \sphinxcode{\sphinxupquote{Axes.boxplot}} and \sphinxcode{\sphinxupquote{Axes.bxp}} were written to accept parameters that individually toggle the drawing of all components of the boxplots, and parameters that individually configure the style of those artists. However, to maintain backwards compatibility, the \sphinxcode{\sphinxupquote{sym}} parameter (previously used to specify the symbol of the fliers) was retained. This parameter itself requires fairly complex logic to reconcile the \sphinxcode{\sphinxupquote{sym}} parameters with the newer \sphinxcode{\sphinxupquote{flierprops}} parameter at the default style specified by \sphinxcode{\sphinxupquote{matplotlibrc}}. This MEP seeks to dramatically simplify the creation of boxplots for novice and advanced users alike. Importantly, the changes proposed here will also be available to downstream packages like seaborn, as seaborn smartly allows users to pass arbitrary dictionaries of parameters through the seaborn API to the underlying matplotlib functions. This will be achieved in the following way: \begin{enumerate} \item {} \sphinxcode{\sphinxupquote{cbook.boxplot\_stats}} will be modified to allow pre- and post- computation transformation functions to be passed in (e.g., \sphinxcode{\sphinxupquote{np.log}} and \sphinxcode{\sphinxupquote{np.exp}} for lognormally distributed data) \item {} \sphinxcode{\sphinxupquote{Axes.boxplot}} will be modified to also accept and naïvely pass them to \sphinxcode{\sphinxupquote{cbook.boxplots\_stats}} (Alt: pass the stat function and a dict of its optional parameters). \item {} Outdated parameters from \sphinxcode{\sphinxupquote{Axes.boxplot}} will be deprecated and later removed. \end{enumerate} \subsubsection{Importance} \label{\detokenize{devel/MEP/MEP28:importance}} Since the limits of the whiskers are computed arithmetically, there is an implicit assumption of normality in box and whisker plots. This primarily affects which data points are classified as outliers. Allowing transformations to the data and the results used to draw boxplots will allow users to opt-out of that assumption if the data are known to not fit a normal distribution. Below is an example of how \sphinxcode{\sphinxupquote{Axes.boxplot}} classifies outliers of lognormal data differently depending one these types of transforms. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k+kn}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib.pyplot} \PYG{k+kn}{as} \PYG{n+nn}{plt} \PYG{k+kn}{from} \PYG{n+nn}{matplotlib} \PYG{k+kn}{import} \PYG{n}{cbook} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{n}{figsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{4}\PYG{p}{,} \PYG{l+m+mi}{6}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{set\PYGZus{}yscale}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{log}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{data} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{lognormal}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{1.75}\PYG{p}{,} \PYG{l+m+mf}{2.75}\PYG{p}{,} \PYG{n}{size}\PYG{o}{=}\PYG{l+m+mi}{37}\PYG{p}{)} \PYG{n}{stats} \PYG{o}{=} \PYG{n}{cbook}\PYG{o}{.}\PYG{n}{boxplot\PYGZus{}stats}\PYG{p}{(}\PYG{n}{data}\PYG{p}{,} \PYG{n}{labels}\PYG{o}{=}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{arithmetic}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \PYG{n}{logstats} \PYG{o}{=} \PYG{n}{cbook}\PYG{o}{.}\PYG{n}{boxplot\PYGZus{}stats}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{log}\PYG{p}{(}\PYG{n}{data}\PYG{p}{)}\PYG{p}{,} \PYG{n}{labels}\PYG{o}{=}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{log\PYGZhy{}transformed}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)} \PYG{k}{for} \PYG{n}{lsdict} \PYG{o+ow}{in} \PYG{n}{logstats}\PYG{p}{:} \PYG{k}{for} \PYG{n}{key}\PYG{p}{,} \PYG{n}{value} \PYG{o+ow}{in} \PYG{n}{lsdict}\PYG{o}{.}\PYG{n}{items}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{k}{if} \PYG{n}{key} \PYG{o}{!=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{lsdict}\PYG{p}{[}\PYG{n}{key}\PYG{p}{]} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{exp}\PYG{p}{(}\PYG{n}{value}\PYG{p}{)} \PYG{n}{stats}\PYG{o}{.}\PYG{n}{extend}\PYG{p}{(}\PYG{n}{logstats}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{bxp}\PYG{p}{(}\PYG{n}{stats}\PYG{p}{)} \PYG{n}{fig}\PYG{o}{.}\PYG{n}{show}\PYG{p}{(}\PYG{p}{)} \end{sphinxVerbatim} \begin{figure}[htbp] \centering \noindent\sphinxincludegraphics{{MEP28-1}.pdf} \end{figure} \subsection{Implementation} \label{\detokenize{devel/MEP/MEP28:implementation}} \subsubsection{Passing transform functions to \sphinxstyleliteralintitle{\sphinxupquote{cbook.boxplots\_stats}}} \label{\detokenize{devel/MEP/MEP28:passing-transform-functions-to-cbook-boxplots-stats}} This MEP proposes that two parameters (e.g., \sphinxcode{\sphinxupquote{transform\_in}} and \sphinxcode{\sphinxupquote{transform\_out}} be added to the cookbook function that computes the statistics for the boxplot function. These will be optional keyword-only arguments and can easily be set to \sphinxcode{\sphinxupquote{lambda x: x}} as a no-op when omitted by the user. The \sphinxcode{\sphinxupquote{transform\_in}} function will be applied to the data as the \sphinxcode{\sphinxupquote{boxplot\_stats}} function loops through each subset of the data passed to it. After the list of statistics dictionaries are computed the \sphinxcode{\sphinxupquote{transform\_out}} function is applied to each value in the dictionaries. These transformations can then be added to the call signature of \sphinxcode{\sphinxupquote{Axes.boxplot}} with little impact to that method’s complexity. This is because they can be directly passed to \sphinxcode{\sphinxupquote{cbook.boxplot\_stats}}. Alternatively, \sphinxcode{\sphinxupquote{Axes.boxplot}} could be modified to accept an optional statistical function kwarg and a dictionary of parameters to be direcly passed to it. At this point in the implementation users and external libraries like seaborn would have complete control via the \sphinxcode{\sphinxupquote{Axes.boxplot}} method. More importantly, at the very least, seaborn would require no changes to its API to allow users to take advantage of these new options. \subsubsection{Simplifications to the \sphinxstyleliteralintitle{\sphinxupquote{Axes.boxplot}} API and other functions} \label{\detokenize{devel/MEP/MEP28:simplifications-to-the-axes-boxplot-api-and-other-functions}} Simplifying the boxplot method consists primarily of deprecating and then removing the redundant parameters. Optionally, a next step would include rectifying minor terminological inconsistencies between \sphinxcode{\sphinxupquote{Axes.boxplot}} and \sphinxcode{\sphinxupquote{Axes.bxp}}. The parameters to be deprecated and removed include: \begin{enumerate} \item {} \sphinxcode{\sphinxupquote{usermedians}} - processed by 10 SLOC, 3 \sphinxcode{\sphinxupquote{if}} blocks, a \sphinxcode{\sphinxupquote{for}} loop \item {} \sphinxcode{\sphinxupquote{conf\_intervals}} - handled by 15 SLOC, 6 \sphinxcode{\sphinxupquote{if}} blocks, a \sphinxcode{\sphinxupquote{for}} loop \item {} \sphinxcode{\sphinxupquote{sym}} - processed by 12 SLOC, 4 \sphinxcode{\sphinxupquote{if}} blocks \end{enumerate} Removing the \sphinxcode{\sphinxupquote{sym}} option allows all code in handling the remaining styling parameters to be moved to \sphinxcode{\sphinxupquote{Axes.bxp}}. This doesn’t remove any complexity, but does reinforce the single responsibility principle among \sphinxcode{\sphinxupquote{Axes.bxp}}, \sphinxcode{\sphinxupquote{cbook.boxplot\_stats}}, and \sphinxcode{\sphinxupquote{Axes.boxplot}}. Additionally, the \sphinxcode{\sphinxupquote{notch}} parameter could be renamed \sphinxcode{\sphinxupquote{shownotches}} to be consistent with \sphinxcode{\sphinxupquote{Axes.bxp}}. This kind of cleanup could be taken a step further and the \sphinxcode{\sphinxupquote{whis}}, \sphinxcode{\sphinxupquote{bootstrap}}, \sphinxcode{\sphinxupquote{autorange}} could be rolled into the kwargs passed to the new \sphinxcode{\sphinxupquote{statfxn}} parameter. \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP28:backward-compatibility}} Implementation of this MEP would eventually result in the backwards incompatible deprecation and then removal of the keyword parameters \sphinxcode{\sphinxupquote{usermedians}}, \sphinxcode{\sphinxupquote{conf\_intervals}}, and \sphinxcode{\sphinxupquote{sym}}. Cursory searches on GitHub indicated that \sphinxcode{\sphinxupquote{usermedians}}, \sphinxcode{\sphinxupquote{conf\_intervals}} are used by few users, who all seem to have a very strong knowledge of matplotlib. A robust deprecation cycle should provide sufficient time for these users to migrate to a new API. Deprecation of \sphinxcode{\sphinxupquote{sym}} however, may have a much broader reach into the matplotlib userbase. \subsubsection{Schedule} \label{\detokenize{devel/MEP/MEP28:schedule}} An accelerated timeline could look like the following: \begin{enumerate} \item {} v2.0.1 add transforms to \sphinxcode{\sphinxupquote{cbook.boxplots\_stats}}, expose in \sphinxcode{\sphinxupquote{Axes.boxplot}} \item {} v2.1.0 Initial Deprecations , and using 2D numpy arrays as input \begin{enumerate} \item {} Using 2D numpy arrays as input. The semantics around 2D arrays are generally confusing. \item {} \sphinxcode{\sphinxupquote{usermedians}}, \sphinxcode{\sphinxupquote{conf\_intervals}}, \sphinxcode{\sphinxupquote{sym}} parameters \end{enumerate} \item {} v2.2.0 \begin{enumerate} \item {} remove \sphinxcode{\sphinxupquote{usermedians}}, \sphinxcode{\sphinxupquote{conf\_intervals}}, \sphinxcode{\sphinxupquote{sym}} parameters \item {} deprecate \sphinxcode{\sphinxupquote{notch}} in favor of \sphinxcode{\sphinxupquote{shownotches}} to be consistent with other parameters and \sphinxcode{\sphinxupquote{Axes.bxp}} \end{enumerate} \item {} \begin{description} \item[{v2.3.0}] \leavevmode\begin{enumerate} \item {} remove \sphinxcode{\sphinxupquote{notch}} parameter \item {} move all style and artist toggling logic to \sphinxcode{\sphinxupquote{Axes.bxp}} such \sphinxcode{\sphinxupquote{Axes.boxplot}} is little more than a broker between \sphinxcode{\sphinxupquote{Axes.bxp}} and \sphinxcode{\sphinxupquote{cbook.boxplots\_stats}} \end{enumerate} \end{description} \end{enumerate} \subsubsection{Anticipated Impacts to Users} \label{\detokenize{devel/MEP/MEP28:anticipated-impacts-to-users}} As described above deprecating \sphinxcode{\sphinxupquote{usermedians}} and \sphinxcode{\sphinxupquote{conf\_intervals}} will likely impact few users. Those who will be impacted are almost certainly advanced users who will be able to adapt to the change. Deprecating the \sphinxcode{\sphinxupquote{sym}} option may import more users and effort should be taken to collect community feedback on this. \subsubsection{Anticipated Impacts to Downstream Libraries} \label{\detokenize{devel/MEP/MEP28:anticipated-impacts-to-downstream-libraries}} The source code (GitHub master as of 2016-10-17) was inspected for seaborn and python-ggplot to see if these changes would impact their use. None of the parameters nominated for removal in this MEP are used by seaborn. The seaborn APIs that use matplotlib’s boxplot function allow user’s to pass arbitrary \sphinxcode{\sphinxupquote{**kwargs}} through to matplotlib’s API. Thus seaborn users with modern matplotlib installations will be able to take full advantage of any new features added as a result of this MEP. Python-ggplot has implemented its own function to draw boxplots. Therefore, no impact can come to it as a result of implementing this MEP. \subsection{Alternatives} \label{\detokenize{devel/MEP/MEP28:alternatives}} \subsubsection{Variations on the theme} \label{\detokenize{devel/MEP/MEP28:variations-on-the-theme}} This MEP can be divided into a few loosely coupled components: \begin{enumerate} \item {} Allowing pre- and post-computation transformation function in \sphinxcode{\sphinxupquote{cbook.boxplot\_stats}} \item {} Exposing that transformation in the \sphinxcode{\sphinxupquote{Axes.boxplot}} API \item {} Removing redundant statistical options in \sphinxcode{\sphinxupquote{Axes.boxplot}} \item {} Shifting all styling parameter processing from \sphinxcode{\sphinxupquote{Axes.boxplot}} to \sphinxcode{\sphinxupquote{Axes.bxp}}. \end{enumerate} With this approach, \#2 depends and \#1, and \#4 depends on \#3. There are two possible approaches to \#2. The first and most direct would be to mirror the new \sphinxcode{\sphinxupquote{transform\_in}} and \sphinxcode{\sphinxupquote{tranform\_out}} parameters of \sphinxcode{\sphinxupquote{cbook.boxplot\_stats}} in \sphinxcode{\sphinxupquote{Axes.boxplot}} and pass them directly. The second approach would be to add \sphinxcode{\sphinxupquote{statfxn}} and \sphinxcode{\sphinxupquote{statfxn\_args}} parameters to \sphinxcode{\sphinxupquote{Axes.boxplot}}. Under this implementation, the default value of \sphinxcode{\sphinxupquote{statfxn}} would be \sphinxcode{\sphinxupquote{cbook.boxplot\_stats}}, but users could pass their own function. Then \sphinxcode{\sphinxupquote{transform\_in}} and \sphinxcode{\sphinxupquote{tranform\_out}} would then be passed as elements of the \sphinxcode{\sphinxupquote{statfxn\_args}} parameter. \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{boxplot\PYGZus{}stats}\PYG{p}{(}\PYG{n}{data}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{transform\PYGZus{}in}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{transform\PYGZus{}out}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)}\PYG{p}{:} \PYG{k}{if} \PYG{n}{transform\PYGZus{}in} \PYG{o+ow}{is} \PYG{k+kc}{None}\PYG{p}{:} \PYG{n}{transform\PYGZus{}in} \PYG{o}{=} \PYG{k}{lambda} \PYG{n}{x}\PYG{p}{:} \PYG{n}{x} \PYG{k}{if} \PYG{n}{transform\PYGZus{}out} \PYG{o+ow}{is} \PYG{k+kc}{None}\PYG{p}{:} \PYG{n}{transform\PYGZus{}out} \PYG{o}{=} \PYG{k}{lambda} \PYG{n}{x}\PYG{p}{:} \PYG{n}{x} \PYG{n}{output} \PYG{o}{=} \PYG{p}{[}\PYG{p}{]} \PYG{k}{for} \PYG{n}{\PYGZus{}d} \PYG{o+ow}{in} \PYG{n}{data}\PYG{p}{:} \PYG{n}{d} \PYG{o}{=} \PYG{n}{transform\PYGZus{}in}\PYG{p}{(}\PYG{n}{\PYGZus{}d}\PYG{p}{)} \PYG{n}{stat\PYGZus{}dict} \PYG{o}{=} \PYG{n}{do\PYGZus{}stats}\PYG{p}{(}\PYG{n}{d}\PYG{p}{)} \PYG{k}{for} \PYG{n}{key}\PYG{p}{,} \PYG{n}{value} \PYG{o+ow}{in} \PYG{n}{stat\PYGZus{}dict}\PYG{o}{.}\PYG{n}{item}\PYG{p}{(}\PYG{p}{)}\PYG{p}{:} \PYG{k}{if} \PYG{n}{key} \PYG{o}{!=} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{label}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{:} \PYG{n}{stat\PYGZus{}dict}\PYG{p}{[}\PYG{n}{key}\PYG{p}{]} \PYG{o}{=} \PYG{n}{transform\PYGZus{}out}\PYG{p}{(}\PYG{n}{value}\PYG{p}{)} \PYG{n}{output}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{d}\PYG{p}{)} \PYG{k}{return} \PYG{n}{output} \PYG{k}{class} \PYG{n+nc}{Axes}\PYG{p}{(}\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)}\PYG{p}{:} \PYG{k}{def} \PYG{n+nf}{boxplot\PYGZus{}option1}\PYG{p}{(}\PYG{n}{data}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{transform\PYGZus{}in}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{n}{transform\PYGZus{}out}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{)}\PYG{p}{:} \PYG{n}{stats} \PYG{o}{=} \PYG{n}{cbook}\PYG{o}{.}\PYG{n}{boxplot\PYGZus{}stats}\PYG{p}{(}\PYG{n}{data}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{transform\PYGZus{}in}\PYG{o}{=}\PYG{n}{transform\PYGZus{}in}\PYG{p}{,} \PYG{n}{transform\PYGZus{}out}\PYG{o}{=}\PYG{n}{transform\PYGZus{}out}\PYG{p}{)} \PYG{k}{return} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{bxp}\PYG{p}{(}\PYG{n}{stats}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \PYG{k}{def} \PYG{n+nf}{boxplot\PYGZus{}option2}\PYG{p}{(}\PYG{n}{data}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{n}{statfxn}\PYG{o}{=}\PYG{k+kc}{None}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{statopts}\PYG{p}{)}\PYG{p}{:} \PYG{k}{if} \PYG{n}{statfxn} \PYG{o+ow}{is} \PYG{k+kc}{None}\PYG{p}{:} \PYG{n}{statfxn} \PYG{o}{=} \PYG{n}{boxplot\PYGZus{}stats} \PYG{n}{stats} \PYG{o}{=} \PYG{n}{statfxn}\PYG{p}{(}\PYG{n}{data}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{statopts}\PYG{p}{)} \PYG{k}{return} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{bxp}\PYG{p}{(}\PYG{n}{stats}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{)} \end{sphinxVerbatim} Both cases would allow users to do the following: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{artists1} \PYG{o}{=} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{boxplot\PYGZus{}optionX}\PYG{p}{(}\PYG{n}{data}\PYG{p}{,} \PYG{n}{transform\PYGZus{}in}\PYG{o}{=}\PYG{n}{np}\PYG{o}{.}\PYG{n}{log}\PYG{p}{,} \PYG{n}{transform\PYGZus{}out}\PYG{o}{=}\PYG{n}{np}\PYG{o}{.}\PYG{n}{exp}\PYG{p}{)} \end{sphinxVerbatim} But Option Two lets a user write a completely custom stat function (e.g., \sphinxcode{\sphinxupquote{my\_box\_stats}}) with fancy BCA confidence intervals and the whiskers set differently depending on some attribute of the data. This is available under the current API: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{my\PYGZus{}stats} \PYG{o}{=} \PYG{n}{my\PYGZus{}box\PYGZus{}stats}\PYG{p}{(}\PYG{n}{data}\PYG{p}{,} \PYG{n}{bootstrap\PYGZus{}method}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{BCA}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{whisker\PYGZus{}method}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{dynamic}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{bxp}\PYG{p}{(}\PYG{n}{my\PYGZus{}stats}\PYG{p}{)} \end{sphinxVerbatim} And would be more concise with Option Two \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{statopts} \PYG{o}{=} \PYG{n+nb}{dict}\PYG{p}{(}\PYG{n}{transform\PYGZus{}in}\PYG{o}{=}\PYG{n}{np}\PYG{o}{.}\PYG{n}{log}\PYG{p}{,} \PYG{n}{transform\PYGZus{}out}\PYG{o}{=}\PYG{n}{np}\PYG{o}{.}\PYG{n}{exp}\PYG{p}{)} \PYG{n}{ax}\PYG{o}{.}\PYG{n}{boxplot}\PYG{p}{(}\PYG{n}{data}\PYG{p}{,} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{statopts}\PYG{p}{)} \end{sphinxVerbatim} Users could also pass their own function to compute the stats: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{fig}\PYG{p}{,} \PYG{n}{ax1} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{p}{)} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{boxplot}\PYG{p}{(}\PYG{n}{data}\PYG{p}{,} \PYG{n}{statfxn}\PYG{o}{=}\PYG{n}{my\PYGZus{}box\PYGZus{}stats}\PYG{p}{,} \PYG{n}{bootstrap\PYGZus{}method}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{BCA}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{whisker\PYGZus{}method}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{dynamic}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} From the examples above, Option Two seems to have only marginal benefit, but in the context of downstream libraries like seaborn, its advantage is more apparent as the following would be possible without any patches to seaborn: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{seaborn} \PYG{n}{tips} \PYG{o}{=} \PYG{n}{seaborn}\PYG{o}{.}\PYG{n}{load\PYGZus{}data}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{tips}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{g} \PYG{o}{=} \PYG{n}{seaborn}\PYG{o}{.}\PYG{n}{factorplot}\PYG{p}{(}\PYG{n}{x}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{day}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{y}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{total\PYGZus{}bill}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{hue}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{sex}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{data}\PYG{o}{=}\PYG{n}{tips}\PYG{p}{,} \PYG{n}{kind}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{box}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{palette}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{PRGn}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{n}{shownotches}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{,} \PYG{n}{statfxn}\PYG{o}{=}\PYG{n}{my\PYGZus{}box\PYGZus{}stats}\PYG{p}{,} \PYG{n}{bootstrap\PYGZus{}method}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{BCA}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{whisker\PYGZus{}method}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{dynamic}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \end{sphinxVerbatim} This type of flexibility was the intention behind splitting the overall boxplot API in the current three functions. In practice however, downstream libraries like seaborn support versions of matplotlib dating back well before the split. Thus, adding just a bit more flexibility to the \sphinxcode{\sphinxupquote{Axes.boxplot}} could expose all the functionality to users of the downstream libraries with modern matplotlib installation without intervention from the downstream library maintainers. \subsubsection{Doing less} \label{\detokenize{devel/MEP/MEP28:doing-less}} Another obvious alternative would be to omit the added pre- and post- computation transform functionality in \sphinxcode{\sphinxupquote{cbook.boxplot\_stats}} and \sphinxcode{\sphinxupquote{Axes.boxplot}}, and simply remove the redundant statistical and style parameters as described above. \subsubsection{Doing nothing} \label{\detokenize{devel/MEP/MEP28:doing-nothing}} As with many things in life, doing nothing is an option here. This means we simply advocate for users and downstream libraries to take advantage of the split between \sphinxcode{\sphinxupquote{cbook.boxplot\_stats}} and \sphinxcode{\sphinxupquote{Axes.bxp}} and let them decide how to provide an interface to that. \section{MEP29: Text light markup} \label{\detokenize{devel/MEP/MEP29:mep29-text-light-markup}}\label{\detokenize{devel/MEP/MEP29::doc}} \begin{sphinxShadowBox} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP29:id1}}{\hyperref[\detokenize{devel/MEP/MEP29:status}]{\sphinxcrossref{Status}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP29:id2}}{\hyperref[\detokenize{devel/MEP/MEP29:branches-and-pull-requests}]{\sphinxcrossref{Branches and Pull requests}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP29:id3}}{\hyperref[\detokenize{devel/MEP/MEP29:abstract}]{\sphinxcrossref{Abstract}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP29:id4}}{\hyperref[\detokenize{devel/MEP/MEP29:detailed-description}]{\sphinxcrossref{Detailed description}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP29:id5}}{\hyperref[\detokenize{devel/MEP/MEP29:implementation}]{\sphinxcrossref{Implementation}}} \begin{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP29:id6}}{\hyperref[\detokenize{devel/MEP/MEP29:improvements}]{\sphinxcrossref{Improvements}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP29:id7}}{\hyperref[\detokenize{devel/MEP/MEP29:problems}]{\sphinxcrossref{Problems}}} \end{itemize} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP29:id8}}{\hyperref[\detokenize{devel/MEP/MEP29:backward-compatibility}]{\sphinxcrossref{Backward compatibility}}} \item {} \phantomsection\label{\detokenize{devel/MEP/MEP29:id9}}{\hyperref[\detokenize{devel/MEP/MEP29:alternatives}]{\sphinxcrossref{Alternatives}}} \end{itemize} \end{sphinxShadowBox} \subsection{Status} \label{\detokenize{devel/MEP/MEP29:status}} Discussion \subsection{Branches and Pull requests} \label{\detokenize{devel/MEP/MEP29:branches-and-pull-requests}} None at the moment, proof of concept only. \subsection{Abstract} \label{\detokenize{devel/MEP/MEP29:abstract}} This MEP proposes to add lightweight markup to the text artist. \subsection{Detailed description} \label{\detokenize{devel/MEP/MEP29:detailed-description}} Using different size/color/family in a text annotation is difficult because the \sphinxcode{\sphinxupquote{text}} method accepts argument for size/color/family/weight/etc. that are used for the whole text. But, if one wants, for example, to have different colors, one has to look at the gallery where one such example is provided: \sphinxurl{http://matplotlib.org/examples/text\_labels\_and\_annotations/rainbow\_text.html} This example takes a list of strings as well as a list of colors which makes it cumbersome to use. An alternative would be to use a restricted set of pango-like markup (see \sphinxurl{https://developer.gnome.org/pango/stable/PangoMarkupFormat.html}) and to interpret this markup. Some markup examples: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] Hello \PYGZlt{}b\PYGZgt{}world!\PYGZlt{}/b\PYGZgt{}{}` Hello \PYGZlt{}span color=\PYGZdq{}blue\PYGZdq{}\PYGZgt{}world!\PYGZlt{}/span\PYGZgt{} \end{sphinxVerbatim} \subsection{Implementation} \label{\detokenize{devel/MEP/MEP29:implementation}} A proof of concept is provided in \sphinxhref{https://github.com/rougier/matplotlib/blob/markup/examples/text\_labels\_and\_annotations/markup.py}{markup\_example.py} but it currently only handles the horizontal direction. \subsubsection{Improvements} \label{\detokenize{devel/MEP/MEP29:improvements}}\begin{itemize} \item {} This proof of concept uses regex to parse the text but it may be better to use the html.parser from the standard library. \item {} Computation of text fragment positions could benefit from the OffsetFrom class. See for example item 5 in \sphinxhref{http://matplotlib.org/devdocs/tutorials/text/annotations.html\#using-complex-coordinates-with-annotations}{Using Complex Coordinates with Annotations} \end{itemize} \subsubsection{Problems} \label{\detokenize{devel/MEP/MEP29:problems}}\begin{itemize} \item {} One serious problem is how to deal with text having both latex and html-like tags. For example, consider the following: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYGZdl{}\PYGZlt{}b\PYGZgt{}Bold\PYGZdl{}\PYGZlt{}/b\PYGZgt{} \end{sphinxVerbatim} Recommendation would be to have mutual exclusion. \end{itemize} \subsection{Backward compatibility} \label{\detokenize{devel/MEP/MEP29:backward-compatibility}} None at the moment since it is only a proof of concept \subsection{Alternatives} \label{\detokenize{devel/MEP/MEP29:alternatives}} As proposed by @anntzer, this could be also implemented as improvements to mathtext. For example: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{l+s+sa}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdl{}}\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{text}\PYG{l+s+s2}{\PYGZob{}}\PYG{l+s+s2}{Hello }\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{textbf}\PYG{l+s+si}{\PYGZob{}world\PYGZcb{}}\PYG{l+s+s2}{\PYGZcb{}\PYGZdl{}}\PYG{l+s+s2}{\PYGZdq{}} \PYG{l+s+sa}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdl{}}\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{text}\PYG{l+s+s2}{\PYGZob{}}\PYG{l+s+s2}{Hello }\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{textcolor}\PYG{l+s+si}{\PYGZob{}blue\PYGZcb{}}\PYG{l+s+si}{\PYGZob{}world\PYGZcb{}}\PYG{l+s+s2}{\PYGZcb{}\PYGZdl{}}\PYG{l+s+s2}{\PYGZdq{}} \PYG{l+s+sa}{r}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdl{}}\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{text}\PYG{l+s+s2}{\PYGZob{}}\PYG{l+s+s2}{Hello }\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{textsf}\PYG{l+s+s2}{\PYGZob{}}\PYG{l+s+s2}{\PYGZbs{}}\PYG{l+s+s2}{small world\PYGZcb{}\PYGZcb{}\PYGZdl{}}\PYG{l+s+s2}{\PYGZdq{}} \end{sphinxVerbatim} \chapter{Licenses} \label{\detokenize{devel/license:licenses}}\label{\detokenize{devel/license:license-discussion}}\label{\detokenize{devel/license::doc}} Matplotlib only uses BSD compatible code. If you bring in code from another project make sure it has a PSF, BSD, MIT or compatible license (see the Open Source Initiative \sphinxhref{https://opensource.org/licenses}{licenses page} for details on individual licenses). If it doesn’t, you may consider contacting the author and asking them to relicense it. GPL and LGPL code are not acceptable in the main code base, though we are considering an alternative way of distributing L/GPL code through an separate channel, possibly a toolkit. If you include code, make sure you include a copy of that code’s license in the license directory if the code’s license requires you to distribute the license with it. Non-BSD compatible licenses are acceptable in matplotlib toolkits (e.g., basemap), but make sure you clearly state the licenses you are using. \section{Why BSD compatible?} \label{\detokenize{devel/license:why-bsd-compatible}} The two dominant license variants in the wild are GPL-style and BSD-style. There are countless other licenses that place specific restrictions on code reuse, but there is an important difference to be considered in the GPL and BSD variants. The best known and perhaps most widely used license is the GPL, which in addition to granting you full rights to the source code including redistribution, carries with it an extra obligation. If you use GPL code in your own code, or link with it, your product must be released under a GPL compatible license. i.e., you are required to give the source code to other people and give them the right to redistribute it as well. Many of the most famous and widely used open source projects are released under the GPL, including linux, gcc, emacs and sage. The second major class are the BSD-style licenses (which includes MIT and the python PSF license). These basically allow you to do whatever you want with the code: ignore it, include it in your own open source project, include it in your proprietary product, sell it, whatever. python itself is released under a BSD compatible license, in the sense that, quoting from the PSF license page: \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{n}{There} \PYG{o+ow}{is} \PYG{n}{no} \PYG{n}{GPL}\PYG{o}{\PYGZhy{}}\PYG{n}{like} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{copyleft}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{restriction}\PYG{o}{.} \PYG{n}{Distributing} \PYG{n}{binary}\PYG{o}{\PYGZhy{}}\PYG{n}{only} \PYG{n}{versions} \PYG{n}{of} \PYG{n}{Python}\PYG{p}{,} \PYG{n}{modified} \PYG{o+ow}{or} \PYG{o+ow}{not}\PYG{p}{,} \PYG{o+ow}{is} \PYG{n}{allowed}\PYG{o}{.} \PYG{n}{There} \PYG{o+ow}{is} \PYG{n}{no} \PYG{n}{requirement} \PYG{n}{to} \PYG{n}{release} \PYG{n+nb}{any} \PYG{n}{of} \PYG{n}{your} \PYG{n}{source} \PYG{n}{code}\PYG{o}{.} \PYG{n}{You} \PYG{n}{can} \PYG{n}{also} \PYG{n}{write} \PYG{n}{extension} \PYG{n}{modules} \PYG{k}{for} \PYG{n}{Python} \PYG{o+ow}{and} \PYG{n}{provide} \PYG{n}{them} \PYG{n}{only} \PYG{o+ow}{in} \PYG{n}{binary} \PYG{n}{form}\PYG{o}{.} \end{sphinxVerbatim} Famous projects released under a BSD-style license in the permissive sense of the last paragraph are the BSD operating system, python and TeX. There are several reasons why early matplotlib developers selected a BSD compatible license. matplotlib is a python extension, and we choose a license that was based on the python license (BSD compatible). Also, we wanted to attract as many users and developers as possible, and many software companies will not use GPL code in software they plan to distribute, even those that are highly committed to open source development, such as \sphinxhref{https://www.enthought.com}{enthought}, out of legitimate concern that use of the GPL will “infect” their code base by its viral nature. In effect, they want to retain the right to release some proprietary code. Companies and institutions who use matplotlib often make significant contributions, because they have the resources to get a job done, even a boring one. Two of the matplotlib backends (FLTK and WX) were contributed by private companies. The final reason behind the licensing choice is compatibility with the other python extensions for scientific computing: ipython, numpy, scipy, the enthought tool suite and python itself are all distributed under BSD compatible licenses. \chapter{Default Color changes} \label{\detokenize{devel/color_changes:default-color-changes}}\label{\detokenize{devel/color_changes:color-changes}}\label{\detokenize{devel/color_changes::doc}} As discussed at length elsewhere {[}insert links{]}, \sphinxcode{\sphinxupquote{jet}} is an empirically bad color map and should not be the default color map. Due to the position that changing the appearance of the plot breaks backward compatibility, this change has been put off for far longer than it should have been. In addition to changing the default color map we plan to take the chance to change the default color-cycle on plots and to adopt a different color map for filled plots (\sphinxcode{\sphinxupquote{imshow}}, \sphinxcode{\sphinxupquote{pcolor}}, \sphinxcode{\sphinxupquote{contourf}}, etc) and for scatter like plots. \section{Default Heat Map Colormap} \label{\detokenize{devel/color_changes:default-heat-map-colormap}} The choice of a new color map is fertile ground to bike-shedding (“No, it should be \_this\_ color”) so we have a proposed set criteria (via Nathaniel Smith) to evaluate proposed color maps. \begin{itemize} \item {} it should be a sequential colormap, because diverging colormaps are really misleading unless you know where the “center” of the data is, and for a default colormap we generally won’t. \item {} it should be perceptually uniform, i.e., human subjective judgments of how far apart nearby colors are should correspond as linearly as possible to the difference between the numerical values they represent, at least locally. \item {} it should have a perceptually uniform luminance ramp, i.e. if you convert to greyscale it should still be uniform. This is useful both in practical terms (greyscale printers are still a thing!) and because luminance is a very strong and natural cue to magnitude. \item {} it should also have some kind of variation in hue, because hue variation is a really helpful additional cue to perception, having two cues is better than one, and there’s no reason not to do it. \item {} the hue variation should be chosen to produce reasonable results even for viewers with the more common types of colorblindness. (Which rules out things like red-to-green.) \item {} For bonus points, it would be nice to choose a hue ramp that still works if you throw away the luminance variation, because then we could use the version with varying luminance for 2d plots, and the version with just hue variation for 3d plots. (In 3d plots you really want to reserve the luminance channel for lighting/shading, because your brain is \sphinxstyleemphasis{really} good at extracting 3d shape from luminance variation. If the 3d surface itself has massively varying luminance then this screws up the ability to see shape.) \item {} Not infringe any existing IP \end{itemize} \subsection{Example script} \label{\detokenize{devel/color_changes:example-script}} \subsection{Proposed Colormaps} \label{\detokenize{devel/color_changes:proposed-colormaps}} \section{Default Scatter Colormap} \label{\detokenize{devel/color_changes:default-scatter-colormap}} For heat-map like applications it can be desirable to cover as much of the luminence scale as possible, however when color mapping markers, having markers too close to white can be a problem. For that reason we propose using a different (but maybe related) color map to the heat map for marker-based. The design parameters are the same as above, only with a more limited luminence variation. \subsection{Example script} \label{\detokenize{devel/color_changes:id1}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{seed}\PYG{p}{(}\PYG{l+m+mi}{1234}\PYG{p}{)} \PYG{n}{fig}\PYG{p}{,} \PYG{p}{(}\PYG{n}{ax1}\PYG{p}{,} \PYG{n}{ax2}\PYG{p}{)} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{N} \PYG{o}{=} \PYG{l+m+mi}{50} \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{n}{N}\PYG{p}{)} \PYG{n}{y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{n}{N}\PYG{p}{)} \PYG{n}{colors} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{n}{N}\PYG{p}{)} \PYG{n}{area} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{pi} \PYG{o}{*} \PYG{p}{(}\PYG{l+m+mi}{15} \PYG{o}{*} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{n}{N}\PYG{p}{)}\PYG{p}{)}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2} \PYG{c+c1}{\PYGZsh{} 0 to 15 point radiuses} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{scatter}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{y}\PYG{p}{,} \PYG{n}{s}\PYG{o}{=}\PYG{n}{area}\PYG{p}{,} \PYG{n}{c}\PYG{o}{=}\PYG{n}{colors}\PYG{p}{,} \PYG{n}{alpha}\PYG{o}{=}\PYG{l+m+mf}{0.5}\PYG{p}{)} \PYG{n}{X}\PYG{p}{,}\PYG{n}{Y} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{meshgrid}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{,} \PYG{o}{.}\PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{arange}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{,} \PYG{o}{.}\PYG{l+m+mi}{2}\PYG{p}{)}\PYG{p}{)} \PYG{n}{U} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{cos}\PYG{p}{(}\PYG{n}{X}\PYG{p}{)} \PYG{n}{V} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{Y}\PYG{p}{)} \PYG{n}{Q} \PYG{o}{=} \PYG{n}{ax2}\PYG{o}{.}\PYG{n}{quiver}\PYG{p}{(}\PYG{n}{X}\PYG{p}{,} \PYG{n}{Y}\PYG{p}{,} \PYG{n}{U}\PYG{p}{,} \PYG{n}{V}\PYG{p}{,} \PYG{n}{units}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{width}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{n}{qd} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{random}\PYG{o}{.}\PYG{n}{rand}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{prod}\PYG{p}{(}\PYG{n}{X}\PYG{o}{.}\PYG{n}{shape}\PYG{p}{)}\PYG{p}{)} \PYG{n}{Q}\PYG{o}{.}\PYG{n}{set\PYGZus{}array}\PYG{p}{(}\PYG{n}{qd}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Proposed Colormaps} \label{\detokenize{devel/color_changes:id2}} \section{Color Cycle / Qualitative color map} \label{\detokenize{devel/color_changes:color-cycle-qualitative-color-map}} When plotting lines it is frequently desirable to plot multiple lines or artists which need to be distinguishable, but there is no inherent ordering. \subsection{Example script} \label{\detokenize{devel/color_changes:id3}} \fvset{hllines={, ,}}% \begin{sphinxVerbatim}[commandchars=\\\{\}] \PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np} \PYG{k+kn}{import} \PYG{n+nn}{matplotlib}\PYG{n+nn}{.}\PYG{n+nn}{pyplot} \PYG{k}{as} \PYG{n+nn}{plt} \PYG{n}{fig}\PYG{p}{,} \PYG{p}{(}\PYG{n}{ax1}\PYG{p}{,} \PYG{n}{ax2}\PYG{p}{)} \PYG{o}{=} \PYG{n}{plt}\PYG{o}{.}\PYG{n}{subplots}\PYG{p}{(}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{p}{)} \PYG{n}{x} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{)} \PYG{k}{for} \PYG{n}{j} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax1}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{x}\PYG{p}{,} \PYG{n}{x} \PYG{o}{*} \PYG{n}{j}\PYG{p}{)} \PYG{n}{th} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{,} \PYG{l+m+mi}{1024}\PYG{p}{)} \PYG{k}{for} \PYG{n}{j} \PYG{o+ow}{in} \PYG{n}{np}\PYG{o}{.}\PYG{n}{linspace}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{,} \PYG{l+m+mi}{10}\PYG{p}{)}\PYG{p}{:} \PYG{n}{ax2}\PYG{o}{.}\PYG{n}{plot}\PYG{p}{(}\PYG{n}{th}\PYG{p}{,} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sin}\PYG{p}{(}\PYG{n}{th} \PYG{o}{+} \PYG{n}{j}\PYG{p}{)}\PYG{p}{)} \PYG{n}{ax2}\PYG{o}{.}\PYG{n}{set\PYGZus{}xlim}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{l+m+mi}{2}\PYG{o}{*}\PYG{n}{np}\PYG{o}{.}\PYG{n}{pi}\PYG{p}{)} \end{sphinxVerbatim} \subsection{Proposed Color cycle} \label{\detokenize{devel/color_changes:proposed-color-cycle}} \part{Glossary} \label{\detokenize{glossary/index:glossary}}\label{\detokenize{glossary/index:id1}}\label{\detokenize{glossary/index::doc}}\begin{description} \item[{AGG\index{AGG|textbf}\phantomsection\label{\detokenize{glossary/index:term-agg}}}] \leavevmode The Anti-Grain Geometry (\sphinxhref{http://antigrain.com/}{Agg}) rendering engine, capable of rendering high-quality images \item[{Cairo\index{Cairo|textbf}\phantomsection\label{\detokenize{glossary/index:term-cairo}}}] \leavevmode The \sphinxhref{https://cairographics.org}{Cairo graphics} engine \item[{dateutil\index{dateutil|textbf}\phantomsection\label{\detokenize{glossary/index:term-dateutil}}}] \leavevmode The \sphinxhref{https://dateutil.readthedocs.io}{dateutil} library provides extensions to the standard datetime module \item[{EPS\index{EPS|textbf}\phantomsection\label{\detokenize{glossary/index:term-eps}}}] \leavevmode Encapsulated Postscript (\sphinxhref{https://en.wikipedia.org/wiki/Encapsulated\_PostScript}{EPS}) \item[{FreeType\index{FreeType|textbf}\phantomsection\label{\detokenize{glossary/index:term-freetype}}}] \leavevmode \sphinxhref{https://www.freetype.org/}{FreeType} is a font rasterization library used by matplotlib which supports TrueType, Type 1, and OpenType fonts. \item[{GDK\index{GDK|textbf}\phantomsection\label{\detokenize{glossary/index:term-gdk}}}] \leavevmode The Gimp Drawing Kit for GTK+ \item[{GTK\index{GTK|textbf}\phantomsection\label{\detokenize{glossary/index:term-gtk}}}] \leavevmode The GIMP Toolkit (\sphinxhref{https://www.gtk.org/}{GTK}) graphical user interface library \item[{JPG\index{JPG|textbf}\phantomsection\label{\detokenize{glossary/index:term-jpg}}}] \leavevmode The Joint Photographic Experts Group (\sphinxhref{https://en.wikipedia.org/wiki/Jpeg}{JPEG}) compression method and file format for photographic images \item[{numpy\index{numpy|textbf}\phantomsection\label{\detokenize{glossary/index:term-numpy}}}] \leavevmode \sphinxhref{http://www.numpy.org/}{numpy} is the standard numerical array library for python, the successor to Numeric and numarray. numpy provides fast operations for homogeneous data sets and common mathematical operations like correlations, standard deviation, fourier transforms, and convolutions. \item[{PDF\index{PDF|textbf}\phantomsection\label{\detokenize{glossary/index:term-pdf}}}] \leavevmode Adobe’s Portable Document Format (\sphinxhref{https://en.wikipedia.org/wiki/Portable\_Document\_Format}{PDF}) \item[{PNG\index{PNG|textbf}\phantomsection\label{\detokenize{glossary/index:term-png}}}] \leavevmode Portable Network Graphics (\sphinxhref{https://en.wikipedia.org/wiki/Portable\_Network\_Graphics}{PNG}), a raster graphics format that employs lossless data compression which is more suitable for line art than the lossy jpg format. Unlike the gif format, png is not encumbered by requirements for a patent license. \item[{PS\index{PS|textbf}\phantomsection\label{\detokenize{glossary/index:term-ps}}}] \leavevmode Postscript (\sphinxhref{https://en.wikipedia.org/wiki/PostScript}{PS}) is a vector graphics ASCII text language widely used in printers and publishing. Postscript was developed by adobe systems and is starting to show its age: for example is does not have an alpha channel. PDF was designed in part as a next-generation document format to replace postscript \item[{pgi\index{pgi|textbf}\phantomsection\label{\detokenize{glossary/index:term-pgi}}}] \leavevmode \sphinxcode{\sphinxupquote{pgi}} exists as a relatively new Python wrapper to GTK3 and acts as a pure python alternative to PyGObject. pgi still exists in its infancy, currently missing many features of PyGObject. However Matplotlib does not use any of these missing features. \item[{pygtk\index{pygtk|textbf}\phantomsection\label{\detokenize{glossary/index:term-pygtk}}}] \leavevmode \sphinxhref{http://www.pygtk.org/}{pygtk} provides python wrappers for the {\hyperref[\detokenize{glossary/index:term-gtk}]{\sphinxtermref{\DUrole{xref,std,std-term}{GTK}}}} widgets library for use with the GTK or GTKAgg backend. Widely used on linux, and is often packages as ‘python-gtk2’ \item[{PyGObject\index{PyGObject|textbf}\phantomsection\label{\detokenize{glossary/index:term-pygobject}}}] \leavevmode Like {\hyperref[\detokenize{glossary/index:term-pygtk}]{\sphinxtermref{\DUrole{xref,std,std-term}{pygtk}}}}, \sphinxcode{\sphinxupquote{PyGObject}} provides python wrappers for the {\hyperref[\detokenize{glossary/index:term-gtk}]{\sphinxtermref{\DUrole{xref,std,std-term}{GTK}}}} widgets library; unlike pygtk, PyGObject wraps GTK3 instead of the now obsolete GTK2. \item[{pyqt\index{pyqt|textbf}\phantomsection\label{\detokenize{glossary/index:term-pyqt}}}] \leavevmode \sphinxhref{https://wiki.python.org/moin/PyQt}{pyqt} provides python wrappers for the {\hyperref[\detokenize{glossary/index:term-qt}]{\sphinxtermref{\DUrole{xref,std,std-term}{Qt}}}} widgets library and is required by the matplotlib Qt5Agg and Qt4Agg backends. Widely used on linux and windows; many linux distributions package this as ‘python-qt5’ or ‘python-qt4’. \item[{python\index{python|textbf}\phantomsection\label{\detokenize{glossary/index:term-python}}}] \leavevmode \sphinxhref{https://www.python.org}{python} is an object oriented interpreted language widely used for scripting, application development, web application servers, scientific computing and more. \item[{pytz\index{pytz|textbf}\phantomsection\label{\detokenize{glossary/index:term-pytz}}}] \leavevmode \sphinxhref{http://pythonhosted.org/pytz/}{pytz} provides the Olson tz database in Python. it allows accurate and cross platform timezone calculations and solves the issue of ambiguous times at the end of daylight savings \item[{Qt\index{Qt|textbf}\phantomsection\label{\detokenize{glossary/index:term-qt}}}] \leavevmode \sphinxhref{https://www.qt.io/}{Qt} is a cross-platform application framework for desktop and embedded development. \item[{Qt4\index{Qt4|textbf}\phantomsection\label{\detokenize{glossary/index:term-qt4}}}] \leavevmode \sphinxhref{http://doc.qt.io/qt-4.8/index.html}{Qt4} is the previous, but most widely used, version of Qt cross-platform application framework for desktop and embedded development. \item[{Qt5\index{Qt5|textbf}\phantomsection\label{\detokenize{glossary/index:term-qt5}}}] \leavevmode \sphinxhref{http://doc.qt.io/qt-5/index.html}{Qt5} is the current version of Qt cross-platform application framework for desktop and embedded development. \item[{raster graphics\index{raster graphics|textbf}\phantomsection\label{\detokenize{glossary/index:term-raster-graphics}}}] \leavevmode \sphinxhref{https://en.wikipedia.org/wiki/Raster\_graphics}{Raster graphics}, or bitmaps, represent an image as an array of pixels which is resolution dependent. Raster graphics are generally most practical for photo-realistic images, but do not scale easily without loss of quality. \item[{SVG\index{SVG|textbf}\phantomsection\label{\detokenize{glossary/index:term-svg}}}] \leavevmode The Scalable Vector Graphics format (\sphinxhref{https://en.wikipedia.org/wiki/Svg}{SVG}). An XML based vector graphics format supported by many web browsers. \item[{TIFF\index{TIFF|textbf}\phantomsection\label{\detokenize{glossary/index:term-tiff}}}] \leavevmode Tagged Image File Format (\sphinxhref{https://en.wikipedia.org/wiki/Tagged\_Image\_File\_Format}{TIFF}) is a file format for storing images, including photographs and line art. \item[{Tk\index{Tk|textbf}\phantomsection\label{\detokenize{glossary/index:term-tk}}}] \leavevmode \sphinxhref{http://www.tcl.tk/}{Tk} is a graphical user interface for Tcl and many other dynamic languages. It can produce rich, native applications that run unchanged across Windows, Mac OS X, Linux and more. \item[{vector graphics\index{vector graphics|textbf}\phantomsection\label{\detokenize{glossary/index:term-vector-graphics}}}] \leavevmode \sphinxhref{https://en.wikipedia.org/wiki/Vector\_graphics}{vector graphics} use geometrical primitives based upon mathematical equations to represent images in computer graphics. Primitives can include points, lines, curves, and shapes or polygons. Vector graphics are scalable, which means that they can be resized without suffering from issues related to inherent resolution like are seen in raster graphics. Vector graphics are generally most practical for typesetting and graphic design applications. \item[{wxpython\index{wxpython|textbf}\phantomsection\label{\detokenize{glossary/index:term-wxpython}}}] \leavevmode \sphinxhref{https://www.wxpython.org/}{wxpython} provides python wrappers for the {\hyperref[\detokenize{glossary/index:term-wxwidgets}]{\sphinxtermref{\DUrole{xref,std,std-term}{wxWidgets}}}} library for use with the WX and WXAgg backends. Widely used on linux, OS-X and windows, it is often packaged by linux distributions as ‘python-wxgtk’ \item[{wxWidgets\index{wxWidgets|textbf}\phantomsection\label{\detokenize{glossary/index:term-wxwidgets}}}] \leavevmode \sphinxhref{http://www.wxwidgets.org/}{WX} is cross-platform GUI and tools library for GTK, MS Windows, and MacOS. It uses native widgets for each operating system, so applications will have the look-and-feel that users on that operating system expect. \end{description} \begin{sphinxthebibliography}{mycarta-banding} \bibitem[colorcet]{\detokenize{colorcet}}{\phantomsection\label{\detokenize{tutorials/colors/colormaps:colorcet}} \sphinxurl{https://github.com/bokeh/colorcet} } \bibitem[Ware]{\detokenize{Ware}}{\phantomsection\label{\detokenize{tutorials/colors/colormaps:ware}} \sphinxurl{http://ccom.unh.edu/sites/default/files/publications/Ware\_1988\_CGA\_Color\_sequences\_univariate\_maps.pdf} } \bibitem[Moreland]{\detokenize{Moreland}}{\phantomsection\label{\detokenize{tutorials/colors/colormaps:moreland}} \sphinxurl{http://www.kennethmoreland.com/color-maps/ColorMapsExpanded.pdf} } \bibitem[list-colormaps]{\detokenize{list-colormaps}}{\phantomsection\label{\detokenize{tutorials/colors/colormaps:list-colormaps}} \sphinxurl{https://gist.github.com/endolith/2719900\#id7} } \bibitem[mycarta-banding]{\detokenize{mycarta-banding}}{\phantomsection\label{\detokenize{tutorials/colors/colormaps:mycarta-banding}} \sphinxurl{https://mycarta.wordpress.com/2012/10/14/the-rainbow-is-deadlong-live-the-rainbow-part-4-cie-lab-heated-body/} } \bibitem[mycarta-jet]{\detokenize{mycarta-jet}}{\phantomsection\label{\detokenize{tutorials/colors/colormaps:mycarta-jet}} \sphinxurl{https://mycarta.wordpress.com/2012/10/06/the-rainbow-is-deadlong-live-the-rainbow-part-3/} } \bibitem[bw]{\detokenize{bw}}{\phantomsection\label{\detokenize{tutorials/colors/colormaps:bw}} \sphinxurl{http://www.tannerhelland.com/3643/grayscale-image-algorithm-vb6/} } \bibitem[colorblindness]{\detokenize{colorblindness}}{\phantomsection\label{\detokenize{tutorials/colors/colormaps:colorblindness}} \sphinxurl{http://www.color-blindness.com/} } \bibitem[vischeck]{\detokenize{vischeck}}{\phantomsection\label{\detokenize{tutorials/colors/colormaps:vischeck}} \sphinxurl{http://www.vischeck.com/vischeck/} } \bibitem[IBM]{\detokenize{IBM}}{\phantomsection\label{\detokenize{tutorials/colors/colormaps:ibm}} \sphinxurl{http://www.research.ibm.com/people/l/lloydt/color/color.HTM} } \bibitem[1]{\detokenize{1}}{\phantomsection\label{\detokenize{api/dviread:ra043a4f19cd5-1}} \sphinxhref{http://www.tug.org/kpathsea/}{Kpathsea documentation} The library that \sphinxstyleliteralstrong{\sphinxupquote{kpsewhich}} is part of. } \bibitem[1]{\detokenize{1}}{\phantomsection\label{\detokenize{api/tri_api:r0be0c58fd53f-1}} Michel Bernadou, Kamal Hassan, “Basis functions for general Hsieh-Clough-Tocher triangles, complete or reduced.”, International Journal for Numerical Methods in Engineering, 17(5):784 - 789. 2.01. } \bibitem[2]{\detokenize{2}}{\phantomsection\label{\detokenize{api/tri_api:r0be0c58fd53f-2}} C.T. Kelley, “Iterative Methods for Optimization”. } \end{sphinxthebibliography} \renewcommand{\indexname}{Python Module Index} \begin{sphinxtheindex} \def\bigletter#1{{\Large\sffamily#1}\nopagebreak\vspace{1mm}} \bigletter{m} \item {\sphinxstyleindexentry{matplotlib.afm}}\sphinxstyleindexpageref{api/afm_api:\detokenize{module-matplotlib.afm}} \item {\sphinxstyleindexentry{matplotlib.animation}}\sphinxstyleindexpageref{api/animation_api:\detokenize{module-matplotlib.animation}} \item {\sphinxstyleindexentry{matplotlib.artist}}\sphinxstyleindexpageref{api/artist_api:\detokenize{module-matplotlib.artist}} \item {\sphinxstyleindexentry{matplotlib.axis}}\sphinxstyleindexpageref{api/axis_api:\detokenize{module-matplotlib.axis}} \item {\sphinxstyleindexentry{matplotlib.backend\_bases}}\sphinxstyleindexpageref{api/backend_bases_api:\detokenize{module-matplotlib.backend_bases}} \item {\sphinxstyleindexentry{matplotlib.backend\_managers}}\sphinxstyleindexpageref{api/backend_managers_api:\detokenize{module-matplotlib.backend_managers}} \item {\sphinxstyleindexentry{matplotlib.backend\_tools}}\sphinxstyleindexpageref{api/backend_tools_api:\detokenize{module-matplotlib.backend_tools}} \item {\sphinxstyleindexentry{matplotlib.backends.backend\_agg}}\sphinxstyleindexpageref{api/backend_agg_api:\detokenize{module-matplotlib.backends.backend_agg}} \item {\sphinxstyleindexentry{matplotlib.backends.backend\_cairo}}\sphinxstyleindexpageref{api/backend_cairo_api:\detokenize{module-matplotlib.backends.backend_cairo}} \item {\sphinxstyleindexentry{matplotlib.backends.backend\_mixed}}\sphinxstyleindexpageref{api/backend_mixed_api:\detokenize{module-matplotlib.backends.backend_mixed}} \item {\sphinxstyleindexentry{matplotlib.backends.backend\_nbagg}}\sphinxstyleindexpageref{api/backend_nbagg_api:\detokenize{module-matplotlib.backends.backend_nbagg}} \item {\sphinxstyleindexentry{matplotlib.backends.backend\_pdf}}\sphinxstyleindexpageref{api/backend_pdf_api:\detokenize{module-matplotlib.backends.backend_pdf}} \item {\sphinxstyleindexentry{matplotlib.backends.backend\_pgf}}\sphinxstyleindexpageref{api/backend_pgf_api:\detokenize{module-matplotlib.backends.backend_pgf}} \item {\sphinxstyleindexentry{matplotlib.backends.backend\_ps}}\sphinxstyleindexpageref{api/backend_ps_api:\detokenize{module-matplotlib.backends.backend_ps}} \item {\sphinxstyleindexentry{matplotlib.backends.backend\_qt4agg}}\sphinxstyleindexpageref{api/backend_qt4agg_api:\detokenize{module-matplotlib.backends.backend_qt4agg}} \item {\sphinxstyleindexentry{matplotlib.backends.backend\_qt4cairo}}\sphinxstyleindexpageref{api/backend_qt4cairo_api:\detokenize{module-matplotlib.backends.backend_qt4cairo}} \item {\sphinxstyleindexentry{matplotlib.backends.backend\_qt5agg}}\sphinxstyleindexpageref{api/backend_qt5agg_api:\detokenize{module-matplotlib.backends.backend_qt5agg}} \item {\sphinxstyleindexentry{matplotlib.backends.backend\_qt5cairo}}\sphinxstyleindexpageref{api/backend_qt5cairo_api:\detokenize{module-matplotlib.backends.backend_qt5cairo}} \item {\sphinxstyleindexentry{matplotlib.backends.backend\_svg}}\sphinxstyleindexpageref{api/backend_svg_api:\detokenize{module-matplotlib.backends.backend_svg}} \item {\sphinxstyleindexentry{matplotlib.backends.backend\_tkagg}}\sphinxstyleindexpageref{api/backend_tkagg_api:\detokenize{module-matplotlib.backends.backend_tkagg}} \item {\sphinxstyleindexentry{matplotlib.backends.backend\_wxagg}}\sphinxstyleindexpageref{api/backend_wxagg_api:\detokenize{module-matplotlib.backends.backend_wxagg}} \item {\sphinxstyleindexentry{matplotlib.cbook}}\sphinxstyleindexpageref{api/cbook_api:\detokenize{module-matplotlib.cbook}} \item {\sphinxstyleindexentry{matplotlib.cm}}\sphinxstyleindexpageref{api/cm_api:\detokenize{module-matplotlib.cm}} \item {\sphinxstyleindexentry{matplotlib.collections}}\sphinxstyleindexpageref{api/collections_api:\detokenize{module-matplotlib.collections}} \item {\sphinxstyleindexentry{matplotlib.colorbar}}\sphinxstyleindexpageref{api/colorbar_api:\detokenize{module-matplotlib.colorbar}} \item {\sphinxstyleindexentry{matplotlib.colors}}\sphinxstyleindexpageref{api/colors_api:\detokenize{module-matplotlib.colors}} \item {\sphinxstyleindexentry{matplotlib.container}}\sphinxstyleindexpageref{api/container_api:\detokenize{module-matplotlib.container}} \item {\sphinxstyleindexentry{matplotlib.contour}}\sphinxstyleindexpageref{api/contour_api:\detokenize{module-matplotlib.contour}} \item {\sphinxstyleindexentry{matplotlib.dates}}\sphinxstyleindexpageref{api/dates_api:\detokenize{module-matplotlib.dates}} \item {\sphinxstyleindexentry{matplotlib.dviread}}\sphinxstyleindexpageref{api/dviread:\detokenize{module-matplotlib.dviread}} \item {\sphinxstyleindexentry{matplotlib.figure}}\sphinxstyleindexpageref{api/figure_api:\detokenize{module-matplotlib.figure}} \item {\sphinxstyleindexentry{matplotlib.font\_manager}}\sphinxstyleindexpageref{api/font_manager_api:\detokenize{module-matplotlib.font_manager}} \item {\sphinxstyleindexentry{matplotlib.fontconfig\_pattern}}\sphinxstyleindexpageref{api/font_manager_api:\detokenize{module-matplotlib.fontconfig_pattern}} \item {\sphinxstyleindexentry{matplotlib.gridspec}}\sphinxstyleindexpageref{api/gridspec_api:\detokenize{module-matplotlib.gridspec}} \item {\sphinxstyleindexentry{matplotlib.image}}\sphinxstyleindexpageref{api/image_api:\detokenize{module-matplotlib.image}} \item {\sphinxstyleindexentry{matplotlib.legend}}\sphinxstyleindexpageref{api/legend_api:\detokenize{module-matplotlib.legend}} \item {\sphinxstyleindexentry{matplotlib.legend\_handler}}\sphinxstyleindexpageref{api/legend_api:\detokenize{module-matplotlib.legend_handler}} \item {\sphinxstyleindexentry{matplotlib.lines}}\sphinxstyleindexpageref{api/lines_api:\detokenize{module-matplotlib.lines}} \item {\sphinxstyleindexentry{matplotlib.markers}}\sphinxstyleindexpageref{api/markers_api:\detokenize{module-matplotlib.markers}} \item {\sphinxstyleindexentry{matplotlib.mathtext}}\sphinxstyleindexpageref{api/mathtext_api:\detokenize{module-matplotlib.mathtext}} \item {\sphinxstyleindexentry{matplotlib.mlab}}\sphinxstyleindexpageref{api/mlab_api:\detokenize{module-matplotlib.mlab}} \item {\sphinxstyleindexentry{matplotlib.offsetbox}}\sphinxstyleindexpageref{api/offsetbox_api:\detokenize{module-matplotlib.offsetbox}} \item {\sphinxstyleindexentry{matplotlib.patches}}\sphinxstyleindexpageref{api/patches_api:\detokenize{module-matplotlib.patches}} \item {\sphinxstyleindexentry{matplotlib.path}}\sphinxstyleindexpageref{api/path_api:\detokenize{module-matplotlib.path}} \item {\sphinxstyleindexentry{matplotlib.patheffects}}\sphinxstyleindexpageref{tutorials/advanced/patheffects_guide:\detokenize{module-matplotlib.patheffects}} \item {\sphinxstyleindexentry{matplotlib.projections}}\sphinxstyleindexpageref{api/projections_api:\detokenize{module-matplotlib.projections}} \item {\sphinxstyleindexentry{matplotlib.projections.polar}}\sphinxstyleindexpageref{api/projections_api:\detokenize{module-matplotlib.projections.polar}} \item {\sphinxstyleindexentry{matplotlib.pyplot}}\sphinxstyleindexpageref{api/_as_gen/matplotlib.pyplot:\detokenize{module-matplotlib.pyplot}} \item {\sphinxstyleindexentry{matplotlib.rcsetup}}\sphinxstyleindexpageref{api/rcsetup_api:\detokenize{module-matplotlib.rcsetup}} \item {\sphinxstyleindexentry{matplotlib.sankey}}\sphinxstyleindexpageref{api/sankey_api:\detokenize{module-matplotlib.sankey}} \item {\sphinxstyleindexentry{matplotlib.scale}}\sphinxstyleindexpageref{api/scale_api:\detokenize{module-matplotlib.scale}} \item {\sphinxstyleindexentry{matplotlib.sphinxext.plot\_directive}}\sphinxstyleindexpageref{devel/plot_directive:\detokenize{module-matplotlib.sphinxext.plot_directive}} \item {\sphinxstyleindexentry{matplotlib.spines}}\sphinxstyleindexpageref{api/spines_api:\detokenize{module-matplotlib.spines}} \item {\sphinxstyleindexentry{matplotlib.style}}\sphinxstyleindexpageref{api/style_api:\detokenize{module-matplotlib.style}} \item {\sphinxstyleindexentry{matplotlib.table}}\sphinxstyleindexpageref{api/table_api:\detokenize{module-matplotlib.table}} \item {\sphinxstyleindexentry{matplotlib.text}}\sphinxstyleindexpageref{api/text_api:\detokenize{module-matplotlib.text}} \item {\sphinxstyleindexentry{matplotlib.ticker}}\sphinxstyleindexpageref{api/ticker_api:\detokenize{module-matplotlib.ticker}} \item {\sphinxstyleindexentry{matplotlib.tight\_layout}}\sphinxstyleindexpageref{api/tight_layout_api:\detokenize{module-matplotlib.tight_layout}} \item {\sphinxstyleindexentry{matplotlib.transforms}}\sphinxstyleindexpageref{api/transformations:\detokenize{module-matplotlib.transforms}} \item {\sphinxstyleindexentry{matplotlib.tri}}\sphinxstyleindexpageref{api/tri_api:\detokenize{module-matplotlib.tri}} \item {\sphinxstyleindexentry{matplotlib.type1font}}\sphinxstyleindexpageref{api/type1font:\detokenize{module-matplotlib.type1font}} \item {\sphinxstyleindexentry{matplotlib.units}}\sphinxstyleindexpageref{api/units_api:\detokenize{module-matplotlib.units}} \item {\sphinxstyleindexentry{matplotlib.widgets}}\sphinxstyleindexpageref{api/widgets_api:\detokenize{module-matplotlib.widgets}} \item {\sphinxstyleindexentry{mpl\_toolkits.axes\_grid1}}\sphinxstyleindexpageref{api/_as_gen/mpl_toolkits.axes_grid1:\detokenize{module-mpl_toolkits.axes_grid1}} \item {\sphinxstyleindexentry{mpl\_toolkits.axisartist}}\sphinxstyleindexpageref{api/_as_gen/mpl_toolkits.axisartist:\detokenize{module-mpl_toolkits.axisartist}} \end{sphinxtheindex} \renewcommand{\indexname}{Index} \printindex \end{document}
X Tutup