Skip to content
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

Clarify input dimensions for pcolormesh in documentation #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 5 additions & 2 deletions docs/plotting_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,14 @@ Creates a pseudo-color plot

`pcolormesh(x, y, data, *args, **kwargs) <http://matplotlib.org/basemap/api/basemap_api.html#mpl_toolkits.basemap.Basemap.pcolormesh>`_

* x and y are matrices of the same size as data, containing the positions of the elements in the map coordinates
* x and y are matrices containing the positions of the elements in the map coordinates
* data is the matrix containing the data values to plot
* The default colormap is *jet*, but the argument *cmap* can be used to change the behavior
* Other possible arguments are documented in the `matplotlib function docs <http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.pcolormesh>`__

Note that ideally the dimensions of x and y should be one greater than those of data;
if the dimensions are the same, then the last row and column of data will be ignored.

.. literalinclude:: ../code_examples/basic_functions/pcolormesh.py
:emphasize-lines: 22
.. image:: images/basic_functions/pcolormesh.png
Expand Down Expand Up @@ -347,4 +350,4 @@ The text can have many many options such as:

.. image:: images/plotting_data/text.png

To draw a text label with an arrow, use :ref:`annotate`.
To draw a text label with an arrow, use :ref:`annotate`.