Skip to content

[Bug]: Strange errorbar caps when polar axes have non-default theta direction or theta zero location #28885

Closed
@Hem-W

Description

@Hem-W

Bug summary

For the projection="polar" axes that are set to use a different theta direction or theta zero location other than the default, the caps of ax.errorbar would be rotated strangely.

Code for reproduction

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.errorbar(theta, r, xerr=0.1, yerr=0.1, capsize=7, fmt="o", c="seagreen")
ax.set_title("Pretty polar error bars")
ax.set_theta_zero_location("N")
ax.set_theta_direction(-1)
plt.show()

Actual outcome

output

Expected outcome

The caps of error bars are expected to be still perpendicular to the error bar lines.

Additional information

No response

Operating system

Ubuntu 20.04

Matplotlib Version

3.9.1

Matplotlib Backend

module://matplotlib_inline.backend_inline

Python version

3.9.18

Jupyter version

No response

Installation

conda

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions