Free
scales on faceted plot¶%useLatestDescriptors
%use lets-plot
%use dataframe
LetsPlot.getInfo()
Lets-Plot Kotlin API v.4.4.2. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.4.0.0.
var mpg_df = DataFrame.readCSV("https://raw.githubusercontent.com/JetBrains/lets-plot-kotlin/master/docs/examples/data/mpg2.csv")
mpg_df.head()
DataFrame: rowsCount = 5, columnsCount = 9
val p = letsPlot(mpg_df.toMap()) {
x="engine horsepower"
y="engine displacement (cu. inches)"
} + geomPoint {color="origin of car"} + themeGrey()
p + ggsize(800, 350)
val fp = p + ggsize(800, 500)
facetGrid()
with fixed
scales (the default)¶Scales are constant across all panels.
fp + facetGrid(y="origin of car")
facetGrid()
with free
Y-scales¶fp + facetGrid(y="origin of car", scales="free_y")
facetWrap()
with fixed
scales (the default)¶Scales are constant across all panels.
fp + facetWrap(facets="number of cylinders", order=1)
facetWrap()
with free
scales along both axis¶fp + facetWrap(facets="number of cylinders", order=1, scales="free")