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

Revert back to old "cyan", "yellow", "magenta" #280

Closed
matthias-k opened this issue Sep 11, 2021 · 4 comments
Closed

Revert back to old "cyan", "yellow", "magenta" #280

matthias-k opened this issue Sep 11, 2021 · 4 comments

Comments

@matthias-k
Copy link

Description

It appears that since one of the recent releases of proplot, the color "cyan" has changed compared to the cyan color of default matplotlib

Steps to reproduce

import matplotlib.pyplot as plt

# first plot a cyan line with matplotlib
plt.plot([1,2], color='cyan')

# now import proplot and plot the cyan line again
import proplot as pplt
plt.plot([1,2], color='cyan')

Expected behavior: [What you expected to happen]

I would expect the two lines to have the same cyan color

Actual behavior: [What actually happened]

The line after importing proplot changed its color

Screenshot_20210912_011228

Screenshot_20210912_011313

Equivalent steps in matplotlib

see above

Proplot version

  • matplotlib: 3.4.2
  • proplot: 0.9.0
@lukelbd
Copy link
Collaborator

lukelbd commented Sep 12, 2021

Thanks for the report. Unfortunately this was intentional (see What's New). In matplotlib, the shorthand names 'y', 'c', and 'm' are different from their full-length equivalents 'yellow', 'cyan', and 'magenta' (see this page). I found this behavior strange, so a long long time ago, I added code to proplot meant to synchronize the shorthand and full-length names. However it was never implemented correctly -- in v0.9 I finally had time to fix it.

In retrospect, however, I definitely should have given this a second thought.... I can see the advantage of being able to easily switch between canonical "dark" and "light" versions of these otherwise very light colors. And the fact that 'yellow' now gives us this very dark mustard yellow is probably even more counterintuitive than 'y' and 'yellow' resulting in different colors. And while proplot lets XKCD colors overwrite CSS colors (see the table), the new color is usually somewhat similar. However, the new 'magenta', 'yellow', and 'cyan' are jarringly different, which is annoying for new users.

So, I think I'll revert back to the old behavior in the next version. I need to submit a quick bugfix release soon anyway, because Natural Earth changed their URLs, which broke older versions of cartopy and thus broke the geographic plot examples in the last stable version of the docs.

@lukelbd lukelbd closed this as completed Sep 12, 2021
@lukelbd lukelbd reopened this Sep 12, 2021
@lukelbd
Copy link
Collaborator

lukelbd commented Sep 12, 2021

Sorry, didn't mean to close this.

@lukelbd lukelbd changed the title Proplot changes color "cyan" Revert back to old "cyan", "yellow", "magenta" Sep 12, 2021
@matthias-k
Copy link
Author

Thanks for your answer! I see the elegance of having the color names unified, but in my opinion, compatibility with matplotlib is more important (as we also discussed in #278). At least with rc['style'] = 'default', i.e. the default matplotlib stylesheet, I would expect the colors to match.

@lukelbd
Copy link
Collaborator

lukelbd commented Sep 14, 2021

This is now implemented on master -- the basic red, blue, green, cyan, yellow, magenta are back to their CSS4 defaults.

@lukelbd lukelbd closed this as completed Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants