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

IEEE cycler limit #33

Closed
eneriz-daniel opened this issue Mar 17, 2021 · 2 comments
Closed

IEEE cycler limit #33

eneriz-daniel opened this issue Mar 17, 2021 · 2 comments

Comments

@eneriz-daniel
Copy link

Hi! Just discovered this repo and love how helpful it is.

I've noticed the IEEE style has a detail that is annoying me. The default plot styles are this ones:
ieee-default

So it only allows up to 4 different plot styles. I've tried to change the cycles order using

from cycler import cycler
plt.rcParams.update({"axes.prop_cycle": cycler('linestyle', ['-', '--', ':', '-.'])*cycler('color', ['k', 'r', 'b', 'g'])})

to get the linestyles to iterate over the colors, creating up to 16 new ploting styles.
ieee-new-cycler

Maybe you want to change it in the repo.

Thanks for sharing your work!

@garrettj403
Copy link
Owner

Hi @eneriz-daniel, I'm glad you find SciencePlots useful!

The IEEE style is a bit difficult to design because the plot should be readable in black & white, meaning that all of the line styles should be different. In your example, the solid black, red, blue and green lines will look identical in B&W. In Matplotlib, there are only 4 different line styles which limits the total number of lines in B&W to 4.

If you don't care about B&W readability, you can always override the ieee color cycle:

plt.style.use(['science', 'ieee', 'std-colors'])

In this example, we still get the formatting of the ieee style (figure size, font, etc.) but std-colors overrides the ieee color cycle.

Note: std-colors isn't in the latest release yet. You need to install from the GitHub repo.

@eneriz-daniel
Copy link
Author

That's true, hadn't thought in the B&W compatibility. Thanks for your suggestion of std-colors.

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

2 participants