diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index de0c6854cbb1..eedef7230944 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -3770,9 +3770,9 @@ def apply_mask(arrays, mask): for l in caplines[axis]: # Rotate caps to be perpendicular to the error bars for theta, r in zip(l.get_xdata(), l.get_ydata()): - rotation = mtransforms.Affine2D().rotate(theta) + rotation = mtransforms.Affine2D().rotate(theta + np.pi / 2) #changed rotation coefficient if axis == 'y': - rotation.rotate(-np.pi / 2) + rotation.rotate(np.pi / 2)#changed sign on "np.pi" ms = mmarkers.MarkerStyle(marker=marker, transform=rotation) self.add_line(mlines.Line2D([theta], [r], marker=ms, diff --git a/test.py b/test.py new file mode 100644 index 000000000000..964971a37c3d --- /dev/null +++ b/test.py @@ -0,0 +1,14 @@ + +import matplotlib.pyplot as plt +import numpy as np + +theta = np.arange(0, 2 * np.pi, np.pi / 8) +r = theta / np.pi / 2 + 0.5 + +fig = plt.figure(figsize=(10, 10)) +ax = fig.add_subplot(projection='polar') +ax.set_theta_zero_location("N") +ax.set_theta_direction(-1) +ax.errorbar(theta, r, xerr=0.1, yerr=0.1, capsize=7, fmt="o", c="seagreen") +ax.set_title("Pretty polar error bars") +plt.show() \ No newline at end of file