KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
In matplotlib we can draw lines using at least 2 methods: plt.plot plt.plot([1,2],[1,2],color='k',marker='o') Line2D method line = lines.Line2D([0.3,0.6],[0.9,0.3],linestyle='dashed',color='k') plt.axes().add_line(line) I suspect both methods are the same in implementation of course. But anyway, it draws a line exactly between 2 stated points. Sometimes I need to extend line over those 2 points up to graph limits. Sure I can calculate it in form of y=ax+b, but does anybody know way easier? Perfect case if I can just put some additional option, but I wasn't able to find it.
Tags (comma-separated)
Save Edits
Cancel