8000 A method added to Colormap classes to reverse the colormap by kjartankg · Pull Request #6211 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

A method added to Colormap classes to reverse the colormap #6211

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

Merged
merged 3 commits into from
Mar 27, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Docstring changes made based on comments:
* NOTE: cnaged to .. note ::
* Raises section removed Colormap.reversed docstring
* methods mentioned in a new file under whats_new
  • Loading branch information
kjartankg committed Mar 26, 2016
commit d2d997156f5003367fd066e4751470bc20b70dde
7 changes: 7 additions & 0 deletions doc/users/whats_new/reversed_colormap.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Colormap reversed method
------------------------

The methods :meth:`~matplotlib.colors.LinearSegmentedColormap.reversed` and
:meth:`~matplotlib.colors.ListedColormap.reversed` return a reversed
instance of the Colormap. This implements a way for any Colormap to be
reversed.
7 changes: 1 addition & 6 deletions lib/matplotlib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,19 +669,14 @@ def reversed(self, name=None):
"""
Make a reversed instance of the Colormap.

NOTE: Function not implemented for base class.
.. note :: Function not implemented for base class.

Parameters
----------
name : str, optional
The name for the reversed colormap. If it's None the
name will be the name of the parent colormap + "_r".

Raises
------
NotImplementedError
Function not implemented for base class.

Notes
-----
See :meth:`LinearSegmentedColormap.reversed` and
Expand Down
0