Skip to main content

An open source library for statistical plotting

Project description

Lets-Plot for Python official JetBrains project

Latest Release
License
OS Linux, MacOS, Windows
Python versions 3.6, 3.7, 3.8

Overview

The Lets-Plot for Python library includes a native backend and a Python API, which was mostly based on the ggplot2 package well-known to data scientists who use R.

R ggplot2 has extensive documentation and a multitude of examples and therefore is an excellent resource for those who want to learn the grammar of graphics.

Note that the Python API being very similar yet is different in detail from R. Although we have not implemented the entire ggplot2 API in our Python package, we have added a few new features to our Python API.

You can try the Lets-Plot library in Datalore. Lets-Plot is available in Datalore out-of-the-box (i.e. you can ignore the Installation chapter below).

The advantage of Datalore as a learning tool in comparison to Jupyter is that it is equipped with very friendly Python editor which comes with auto-completion, intentions, and other useful coding assistance features.

Begin with the quickstart in Datalore notebook to learn more about Datalore notebooks.

Watch the Datalore Getting Started Tutorial video for a quick introduction to Datalore.

Installation

1. For Linux and Mac users:

To install the Lets-Plot library, run the following command:

pip install lets-plot

2. For Windows users:

Install Anaconda3 (or Miniconda3), then install MinGW toolchain to Conda:

conda install m2w64-toolchain

Install the Lets-Plot library:

pip install lets-plot

Quick start with Jupyter

To evaluate the plotting capabilities of Lets-Plot, add the following code to a Jupyter notebook:

import numpy as np
from lets_plot import *
LetsPlot.setup_html()        

np.random.seed(12)
data = dict(
    cond=np.repeat(['A','B'], 200),
    rating=np.concatenate((np.random.normal(0, 1, 200), np.random.normal(1, 1.5, 200)))
)

ggplot(data, aes(x='rating', fill='cond')) + ggsize(500, 250) \
+ geom_density(color='dark_green', alpha=.7) + scale_fill_brewer(type='seq') \
+ theme(axis_line_y='blank')
Couldn't load quickstart.png
        

Example Notebooks

See Example Notebooks.

GGBunch

GGBunch allows to show a collection of plots on one figure. Each plot in the collection can have arbitrary location and size. There is no automatic layout inside the bunch.

Data Sampling

Sampling is a special technique of data transformation, which helps dealing with large datasets and overplotting.

Learn more: Data Sampling.

Export to File

The ggsave() function is an easy way to export plot to a file in SVG or HTML formats.

Note: The ggsave() function currently do not save images of interactive maps to SVG.

Example notebook: export_SVG_HTML

Cloud Notebooks

Examples:

Geospatial

GeoPandas Support

GeoPandas GeoDataFrame is supported by the following geometry layers: geom_polygon, geom_map, geom_point, geom_text, geom_rect.

Learn more: GeoPandas Support.

Couldn't load kotlin_island.png

Interactive Maps

Interactive maps allow zooming and panning around geospatial data that can be added to the base-map layer using regular ggplot geoms.

Learn more: Interactive Maps.

Geocoding API

Geocoding is the process of converting names of places into geographic coordinates.

Learn more: Geocoding API.

Interesting Demos

A set of interesting notebooks using Lets-Plot library for visualization.
Couldn't load klein_bottle.png

Offline Mode

In classic Jupyter notebook the LetsPlot.setup_html() statement by default pre-loads Lets-Plot JS library from CDN. Alternatively, option offline=True will force Lets-Plot adding the full Lets-Plot JS bundle to the notebook. In this case, plots in the notebook will be working without an Internet connection.

from lets_plot import *

LetsPlot.setup_html(offline=True)

Scientific mode in IntelliJ IDEA / PyCharm

JetBrains Plugins JetBrains plugins

Plugin "Lets-Plot in SciView" is available at the JetBrains Plugin Repository.

The plugin adds support for interactive plots in IntelliJ-based IDEs with the enabled Scientific mode.

To learn more about the plugin check: Lets-Plot in SciView plugin homepage.

Couldn't load pycharm_quickstart.png Couldn't load pycharm_logo.png

What is new in 1.5.3

  • Tooltip Customization

    New API for customization of tooltip contents and its position (see Tooltip Customization).

  • Attribution when Configuring 3-rd Party Map-tiles

    New arguments in the maptiles_zxy() function allowing configuring attributions when using 3-rd party map-tiles as a base-map layer.

    See The Gallery of Base-maps.

  • Formatting labels in geom_text()

    New parameter, 'label_format' to define a formatting pattern.

    See demo: label_format.ipynb

  • Export to File

    The ggsave() function is an easy way to export plot to a file in SVG or HTML formats.

    Note: The ggsave() function currently do not save images of interactive maps to SVG.

    Example: export_SVG_HTML

  • Fixed 'HUE' Scale and Other Fixes

    See CHANGELOG.md for details.

Change Log

See CHANGELOG.md.

License

Code and documentation released under the MIT license. Copyright © 2019-2020, JetBrains s.r.o.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

lets_plot-1.5.5rc1-cp38-cp38-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.8 Windows x86-64

lets_plot-1.5.5rc1-cp38-cp38-manylinux1_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.8

lets_plot-1.5.5rc1-cp38-cp38-macosx_10_9_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

lets_plot-1.5.5rc1-cp37-cp37m-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.7m Windows x86-64

lets_plot-1.5.5rc1-cp37-cp37m-manylinux1_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.7m

lets_plot-1.5.5rc1-cp37-cp37m-macosx_10_9_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

lets_plot-1.5.5rc1-cp36-cp36m-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.6m Windows x86-64

lets_plot-1.5.5rc1-cp36-cp36m-manylinux1_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.6m

lets_plot-1.5.5rc1-cp36-cp36m-macosx_10_7_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.6m macOS 10.7+ x86-64

File details

Details for the file lets_plot-1.5.5rc1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: lets_plot-1.5.5rc1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for lets_plot-1.5.5rc1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 63906a13dbc482a7c273d59e90c9ed1569ca34332048e994042c53b59a4a066f
MD5 261fdb1b51cf6310444afb777ef852a2
BLAKE2b-256 5b6e3ae0a245ec78baed594c1515f22b4d6abd7130d763a93fc15c8620a8b6b8

See more details on using hashes here.

File details

Details for the file lets_plot-1.5.5rc1-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: lets_plot-1.5.5rc1-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for lets_plot-1.5.5rc1-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a6de5672470f38fbcfb08d856e874817b56dcfc1f42990d83dbd752403c2d0e9
MD5 b641cdbe542664d5a0ca6ef5d7196e08
BLAKE2b-256 b3abab1438a4956f2474fc3a7cb630699e202b33e70908c240ae41794791b297

See more details on using hashes here.

File details

Details for the file lets_plot-1.5.5rc1-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: lets_plot-1.5.5rc1-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for lets_plot-1.5.5rc1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 77a02c4b9f72cb2935c4b173811c622c2e7fa80ca4e7233e4b21a48e50c80113
MD5 6c3edf7f27c96dba55cb5cf1bb061939
BLAKE2b-256 3228b1f525015ce25c819031ef139745e23b1d51d733277880585c665cce12e2

See more details on using hashes here.

File details

Details for the file lets_plot-1.5.5rc1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: lets_plot-1.5.5rc1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for lets_plot-1.5.5rc1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 b43c192997fa8e6d22bda8fb9f21a66d1701d34f9c56cc7997ef2749c5ce9a64
MD5 bec2429ff4b06560f9e96721e0e5665a
BLAKE2b-256 5688e3652c92571058256f0da994a197320f2219d7cbc39ba5715ebadb8ddec2

See more details on using hashes here.

File details

Details for the file lets_plot-1.5.5rc1-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: lets_plot-1.5.5rc1-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for lets_plot-1.5.5rc1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 be1437a50e75e73a9103b79e8cad5cdaebd5d6bb375ca00eccd4ab6ddbcd40b9
MD5 ac76f9324402a3a345b94926119178ec
BLAKE2b-256 14b383d9c0fff707ddcb42a19ef0c909019ef45f57a98f887f11ba5abb1ff1ed

See more details on using hashes here.

File details

Details for the file lets_plot-1.5.5rc1-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: lets_plot-1.5.5rc1-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for lets_plot-1.5.5rc1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1e66bed7c0a18bc038e86b4fa9d34e4916852b6debebf1c4fcad55ede840d57d
MD5 7aed301cb56d648eae3fe49b51bb7765
BLAKE2b-256 cf6ec29b9aa428ed32da9470f6ae6e5c3a24fcf94156c461fad211414f6d2298

See more details on using hashes here.

File details

Details for the file lets_plot-1.5.5rc1-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: lets_plot-1.5.5rc1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for lets_plot-1.5.5rc1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 bb84e32b9dec60bb92552c75975b618f9f4af152e327c30fad11df83c48debf7
MD5 6c9fe45d5323bb2d00e1b78148797675
BLAKE2b-256 9183d867bcfd3f5df415ccdbab7a70831cb7d920f24a4a87e4edfb99cf393201

See more details on using hashes here.

File details

Details for the file lets_plot-1.5.5rc1-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: lets_plot-1.5.5rc1-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for lets_plot-1.5.5rc1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ebcd0932479d9633d5ad6b78a938c9741e69143fb2aa3cce0d3654bd66401cb2
MD5 a4ac15f678bd624ab20a7f4df7e01c28
BLAKE2b-256 06f1bb2c8cd9dcd74497ad26a8592463efd412e9958f232d6122531297176ff7

See more details on using hashes here.

File details

Details for the file lets_plot-1.5.5rc1-cp36-cp36m-macosx_10_7_x86_64.whl.

File metadata

  • Download URL: lets_plot-1.5.5rc1-cp36-cp36m-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: CPython 3.6m, macOS 10.7+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for lets_plot-1.5.5rc1-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 94afa2f725d73445a480689d15cd8b231edf1b19db83468230a2cdb0eed2dc92
MD5 aa1f02be95c4d4a7850d8dad43eb02c3
BLAKE2b-256 165bdd9b87142cb559eaaa3b1520c668149ff5165e202ca7d7ce71a2b0d820e7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page