Python Plotting Library Based on the Grammar of Graphics¶
Python versions: 3.7-3.12
OS: Linux, macOS, Windows
pip install lets-plot
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')
Explore Your Data with Lets-Plot¶
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.
You can customize the content, values formatting and appearance of tooltip for any geometry layer in your plot. Learn more.
Lets-Plot supports formatting of numeric and date-time values in tooltips, legends, on the axes and text geometry layer. 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.
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.
offline=True will be working without an Internet connection. Learn more.