[WIP] Add Axes method for drawing infinite lines.#7506
[WIP] Add Axes method for drawing infinite lines.#7506QuLogic wants to merge 1 commit intomatplotlib:masterfrom
Conversation
|
This is pretty neat! Given |
|
|
||
| @docstring.dedent_interpd | ||
| def axline(self, slope=1, intercept=0, **kwargs): | ||
| """ |
| Add an infinite line across the axes. | ||
|
|
||
| Parameters | ||
| ---------- |
There was a problem hiding this comment.
Is there a reason this and intercept are optional? I would say the user should be forced to give them.
|
|
||
| See Also | ||
| -------- | ||
| axhline : for strictly horizontal lines |
There was a problem hiding this comment.
Do these get automatically linked? If not would be nice to have some sphinx markup to link to relevant methods.
|
A tentative suggestion on arguments, how about following forms: Accept following combinations:
This may cover most forms as suggeted by #5253 . Surely, we may assign default value to |
|
@QuLogic do you have any plans to work on this? If not let me know and I'm happy to pick it up. I think it would be a cool and useful feature to add. |
|
I don't really have time at the moment, so feel free to prepare something based on it. |
|
Closing in favour of #9321 |

This is an implementation of an infinite line artist following the transforms I outlined in #5253. However, I did need to change from
ax.dataLimtoax.viewLimbecause the former is infinite when nothing else is on the plot. I'm not sure if that will cause problems (maybe in log-scaled plots?), though it seems to work:Unlike
axhlineandaxvline, there is no[xy]{min,max}or autoscaling based on these artists because I don't think it makes sense for infinite lines.I've only implemented
slope/interceptand not any of the alternates in #5253; not sure which ones we want to support. Also needs some tests, wrapper inpyplot, etc., so it's still WIP.