X Tutup
Skip to content

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

@nanicpc

Description

@nanicpc

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup