Skip to content
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

CLN: resolve UserWarning in pandas/plotting/_matplotlib/core.py #35945 #35946

Merged
merged 5 commits into from
Sep 5, 2020
Merged
Changes from 1 commit
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
4 changes: 1 addition & 3 deletions pandas/plotting/_matplotlib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1219,8 +1219,6 @@ def _update_stacker(cls, ax, stacking_id, values):
ax._stacker_neg_prior[stacking_id] += values

def _post_plot_logic(self, ax, data):
from matplotlib.ticker import FixedLocator

def get_label(i):
if is_float(i) and i.is_integer():
i = int(i)
Expand All @@ -1232,8 +1230,8 @@ def get_label(i):
if self._need_to_set_index:
xticks = ax.get_xticks()
xticklabels = [get_label(x) for x in xticks]
ax.set_xticks(xticks)
fangchenli marked this conversation as resolved.
Show resolved Hide resolved
ax.set_xticklabels(xticklabels)
ax.xaxis.set_major_locator(FixedLocator(xticks))

condition = (
not self._use_dynamic_x()
Expand Down