-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Plotting use FixedLocator #26185
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 3 commits
2e732b1
7cea50a
7e67f99
3620080
f343631
62874fb
863ba3d
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 |
---|---|---|
|
@@ -410,8 +410,13 @@ def get_label(i): | |
|
||
if self.orientation == 'vertical' or self.orientation is None: | ||
if self._need_to_set_index: | ||
xticklabels = [get_label(x) for x in ax.get_xticks()] | ||
xticks = ax.get_xticks() | ||
xticklabels = [get_label(x) for x in xticks] | ||
ax.set_xticklabels(xticklabels) | ||
from matplotlib.ticker import FixedLocator, FixedFormatter | ||
ax.xaxis.set_major_locator(FixedLocator(xticks)) | ||
ax.xaxis.set_major_formatter(FixedFormatter(xticklabels)) | ||
|
||
self._apply_axis_properties(ax.xaxis, rot=self.rot, | ||
fontsize=self.fontsize) | ||
self._apply_axis_properties(ax.yaxis, fontsize=self.fontsize) | ||
|
@@ -422,8 +427,12 @@ def get_label(i): | |
|
||
elif self.orientation == 'horizontal': | ||
if self._need_to_set_index: | ||
yticklabels = [get_label(y) for y in ax.get_yticks()] | ||
yticks = ax.get_yticks() | ||
yticklabels = [get_label(y) for y in yticks] | ||
ax.set_yticklabels(yticklabels) | ||
from matplotlib.ticker import FixedLocator, FixedFormatter | ||
ax.xaxis.set_major_locator(FixedLocator(yticks)) | ||
ax.xaxis.set_major_formatter(FixedFormatter(yticklabels)) | ||
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. Why is the x axis given the y-tick(label)s here? Seems like an error to me. Also note 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. This is definitly an error. 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. If you have identified dead code you can submit a follow up PR to remove |
||
self._apply_axis_properties(ax.yaxis, rot=self.rot, | ||
fontsize=self.fontsize) | ||
self._apply_axis_properties(ax.xaxis, fontsize=self.fontsize) | ||
|
Uh oh!
There was an error while loading. Please reload this page.