Skip to main content

An open source library for statistical plotting

Project description

Lets-Plot for Python

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

Implementation Overview

The Lets-Plot python extension includes 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 and is almost identical to the one we ship as PyPI package. This is because Lets-Plot is an offshoot of the Datalore project from which it was extracted to a separate plotting library.

One important difference is that the python package in Datalore is named datalore.plot and the package you install from PyPI has name lets_plot.

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.

Installation

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

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 *

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


What is new in v.1.2.0

Couldn't load kotlin_island.png

Example Notebooks

Try the following examples to study more features of the Lets-Plot library.

The following features of Lets-Plot are not present or have different implementation in other Grammar of Graphics libraries.

Plotting functions
  • ggsize() - sets the size of the plot. Used in many examples starting from quickstart.

  • geom_density2df() - fills space between equal density lines on a 2D density plot. Similar to geom_density2d but supports the fill aesthetic.

    Example: density_2d.ipynb

  • geom_contourf() - fills space between the lines of equal level of the bivariate function. Similar to geom_contour but supports the fill aesthetic.

    Example: contours.ipynb

  • geom_image() - displays an image specified by a ndarray with shape (n,m) or (n,m,3) or (n,m,4).

    Example: image_101.ipynb

    Example: image_fisher_boat.ipynb

  • gg_image_matrix() - a utility helping to combine several images into one graphical object.

    Example: image_matrix.ipynb

GGBanch

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.

Examples:

Data sampling

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

Learn more about sampling in Lets-Plot.

Artistic demos

A set of interesting notebooks with Lets-Plot for visualization.

Change Log

See Lets-Plot at Github.

License

Code and documentation released under the MIT license. Copyright 2019, 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.2.1-cp38-cp38-manylinux1_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.8

lets_plot-1.2.1-cp38-cp38-macosx_10_9_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

lets_plot-1.2.1-cp37-cp37m-manylinux1_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.7m

lets_plot-1.2.1-cp37-cp37m-macosx_10_9_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: lets_plot-1.2.1-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191030 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.8.0

File hashes

Hashes for lets_plot-1.2.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 614de5888650b7930de30c78bf1db752ca58e4562c47b51a27b412d404326fe5
MD5 604f08fd37716d568c7fd4dfddcc9ab0
BLAKE2b-256 48e3cb15ee9c41fc266b4233c7e44e9c59199ab37a9f5be3b7bb92332d400851

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lets_plot-1.2.1-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191201 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.8.0

File hashes

Hashes for lets_plot-1.2.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 86ade4353924b55d0a7da23864ee9df935ecde9294609004202b802784365b46
MD5 d87c8547cb367f87a1bebdf26eedc871
BLAKE2b-256 50d738c7d4ceb3f8a7e518981b3e4d388a80cffc9ed8f92bf0dd6f6f0f51f9c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lets_plot-1.2.1-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191030 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.8.0

File hashes

Hashes for lets_plot-1.2.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 74bb5002c96bd028050b369b65e3b01f699c3489bb04a28d56636a1ddd01a748
MD5 3d4c1a4bea47a92b43916ce4f81efb97
BLAKE2b-256 f75744aa51fe5c11888bcde1c7f93352e0d8bb1b6784544e76953f819a12dd9a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lets_plot-1.2.1-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191201 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.8.0

File hashes

Hashes for lets_plot-1.2.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2af19c5ad4bcd971534a3cc8ef1b5ee818389390fa471d76a53c8a648c7b04e4
MD5 f90535d8c78009ed23b054103914f18a
BLAKE2b-256 c64dbad55f4fb288e6617024c9dd6242d94abbfeb20792e41facf6c54eca9fcd

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