-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed as not planned
Labels
API: consistencystatus: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.Issues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github ActionMarked by the “Stale” Github Actiontopic: text
Milestone
Description
I expect the code
figure, axes = plt.subplots(2, 2, subplot_kw={
'xticks': range(30),
'xticklabels': [matplotlib.text.Text(text=date.strftime('%m%d'),
rotation=45) for date in stat_dates_list]
})
And I wrote
for ax in axes.flatten():
for label in ax.get_xticklabels():
label.set_rotation(45)
and finally got what I want.
I look into axis.py and find that in Axes.set_ticklabels,
get_labels = []
for t in ticklabels:
# try calling get_text() to check whether it is Text object
# if it is Text, get label content
try:
get_labels.append(t.get_text())
# otherwise add the label to the list directly
except AttributeError:
get_labels.append(t)
# replace the ticklabels list with the processed one
ticklabels = get_labels
It totally ignores the kwargs of t
if t
is Text
like what's in my code above.
I think it would be more reasonable if it got not only the label content but also other kwargs if it is Text.
apunnamar and Sumon-FurReal
Metadata
Metadata
Assignees
Labels
API: consistencystatus: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.Issues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github ActionMarked by the “Stale” Github Actiontopic: text