Skip to content

Correctly handle units in ax{v,h}line - #10143

Closed
dstansby wants to merge 1 commit into
matplotlib:masterfrom
dstansby:axline-units
Closed

dstansby wants to merge 1 commit into
matplotlib:masterfrom
dstansby:axline-units

Conversation

@dstansby

@dstansby dstansby commented Jan 1, 2018

Copy link
Copy Markdown
Member

This makes axvline and axhline work with units. I have checked this with astropy units (needs astropy/astropy#7037), but I'm not sure how to check it with other unit systems.

@tacaswell

Copy link
Copy Markdown
Member

This does not seem right as it is attaching units to the user input. It does not currently work if you pass in xmin/ymin with units (ex dates)?

@tacaswell tacaswell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case of axhline the xmin/xmax should be in axis fraction which I do not understand why this should have units attached to it.

I suspect this bug should be fixed a different way.

@jklymak

jklymak commented Jan 2, 2018

Copy link
Copy Markdown
Member

@dstansby can you give us a non-astropy example that doesn't work? Maybe w/ dates as that is a readilly usable units for the rest of us...

@dstansby

dstansby commented Jan 2, 2018

Copy link
Copy Markdown
Member Author

Yeah, sorry, I've had my head buried in astropy units recently, so this approach doesn't work generally.

@dstansby dstansby closed this Jan 2, 2018
@dstansby
dstansby deleted the axline-units branch January 2, 2018 20:53
@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants