Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Pass linewidth to Mac context properly #1209

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 10, 2012
Merged

Conversation

dmcdougall
Copy link
Member

Attempt to fix #786.

@dmcdougall
Copy link
Member Author

I think I am still missing some things. For example, the tick marks still don't match those using the agg backend.

@dmcdougall
Copy link
Member Author

Here's what the interactive macosx backend output looked like before the change:

before

And after the change:

after

These plots were done with @efiring's test script:

import numpy as np
import matplotlib
matplotlib.use("macosx")
matplotlib.rcParams['figure.dpi'] = 240
import matplotlib.pyplot as plt

fig, ax = plt.subplots(1, figsize=(3,2)) # 2 inches high
ax.plot([1,2,3], lw=72) # line 1 inch wide
fig.savefig("testdpi.png", dpi=240)
plt.show()

@WeatherGod
Copy link
Member

Are there any other properties that are missing? Maybe linestyles and such? @pmarshwx, this PR might be of interest to you with the problem you discovered during SciPy 2012.

@dmcdougall
Copy link
Member Author

Things like markeredgewidth are covered by this change.

Edit: Though, it is possible I may have missed something. Perhaps I should add some sort of test for this?

@efiring
Copy link
Member

efiring commented Sep 6, 2012

I don't think we have any way of testing this sort of thing automatically.
I think the macosx author, Michiel de Hoon, will be able to review this pull request this weekend.

@dmcdougall
Copy link
Member Author

There are probably other ways to do what I have done, perhaps better ways, so his feedback would certainly be appreciated. Thanks.

@mdboom
Copy link
Member

mdboom commented Sep 7, 2012

Marking this for 1.2.x, as it's really a follow-on to #786.

@mdboom
Copy link
Member

mdboom commented Sep 7, 2012

It's nice to fix this for linewidth, but I wonder if we couldn't also fix this at a deeper level and also resolve #113? (I say this having not looked at the code at all...)

@efiring
Copy link
Member

efiring commented Sep 7, 2012

@mdboom, if Michiel can look at it this weekend and either approve @dmcdougall's PR or come up with a better one, why shouldn't this go into 1.2? I think this PR does address all of the aspects that have been clearly identified, and the changes it makes are simple.

@mdboom
Copy link
Member

mdboom commented Sep 7, 2012

@efiring: I think we're in agreement. I think this should go into 1.2.

@mdboom
Copy link
Member

mdboom commented Sep 10, 2012

@dmcdougall: This looks good to go. Is there anything else from your end?

@dmcdougall
Copy link
Member Author

@mdboom In short, no. I consider this ready to merge.

The long answer is: I'd like to also solve the dpi issue in the osx backend, but I think I will do that in a different PR. I feel passing in the dpi like this sets up the necessary groundwork for extending a to a solution for that problem.

mdboom added a commit that referenced this pull request Sep 10, 2012
Pass linewidth to Mac context properly
@mdboom mdboom merged commit 156c76d into matplotlib:master Sep 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

savefig() renders paths and text differently than show()
4 participants