8000 Solarize_Light2 by ilivni · Pull Request #3851 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Solarize_Light2 #3851

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

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Example Script
No changes to the mplstyle.
  • Loading branch information
ilivni committed Nov 26, 2014
commit a9e83a4b27e290f3c861039959e052e227fb0352
42 changes: 42 additions & 0 deletions examples/style_sheets/plot_solarizedlight2
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""
Copy link
Member

Choose a reason for hiding this comment

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

This should have a file extension.

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( )
60 changes: 60 additions & 0 deletions lib/matplotlib/mpl-data/stylelib/Solarize_Light2.mplstyle
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# 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'
Copy link
Member

Choose a reason for hiding this comment

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

Lets get these things lined up nicely, please (through out the file). I suspect there is a mix of tabs and spaces.

#orange ='#cb4b16'


figure.facecolor : FDF6E3

patch.facecolor : eee8d5 # Not sure what this does
patch.antialiased : True
Copy link
Member

Choose a reason for hiding this comment

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

Some of these entries are not related to coloring. Perhaps they should be taken out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Like the tick direction?

Copy link
Member

Choose a reason for hiding this comment

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

yes, like the tick direction. It is up to you, it is your style that you are creating, and we don't have any set rules or guidelines yet. But matplotlib has the ability to mix style files, so it might make sense to keep them logically organized. If not, that's fine, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmmm... I was hoping to closely align it with my perceived intentions of the original palette including fonts. Let me know if you disagree and I will change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I re-read this from http://matplotlib.org/users/style_sheets.html

Style sheets are designed to be composed together. So you can have a style sheet that customizes colors and a separate style sheet that alters element sizes for presentations. These styles can easily be combined by passing a list of styles:

I will make it just about the color scheme ...


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

0