Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

abline() - for drawing arbitrary lines on a plot, given specifications. #5253

Closed
Assignees
QuLogic
Milestone
@naught101

Description

@naught101

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp