has2k1 / plotnine

A Grammar of Graphics for Python
https://plotnine.org
MIT License
3.99k stars 213 forks source link

Dark background theme #164

Open ghost opened 6 years ago

ghost commented 6 years ago

Thanks for plotnine, I'm a big fan!

I like working with a dark background. Using plotnine.themes.theme_dark gives this image, which has a lot of light area which doesn't work well on a dark background.

image

from plotnine import ggplot, qplot, aes, geom_point, geom_smooth, geom_bar, ggsave, geom_density, theme_set, theme_dark, theme_xkcd
import pandas as pd

theme_set(theme_dark())
df = pd.DataFrame({'a': [1,2,3], 'b': [4,5,6]})
ggplot(aes(x='a', y='b'), data=df) + geom_point()

Might it be possible to add a dark theme like theme_solarized_2 from ggthemes?

image

has2k1 commented 6 years ago

I need to think more about this. Since the themes in ggthemes tend to have companion scales, this feature threatens to add a lot more to the code base, yet may be a separate package would be better.