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

Include outward ticks in bounding box#5683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tacaswell merged 5 commits intomatplotlib:masterfrommdboom:tight-ticks
Dec 19, 2015

Conversation

mdboom
Copy link
Member

Replaces#5502.

@mdboom
Copy link
MemberAuthor

This needs a test specifically of tight layout on outward ticks, but I thought I'd put this up for comment early anyway...

@mdboommdboom added this to thenext major release (2.0) milestoneDec 15, 2015
@QuLogic
Copy link
Member

I think you meant this replaces#5502?

@mdboom
Copy link
MemberAuthor

I think you meant this replaces#5502?

Oops. You're right.

@QuLogic
Copy link
Member

Well, I don't see anything particularly wrong with it, but are there no test images that use outward ticks? Or just none with a tight bounding box?

@mdboom
Copy link
MemberAuthor

A test has been added

x_pad = self.xaxis.get_tick_padding()
y_pad = self.yaxis.get_tick_padding()
return mtransforms.Bbox([[bbox.x0 - x_pad, bbox.y0 - y_pad],
[bbox.x1 + x_pad, bbox.y1 + y_pad]])
Copy link
Member

Choose a reason for hiding this comment

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

Is this going to work for polar axes? I would also double-check that this doesn't utterly bork for axes3d (not that I'd expect it to work great there, just to not crash or something).

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

polar axes don't have ticks -- but it does appear that this needs to be updated so it's aware of when the ticks are present or not.

It doesn't seem to crash for axes3d, though as you say, it doesn't really do the right thin other than add a bit more space.

@WeatherGod
Copy link
Member

image tests that have just been added are failing

@WeatherGod
Copy link
Member

I don't think the test is really all that useful. tight_layout is for ensuring that subplots don't run into each other. So, a good test would be to have a grid of subplots, perhaps each with different tick directions?

@mdboommdboomforce-pushed thetight-ticks branch 2 times, most recently from83e8a00 to14190e4CompareDecember 16, 2015 15:35
@mdboom
Copy link
MemberAuthor

@WeatherGod: I've updated the test as you helpfully suggested.

Get the length of the tick outside of the axes.
"""
tickdir = self._tickdir
if tickdir == 'in':
Copy link
Member

Choose a reason for hiding this comment

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

bit of a bike shed, better to do this with a dictionary?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Sure.

@mdboom
Copy link
MemberAuthor

I've addressed@tacaswell's comments, and added minor ticks to the test to catch the pathological case he mentions.

@mdboom
Copy link
MemberAuthor

Also updated to handle the case where there are no ticks, as suggested by@WeatherGod

tacaswell added a commit that referenced this pull requestDec 19, 2015
Include outward ticks in bounding box
@tacaswelltacaswell merged commit08fc864 intomatplotlib:masterDec 19, 2015
@tacaswell
Copy link
Member

backported as2a6bb26

tacaswell added a commit that referenced this pull requestDec 19, 2015
Include outward ticks in bounding box
@QuLogic
Copy link
Member

Backport to v2.x was actually via8ac5b4b.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v2.0.0
Development

Successfully merging this pull request may close these issues.

4 participants
@mdboom@QuLogic@WeatherGod@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp