Skip to content

polar error bar fix #28924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3770,9 +3770,9 @@
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

Check failure on line 3773 in lib/matplotlib/axes/_axes.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 E261 at least two spaces before inline comment Raw Output: ./lib/matplotlib/axes/_axes.py:3773:84: E261 at least two spaces before inline comment

Check failure on line 3773 in lib/matplotlib/axes/_axes.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 E262 inline comment should start with '# ' Raw Output: ./lib/matplotlib/axes/_axes.py:3773:85: E262 inline comment should start with '# '

Check failure on line 3773 in lib/matplotlib/axes/_axes.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 E501 line too long (113 > 88 characters) Raw Output: ./lib/matplotlib/axes/_axes.py:3773:89: E501 line too long (113 > 88 characters)
if axis == 'y':
rotation.rotate(-np.pi / 2)
rotation.rotate(np.pi / 2)#changed sign on "np.pi"

Check failure on line 3775 in lib/matplotlib/axes/_axes.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 E261 at least two spaces before inline comment Raw Output: ./lib/matplotlib/axes/_axes.py:3775:55: E261 at least two spaces before inline comment

Check failure on line 3775 in lib/matplotlib/axes/_axes.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 E262 inline comment should start with '# ' Raw Output: ./lib/matplotlib/axes/_axes.py:3775:55: E262 inline comment should start with '# '
ms = mmarkers.MarkerStyle(marker=marker,
transform=rotation)
self.add_line(mlines.Line2D([theta], [r], marker=ms,
Expand Down
14 changes: 14 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -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()

Check failure on line 14 in test.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 W292 no newline at end of file Raw Output: ./test.py:14:11: W292 no newline at end of file
Loading