Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
ENH: Add Petroff 6 and 8 color cycle style sheets#30065
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Six and eight color Petroff color cycles | ||
---------------------------------------- | ||
The six and eight color accessible Petroff color cycles are named 'petroff6' and | ||
'petroff8'. | ||
They compliment the existing 'petroff10' color cycle, added in `Matplotlib 3.10.0`_ | ||
For more details see | ||
`Petroff, M. A.: "Accessible Color Sequences for Data Visualization" | ||
<https://arxiv.org/abs/2107.02270>`_. | ||
To load the 'petroff6' color cycle in place of the default:: | ||
import matplotlib.pyplot as plt | ||
plt.style.use('petroff6') | ||
or to load the 'petroff8' color cycle:: | ||
import matplotlib.pyplot as plt | ||
plt.style.use('petroff8') | ||
.. _Matplotlib 3.10.0: https://matplotlib.org/stable/users/prev_whats_new/whats_new_3.10.0.html#new-more-accessible-color-cycle |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. The RGB values were determiend from converting the hex usinghttps://www.rapidtables.com/convert/color/hex-to-rgb.html. If a more specific method is desired, I'm happy to double check the RGB values with it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I think this should do, since screens have much more difference between them than a single RGB color step anyway. (Since I didn't know which was the original format, I did some conversions, thinking that the RGB was the approximation of the 0-1-range. And then read the paper to see that it was the other way around. It seems to match exactly.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This code will exactly convert the #!/usr/bin/env python3importjsonwithopen("top-cycles.json")asinfile:cycles=json.load(infile)forkincycles:print(f"_petroff{k}_data = (")forcincycles[k]:cf= [str(int(c[i*2 : (i+1)*2],16)/255)foriinrange(3)]print(f" ({cf[0]+',':20}{cf[1]+',':20}{cf[2]+'),':22} #{c}")print(")\n") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Color cycle survey palette from Petroff (2021): | ||
# https://arxiv.org/abs/2107.02270 | ||
# https://github.com/mpetroff/accessible-color-cycles | ||
axes.prop_cycle: cycler('color', ['5790fc', 'f89c20', 'e42536', '964a8b', '9c9ca1', '7a21dd']) | ||
patch.facecolor: 5790fc |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Color cycle survey palette from Petroff (2021): | ||
# https://arxiv.org/abs/2107.02270 | ||
# https://github.com/mpetroff/accessible-color-cycles | ||
axes.prop_cycle: cycler('color', ['1845fb', 'ff5e02', 'c91f16', 'c849a9', 'adad7d', '86c8dd', '578dff', '656364']) | ||
patch.facecolor: 1845fb |
Uh oh!
There was an error while loading.Please reload this page.