{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "***********\n", "Usage Guide\n", "***********\n", "\n", "This tutorial covers some basic usage patterns and best-practices to\n", "help you get started with Matplotlib.\n", "\n", "\n", "General Concepts\n", "================\n", "\n", ":mod:`matplotlib` has an extensive codebase that can be daunting to many\n", "new users. However, most of matplotlib can be understood with a fairly\n", "simple conceptual framework and knowledge of a few important points.\n", "\n", "Plotting requires action on a range of levels, from the most general\n", "(e.g., 'contour this 2-D array') to the most specific (e.g., 'color\n", "this screen pixel red'). The purpose of a plotting package is to assist\n", "you in visualizing your data as easily as possible, with all the necessary\n", "control -- that is, by using relatively high-level commands most of\n", "the time, and still have the ability to use the low-level commands when\n", "needed.\n", "\n", "Therefore, everything in matplotlib is organized in a hierarchy. At the top\n", "of the hierarchy is the matplotlib \"state-machine environment\" which is\n", "provided by the :mod:`matplotlib.pyplot` module. At this level, simple\n", "functions are used to add plot elements (lines, images, text, etc.) to\n", "the current axes in the current figure.\n", "\n", "
Pyplot's state-machine environment behaves similarly to MATLAB and\n", " should be most familiar to users with MATLAB experience.
Developers for matplotlib have to follow a specific style and guidelines.\n", " See `developers-guide-index`.
Backend name specifications are not case-sensitive; e.g., 'GTK3Agg'\n", " and 'gtk3agg' are equivalent.
Major changes related to interactivity, and in particular the\n", " role and behavior of :func:`~matplotlib.pyplot.show`, were made in the\n", " transition to matplotlib version 1.0, and bugs were fixed in\n", " 1.0.1. Here we describe the version 1.0.1 behavior for the\n", " primary interactive backends, with the partial exception of\n", " *macosx*.
Interactive mode works with suitable backends in ipython and in\n", " the ordinary python shell, but it does *not* work in the IDLE IDE.\n", " If the default backend does not support interactivity, an interactive\n", " backend can be explicitly activated using any of the methods discussed in `What is a backend?`_.
Changes related to how line segments are simplified were made\n", " in version 2.1. Rendering time will still be improved by these\n", " parameters prior to 2.1, but rendering time for some kinds of\n", " data will be vastly improved in versions 2.1 and greater.