Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Description
It would be really nice to have some function that could draw arbitrarily angled straight lines on a graph, along the lines ofggplot's abline
for example, these might be ways to draw infinite lines:
pl.abline(intercept=0,slope=1)# 1:1 line from the originpl.abline(a=[0,0],b=[1,1])# same line as above, using 2 pointspl.abline(a=[0,0],angle=45)# same line again, using 1 point and an anglepl.abline(a=[0,0],gradient=1)# same line again, using 1 point and the gradient
These are all infinite lines (they extend to the bounds of the graph, regardless of where their specified points lie).
There are a few questions on stack overflow indicating how popular this might be, eg:
http://stackoverflow.com/questions/22104256/does-matplotlib-have-a-function-for-drawing-diagonal-lines-in-axis-coordinates