Skip to content
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

Savefig() to pdf renders markers differently than show() #6477

Closed
nanicpc opened this issue May 25, 2016 · 7 comments
Closed

Savefig() to pdf renders markers differently than show() #6477

nanicpc opened this issue May 25, 2016 · 7 comments

Comments

@nanicpc
Copy link

nanicpc commented May 25, 2016

I'm making a scatter plot. Saving the figure in eps format makes (sometimes) a reproduction of the figure " show() " but the pdf changes (always) the configuration. For example, changing the colors and adding contour lines that weren't there.

ex2

Even worst in some cases saving the figure weather in eps format or in the pdf changes the figure itself.

ex1

fig2=plt.figure(figsize=[4,3])
fig2.add_subplot(111,yticks=[-4,0,4],xticks=[-10,0,10])
plt.scatter(X_l[:, 0], X_l[:, 1], c=np.array(colors[yy_lab].tolist()), s=np.array(sizes[yy_lab].tolist()),lw=0)
plt.axis([-11, 11, -4, 4])
fig2.savefig("fig.pdf",bbox_inches='tight',format='pdf')
fig2.savefig("fig.eps",bbox_inches='tight')
plt.show()
@WeatherGod
Copy link
Member

Which version of matplotlib? I know some of the differences have been fixed
already. Also, which version of python?

On Wed, May 25, 2016 at 11:17 AM, nanicpc notifications@github.com wrote:

I'm making a scatter plot. Saving the figure in eps format makes
(sometimes) a reproduction of the figure " show() " but the pdf changes
(always) the configuration. For example, changing the colors and adding
contour lines that weren't there.

[image: ex2]
https://cloud.githubusercontent.com/assets/15998450/15545187/bf847bcc-229b-11e6-8eee-1556d2fd4336.png

Even worst in some cases saving the figure weather in eps format or in the
pdf changes the figure itself.

[image: ex1]
https://cloud.githubusercontent.com/assets/15998450/15545189/c3d8ffcc-229b-11e6-8c83-2133bba8653e.png

fig2=plt.figure(figsize=[4,3])
fig2.add_subplot(111,yticks=[-4,0,4],xticks=[-10,0,10])
plt.scatter(X_l[:, 0], X_l[:, 1], c=np.array(colors[yy_lab].tolist()), s=np.array(sizes[yy_lab].tolist()),lw=0)
plt.axis([-11, 11, -4, 4])
fig2.savefig("fig.pdf",bbox_inches='tight',format='pdf')
fig2.savefig("fig.eps",bbox_inches='tight')
plt.show()


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#6477

@nanicpc
Copy link
Author

nanicpc commented May 25, 2016

Sorry.
Matplotlib 1.4.2
Python 3.4.3

@WeatherGod
Copy link
Member

Yes, I think most if not all of those problems were fixed in 1.5.1, and
1.5.2 is in release candidate mode right now. Could you try with one of
those?

On Wed, May 25, 2016 at 12:07 PM, nanicpc notifications@github.com wrote:

Sorry.
Matplotlib 1.4.2
Python 3.4.3


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#6477 (comment)

@tacaswell
Copy link
Member

@WeatherGod What bugs were these? I have no memory of anything like this going by.

@WeatherGod
Copy link
Member

I am thinking along the lines of the dictionary ordering issue, maybe? TBH,
I can't quite remember what I was thinking when I wrote that.

On Thu, May 26, 2016 at 1:09 PM, Thomas A Caswell notifications@github.com
wrote:

@WeatherGod https://github.com/WeatherGod What bugs were these? I have
no memory of anything like this going by.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#6477 (comment)

@tacaswell
Copy link
Member

@nanicpc Can you provide a runnable example? Your code has a couple of undefined variables so it is hard to tell what you are doing.

@nanicpc
Copy link
Author

nanicpc commented Jun 2, 2016

i'm now using the 1.5.1 and the border inclusion is fixed and also the configuration is kept, you were right, thanks!

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

No branches or pull requests

3 participants