Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Do not check value of parameters from rcParam (and check rcParam befo…#26167
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
…re using them)
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -740,7 +740,8 @@ def set_style(self, style): | ||
""" | ||
if style is None: | ||
style = mpl.rcParams['font.style'] | ||
else: | ||
_api.check_in_list(['normal', 'italic', 'oblique'], style=style) | ||
Comment on lines 741 to +744 Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I'm not a fan of this kind of change. The code get's longer, harder to follow and more prone to errors. Double checking the rcParam value here does not hurt. The only disadvantage are 300ns performance loss (which I claim to be negigible in any real-world application). But since the rcParam validation is an independent concept, we don't have a guarantee that they are synchronous. Such differences could be an oversight. But I can also imagine cases where rcParams are used in multiple places and have a slightly broader acceptance range than what a specific function supports. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. The thing is that those 300 ns are multiplied with a huge number in many situations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. What is huge? If huge * 300ns > 2% of the total plot time, we may start to consider, otherwise, the benefit is negligible. | ||
self._slant = style | ||
def set_variant(self, variant): | ||
@@ -753,7 +754,8 @@ def set_variant(self, variant): | ||
""" | ||
if variant is None: | ||
variant = mpl.rcParams['font.variant'] | ||
else: | ||
_api.check_in_list(['normal', 'small-caps'], variant=variant) | ||
self._variant = variant | ||
def set_weight(self, weight): | ||