garrettj403 / SciencePlots

Matplotlib styles for scientific plotting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why are there some problems with the displayed images when using the ieee style?

kongxinz opened this issue · comments

Why are there some problems with the displayed images when using the ieee style?

Please, check how you have shared the image.
Follow this StackOverflow answer so we can see the image:.

I'm sorry, but the problem was caused by the fact that I didn't set the correct resolution when exporting the image. The issue is now resolved, thanks a lot.

Still can't see it. Can you check without login in GitHub?

Can you also provide the code?

I've done some minimal testing and found a workaround for that.
Go to your ieee.myplstyle (should look like this file, mine was, in Windows, in user/.matplotlib/stylelib) and comment line 10 with a #. I believe it will mess up with the standard but at least you now know what to change to have better results.

Edit: in fact it's easier to just import the style and after that do:

plt.rcParams.update({
        'figure.dpi': '100' # Default DPI value
})

I recommend against closing this issue.
Although I've provided a workaround, it's still an issue and many people will come here looking for advice or to report the same.

I don't really know much about DPI and how it works on each level, but from this stackoverflow post I think the problem is with the huge DPI on this style.

Ya, the IEEE style doesn't work very well with plt.show(). However, IEEE recommends 600 DPI for line art (link).

I added a note to the IEEE style in the project wiki (link).

I should let you know that when I put the 125 dpi I didn't bother to find the default value for it. It is in fact 100, so for the wiki it would be better to specify it. Sorry for not changing it before.
Also, thanks for the nice work put into this.

Edit: changed my workaround answer to add it.