Free
scales on a faceted plot¶import pandas as pd
from lets_plot import *
LetsPlot.setup_html()
data = pd.read_csv('https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/mpg2.csv')
data.head(3)
p = (ggplot(data, aes(x="engine horsepower", y="engine displacement (cu. inches)")) +
geom_point(aes(color="origin of car")) + theme_grey())
p + ggsize(800, 350)
fp = p + ggsize(800, 500)
facet_grid()
with fixed
scales (the default)¶Scales are constant across all panels.
fp + facet_grid(y='origin of car')
facet_grid()
with free
Y-scales¶fp + facet_grid(y='origin of car', scales='free_y')
facet_wrap()
with fixed
scales (the default)¶Scales are constant across all panels.
fp + facet_wrap(facets="number of cylinders", order=1)
facet_wrap()
with free
scales along both axis¶fp + facet_wrap(facets="number of cylinders", order=1, scales='free')