8000 Validate rcParams["image.origin"]. by anntzer · Pull Request #12898 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Validate rcParams["image.origin"]. #12898

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 1 commit into from
Nov 27, 2018
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions lib/matplotlib/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -1752,8 +1752,7 @@ def _initialize_x_y(self, z):
- 'lower': ``Z[0, 0]`` is at X=0.5, Y=0.5 in the lower left corner.
- 'upper': ``Z[0, 0]`` is at X=N+0.5, Y=0.5 in the upper left
corner.
- 'image': Use the value from :rc:`image.origin`. Note: The value
*None* in the rcParam is currently handled as 'lower'.
- 'image': Use the value from :rc:`image.origin`.

extent : (x0, x1, y0, y1), optional
If *origin* is not *None*, then *extent* is interpreted as
Expand Down
3 changes: 2 additions & 1 deletion lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,8 @@ def _validate_linestyle(ls):
'image.interpolation': ['nearest', validate_string],
'image.cmap': ['viridis', validate_string], # one of gray, jet, etc
'image.lut': [256, validate_int], # lookup table
'image.origin': ['upper', validate_string], # lookup table
'image.origin': ['upper',
ValidateInStrings('image.origin', ['upper', 'lower'])],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprised you didn't wrap this in something that wasn't camel case 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have bigger plans for rcsetup, but they're shelved for now...

'image.resample': [True, validate_bool],
# Specify whether vector graphics backends will combine all images on a
# set of axes into a single composite image
Expand Down
0