-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Remove many unused variables. #13932
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1026,15 +1026,10 @@ def _draw_text_as_text(self, gc, x, y, s, prop, angle, ismath, mtext=None): | |
font = self._get_font(prop) | ||
font.set_text(s, 0.0, flags=LOAD_NO_HINTING) | ||
|
||
fontsize = prop.get_size_in_points() | ||
|
||
fontfamily = font.family_name | ||
fontstyle = prop.get_style() | ||
|
||
attrib = {} | ||
# Must add "px" to workaround a Firefox bug | ||
style['font-size'] = short_float_fmt(fontsize) + 'px' | ||
style['font-family'] = str(fontfamily) | ||
style['font-size'] = short_float_fmt(prop.get_size()) + 'px' | ||
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.
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 know... planning to deprecate get_size_in_points but there are bugger issues with fontproperties anyways. |
||
style['font-family'] = str(font.family_name) | ||
style['font-style'] = prop.get_style().lower() | ||
style['font-weight'] = str(prop.get_weight()).lower() | ||
attrib['style'] = generate_css(style) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I loosely recall that there was a discussion if examples should have return values even though they are not used.
Advantage: The user sees that this returns an object that can be used further.
Disadvantage: In practical use, you would only define the return value if you actually need it. So the example does not represent how you would use Matplotlib in real life. And it's more cluttered than need be.
Personally, I'm fine with removing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope no one is reading axes_grid demos to learn about basic mpl concepts such as artists being returned by most calls :)