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

Different line styles between PNG and PDF exports. #6588

Closed
Assignees
jkseppan
Milestone
@afvincent

Description

@afvincent

Is the line style supposed to depend on the export backend?

MPL 1.5.1 is from Anaconda and MPL 2.x is from Github, both on Linux (CentOS 7)

With MPL 1.5.1, I get the same line styles between both PDF and PNG exports:

  • PNG @ 100 DPI:

mpl_ver_1 5 1_100dpi

while with master version, they are different between PDF and PNG exports:

  • PNG @ 100 DPI:

mpl_ver_2 0 0b1 post1628 g1aba7c3_100dpi

NB: the problem seems to be independent from the DPI value: I get similar line styles between both PNG exports with 100 DPI and 300 DPI.

  • PNG @ 300 DPI:

mpl_ver_2 0 0b1 post1628 g1aba7c3_300

The example snippet is

importmatplotlibimportmatplotlib.pyplotaspltimportnumpyasnptest_case=matplotlib.__version__fig,ax=plt.subplots(num=test_case,figsize=(4.8,3.2))ax.set_title("MPL version: {0:s}".format(test_case))xx=np.array([0.0,1.0])ax.plot(xx,1*xx,ls='dashed',label='default lw')ax.plot(xx,2*xx,ls='dashed',lw=2,label='lw=2')ax.plot(xx,3*xx,ls='dashed',lw=3,label='lw=3')ax.legend(loc='upper left')plt.show()forext,dpiin (('pdf',None), ('png',100), ('png',300)):fig.savefig("MPL_ver_{v:s}_{d}.{e:s}".format(v=test_case,d=dpi,e=ext),dpi=dpi)

My guess would that I may be somehow related to the new behavior introduced in#5926,but I didn't have time to have a look yet.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp