Skip to content

Adjusting Rotation #28937

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 1 commit into from
Closed
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
16 changes: 11 additions & 5 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3766,17 +3766,23 @@
caplines[dep_axis].append(mlines.Line2D(
x_masked, y_masked, marker=marker, **eb_cap_style))
if self.name == 'polar':
# Get theta direction and theta offset for proper cap alignment
theta_direction = self.get_theta_direction()
theta_offset = self.get_theta_offset()

for axis in caplines:
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)
# Adjust rotation using theta direction and offset
rotation = mtransforms.Affine2D().rotate((theta * theta_direction) + theta_offset)

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

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 E501 line too long (106 > 88 characters) Raw Output: ./lib/matplotlib/axes/_axes.py:3778:89: E501 line too long (106 > 88 characters)

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

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 W293 blank line contains whitespace Raw Output: ./lib/matplotlib/axes/_axes.py:3779:1: W293 blank line contains whitespace
if axis == 'y':
rotation.rotate(-np.pi / 2)
ms = mmarkers.MarkerStyle(marker=marker,
transform=rotation)
self.add_line(mlines.Line2D([theta], [r], marker=ms,
**eb_cap_style))

ms = mmarkers.MarkerStyle(marker=marker, transform=rotation)
self.add_line(mlines.Line2D([theta], [r], marker=ms, **eb_cap_style))

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

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 E501 line too long (93 > 88 characters) Raw Output: ./lib/matplotlib/axes/_axes.py:3784:89: E501 line too long (93 > 88 characters)

else:
for axis in caplines:
for l in caplines[axis]:
Expand Down
Loading