python - Move radial tick labels on a polar plot in matplotlib -
from matplotlib examples:
import numpy np import seaborn sbs import matplotlib.pyplot plt r = np.arange(0, 3.0, 0.01) theta = 2 * np.pi * r ax = plt.subplot(111, polar=true) ax.plot(theta, r, color='r', linewidth=3) ax.set_rmax(2.0) ax.grid(true) ax.set_title("a line plot on polar axis", va='bottom') plt.show()
how move radial tick labels (0.5, 1.0, 1.5, 2.0) different angle, 120 deg?
with version 1.4 or later, can use "set_rlabel_position". e.g. place radial ticks long line at, say, 135 degrees:
ax.set_rlabel_position(135)
the relevant documentation residing here, bit hidden under "projections".
adding line above yields (i don't have seaborn has default matplotlib formatting):
prior 1.4, ax.set_rgrids
can take angle argument.
Comments
Post a Comment