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

NF - option to make colorbar extensions rectangles #1229

Merged
merged 1 commit into from Oct 15, 2012

Conversation

ajdawson
Copy link
Contributor

I made a small change to allow the minimum and maximum colorbar extensions to be rectangular instead of triangular. This makes most sense when used in combination with the recently added extendfrac keyword with extendfrac='auto'.

A use case for this (one I recently encountered) is the need to make plots from matplotlib visually consistent with plots produced in other systems. For example, the NCAR Command Language (NCL) cannot produce triangular colorbar extensions at all (see http://www.ncl.ucar.edu/Applications/labelbar.shtml).

I appreciate that the same result could probably be achieved through fiddling with the colorbar values and labels, but this feels like the most intuitive solution for users.

@WeatherGod
Copy link
Member

I like the idea, and your use-case is certainly valid as I know many people would want to have as identical as possible images when porting a script from one language to another. Just a few things for polishing: put asterisks around "True" and "False" in the docstrings (and make sure to use "True" and "False" instead of "true"/"false"). Add a test. Add an entry to doc/users/whats_new.rst. Note that you will likely have to create a new section for v1.3.

@ajdawson
Copy link
Contributor Author

I've added tests, actually I refactored the test_colorbar.py module somewhat to accomodate the new tests more efficiently.
Also added entries to doc/user/whats_new.rst and doc/api/api_changes.rst.
Finally, rebased onto master

@ajdawson
Copy link
Contributor Author

I think this one is ready to go now. It is freshly rebased onto master ready for merging.

@WeatherGod
Copy link
Member

Thanks for the ping. Things look good to me here. Merging!

WeatherGod added a commit that referenced this pull request Oct 15, 2012
NF - option to make colorbar extensions rectangles
@WeatherGod WeatherGod merged commit ee2d7f7 into matplotlib:master Oct 15, 2012
@ajdawson ajdawson deleted the colorbar-triangles branch July 18, 2013 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants