lets_plot.LetsPlot¶
- class lets_plot.LetsPlot¶
Initalize the library and its options.
- classmethod setup_html(*, isolated_frame: Optional[bool] = None, offline: Optional[bool] = None, no_js: Optional[bool] = None, show_status: bool = False) None ¶
Configures Lets-Plot HTML output. Depending on the usage, LetsPlot generates different HTML to show plots. In most cases LetsPlot will detect type of the environment automatically. Auto-detection can be overwritten using this method parameters.
- Parameters
- isolated_framebool
True - generate HTLM which can be used in iframe or in a standalone HTML document. False - pre-load Lets-Plot JS library. Notebook cell output will only consist of HTML for the plot rendering. Default: None - auto-detect.
- offlinebool
True - full Lets-Plot JS bundle will be added to the notebook. Use this option if you would like to work with notebook without the Internet connection. False - load Lets-Plot JS library from CDN. Default (None): ‘connected’ mode in production environment and ‘offline’ mode in dev environment.
- no_jsbool, default=False
True - do not generate HTML+JS as an output - just static SVG image. Note that without JS interactive maps and tooltips doesn’t work!
- show_statusbool, default=False
Whether to show status of loading of the Lets-Plot JS library. Only applicable when the Lets-Plot JS library is preloaded.
Examples
1from lets_plot import * 2LetsPlot.setup_html() 3ggplot({'x': [0], 'y': [0]}, aes('x', 'y')) + geom_point()