8000 Issue #4271: reversed method added to Colormap objects. by kjartankg · Pull Request #5899 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

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

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 3 commits into from

Conversation

kjartankg
Copy link
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
Member

attn @efiring

* PEP8 issues
* Python3 compatability using the six module
* Initializing data properly for the Nose test
@kjartankg
Copy link
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
Member

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

@kjartankg
Copy link
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
Member

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
0

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