Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Changes to the pyplot api documentation #11620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions doc/api/colors_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
colors
******

For a visual representation of the Matplotlib colormaps, see:
Tutorials and examples about matplotlib colors:

* :doc:`/tutorials/colors/colors` tutorial.
* :doc:`/tutorials/colors/colormaps` tutorial.
* All :ref:`tutorials-colors` tutorials.
* The :ref:`color_examples` examples for examples of controlling color with
Matplotlib.
* The :ref:`tutorials-colors` tutorial for an in-depth guide on controlling
color.


:mod:`matplotlib.colors`
========================
Expand Down
278 changes: 262 additions & 16 deletions doc/api/pyplot_summary.rst
Original file line number Diff line number Diff line change
@@ -1,29 +1,275 @@
Pyplot function overview
------------------------
******
pyplot
******

.. currentmodule:: matplotlib
.. currentmodule:: matplotlib.pyplot

.. automodule:: matplotlib.pyplot
:no-members:

Creating figures
================
.. autosummary::
:toctree: _as_gen
:template: autofunctions.rst
:toctree: _as_gen
:template: autosummary.rst
:nosignatures:

pyplot
figure
subplots

Global functions
================

.. currentmodule:: matplotlib.pyplot
.. autosummary::
:toctree: _as_gen
:template: autosummary.rst
:nosignatures:

.. autofunction:: plotting
findobj
get_plot_commands
install_repl_displayhook
ioff
ion
isinteractive
pause
rc
rc_context
rcdefaults
show
switch_backend
uninstall_repl_displayhook

Any artist
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean? Functions that can be used by any artist? Or functions that are applied to every artist on the plot?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are functions that can be applied to every artist. The name was just taken from thepyplot file.

==========

Colors in Matplotlib
--------------------
.. autosummary::
:toctree: _as_gen
:template: autosummary.rst
:nosignatures:

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.
getp
setp
xkcd

For a more in-depth look at colormaps, see the
:doc:`/tutorials/colors/colormaps` tutorial.
Working with figures
====================

.. currentmodule:: matplotlib.pyplot
.. autosummary::
:toctree: _as_gen
:template: autosummary.rst
:nosignatures:

clf
close
connect
disconnect
draw
fignum_exists
figure
gcf
get_current_fig_manager
get_figlabels
get_fignums
ginput
savefig
waitforbuttonpress

Adding elements to figures
==========================

.. autosummary::
:toctree: _as_gen
:template: autosummary.rst
:nosignatures:

figimage
figlegend
figtext
suptitle

Working with axes
=================

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth putting a single sentence here saying what an axes is (as opposed to an axis)

.. autosummary::
:toctree: _as_gen
:template: autosummary.rst
:nosignatures:

axes
box
cla
delaxes
gca
grid
sca
subplot
subplots
subplot2grid
subplot_tool
subplots_adjust
tight_layout
twinx
twiny

Adding elements to axes
=======================

.. autosummary::
:toctree: _as_gen
:template: autosummary.rst
:nosignatures:

annotate
arrow
legend
table
text
title


Working with axis
=================

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth putting a single sentence here saying what an axis is (as opposed to an axes)

.. autosummary::
:toctree: _as_gen
:template: autosummary.rst
:nosignatures:

autoscale
axis
locator_params
margins
minorticks_off
minorticks_on
rgrids
thetagrids
tick_params
ticklabel_format
xlabel
ylabel
xlim
ylim
xscale
yscale
xticks
yticks


Current image
=============

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current image doesn't mean much to me, might be worth putting a single sentence here too.

.. autosummary::
:toctree: _as_gen
:template: autosummary.rst
:nosignatures:

clabel
clim
colorbar
colormaps
gci
sci
set_cmap

Working with images
===================

.. autosummary::
:toctree: _as_gen
:template: autosummary.rst
:nosignatures:

imread
imsave

Plotting functions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth moving this up too, since these are probably the second most common set of functions that people use.

==================

.. autosummary::
:toctree: _as_gen
:template: autosummary.rst
:nosignatures:

acorr
angle_spectrum
axhline
axhspan
axvline
axvspan
bar
barbs
barh
boxplot
broken_barh
cohere
contour
contourf
csd
errorbar
eventplot
fill
fill_between
fill_betweenx
hexbin
hist
hist2d
hlines
imshow
loglog
magnitude_spectrum
matshow
pcolor
pcolormesh
phase_spectrum
pie
plot
plot_date
plotfile
polar
psd
quiver
quiverkey
scatter
semilogx
semilogy
specgram
spy
stackplot
stem
step
streamplot
tricontour
tricontourf
tripcolor
triplot
violinplot
vlines
xcorr

Colormaps
=========

.. autosummary::
:toctree: _as_gen
:template: autosummary.rst
:nosignatures:

.. autofunction:: colormaps
autumn
bone
cool
copper
flag
gray
hot
hsv
inferno
jet
magma
nipy_spectral
pink
plasma
prism
spring
summer
viridis
winter
23 changes: 21 additions & 2 deletions lib/matplotlib/cm.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
"""
Builtin colormaps, colormap handling utilities, and the `ScalarMappable` mixin.

See :doc:`/gallery/color/colormap_reference` for a list of builtin colormaps.
See :doc:`/tutorials/colors/colormaps` for an in-depth discussion of colormaps.
See :doc:`/gallery/color/colormap_reference` for a list of builtin colormaps
and :doc:`/tutorials/colors/colormaps` for an in-depth discussion of colormaps.

Attributes
----------
cmap_d : dict
A dictionary with all registred colormaps.

cmap : for example viridis
Every registred colormap is an attribute in the module.

See Also
--------
.pyplot.colormaps : Returns a list with the names of all available colormaps.
.colors.Colormap : The colormap class.

Examples
--------
The viridis colormap is returned by::

matplotlib.cm.viridis
"""

import numpy as np
Expand Down
Loading