-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix: axis, ticks are set to defaults fontsize after ax.clear() #21253
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 2 commits
25a7adb
51a67ab
7f6cf25
f1881a4
5507567
f07cf62
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 |
---|---|---|
|
@@ -163,6 +163,40 @@ def __init__(self, | |
""" | ||
super().__init__() | ||
self._x, self._y = x, y | ||
self._reset_visual_defaults( | ||
text=text, | ||
color=color, | ||
fontproperties=fontproperties, | ||
usetex=usetex, | ||
parse_math=parse_math, | ||
wrap=wrap, | ||
verticalalignment=verticalalignment, | ||
horizontalalignment=horizontalalignment, | ||
multialignment=multialignment, | ||
rotation=rotation, | ||
transform_rotates_text=transform_rotates_text, | ||
linespacing=linespacing, | ||
rotation_mode=rotation_mode, | ||
**kwargs, | ||
) | ||
|
||
def _reset_visual_defaults( | ||
self, | ||
text='', | ||
color=None, | ||
fontproperties=None, | ||
usetex=None, | ||
parse_math=None, | ||
wrap=False, | ||
verticalalignment='baseline', | ||
horizontalalignment='left', | ||
multialignment=None, | ||
rotation=None, | ||
transform_rotates_text=False, | ||
linespacing=None, | ||
rotation_mode=None, | ||
**kwargs, | ||
): | ||
self._text = '' | ||
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. Move this line to 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 also thnik that 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. Thank you for your review @oscargus ! but I'm a bit comfused about the first comment. 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. Sorry. I meant that the lines so something like:
|
||
self.set_text(text) | ||
self.set_color( | ||
|
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 think it's clearer to name this
_init
because this is really the__init__
logic extracted in a separate method.