Viridis Scale

In [1]:
from datetime import datetime

import pandas as pd

from lets_plot import *
LetsPlot.setup_html()
In [2]:
df = pd.read_csv('https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/economics.csv', \
                 parse_dates=['date'])
df = df[df.date > datetime(2000, 1, 1)]
In [3]:
p = ggplot(df, aes(x='psavert')) + geom_histogram(aes(fill='psavert'), show_legend=False)
p11 = p + scale_fill_viridis()
p12 = p + scale_fill_viridis(option="cividis")
p21 = p + scale_fill_viridis(option="twilight")
p22 = p + scale_fill_viridis(option="magma")
p31 = p + scale_fill_viridis(option="plasma")
p32 = p + scale_fill_viridis(option="turbo")

w, h = 300, 200
bunch = GGBunch()
bunch.add_plot(p11, 0, 0, w, h)
bunch.add_plot(p12, w, 0, w, h)
bunch.add_plot(p21, 0, h, w, h)
bunch.add_plot(p22, w, h, w, h)
bunch.add_plot(p31, 0, 2 * h, w, h)
bunch.add_plot(p32, w, 2 * h, w, h)
bunch.show()