From d8f93c81088392532b2e9bb4a7f679d4b77c8e71 Mon Sep 17 00:00:00 2001 From: aloctavodia Date: Tue, 8 Nov 2022 18:07:27 -0300 Subject: [PATCH 1/2] add grid and nor grid version for style arviz-doc --- arviz/plots/styles/arviz-doc.mplstyle | 9 +-- arviz/plots/styles/arviz-docgrid.mplstyle | 88 +++++++++++++++++++++++ 2 files changed, 89 insertions(+), 8 deletions(-) create mode 100644 arviz/plots/styles/arviz-docgrid.mplstyle diff --git a/arviz/plots/styles/arviz-doc.mplstyle b/arviz/plots/styles/arviz-doc.mplstyle index 08c70af662..57885d7fe5 100644 --- a/arviz/plots/styles/arviz-doc.mplstyle +++ b/arviz/plots/styles/arviz-doc.mplstyle @@ -30,16 +30,9 @@ axes.facecolor: white axes.edgecolor: .33 # axes edge color axes.linewidth: 0.8 # edge line width -axes.grid: True # show grid -# axes.grid.axis: y # which axis the grid should apply to -axes.grid.which: major # grid lines at {major, minor, both} ticks +axes.grid: False # do not show grid axes.axisbelow: True # keep grid layer in the back -grid.color: .8 # grid color -grid.linestyle: - # solid -grid.linewidth: 0.8 # in points -grid.alpha: 1.0 # transparency, between 0.0 and 1.0 - lines.solid_capstyle: round axes.spines.right: False # do not show right spine diff --git a/arviz/plots/styles/arviz-docgrid.mplstyle b/arviz/plots/styles/arviz-docgrid.mplstyle new file mode 100644 index 0000000000..08c70af662 --- /dev/null +++ b/arviz/plots/styles/arviz-docgrid.mplstyle @@ -0,0 +1,88 @@ +## *************************************************************************** +## * FIGURE * +## *************************************************************************** + +figure.facecolor: white # broken white outside box +figure.edgecolor: None # broken white outside box +figure.titleweight: bold # weight of the figure title +figure.titlesize: 18 + +figure.figsize: 11.5, 5 +figure.dpi: 300.0 +figure.constrained_layout.use: True + +## *************************************************************************** +## * FONT * +## *************************************************************************** + +font.style: normal +font.variant: normal +font.weight: normal +font.stretch: normal + +text.color: .15 + +## *************************************************************************** +## * AXES * +## *************************************************************************** + +axes.facecolor: white +axes.edgecolor: .33 # axes edge color +axes.linewidth: 0.8 # edge line width + +axes.grid: True # show grid +# axes.grid.axis: y # which axis the grid should apply to +axes.grid.which: major # grid lines at {major, minor, both} ticks +axes.axisbelow: True # keep grid layer in the back + +grid.color: .8 # grid color +grid.linestyle: - # solid +grid.linewidth: 0.8 # in points +grid.alpha: 1.0 # transparency, between 0.0 and 1.0 + +lines.solid_capstyle: round + +axes.spines.right: False # do not show right spine +axes.spines.top: False # do not show top spine + +axes.titlesize: 16 +axes.titleweight: bold # font weight of title + +axes.labelsize: 14 +axes.labelcolor: .15 +axes.labelweight: normal # weight of the x and y labels + +# color-blind friendly cycle designed using https://colorcyclepicker.mpetroff.net/ +# see preview and check for colorblindness here https://coolors.co/107591-00c0bf-f69a48-fdcd49-8da798-a19368-525252-a6761d-7035b7-cf166e +axes.prop_cycle: cycler(color=['107591','00c0bf','f69a48','fdcd49','8da798','a19368','525252','a6761d','7035b7','cf166e']) + +image.cmap: viridis + +## *************************************************************************** +## * TICKS * +## *************************************************************************** + +xtick.labelsize: 14 +xtick.color: .15 +xtick.top: False +xtick.bottom: True +xtick.direction: out + +ytick.labelsize: 14 +ytick.color: .15 +ytick.left: True +ytick.right: False +ytick.direction: out + +## *************************************************************************** +## * LEGEND * +## *************************************************************************** + +legend.framealpha: 0.5 +legend.frameon: False # do not draw on background patch +legend.fancybox: False # do not round corners + +legend.numpoints: 1 +legend.scatterpoints: 1 + +legend.fontsize: 14 From d8096278122b25871ab0f79b7b022951395c6262 Mon Sep 17 00:00:00 2001 From: aloctavodia Date: Thu, 10 Nov 2022 10:15:21 -0300 Subject: [PATCH 2/2] keep styles the same except for the grid on/off --- arviz/plots/styles/arviz-doc.mplstyle | 7 +++++++ examples/matplotlib/mpl_styles.py | 1 + 2 files changed, 8 insertions(+) diff --git a/arviz/plots/styles/arviz-doc.mplstyle b/arviz/plots/styles/arviz-doc.mplstyle index 57885d7fe5..41c64e2241 100644 --- a/arviz/plots/styles/arviz-doc.mplstyle +++ b/arviz/plots/styles/arviz-doc.mplstyle @@ -31,8 +31,15 @@ axes.edgecolor: .33 # axes edge color axes.linewidth: 0.8 # edge line width axes.grid: False # do not show grid +# axes.grid.axis: y # which axis the grid should apply to +axes.grid.which: major # grid lines at {major, minor, both} ticks axes.axisbelow: True # keep grid layer in the back +grid.color: .8 # grid color +grid.linestyle: - # solid +grid.linewidth: 0.8 # in points +grid.alpha: 1.0 # transparency, between 0.0 and 1.0 + lines.solid_capstyle: round axes.spines.right: False # do not show right spine diff --git a/examples/matplotlib/mpl_styles.py b/examples/matplotlib/mpl_styles.py index 822c6339d7..8119235990 100644 --- a/examples/matplotlib/mpl_styles.py +++ b/examples/matplotlib/mpl_styles.py @@ -31,6 +31,7 @@ ["arviz-white", "arviz-viridish"], ["arviz-white", "arviz-plasmish"], "arviz-doc", + "arviz-docgrid", ] fig = plt.figure(figsize=(20, 10))