Use the lablim
parameter in scale_xxx()
functions to specify the maximum length (number of characters) of labels for correspondent axis or legend.
Labels exceeding the specified maximum lenfth will be trimmed.
from lets_plot import *
LetsPlot.setup_html()
data = {
'x': ['A picture is worth a thousand words', 'Make a long story short']
}
p = ggplot(data, aes(x='x', color='x')) + geom_point(size=7)
p
lablim
Parameter to Trim X-Axis Labels¶p + scale_x_discrete(lablim=10)