lets-plot
lets-plot copied to clipboard
Using range in scales
If I need to specify breaks parameter in scale_***(), I have to transform my values into list. Generators are not available, even the simple range:
import numpy as np
from lets_plot import *
LetsPlot.setup_html()
np.random.seed(42)
data = {'rating': np.round(np.random.normal(loc=7, scale=1, size=100), 1)}
ggplot(data) + \
geom_histogram(aes(x='rating'), binwidth=.25, center=0) + \
scale_x_continuous(breaks=range(1, 11))
Here I got an exception: Not a List: breaks: String.