From b7ad0f2d8a999251fed73c98308f63ccb9aab5bb Mon Sep 17 00:00:00 2001 From: ilivni Date: Wed, 26 Nov 2014 11:41:21 -0600 Subject: [PATCH 1/4] Solarize_Light2 Adapted from ggplot2 Title padding Title color Minor grid width Alpha for graphs with a "fill" Solarized_License Taken from the Solarized Github page: https://github.com/altercation/solarized Example Script No changes to the mplstyle. Changed Name of File File Conventions Conforming to matplolib conventions Deleted Some Empty Lines Failed last Travis regression Get Rid of white spaces 2 Solaraized Light Style File Fixed style sheet remove white spaces Tried setting the user save preference "trim_trailing_white_space_on_save": true 3rd Try White Spaces Used convert tabs -> spaces script Used PSPAD to check whitespace Set Sublime to UNIX Line style endings Tried Unix style line endings with sublime --- LICENSE/Solarized.txt | 20 +++++++ examples/style_sheets/plot_solarizedlight2.py | 34 ++++++++++++ .../stylelib/Solarize_Light2.mplstyle | 54 +++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 LICENSE/Solarized.txt create mode 100644 examples/style_sheets/plot_solarizedlight2.py create mode 100644 lib/matplotlib/mpl-data/stylelib/Solarize_Light2.mplstyle diff --git a/LICENSE/Solarized.txt b/LICENSE/Solarized.txt new file mode 100644 index 000000000000..67ed2b7293fe --- /dev/null +++ b/LICENSE/Solarized.txt @@ -0,0 +1,20 @@ +https://github.com/altercation/solarized/blob/master/LICENSE +Copyright (c) 2011 Ethan Schoonover + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/examples/style_sheets/plot_solarizedlight2.py b/examples/style_sheets/plot_solarizedlight2.py new file mode 100644 index 000000000000..e44969610599 --- /dev/null +++ b/examples/style_sheets/plot_solarizedlight2.py @@ -0,0 +1,34 @@ +""" +Version 0.1 +This shows an example of "Solarized_Light2" styling, which +tries to replicate the styles of: + - http://ethanschoonover.com/solarized + - https://github.com/jrnold/ggthemes + - http://pygal.org/builtin_styles/#idlight-solarized + + and work of: + - https://github.com/tonysyu/mpltools + +using all 8 accents of the color palette - starting with blue + +ToDo: + - Create alpha values for bar and stacked charts. .33 or .5 + - Apply Layout Rules +""" +from matplotlib import pyplot as plt +import numpy as np +x = np.linspace(0, 10) +with plt.style.context('Solarize_Light2'): + plt.plot(x, np.sin(x) + x + np.random.randn(50)) + plt.plot(x, np.sin(x) + 2 * x + np.random.randn(50)) + plt.plot(x, np.sin(x) + 3 * x + np.random.randn(50)) + plt.plot(x, np.sin(x) + 4 + np.random.randn(50)) + plt.plot(x, np.sin(x) + 5 * x + np.random.randn(50)) + plt.plot(x, np.sin(x) + 6 * x + np.random.randn(50)) + plt.plot(x, np.sin(x) + 7 * x + np.random.randn(50)) + plt.plot(x, np.sin(x) + 8 * x + np.random.randn(50)) + #Number of accent colors in the color scheme + plt.title('8 Random Lines - Line') + plt.xlabel('x label', fontsize=14) + plt.ylabel('y label', fontsize=14) +plt.show( ) \ No newline at end of file diff --git a/lib/matplotlib/mpl-data/stylelib/Solarize_Light2.mplstyle b/lib/matplotlib/mpl-data/stylelib/Solarize_Light2.mplstyle new file mode 100644 index 000000000000..853f767bd50e --- /dev/null +++ b/lib/matplotlib/mpl-data/stylelib/Solarize_Light2.mplstyle @@ -0,0 +1,54 @@ +# Solarized color palette taken from http://ethanschoonover.com/solarized +# Inspired by, and copied from ggthemes https://github.com/jrnold/ggthemes + +#TODO: +# 1. Padding to title from face +# 2. Remove top & right ticks +# 3. Give Title a Magenta Color(?) + +#base00 ='#657b83' +#base01 ='#93a1a1' +#base2 ='#eee8d5' +#base3 ='#fdf6e3' +#base01 ='#586e75' +#Magenta ='#d33682' +#Blue ='#268bd2' +#cyan ='#2aa198' +#violet ='#6c71c4' +#green ='#859900' +#orange ='#cb4b16' + +figure.facecolor : FDF6E3 + +patch.facecolor : eee8d5 # Not sure what this does +patch.antialiased : True + +lines.linewidth : 2.0 +lines.solid_capstyle: butt + +axes.titlesize : 16 +axes.labelsize : 12 +axes.labelcolor : 657b83 +axes.facecolor : eee8d5 +axes.edgecolor : eee8d5 +axes.axisbelow : True +axes.color_cycle : 268BD2, 2AA198, 859900, B58900, CB4B16, DC322F, D33682, 6C71C4 + # Blue + # Cyan + # Green + # Yellow + # Orange + # Red + # Magenta + # Violet +axes.grid : True +grid.color : fdf6e3 # grid color +grid.linestyle : - # line +grid.linewidth : 1 # in points + +### TICKS +xtick.color : 657b83 +xtick.direction : out + +ytick.color : 657b83 +ytick.direction : out \ No newline at end of file From e5b5da02d4f384cbf438c8cfb25c34d4fc66803c Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sat, 12 Aug 2017 21:24:48 -0400 Subject: [PATCH 2/4] MNT/DOC: whitespace + updated example heading --- LICENSE/Solarized.txt | 2 +- examples/style_sheets/plot_solarizedlight2.py | 24 ++++++++++++------- .../stylelib/Solarize_Light2.mplstyle | 20 ++++++++-------- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/LICENSE/Solarized.txt b/LICENSE/Solarized.txt index 67ed2b7293fe..6e5a0475dd24 100644 --- a/LICENSE/Solarized.txt +++ b/LICENSE/Solarized.txt @@ -17,4 +17,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file +THE SOFTWARE. diff --git a/examples/style_sheets/plot_solarizedlight2.py b/examples/style_sheets/plot_solarizedlight2.py index e44969610599..785d069b0aa1 100644 --- a/examples/style_sheets/plot_solarizedlight2.py +++ b/examples/style_sheets/plot_solarizedlight2.py @@ -1,13 +1,18 @@ """ -Version 0.1 -This shows an example of "Solarized_Light2" styling, which +========================== +Solarized Light stylesheet +========================== + +This shows an example of "Solarized_Light" styling, which tries to replicate the styles of: - - http://ethanschoonover.com/solarized - - https://github.com/jrnold/ggthemes - - http://pygal.org/builtin_styles/#idlight-solarized - and work of: - - https://github.com/tonysyu/mpltools + - ``__ + - ``__ + - ``__ + +and work of: + + - ``__ using all 8 accents of the color palette - starting with blue @@ -27,8 +32,9 @@ plt.plot(x, np.sin(x) + 6 * x + np.random.randn(50)) plt.plot(x, np.sin(x) + 7 * x + np.random.randn(50)) plt.plot(x, np.sin(x) + 8 * x + np.random.randn(50)) - #Number of accent colors in the color scheme + # Number of accent colors in the color scheme plt.title('8 Random Lines - Line') plt.xlabel('x label', fontsize=14) plt.ylabel('y label', fontsize=14) -plt.show( ) \ No newline at end of file + +plt.show() diff --git a/lib/matplotlib/mpl-data/stylelib/Solarize_Light2.mplstyle b/lib/matplotlib/mpl-data/stylelib/Solarize_Light2.mplstyle index 853f767bd50e..03e2f1b184a1 100644 --- a/lib/matplotlib/mpl-data/stylelib/Solarize_Light2.mplstyle +++ b/lib/matplotlib/mpl-data/stylelib/Solarize_Light2.mplstyle @@ -32,15 +32,15 @@ axes.labelcolor : 657b83 axes.facecolor : eee8d5 axes.edgecolor : eee8d5 axes.axisbelow : True -axes.color_cycle : 268BD2, 2AA198, 859900, B58900, CB4B16, DC322F, D33682, 6C71C4 - # Blue - # Cyan - # Green - # Yellow - # Orange - # Red - # Magenta - # Violet +axes.prop_cycle : cycler('color', ['268BD2', '2AA198', '859900', 'B58900', 'CB4B16', 'DC322F', 'D33682', '6C71C4']) +# Blue +# Cyan +# Green +# Yellow +# Orange +# Red +# Magenta +# Violet axes.grid : True grid.color : fdf6e3 # grid color grid.linestyle : - # line @@ -51,4 +51,4 @@ xtick.color : 657b83 xtick.direction : out ytick.color : 657b83 -ytick.direction : out \ No newline at end of file +ytick.direction : out From 0001991a0740c2e629f32bbe1ca77295db5545b4 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 14 Aug 2017 16:09:04 -0400 Subject: [PATCH 3/4] MNT: remove setting patch color default --- lib/matplotlib/mpl-data/stylelib/Solarize_Light2.mplstyle | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/matplotlib/mpl-data/stylelib/Solarize_Light2.mplstyle b/lib/matplotlib/mpl-data/stylelib/Solarize_Light2.mplstyle index 03e2f1b184a1..6c7aa7ee1219 100644 --- a/lib/matplotlib/mpl-data/stylelib/Solarize_Light2.mplstyle +++ b/lib/matplotlib/mpl-data/stylelib/Solarize_Light2.mplstyle @@ -20,7 +20,6 @@ figure.facecolor : FDF6E3 -patch.facecolor : eee8d5 # Not sure what this does patch.antialiased : True lines.linewidth : 2.0 From ae1ddb71556ce325e81094242e5fee9e99cc2bad Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 14 Aug 2017 16:14:59 -0400 Subject: [PATCH 4/4] DOC: fix link --- examples/style_sheets/plot_solarizedlight2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/style_sheets/plot_solarizedlight2.py b/examples/style_sheets/plot_solarizedlight2.py index 785d069b0aa1..79db70195458 100644 --- a/examples/style_sheets/plot_solarizedlight2.py +++ b/examples/style_sheets/plot_solarizedlight2.py @@ -8,7 +8,7 @@ - ``__ - ``__ - - ``__ + - ``__ and work of: