-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Closed
Description
Moving Y ticks on the right (tick_right(), set_label_position("right")) removes any styling applied to tick labels. Works ok for left-hand tick labels.
Any solution for this? I want to achieve conditional label styling (e.g. every other label is bold) based on label text.
- Matplotlib 1.5.1
- Python 3.5.2
- installed with anaconda
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
fig, (ax_left, ax_right) = plt.subplots(1,2, figsize=(8, 4))
pd.Series(np.random.randint(0, high=10, size=10)).plot(kind='bar', ax=ax_left)
for tick in ax_left.yaxis.get_major_ticks():
tick.label.set_weight('bold')
tick.label.set_style('italic')
pd.Series(np.random.randint(0, high=10, size=10)).plot(kind='bar', ax=ax_right)
for tick in ax_right.yaxis.get_major_ticks():
tick.label.set_weight('bold')
tick.label.set_style('italic')
ax_right.yaxis.tick_right()
ax_right.yaxis.set_label_position("right")
plt.show();
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
