Description
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
from pylab import *
polar(); axvline(-np.radians(22.5), color="C0"); axhline(.5, color="C1")
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