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
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.
Operating system
fedora
Matplotlib Version
3.7.0.dev1370+g651a87407a
Matplotlib Backend
mplcairo
Python version
3.10
Jupyter version
ENOSUCHLIB
Installation
git checkout
The text was updated successfully, but these errors were encountered:
+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).
Bug summary
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.)
Code for reproduction
Actual outcome
Expected outcome
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.
Operating system
fedora
Matplotlib Version
3.7.0.dev1370+g651a87407a
Matplotlib Backend
mplcairo
Python version
3.10
Jupyter version
ENOSUCHLIB
Installation
git checkout
The text was updated successfully, but these errors were encountered: