1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
|
API Reference
=============
Matplotlib interfaces
---------------------
Matplotlib has two interfaces. See :ref:`api_interfaces` for a more detailed
description of both and their recommended use cases.
.. grid:: 1 1 2 2
:padding: 0
:gutter: 2
.. grid-item-card::
:shadow: none
:class-footer: api-interface-footer
**Axes interface** (object-based, explicit)
create a `.Figure` and one or more `~.axes.Axes` objects, then *explicitly* use
methods on these objects to add data, configure limits, set labels etc.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
API:
- `~.pyplot.subplots`: create Figure and Axes
- :mod:`~matplotlib.axes`: add data, limits, labels etc.
- `.Figure`: for figure-level methods
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Example:
.. code-block:: python
:class: api-interface-example
fig, ax = plt.subplots()
ax.plot(x, y)
ax.set_title("Sample plot")
plt.show()
.. grid-item-card::
:shadow: none
:class-footer: api-interface-footer
**pyplot interface** (function-based, implicit)
consists of functions in the `.pyplot` module. Figure and Axes are manipulated
through these functions and are only *implicitly* present in the background.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
API:
- `matplotlib.pyplot`
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Example:
.. code-block:: python
:class: api-interface-example
plt.plot(x, y)
plt.title("Sample plot")
plt.show()
.. _api-index:
Modules
-------
Alphabetical list of modules:
.. toctree::
:maxdepth: 1
matplotlib_configuration_api.rst
animation_api.rst
artist_api.rst
axes_api.rst
axis_api.rst
backend_bases_api.rst
backend_managers_api.rst
backend_tools_api.rst
index_backend_api.rst
bezier_api.rst
category_api.rst
cbook_api.rst
cm_api.rst
collections_api.rst
colorbar_api.rst
colorizer_api.rst
colors_api.rst
container_api.rst
contour_api.rst
dates_api.rst
dviread.rst
figure_api.rst
font_manager_api.rst
ft2font.rst
gridspec_api.rst
hatch_api.rst
image_api.rst
inset_api.rst
layout_engine_api.rst
legend_api.rst
legend_handler_api.rst
lines_api.rst
markers_api.rst
mathtext_api.rst
mlab_api.rst
offsetbox_api.rst
patches_api.rst
path_api.rst
patheffects_api.rst
pyplot_summary.rst
projections_api.rst
quiver_api.rst
rcsetup_api.rst
sankey_api.rst
scale_api.rst
sphinxext_mathmpl_api.rst
sphinxext_plot_directive_api.rst
sphinxext_figmpl_directive_api.rst
sphinxext_roles.rst
spines_api.rst
style_api.rst
table_api.rst
testing_api.rst
text_api.rst
texmanager_api.rst
ticker_api.rst
transformations.rst
tri_api.rst
typing_api.rst
units_api.rst
widgets_api.rst
_afm_api.rst
_api_api.rst
_docstring_api.rst
_enums_api.rst
_type1font.rst
_tight_bbox_api.rst
_tight_layout_api.rst
toolkits/mplot3d.rst
toolkits/axes_grid1.rst
toolkits/axisartist.rst
pylab.rst
|