An Open-source Plotting Library for Statistical Data¶
Python versions: 3.7-3.11
OS: Linux, macOS, Windows
pip install lets-plot
You can try Lets-Plot in Datalore where it is available out-of-the-box.
1import numpy as np 2from lets_plot import * 3LetsPlot.setup_html() 4 5np.random.seed(12) 6data = dict( 7 cond=np.repeat(['A', 'B'], 200), 8 rating=np.concatenate((np.random.normal(0, 1, 200), np.random.normal(1, 1.5, 200))) 9) 10 11ggplot(data, aes(x='rating', fill='cond')) + ggsize(700, 300) + \ 12 geom_density(color='dark_green', alpha=.7) + scale_fill_brewer(type='seq') + \ 13 theme(panel_grid_major_x='blank')
Meet the Grammar of Graphics¶
To learn more about the grammar of graphics, we recommend an excellent book called “ggplot2: Elegant Graphics for Data Analysis”. This will be a good prerequisite for further exploration of the Lets-Plot library.
Explore Your Data with Lets-Plot¶
GGBunch shows a collection of plots on one figure. Each plot in the collection can have an arbitrary location and size.
You can customize the content, values formatting and appearance of tooltip for any geometry layer in your plot. Learn more.
R, Python, what’s next? Right. Lets-Plot Kotlin API enables data visualization in JVM and Kotlin/JS applications as well as in scientific notebooks like Jupyter and Datalore.
Lets-Plot supports formatting of numeric and date-time values in tooltips, legends, on the axes and text geometry layer. Learn more.
Sampling is a special technique of data transformation, which helps to deal with large datasets and overplotting. Learn more.
Interactive maps allow zooming and panning around your geospatial data with customizable vector or raster basemaps as a backdrop. Learn more.
Export to SVG and HTML
ggsave() function is an easy way to export plot to a file in SVG or HTML formats.
offline=True will be working without an Internet connection. Learn more.