X Tutup
Skip to content

Issue #4271: reversed method added to Colormap objects.#5899

Closed
kjartankg wants to merge 3 commits intomatplotlib:masterfrom
kjartankg:master
Closed

Issue #4271: reversed method added to Colormap objects.#5899
kjartankg wants to merge 3 commits intomatplotlib:masterfrom
kjartankg:master

Conversation

@kjartankg
Copy link
Copy Markdown
Contributor

  • method added to all Colormap classes
    • a test added in test_colors

A few things that I ran into while implementing this:

  • Functions to reverse Colormap data already existed in matplotlib.cm but they are inconvenient for a user. After seeing that I changed my implementation to resemble them more. Perhaps the old functions should eventually be deprecated?
  • The documentation for LinearSegmentedColormap does not mention that input data can be functions. It is mentioned briefly in the doc for makeMappingArray but should probably be mentioned in the doc for LinearSegmentedColormap.
  • The data is specified as "list of tuples" LinearSegmentedColormap and ListedColormap "a list of matplotlib color specifications, or an equivalent Nx3 or Nx4 floating point array (N rgb or rgba values)". I would suggest that this would be changed to array_like and that the data is then copied into a numpy array for internal use.

figure_1
figure_2
figure_3
figure_4
figure_5
figure_6

    - method added to all Colormap classes
    - a test added in test_colors
@tacaswell tacaswell added this to the proposed next point release (2.1) milestone Jan 23, 2016
@tacaswell
Copy link
Copy Markdown
Member

attn @efiring

* PEP8 issues
* Python3 compatability using the six module
* Initializing data properly for the Nose test
@kjartankg
Copy link
Copy Markdown
Contributor Author

As I made the rookie mistake of working on the master branch and now there's a conflict, I need to close this PR and make a new one.

@tacaswell
Copy link
Copy Markdown
Member

For future reference you can just force-push to this branch and the PR will update it's self.

@kjartankg
Copy link
Copy Markdown
Contributor Author

@tacaswell , you mean then keep working on the master branch? I considered that but didn't really dare to. Guess I should have asked first..

Also since I have no clue how long this PR was going to take I kinda wanted to free up my master branch.

Sorry for the mess I'm making.

@tacaswell
Copy link
Copy Markdown
Member

Ah, sorry I missed that this PR was from your master, carry on 🐑

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

X Tutup