lets-plot icon indicating copy to clipboard operation
lets-plot copied to clipboard

More flexible ggsize()

Open ASmirnov-HORIS opened this issue 5 years ago • 0 comments

Sometimes I only need to restrict the width of my plot. But I can only specify either both parameters or none, but cannot just change one of them. Here is one case example:

import pandas as pd

from lets_plot import *
LetsPlot.setup_html()

df = pd.read_csv('https://raw.githubusercontent.com/HIL-HK/lets-plot-examples/master/data/mpg.csv')

ggplot(df.sort_values(by=['cyl', 'year'])) + \
    geom_point(aes(x='cty', y='hwy')) + \
    facet_grid(x='year', y='cyl') + \
    ggsize(600, 800) # Better: ggsize(width=600)

ASmirnov-HORIS avatar Jan 27 '21 13:01 ASmirnov-HORIS