Customizing Tick Marks in Colorbars

Two new parameters in the theme() function, legend_ticks and legend_ticks_length, provide fine-grained control over colorbar tick marks.

In [1]:
from lets_plot import *
LetsPlot.setup_html()
In [2]:
data = dict(time=['Lunch', 'Lunch', 'Dinner', 'Dinner', 'Dinner'])
p = ggplot(data) + geom_bar(aes(x='time', fill='..count..')) + scale_fill_grey() + theme_void() + ggsize(400, 200)
p
Out[2]:
In [3]:
long_ticks = theme(legend_ticks_length=10) + ggtitle("Long Ticks")
thick_ticks = theme(legend_ticks=element_line(size=4)) + ggtitle("Thick Ticks")
thick_red_ticks = theme(legend_ticks=element_line(size=4, color='red')) + ggtitle("Thick Red Ticks")
hidden_ticks = theme(legend_ticks='blank') + ggtitle("Hidden Ticks")

gggrid([
    p + long_ticks,
    p + thick_ticks,
    p + thick_red_ticks,
    p + hidden_ticks,
]) + ggsize(800, 200)
Out[3]: