I'm looking to change the values at which there are ticks, for the right hand side y-axis (but NOT the left).
Here's a MWE:
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot([1, 2, 3], [1, 2, 3])
ax.tick_params(axis="y", which="both", labelright="on")
ax.tick_params(axis="y", which="both", labelleft="on", labelright="on")
ax.set_yticks([1, 2, 3])
plt.show()
With the set_yticks
command I get the behavior on both axes:
For reference, here are the default ticks:
I'm looking for something like
ax.set_yticks([1, 2, 3], which='right')
so that I can have ticks every 0.25 on the left axis, and ticks every 1 on the right axis. Any ideas?