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 lables 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.4-cp38-cp38-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.8

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

Uploaded CPython 3.8macOS 10.9+ x86-64

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.7m

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

Uploaded CPython 3.7mmacOS 10.9+ x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6mmacOS 10.7+ x86-64

File details

Details for the file lets_plot-1.5.4-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: lets_plot-1.5.4-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.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.2.0.post20200511 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for lets_plot-1.5.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 48baa44a17b3cc690fee29bb80f1e48b8e009c654f2629f81b96f87ed949e3f5
MD5 ebe03e18b3b1a079f5029ac63bd07aa4
BLAKE2b-256 48182e2da26ae0152d59690f03d5bc13c09f5529280670ba001cd6d1d82038a9

See more details on using hashes here.

File details

Details for the file lets_plot-1.5.4-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: lets_plot-1.5.4-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.4-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7c16f594da2a637fb5691024e73cc05fad22bb565e20fd7ca6e9a3bf7e377096
MD5 69e6d84276e6cd56b11861373ee891ef
BLAKE2b-256 2f0b31d43ec8ac744acdd27b7edb0d49c1757bebdfd2d400de6b1a89bd56188f

See more details on using hashes here.

File details

Details for the file lets_plot-1.5.4-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: lets_plot-1.5.4-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.4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4830f43585824d92f6f94ed396d7b10bd571ae03040909bd0ac3d093285040b4
MD5 a19f5e075585221314424a8062b10efb
BLAKE2b-256 894eae853a8714c082fe45084802c14924e0d6639ac185f00a9fd25e9048861b

See more details on using hashes here.

File details

Details for the file lets_plot-1.5.4-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: lets_plot-1.5.4-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.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.2.0.post20200511 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for lets_plot-1.5.4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 94bf689b988b5803e5a2e38a3d9cf7c238b2f82f209e5db3485fd1f939f92b73
MD5 6526d9b95ed01d612af3cc8c2f2d3edc
BLAKE2b-256 08f0f0a857796985885e8973586943d57bc9e5d64b768dd2f225bd1334dbe026

See more details on using hashes here.

File details

Details for the file lets_plot-1.5.4-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: lets_plot-1.5.4-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.4-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e062336ed8f2b44b08f92f768399206c825404e3a3aca981e2c602f2f4b25837
MD5 ce63a135e3a0faf2140210911d467074
BLAKE2b-256 763f514816a322963476bcdf266b9ce22ced66c2e1d93437647b008033fc09d2

See more details on using hashes here.

File details

Details for the file lets_plot-1.5.4-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: lets_plot-1.5.4-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.4-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 763047700839fabc9f9727df8595864fe6721bea7a7c3a51ae6f7d29e2e33557
MD5 183e82ed682239b87ff8ed9034c13008
BLAKE2b-256 2cb63a99840a8ca5062be3db257085fe72b11d63cfae727b2a6fe8496722ba80

See more details on using hashes here.

File details

Details for the file lets_plot-1.5.4-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: lets_plot-1.5.4-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.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.2.0.post20200511 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for lets_plot-1.5.4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 b719548d37046239ba2f9ba10329ae039dd3fbac76492108355ce27dcbe0ecc5
MD5 47664314cea73c6dddd166afaff4384d
BLAKE2b-256 498e6816991b23835b7fea8765d00411ecc7d76aaee5ee67695faf37e2a09954

See more details on using hashes here.

File details

Details for the file lets_plot-1.5.4-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: lets_plot-1.5.4-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.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 af8756bc929a1888ade4fdd99cb12128d76e377e6d0acdbae039630a3787ad48
MD5 8b01aceed4afefb462c8635bc873f762
BLAKE2b-256 55322607a521e1c3d74460b76bf052d714da685b768eb50e4d6b0996a1168fe9

See more details on using hashes here.

File details

Details for the file lets_plot-1.5.4-cp36-cp36m-macosx_10_7_x86_64.whl.

File metadata

  • Download URL: lets_plot-1.5.4-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.4-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 5527bbc415985df2618d26d2722ef30a456452796e3f6f410525d4934f2b9212
MD5 b72a665181dcf0c5090539a8255908ce
BLAKE2b-256 196a42b24db9186f7d3aef4e016064de6b7d70f647faac0d910260c172e37c26

See more details on using hashes here.

Supported by

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