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

New grayscale style #1164

Merged
merged 6 commits into from
Apr 30, 2020
Merged

New grayscale style #1164

merged 6 commits into from
Apr 30, 2020

Conversation

aloctavodia
Copy link
Contributor

@aloctavodia aloctavodia commented Apr 22, 2020

Adds new grayscale style. Originally intended for the BMCP book but probably useful for a more general use. It is based on the arviz-white style, but the color cycle has only five colors the first four are grays and the fifth is the ArviZ's "C0 blue", the cmap is matplotlib's gray cmap

  • Follows official PR format
  • Includes a sample plot to visually illustrate the changes (only for plot-related functions)
  • New features are properly documented (with an example if appropriate)?
  • Code style correct (follows pylint and black guidelines)
  • Changes are listed in changelog

A few examples from the gallery (some of with their default colors changed)
0A

00

01

02

03
04

@codecov
Copy link

codecov bot commented Apr 22, 2020

Codecov Report

Merging #1164 into master will increase coverage by 0.28%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1164      +/-   ##
==========================================
+ Coverage   93.11%   93.39%   +0.28%     
==========================================
  Files          94       94              
  Lines        9289     9995     +706     
==========================================
+ Hits         8649     9335     +686     
- Misses        640      660      +20     
Impacted Files Coverage Δ
arviz/plots/violinplot.py 90.74% <0.00%> (-0.17%) ⬇️
arviz/plots/forestplot.py 94.00% <0.00%> (-0.12%) ⬇️
arviz/plots/essplot.py 100.00% <0.00%> (ø)
arviz/plots/mcseplot.py 100.00% <0.00%> (ø)
arviz/plots/autocorrplot.py 100.00% <0.00%> (ø)
arviz/utils.py 91.18% <0.00%> (+0.15%) ⬆️
arviz/stats/stats.py 96.96% <0.00%> (+0.63%) ⬆️
arviz/plots/traceplot.py 98.19% <0.00%> (+0.86%) ⬆️
arviz/plots/rankplot.py 92.85% <0.00%> (+0.96%) ⬆️
arviz/plots/ppcplot.py 96.63% <0.00%> (+1.34%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a51574...bbf2d37. Read the comment docs.

axes.linewidth: 1
axes.spines.top: False
axes.spines.right: False
image.cmap: gray
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what cmap is this? The mpl default or the one in colorcet (etc+)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default from matplotlib, as I understand this one is perceptually uniform. But I could check again.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:( OK, I will fix it

@aloctavodia
Copy link
Contributor Author

updated cmap figures

01

02

I was unsure if we should use the linear_grey_10_95_c0 or linear_grey_0_100_c0 scales. The first one does not include the extreme values, i.e the white and black. @ahartikainen What do you think?

@canyon289
Copy link
Member

This is nice!

@canyon289
Copy link
Member

updated cmap figures

01

02

I was unsure if we should use the linear_grey_10_95_c0 or linear_grey_0_100_c0 scales. The first one does not include the extreme values, i.e the white and black. @ahartikainen What do you think?

If this is meant for printed book format should we ask publishers which plot will look better in print? My assumption for book is if readers decide to reproduce on computer the limitation of grayscale wont apply anymore and we tell them to use full colorscale, so this styles main use case is printed material

@ahartikainen
Copy link
Contributor

Also, for printing, we can force colours to be a bit lighter

@aloctavodia
Copy link
Contributor Author

This is more general than the book. Many journals use gray-scale figures or charge for color ones. So having an easy to use grey-scale could be useful for many users. Notice this adds the cet_grey_r and cet_grey_r` cmaps.

01_b

@aloctavodia aloctavodia merged commit e91b3cc into master Apr 30, 2020
@ahartikainen ahartikainen deleted the grayscale branch May 12, 2020 07:06
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

Successfully merging this pull request may close these issues.

3 participants