You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: for non-rectilinear axes, axvline/axhline should behave as "draw a gridline at that x/y" #24996
Currently, on polar axes, axvline correctly draws a radial line at a given angle, but axhline draws nothing. It would be nice if axhline provided an easy way to draw a circle at a given radius (= a line at constant r), something for which I don't think there's an easy API right now.
More generally, for arbitrary axes, it seems that axvline and axhline have "clear" generalizations as "draw a gridline at a given x or y value".
(And likewise for axvspan/axhspan.)
For polar axes, the solution is to explicitly set _interpolation_steps, i.e. axhline(.5, color="C1").get_path()._interpolation_steps = 180. (Otherwise, what happens is that both ends of the axhline (at theta=0 and theta=2pi) end up being transformed to the same point and a degenerate, null line is drawn.)
Perhaps axvline/axhline should simply do that.
Additional information
One could ultimately consider drawing gridlines using axhline/axvline, if this is fixed.
+1 to this issue.
Also, when using polar axes, yticks label cannot be modified with matplotlib.axes.Axes.tick_params (for example moving the label to be on top of the line instead of being on the right side).
Activity
javivallejo commentedon Sep 15, 2023
+1 to this issue.
Also, when using polar axes, yticks label cannot be modified with
matplotlib.axes.Axes.tick_params(for example moving the label to be on top of the line instead of being on the right side).