ggtb(): size_zoomin and size_basis Parameters for Geometry Scaling¶size_zoomin parameter¶The size_zoomin parameter accepts an integer value:
0 — zoom in disabled (default)-1 — unlimited zoom in2 means the geometry can be scaled up to 2×.size_basis parameter¶The size_basis parameter accepts a string value: x, y, min, or max (default: max).
It defines which axis is used to calculate the scaling factor.
x and y specify the corresponding axis.min uses the smaller scaling factor.max uses the larger scaling factor.from lets_plot import *
import pandas as pd
LetsPlot.setup_html()
ggplot() + geom_point(x=0, y=0, size=10) + ggtb(
size_zoomin=-1 # <-- Point size can grow without limits.
)
mpg = pd.read_csv('https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/mpg2.csv')
p = (
ggplot(mpg,
aes('engine horsepower', 'miles per gallon',
color=as_discrete('origin of car',order=-1)))
+ theme_grey() + ggtitle('Efficiency vs Engine Horsepower')
)
p + geom_jitter(seed=42) + ggtb(
size_zoomin=3 # <-- Point size can grow to 3x of the original size max.
)